text stringlengths 12 6.59M |
|---|
from unittest import skip
from unittest.mock import MagicMock
from django.core import mail
from django.core.management import call_command
from django.core.urlresolvers import reverse
from django.test.utils import override_settings
from wizard_builder.forms import PageForm
from .. import test_base
from ...delivery i... |
# Copyright 2014 DreamHost, LLC
#
# Author: DreamHost, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... |
"""This is Pando, a Python web framework.
Installation
------------
:py:mod:`pando` is available on `GitHub`_ and on `PyPI`_::
$ pip install pando
We `test <https://travis-ci.org/AspenWeb/pando.py>`_ against Python 2.7.
:py:mod:`pando` is in `MIT-licensed`_.
.. _github: https://github.com/AspenWeb/pando.py
.... |
"""Tests for the YQL object"""
from nose.tools import raises
from yql import YQLObj, NotOneError
try:
import json
except ImportError:
import simplejson as json
data_dict = json.loads("""{"query":{"count":"3","created":"2009-11-20T12:11:56Z","lang":"en-US","updated":"2009-11-20T12:11:56Z","uri":"http://quer... |
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Ericsson AB
#
# 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 ... |
"""Python client class for interacting with Amazon Alexa Voice Service (AVS).
"""
import ConfigParser
import requests
import json
import uuid
import os
import re
from requests_futures.sessions import FuturesSession
# Read the alexa_client.ini config file
config = ConfigParser.ConfigParser()
config.read([
'config/a... |
import csv
from StringIO import StringIO
from django_webtest import WebTest
from .auth import TestUserMixin
from .factories import (
AreaExtraFactory, AreaTypeFactory, ElectionFactory,
PostExtraFactory, ParliamentaryChamberFactory,
PersonExtraFactory, CandidacyExtraFactory, PartyExtraFactory,
PartyFac... |
#
# Copyright (c) 2009 rPath, Inc.
#
# This program is distributed under the terms of the Common Public License,
# version 1.0. A copy of this license should have been distributed with this
# source file in a file called LICENSE. If it is not present, the license
# is always available at http://www.rpath.com/permanent/... |
from typing import Any, Dict, List, Optional
from django.http import HttpRequest
from django.conf import settings
from zerver.models import UserProfile, get_realm, Realm
from zproject.backends import (
any_oauth_backend_enabled,
dev_auth_enabled,
github_auth_enabled,
google_auth_enabled,
password_... |
from __future__ import print_function
import atexit
import codecs
import glob
import json
import logging
import os
import re
import shutil
import subprocess
import sys
import tempfile
import uuid
from xml.dom import minidom
from traitlets import Dict, Unicode
from metakernel import MetaKernel, ProcessMetaKernel, REPL... |
#!/usr/bin/env python
"""
Created by stevertaylor
Copyright (c) 2014 Stephen R. Taylor
Code contributions by Rutger van Haasteren (piccard) and Justin Ellis (PAL/PAL2).
"""
import numpy as np
import sys, os, glob
import libstempo as T2
import ephem
from ephem import *
import NX01_utils as utils
from collections imp... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''\
Imagine
A pandoc filter to turn fenced codeblocks into graphics or ascii art by
wrapping some external command line utilities, such as:
%(cmds)s
Installation
%% sudo -H pip install pandoc-imagine
or simply save `pandoc-imagine.py` anywhere along $... |
#!/usr/bin/env python
# Scrapes all strands-project repositories for any readme files and wikis, and
# puts them into directories by repository
import requests
import getpass
import os
import json
import argparse
import rospkg
import subprocess
import shutil
import base64
import sys
import fnmatch
ignore_repos = ["l... |
import time
import pandas as pd
from warnings import warn
from carto.auth import APIKeyAuthClient
from carto.datasets import DatasetManager
from carto.exceptions import CartoException, CartoRateLimitException
from carto.sql import SQLClient, BatchSQLClient, CopySQLClient
from pyrestcli.exceptions import NotFoundExce... |
# Webhooks for external integrations.
from __future__ import absolute_import
from typing import Any, Dict, List, Optional, Text, Tuple
from django.utils.translation import ugettext as _
from django.db.models import Q
from django.conf import settings
from django.http import HttpRequest, HttpResponse
from zerver.models... |
#!/usr/bin/python3
from __future__ import print_function
import os
import time
import subprocess
import sys
WAIT = 30
def main():
directory = sys.argv[1]
url = os.environ['RSYNC_URL']
while True:
fnames = sorted(list(f for f in os.listdir(directory) if f.endswith('.warc.gz')))
if len(fna... |
# -*- coding: utf-8 -*-
#
# This file is part of agora-election.
# Copyright (C) 2013 Eduardo Robles Elvira <edulix AT agoravoting DOT com>
# 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 Foundatio... |
# coding=utf-8
import os
import tempfile
import commonware
import json
import shutil
import simplejson
import hashlib
from test_utils import TestCase
from nose.tools import eq_
from nose import SkipTest
from datetime import datetime
from django.contrib.auth.models import User
from django.conf import settings
from dj... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2015-2017:
# Frederic Mohier, frederic.mohier@alignak.net
#
"""
Alignak - Web User Interface
"""
# Package name
__pkg_name__ = u"alignak_webui"
# Checks types for PyPI keywords
# Used for:
# - PyPI keywords
# - directory where to store files in the ... |
"""
Parameters are a kind of class attribute allowing special behavior,
including dynamically generated parameter values, documentation
strings, constant and read-only parameters, and type or range checking
at assignment time.
Potentially useful for any large Python program that needs
user-modifiable object attributes... |
# Copyright 2013-present Barefoot Networks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# The MIT License (MIT)
#
# Copyright (c) 2014 Paul Durivage for Storj Labs
#
# 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 restrictio... |
#!/usr/bin/env python
from __future__ import unicode_literals, division, print_function
from scaffold import read_cinder_conf, getAPI
import argparse
import contextlib
import functools
import random
import re
import shlex
import socket
import subprocess
import sys
import time
import traceback
import uuid
from dfs_sd... |
import asyncio
import http.cookies
import io
import json
import mimetypes
import os
import sys
import traceback
import urllib.parse
import warnings
try:
import cchardet as chardet
except ImportError:
import chardet
import aiohttp
from . import hdrs, helpers, streams
from .log import client_logger
from .stream... |
#!/usr/bin/env python
# Copyright (c) 2017 Trail of Bits, 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 applica... |
#
# Copyright 2016 Quantopian, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... |
# Copyright (C) 2003-2007 John Rochester <john@jrochester.org>
#
# This file is part of paramiko.
#
# Paramiko is free software; you can redistribute it and/or modify it under the
# terms of the GNU Lesser General Public License as published by the Free
# Software Foundation; either version 2.1 of the License, or (at ... |
from django.conf import settings
from django.conf.urls import patterns, include, url
from . import one_time_startup
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
urlpatterns = ('',
url(r'^$', 'contentstore.views.howitworks', name='homepage'),
url... |
#!/usr/bin/env python
"""
Extracts a spectrum from a region in a spectral cube.
The pixels will be averaged spatially inside the given region.
The region must be specified as shape,coords,parameters
Region can be, point, box or circle.
Coords can be pix or sky.
Parameters, for point the coordinates of the point, e.g. ... |
# The following logging functions were modified from the osmnx library and
# used with permission from the author Geoff Boeing:
# log, _get_logger: https://github.com/gboeing/osmnx/blob/master/osmnx/utils.py
import logging as lg
import unicodedata
import sys
import datetime as dt
import os
import pandas as pd
from ur... |
import asyncio
import codecs
import io
import re
import sys
import traceback
import warnings
from hashlib import md5, sha1, sha256
from http.cookies import CookieError, Morsel, SimpleCookie
from types import MappingProxyType, TracebackType
from typing import ( # noqa
TYPE_CHECKING,
Any,
Dict,
Iterable,... |
# system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... |
# Copyright (C) 2012 Yipit, Inc <coders@yipit.com>
#
# This file is part of paramiko.
#
# Paramiko is free software; you can redistribute it and/or modify it under the
# terms of the GNU Lesser General Public License as published by the Free
# Software Foundation; either version 2.1 of the License, or (at your option)... |
# The version is defined in its own module so we can import it from setup.py
# without introducing unwanted dependencies at that stage.
VERSION = '0.3'
|
#!/usr/bin/env python
# png.py - PNG encoder/decoder in pure Python
#
# Copyright (C) 2006 Johann C. Rocholl <johann@browsershots.org>
# Portions Copyright (C) 2009 David Jones <drj@pobox.com>
# And probably portions Copyright (C) 2006 Nicko van Someren <nicko@nicko.org>
#
# Original concept by Johann C. Rocholl.
#
# ... |
#coding: utf8
#
# urlfetch
# ~~~~~~~~
#
# An easy to use HTTP client based on httplib.
#
# :copyright: (c) 2011 Elyes Du.
# :license: BSD, see LICENSE for more details.
#
__version__ = '0.3.5'
__author__ = 'Elyes Du <lyxint@gmail.com>'
__url__ = 'https://github.com/lyxint/urlfetch'
from . import util... |
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
#!/usr/bin/env python
# Class for submitting ample modelling and MR/Refine/Build components to a cluster
# queuing system.
#
# Ronan Keegan 25/10/2011
#
import logging
import os
import subprocess
import shlex
import time
if not "CCP4" in sorted(os.environ.keys()):
raise RuntimeError('CCP4 not found')
logger = l... |
#!/usr/bin/python3
import click
from os.path import basename
from pdc_client import PDCClient
import yaml
from datetime import date
try:
from yaml import CLoader as Loader, CDumper as Dumper
except ImportError:
from yaml import Loader, Dumper
def get_modulemd(module_name, stream):
"""
Check if module ... |
#!/usr/bin/env python
# png.py - PNG encoder/decoder in pure Python
#
# Copyright (C) 2006 Johann C. Rocholl <johann@browsershots.org>
# Portions Copyright (C) 2009 David Jones <drj@pobox.com>
# And probably portions Copyright (C) 2006 Nicko van Someren <nicko@nicko.org>
#
# Original concept by Johann C. Rocholl.
#
# ... |
#!usr/bin/env python
# -*- coding: utf-8 -*-
'''
Authors:
Sebastian Burgstaller (sebastian.burgstaller' at 'gmail.com
Andra Waagmeester (andra' at ' micelio.be)
This file is part of ProteinBoxBot.
ProteinBoxBot is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public ... |
# ===========================================================================
import swap
import subprocess,sys,os,time
import numpy as np
from subject import Ntrajectory
# ======================================================================
"""
NAME
logging.py
PURPOSE
Bits and pieces to ... |
# Copyright (c) 2016-2017 Adobe Inc. All rights reserved.
#
# 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, modif... |
from lib.cfg import NonterminalLabel
from lib.hgraph.hgraph import Hgraph
from lib.hgraph.graph_description_parser import ParserError, LexerError
from lib.tree import Tree
from lib import log
from common.rule import Rule
import sys
import cPickle as pickle
from collections import defaultdict as ddict
import re
import S... |
# Copyright 2014 DreamHost, LLC
#
# Author: DreamHost, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... |
# -*- coding: utf-8 -*-
import contextlib
import json
import os
import platform
import re
import ssl
import subprocess
import sys
import traceback
from subprocess import PIPE
from zipfile import ZipFile
try:
from ConfigParser import SafeConfigParser as ConfigParser
from ConfigParser import Error as ConfigPar... |
"""
Goal: Lookup hashed strings in the database
and generate a new uuid or return an existing one.
@authors:
Andrei Sura <sura.andrei@gmail.com>
"""
import collections # noqa
import multiprocessing as mp
import os
import pandas as pd
import numpy as np
import pprint # noqa
import sys
import traceback
from b... |
#!/usr/bin/env python
from __future__ import print_function
# png.py - PNG encoder/decoder in pure Python
#
# Copyright (C) 2006 Johann C. Rocholl <johann@browsershots.org>
# Portions Copyright (C) 2009 David Jones <drj@pobox.com>
# And probably portions Copyright (C) 2006 Nicko van Someren <nicko@nicko.org>
#
# Orig... |
from flask import Flask, request, session, redirect, url_for, \
abort, render_template, flash
from max31855.max31855 import MAX31855, MAX31855Error
import math
import RPi.GPIO as GPIO
from time import perf_counter
import time
import threading
from RPLCD import CharLCD
from RPLCD import Alignment, CursorMode, Shift... |
from django.shortcuts import render_to_response
from django.contrib.auth.decorators import login_required
from django.http import HttpResponseRedirect, HttpResponse
from django.shortcuts import render_to_response, get_object_or_404
from django.utils.translation import ugettext as _
from userprofile.forms import AvatarF... |
"""Parsing Class for python files."""
import logging
import re
log = logging.getLogger(__name__)
def get_parser(view):
"""Return the class of the parser to use.
Arguments:
view {sublime.View} -- The sublime text view in which this is executing in
Returns:
{PythonParser} or None if the c... |
# -*- 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.conf import settings
fro... |
# Copyright (c) 2014 Jesse Meek <https://github.com/waigani>
# This program is Free Software see LICENSE file for details.
"""
GoOracle is a Go oracle plugin for Sublime Text 3.
It depends on the oracle tool being installed:
go get code.google.com/p/go.tools/cmd/oracle
"""
import sublime, sublime_plugin, subprocess, ... |
"""Convert an annotations JSON file to a Synapse Table Schema.
This script takes a JSON-formatted annotation definition file (annotation name and allowed values)
converts them it a Synapse Table Schema, and stores it to a Synapse Table.
It is naive in terms of type discovery, using the following hierarchy:
null (str... |
import json
import os
from fuzzywuzzy import process
from onepassword.encryption_key import EncryptionKey
class Keychain(object):
def __init__(self, path):
self._path = os.path.expanduser(path)
self._load_encryption_keys()
self._load_item_list()
self._locked = True
def unlock... |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
SlideShow
A QGIS plugin
This Plugin is SlideShow
-------------------
begin : 2014-09-20
git sha : $Format:... |
import logging
import os
from logging.handlers import TimedRotatingFileHandler
GET_FILES_TO_DELETE = "getFilesToDelete"
DO_ROLLOVER = "doRollover"
NO_FILE_BASED_LOGGING = os.environ.get("KOLIBRI_NO_FILE_BASED_LOGGING", False)
class KolibriTimedRotatingFileHandler(TimedRotatingFileHandler):
"""
A custom Tim... |
"""This tutorial introduces restricted boltzmann machines (RBM) using Theano.
Boltzmann Machines (BMs) are a particular form of energy-based model which
contain hidden variables. Restricted Boltzmann Machines further restrict BMs
to those without visible-visible and hidden-hidden connections.
"""
import numpy, tim... |
from ..errors import AngrMemoryError, AngrTranslationError
from ..analysis import Analysis, register_analysis
from collections import deque
import logging
import math
import networkx
import types
# todo include an explanation of the algorithm
# todo include a method that detects any change other than constants
# todo... |
#
# PLCAPI authentication parameters
#
# Mark Huang <mlhuang@cs.princeton.edu>
# Copyright (C) 2006 The Trustees of Princeton University
#
# $Id: Auth.py,v 1.17 2007/02/10 18:39:09 mlhuang Exp $
#
import crypt
import sha
import hmac
import time
from PLC.Faults import *
from PLC.Parameter import Parameter, Mixed
from ... |
#!/usr/bin/python
"""
TestGyp.py: a testing framework for GYP integration tests.
"""
import os
import shutil
import stat
import sys
import TestCommon
from TestCommon import __all__
__all__.extend([
'TestGyp',
])
class TestGypBase(TestCommon.TestCommon):
"""
Class for controlling end-to-end tests of gyp gen... |
"""Parsl is a Parallel Scripting Library, designed to enable efficient workflow execution.
Importing
---------
To get all the required functionality, we suggest importing the library as follows:
>>> import parsl
>>> from parsl import *
Logging
-------
Following the general logging philosophy of python libraries, b... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib import admin
from django.utils.translation import ugettext_lazy as _
from cms.admin.placeholderadmin import (
FrontendEditableAdminMixin,
PlaceholderAdminMixin,
)
from parler.forms import TranslatableModelForm
from parler.admi... |
import sublime
import sublime_plugin
import os
import shutil
import sys
import zipfile
from os import path
from sublime import Region
from importlib.machinery import SourceFileLoader
import CodeMap.code_map_support as Mapper
from CodeMap.code_map_support import NavigateCodeMap as Nav
# version = 1.0.8
if sys.version_... |
#!/usr/bin/python
import requests
import subprocess
import sys
import random
from time import sleep
from datetime import datetime
if len(sys.argv) < 3:
print "\nUsage: gonotify.py latitude longitude [delay]"
print "latitude: latitude position to scan from."
print "longitude: longitude position to scan fro... |
import uuid
import csv
from arches.app.models import models
from arches.app.models import concept
from arches.app.models.system_settings import settings
from arches.app.datatypes.base import BaseDataType
from arches.app.datatypes.datatypes import DataTypeFactory
from arches.app.models.concept import get_preflabel_from_... |
__version__ = "0.1.9"
|
# coding=utf-8
from __future__ import print_function, unicode_literals, division
import json
import math
import os
import random
import threading
from itertools import chain, product
from logger import logger
from PIL import Image
try:
import Queue
import urlparse
from urllib import urlencode
except Impo... |
from __future__ import absolute_import, division, print_function
from urllib.parse import urlparse, parse_qs
from os.path import join, dirname
import shutil
import mimetypes
from mock import patch
from esridump.errors import EsriDownloadError
import unittest
import httmock
import tempfile
from ..cache import guess_... |
import asyncio
import logging
import math
import os
import re
import shutil
import subprocess
from functools import partial
import discord
from discord.errors import DiscordException
from discord.ext import commands
from slugify import slugify
from youtube_dl import DownloadError, YoutubeDL
from ..tools import Cog, i... |
#!/usr/bin/python
import requests
import subprocess
import sys
import random
from time import sleep
from datetime import datetime
if len(sys.argv) < 3:
print "\nUsage: gonotify.py latitude longitude [delay]"
print "latitude: latitude position to scan from."
print "longitude: longitude position to scan fro... |
#!/usr/bin/env python
#########################################################################################
#
# Parser
# Add option with name, type, short description, mandatory or not, example using add_option method.
# usage: add_option(name, type_value=None, description=None, mandatory=False, example=None, help=... |
from EXOSIMS.Observatory.SotoStarshade import SotoStarshade
import numpy as np
import astropy.units as u
from scipy.integrate import solve_ivp
import astropy.constants as const
import hashlib
import scipy.optimize as optimize
from scipy.optimize import basinhopping
import scipy.interpolate as interp
import scipy.integr... |
import os
def Convergekgrid(InFile1=None, kGrid1=[1, 1, 1], InFile2=None, kGrid2=None, kGridMultipliers=range(1, 3)):
""" InFile1 and 2 should have a format like 'spinel.1.in. 1 and 2 indicate the we are looking for differential convergence.
if InFile2 is empty, then we only converge on InFile1.
... |
"""
Module for declaration of common constants available throughout Open Civic Data code.
"""
DIVISION_ID_REGEX = r'^ocd-division/country:[a-z]{2}(/[^\W\d]+:[\w.~-]+)*$'
JURISDICTION_ID_REGEX = r'^ocd-jurisdiction/country:[a-z]{2}(/[^\W\d]+:[\w.~-]+)*/\w+$'
# helper for making options-only lists
_keys = lambda allopt... |
# -*- coding: utf-8 -*-
#
# Copyright (C)2005-2009 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... |
from django import template
from django.core.cache import cache
from django.core.urlresolvers import resolve, reverse, Resolver404
from articles.models import Article, Tag
from datetime import datetime
import math
register = template.Library()
class GetCategoriesNode(template.Node):
"""
Retrieves a list of ac... |
#!/usr/bin/python
#============================ adjust path =====================================
import sys
import os
if __name__ == "__main__":
here = sys.path[0]
sys.path.insert(0, os.path.join(here, '..', 'sol'))
sys.path.insert(0, os.path.join(here, '..', 'smartmeshsdk', 'libs'))
#=====... |
#!/usr/bin/env python
#########################################################################################
#
# Parser
# Add option with name, type, short description, mandatory or not, example using add_option method.
# usage: add_option(name, type_value=None, description=None, mandatory=False, example=None, help=... |
#!/usr/bin/env python
import argparse
import sys
from codonpdx.calc import calcScore
from codonpdx.count import codonCount
from codonpdx.insert import loadDB
# create the top-level parser
parser = argparse.ArgumentParser(prog='codonpdx',
description='Codonpdx command line utility.')
p... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you ca... |
"""
This script is made for the purpose of testing the GPIO
pins on a Raspberry Pi 3 Model B.
"""
try:
import RPi.GPIO as GPIO
except RuntimeError:
print("Error importing RPi.GPIO! This is probably because you need superuser privileges. \
You can achieve this by using 'sudo' to run your script")
impor... |
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.contrib.sites.shortcuts import get_current_site
from django.http import (
Http404,
HttpResponsePermanentRedirect,
HttpResponseRedirect,
)
from django.shortcuts import redirect
from django.urls import re... |
#!/usr/bin/env python2
# Copyright (C) 2013-2014 Red Hat, Inc.
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or any later version.
#
# This library... |
# -*- coding: utf-8 -*-
"""
author: Trish Gillett (github.com/discardthree)
Basic scraper/webdriver to submit an sdpt3 problem on the NEOS webpage.
This version uses selenium because when I tried submitting problems of this
type via XML-RPC, something went wrong.
With gratitude to Estela Alvarez (github.com/supita) wh... |
import random
class HelloWorld(object):
""" A passive model structure. If
the controllor needs information
or wants to update the database
it have to ask the model. It is
not notified.
"""
def __init__(self, data):
""" Sets the data object given
from the controller. In the
structur... |
import inspect, time, re
import base64
try: from hashlib import md5
except: md5 = __import__('md5').new
import traceback, sys, os
ranks = (5, 15, 30, 100, 300, 1000, 3000, 10000)
restricted = {
'everyone':['TOKENIZE','TELNET','HASH','EXIT','PING'],
'fresh':['LOGIN','REGISTER','REQUESTUPDATEFILE'],
'agreeme... |
#!/bin/env python
import aiohttp
import discord
from discord.ext import commands
from bs4 import BeautifulSoup
from utils import aiohttp_wrap as aw
class AskAsk:
def __init__(self, bot):
self.bot = bot
self.aio_session = bot.aio_session
self.scrape_uri = 'http://www.ask.com/web?q={}&o=0&q... |
import datetime
from typing import Optional
import json
from copy import deepcopy
import openpyxl
from dateutil.relativedelta import relativedelta
from django.contrib.auth.decorators import login_required
from api.monitorings import structure_sheet
from laboratory.decorators import group_required
from django.http imp... |
import logging
from django.core.exceptions import PermissionDenied
from django.db import IntegrityError, transaction
from rest_framework import serializers
from drf_extra_fields.geo_fields import PointField
from login.models import Client
from login.permissions import get_permissions
from .models import Ambulance, Am... |
import os, sys, nrrd, cmtk, gc, subprocess
import numpy as np
import warpScoring.CheckImages as ci
from cmtk import cur, tempfolder, active, run_stage, cmtkdir, template, checkDir, host, templatedir
wlzDir = "/partition/bocian/VFBTools/Woolz2013Full/bin/"
Fiji = "nice /partition/bocian/VFBTools/Fiji/ImageJ-linux64 --h... |
#!/usr/bin/env python
from __future__ import print_function
import numpy as np
import random
random.seed(1337)
np.random.seed(1337) # for reproducibility
from keras.models import Sequential, load_model, save_model
from keras.layers import Dense, Dropout, Activation, Flatten
from keras.layers import Convolution3D, Ma... |
#!/usr/bin/env python
# coding: utf-8
# Copyright 2019 The Crashpad 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/LICEN... |
# Script to download the sd_blobs of the front page
# Author: hackrush(hackrush@lbry.io)
import asyncio
from twisted.internet import asyncioreactor
asyncioreactor.install()
import keyring
import logging
import tempfile
import time
import treq
import typing
import shutil
from binascii import unhexlify
from twisted.in... |
"""
In this module, we define the coordinate representation classes, which are
used to represent low-level cartesian, spherical, cylindrical, and other
coordinates.
All classes should define a ``to_cartesian`` method and a ``from_cartesian``
class method. By default, transformations are done via the cartesian system,
... |
# -*- coding: utf-8 -*-
from opentuner.search import technique, manipulator
import random
N=10
class PSO(technique.SequentialSearchTechnique ):
""" Particle Swarm Optimization """
def __init__(self, crossover, *pargs, **kwargs):
"""
crossover: name of crossover operator function
"""
... |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# This is a Python API for the Nitrate test case management system.
# Copyright (c) 2012 Red Hat, Inc. All rights reserved.
# Author: Petr Splichal <psplicha@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~... |
###########################################################################
# (C) Vrije Universiteit, Amsterdam (the Netherlands) #
# #
# This file is part of AmCAT - The Amsterdam Content Analysis Toolkit #
# ... |
import os
import sys
from random import randint
import sqlite3 as lite
from discord.ext import commands
from lib import shipname as improved_shipname
class FunCog():
"fun fun fun fun fun fun"
def __init__(self, bot):
self.bot = bot
type(self).__name__ = "Fun Commands"
@commands.command(n... |
#!/usr/bin/env python
# Copyright (c) 2006-2007 The Regents of The University of Michigan
# 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 cop... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.