src stringlengths 721 1.04M |
|---|
from django.conf.urls import url, include
from django.contrib.auth import views as auth_views
from . import views
app_name = 'ploghubapp'
urlpatterns = [
url(r'^$', views.IndexView.as_view(), name='home_page'),
url(r'^register/$', views.RegisterView.as_view(), name='register'),
url(r'^profile/$', views.P... |
import os
import shutil
import glob
from ruffus import *
from genomon_pipeline.config.run_conf import *
from genomon_pipeline.config.genomon_conf import *
from genomon_pipeline.config.sample_conf import *
from genomon_pipeline.dna_resource.bamtofastq import *
from genomon_pipeline.dna_resource.fastq_splitter import *
f... |
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import ImageGrid
import numpy as np
from os import listdir, getcwd
from os import chdir
from PIL import Image
import matplotlib.gridspec as gridspec
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import matplotlib.image as mimage
from ... |
"""
Module to set up run time parameters for Clawpack.
The values set in the function setrun are then written out to data files
that will be read in by the Fortran code.
"""
import os
import numpy as np
from pdb import *
# import topotools
try:
FCLAW = os.environ['FCLAW']
except:
raise Exception("*** Must F... |
# -*- coding: utf-8 -*-
"""
pygments.lexers.javascript
~~~~~~~~~~~~~~~~~~~~~~~~~~
Lexers for JavaScript and related languages.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, include, ... |
# Copyright (c) 2008-2009 Junior (Frederic) FLEURIAL MONFILS
#
# This file is part of PyAnalyzer.
#
# PyAnalyzer 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
# (a... |
#!/Users/toma/python278i/bin/python
# Tom Anderson
# Thermal simulation prototype
# Sun Jul 13 22:30:26 PDT 2014
#
# Thermonous pertains to stimulation by heat.
# The literal ancient Greek is hot minded.
# If you need a name for it, "ephippion" is the ancient Greek word for saddle blanket
# and in Latin is "ephippia". ... |
# -*- coding: utf-8 -*-
#
# FRR documentation build configuration file, created by
# sphinx-quickstart on Tue Jan 31 16:00:52 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All c... |
"""Test for registration view."""
from bs4 import BeautifulSoup
from django.contrib.auth.models import User
from django.core import mail
from django.test import Client
from django.test import RequestFactory
from django.test import TestCase
from django.urls import reverse
from imagersite.views import home_view
from dja... |
#!/usr/bin/env python
"""
Synopsis:
PHoneyC: Pure python honeyclient implementation.
Usage:
python phoneyc.py [ options ] url
Options:
-h , --help Display this help information.
-l <filename> , --logfile=<filename> Output file name for logs.
-v ... |
"""
Copyright 2010 Serge Matveenko
This file is part of Picket.
Picket is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Picket is distribut... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutTuples(Koan):
def test_creating_a_tuple(self):
count_of_three = (1, 2, 5)
self.assertEqual(5, count_of_three[2])
def test_tuples_are_immutable_so_item_assignment_is_not_possible(self):
count_of_three =... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
from __future__ import division
from .rib import Rib
from .profile import Profile
from .coordinate import Coordinate
class Panel():
"""
A Panel is a representation of a wing panel and contains all of the items/objects
necessary to define a wing.
A Panel can be thought of as a wing facing down with ri... |
#!/usr/bin/env python3
import json
import requests
import os
import sys
import re
import shutil
from os.path import basename
from jinja2 import Template
from subprocess import call
from trello import TrelloClient
from zipfile import ZipFile
AUTH_CONFIG = "auth-config.json"
TRELLO_TEMPLATE = "TEMPLATE: PPgen workflow... |
'''
Calling a JSON API
In this assignment, you will write a Python program somewhat similar to
http://www.py4e.com/code3/geojson.py. The program will prompt for a location,
contact a web service and retrieve JSON for the web service and parse that data,
and retrieve the first place_id from the JSON. A place ID is a te... |
# coding=utf8
from os.path import join
main_node_host = 'localhost'
main_node_port = 5036
controller_port = 5036
controller_timeout = 10
main_node_manhole_port = 8791
app_root = '/home/wubin/observer'
client_register_timeout = 10
client_request_timeout = 1000 # seconds
request_max_attempts = 1
request_attem... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import nerve
import threading
class Thread (threading.Thread):
delay = True
threads = []
quit = False
def __init__(self, name=None, target=None):
threading.Thread.__init__(self, None, target, name)
Thread.threads.insert(0, self)
sel... |
# Microsoft Azure Linux Agent
#
# Copyright 2018 Microsoft Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... |
"""
Created by Gotham on 25-08-2018.
"""
from datetime import datetime, timedelta
from telegram import InlineKeyboardButton, InlineKeyboardMarkup
from utility import Utility
class ContestUtility(Utility):
@staticmethod
def contest_parser(contest):
title = contest['event']
start = contest['sta... |
from django.db import models
from django.conf import settings
from django.utils import timezone
from easy_thumbnails.files import get_thumbnailer
from easy_thumbnails.fields import ThumbnailerImageField
from easy_thumbnails.signals import saved_file
from easy_thumbnails.signal_handlers import generate_aliases_global
s... |
#!/usr/bin/jython
import os
import sys
from java.io import FileOutputStream
import logging
import optparse
import getopt
import string
__all__ = []
__version__ = 0.1
__date__ = '15-03-2015'
__updated__ ='21-03-2016'
__author__='asini'
## related path
if os.path.dirname(sys.argv[0])!= "":
directery_name=os.path.dir... |
import pyquaternion
# Create a quaternion representing a rotation of +90 degrees about positive y axis.
my_quaternion = pyquaternion.Quaternion(axis=[0, 1, 0], degrees=90)
my_vector = [0, 0, 4]
my_rotated_vector = my_quaternion.rotate(my_vector)
print('\nBasic Rotation')
print('--------------')
print('My Vector: {}... |
import AppKit
import objc
from keyword import kwlist
import re
from pygments.lexers import PythonLexer, get_lexer_by_name
from pygments.token import *
from pygments.style import Style
from pygments.styles.default import DefaultStyle
try:
import jedi
hasJedi = True
except:
hasJedi = False
from vanilla im... |
import argparse
import time
import logging
from statistics import mean, stdev
import zmq
from multiprocessing import Process, Manager
from ipyparallel.serialize import pack_apply_message, unpack_apply_message
from ipyparallel.serialize import deserialize_object
from constants import CLIENT_IP_FILE
from parsl.addresse... |
#!/usr/bin/env python
# _*_ coding: utf-8_*_
#
# Copyright 2016 planc2c.com
# thomas@time2box.com
#
# 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/LICENS... |
"""
The :mod:`sklearn.pls` module implements Partial Least Squares (PLS).
"""
# Author: Edouard Duchesnay <edouard.duchesnay@cea.fr>
# License: BSD Style.
from .base import BaseEstimator
from .utils import as_float_array
import warnings
import numpy as np
from scipy import linalg
def _nipals_twoblocks_inner_loop(X... |
#######################################################################
#
# Copyright 2009-2010 by Ullrich Koethe
#
# This file is part of the VIGRA computer vision library.
# The VIGRA Website is
# http://hci.iwr.uni-heidelberg.de/vigra/
# Please direct questions, bug reports, and contributions... |
#!/usr/bin/env python
# SerialGrabber reads data from a serial port and processes it with the
# configured processor.
# Copyright (C) 2012 NigelB
#
# 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 Foundatio... |
# -*- coding: utf-8 -*-
'''Everything returned by Bottle()._cast() MUST be WSGI compatiple.'''
import unittest
import bottle
from tools import ServerTestBase, tob, tobs
class TestOutputFilter(ServerTestBase):
''' Tests for WSGI functionality, routing and output casting (decorators) '''
def test_bytes(self):
... |
import rdflib
rdflib.plugin.register('nifttl', rdflib.serializer.Serializer,
'ttlser', 'CustomTurtleSerializer')
rdflib.plugin.register('cmpttl', rdflib.serializer.Serializer,
'ttlser', 'CompactTurtleSerializer')
rdflib.plugin.register('uncmpttl', rdflib.serializer.Seriali... |
#!/usr/bin/env python
"""
Very simple HTTP server in python.
Usage::
./dummy-web-server.py [<port>]
Send a GET request::
curl http://localhost
Send a HEAD request::
curl -I http://localhost
Send a POST request::
curl -d "foo=bar&bin=baz" http://localhost
"""
from BaseHTTPServer import BaseHTTPRequ... |
from dateutil import parser
from rdflib import Graph, Literal, BNode, Namespace, RDF, XSD, URIRef
import queries
global SSN
global GEO
global DUL
# SSN Namespace
SSN = Namespace('https://www.w3.org/2005/Incubator/ssn/ssnx/ssn#')
# Geo Namespace
GEO = Namespace('http://www.w3.org/2003/01/geo/wgs84_pos#')
# DUL Name... |
#
# 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/.
#
# Creates and returns a build environment that uses Clang. This is done by altering the GCC build environment.
import... |
"""
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 use this ... |
"""SCons.Tool.386asm
Tool specification for the 386ASM assembler for the Phar Lap ETS embedded
operating system.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004 The S... |
# -*- coding: utf8 -*-
# SDAPS - Scripts for data acquisition with paper based surveys
# Copyright(C) 2008, Christoph Simon <post@christoph-simon.eu>
# Copyright(C) 2008, Benjamin Berg <benjamin@sipsolutions.net>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Ge... |
# Copyright (c) 2017-2019 Uber Technologies, Inc.
# SPDX-License-Identifier: Apache-2.0
"""
An implementation of a Deep Markov Model in Pyro based on reference [1].
This is essentially the DKS variant outlined in the paper. The primary difference
between this implementation and theirs is that in our version any KL div... |
import numpy
from infos.InfoElement import SimpleDescription, PrintableInfoElement
from infos.InfoList import InfoList
from datasets.Batch import Batch
from datasets.MarkerBasedTask import MarkerBasedTask
from datasets.Task import Task
from Configs import Configs
import theano.tensor as TT
__author__ = 'giulio'
clas... |
#!/usr/bin/env python
# Copyright (C) 2013 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... |
#!/usr/bin/env python
"""
"**Pycco**" is a Python port of [Docco](http://jashkenas.github.com/docco/):
the original quick-and-dirty, hundred-line-long, literate-programming-style
documentation generator. It produces HTML that displays your comments
alongside your code. Comments are passed through
[Markdown](http://dar... |
# Copyright 2012 NagiosQL-API authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
# Django settings for nagiosqlapi project.
TESTING=False
from environment_settings import *
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Leandro... |
import os
from unittest import skipUnless
from decimal import Decimal
from django.test import TestCase
from django.conf import settings
from django.core.files import File
from ccpages.forms import PagePasswordForm
from ccpages.models import Page, PageAttachment
class ListenerTestCases(TestCase):
@skipUnless(os.pa... |
# -*- coding: utf-8 -*-
import io
import os
from dlstats.fetchers.bea import BEA as Fetcher
import httpretty
from dlstats.tests.base import RESOURCES_DIR as BASE_RESOURCES_DIR
from dlstats.tests.fetchers.base import BaseFetcherTestCase
import unittest
from unittest import mock
RESOURCES_DIR = os.path.abspath(os.p... |
# Copyright 2013 Eviatar Bach, eviatarbach@gmail.com
#
# 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... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2016 Jérémie DECOCK (http://www.jdhp.org)
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including witho... |
import os
import sys
import re
import subprocess
import json
VCC_PATH = 'C:/Program Files/Side Effects Software/Houdini 16.0.600/bin/vcc.exe'
SYN_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..')
COMP_PATH = os.path.join(SYN_PATH, 'VEX.sublime-completions')
FUNC_PATH = os.path.join(os.path.join(S... |
import asyncio
import logging
from bashbot.core.settings import settings
loop = asyncio.get_event_loop()
def get_logger(name):
logger = logging.getLogger(name)
handler = logging.FileHandler('bashbot.log')
formatter = logging.Formatter('[%(asctime)s] %(levelname)s:%(name)s: %(message)s')
handler.set... |
# Copyright (c) 2020, NVIDIA CORPORATION. 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 appli... |
# Copyright 2014 Donald Stufft
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# This file is part of box-linux-sync.
#
# Copyright (C) 2013 Vítor Brandão <noisebleed@noiselabs.org>
#
# box-linux-sync 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... |
# Copyright 2018 AT&T Intellectual Property. All other 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... |
import datetime
from application import db
from config import admin_group_name
Base = db.Model
username_maxlength = 24
name_maxlength = 60
email_maxlength = 24
group_maxlength = 64
groups = db.Table('groups',
db.Column('user_id', db.Integer, db.ForeignKey('users.id')),
db.Colum... |
# Slightly modified django.contrib.messages.api
from django.contrib.messages import constants
from django.contrib.messages.api import get_messages, get_level, set_level, MessageFailure
def add_message(request, level, message, extra_tags='', fail_silently=False, sticky=False):
"""
Attempts to add a message to ... |
import os
import sys
import inspect
from jsub.error import JsubError
class LoadError(JsubError):
pass
class ModuleNotFoundError(LoadError):
pass
class ClassNotFoundError(LoadError):
pass
class NotAClassError(LoadError):
pass
class PackageDirectoryNotFoundError(LoadError):
pass
def load_module(module_name)... |
# -*- coding: utf-8 -*-
# Copyright © 2012-2013 Roberto Alsina and others.
# 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 t... |
import random
from gloss import models
from gloss.translators.hl7 import coded_values
from datetime import datetime, date, timedelta
from gloss.external_api import save_message
first_names = [
"Jane", "James", "Chandeep", "Samantha", "Oliver", "Charlie",
"Sophie", "Emily", "Lily", "Olivia", "Amelia", "Isabell... |
from django.db import models
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from wagtail.wagtailcore.fields import RichTextField
from wagtail.wagtailcore.models import Page
from wagtail.wagtailadmin.edit_handlers import FieldPanel, MultiFieldPanel
from wagtail.wagtaildocs.models import Docume... |
# -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2006-2007 Lukáš Lalinský
# Copyright (C) 2009, 2014, 2019-2020 Philipp Wolfer
# Copyright (C) 2012-2013 Michael Wiencek
# Copyright (C) 2014, 2017 Sophist-UK
# Copyright (C) 2016-2017 Sambhav Kothari
# Copyright (C) 2017 Ville ... |
# -*- coding: utf-8 -*-
import unittest
from sync_settings.libs import file
class TestJSON(unittest.TestCase):
def test_encode_json_with_comment_blocks(self):
content = """
{
// gist id
"gist_id": "123123",
/**
another commen... |
#!/usr/bin/env python3
#
# Looks for registration routines in the plugins
# and assembles C code to call all the routines.
#
import os
import sys
import re
#
# The first argument is the directory in which the source files live.
#
srcdir = sys.argv[1]
#
# The second argument is either "plugin", "plugin_wtap" or "plugi... |
"""
Scrapy engine tests
This starts a testing web server (using twisted.server.Site) and then crawls it
with the Scrapy crawler.
To view the testing web server in a browser you can start it by running this
module with the ``runserver`` argument::
python test_engine.py runserver
"""
import sys, os, re, urlparse
... |
def filterByFDR(tophits, cutoff):
tophits = sorted(tophits, key = lambda x : x[4], reverse = True)
intraCumCount = []
interCumCount = []
tardecCumCount = []
decdecCumCount = []
intraCount = 0
interCount = 0
tardecCount = 0
decdecCount = 0
xlType = []
for i in range(len(tophits)):
pro1 = tophits[i][2][... |
# Copyright (c) 2013-2014 by pyramid_localize authors and contributors <see AUTHORS file>
#
# This module is part of pyramid_localize and is released under
# the MIT License (MIT): http://opensource.org/licenses/MIT
"""methods in this module are tools, thank to which pyramid_localize works most of its magic."""
import... |
#!/usr/bin/env python
"""Compiled modules may be out of date or missing"""
import os, sys
__author__ = "Peter Maxwell"
__copyright__ = "Copyright 2007-2012, The Cogent Project"
__credits__ = ["Peter Maxwell"]
__license__ = "GPL"
__version__ = "1.5.3"
__maintainer__ = "Peter Maxwell"
__email__ = "pm67nz@gmail.com"
__s... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is part of OpenDrift.
#
# OpenDrift 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, version 2
#
# OpenDrift is distributed in the hope that it will b... |
# F3AT - Flumotion Asynchronous Autonomous Agent Toolkit
# Copyright (C) 2010,2011 Flumotion Services, S.A.
# All rights reserved.
# 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... |
from keywords import *
VERSION = '0.5.3'
__version__ = VERSION
class Selenium2Library(
_LoggingKeywords,
_RunOnFailureKeywords,
_BrowserManagementKeywords,
_ElementKeywords,
_TableElementKeywords,
_FormElementKeywords,
_SelectElementKeywords,
_JavaScriptKeywords,
_CookieKeyword... |
# coding: utf8
from ckan.logic import side_effect_free
from ckan.logic.action.get import user_show
import ckan.plugins.toolkit as toolkit
from ckanext.passwordless import util
import json
from xml.etree import ElementTree
import requests
from logging import getLogger
log = getLogger(__name__)
@side_effect_free
de... |
import re
import sys
import os
import logging
import time
import hashlib
from urlparse import urlparse
from virus_total_apis import PrivateApi as VirusTotal
import pcap
import decoder
import apikey
from snort import SnortRule
from database import SQLiteTool
logger = logging.getLogger(__name__)
REQUEST_RATE = 300
AP... |
# -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# 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 ... |
#!/usr/bin/python
#
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... |
"""
This module implements the request manager functionality.
Job Queue and Processing
^^^^^^^^^^^^^^^^^^^^^^^^
As requests are issued via http to the API a process queue will store all
active jobs. Processes will be created and assume one of the following
states throughout their existence: ::... |
# $HeadURL$
""" Queries BDII for unknown CE.
Queries BDII for CE information and puts it to CS.
"""
__RCSID__ = "$Id$"
from DIRAC import S_OK, S_ERROR, gConfig
from DIRAC.Core.Base.AgentModule import AgentModule
from DIRAC.Core.Utilities ... |
#! /usr/bin/env python
# MailTask Alpha: The Email Manager
# Copyright (C) 2015 Patrick Simmons
# 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
# (at your ... |
#!/usr/bin/env python
'''Functions for converting to native byte order
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import sys
import SDL.constants
def SDL_Swap16(x):
return (x << 8 & 0xff00) | \
(x >> 8 & 0x00ff)
def SDL_Swap32(x):
return (x << 24 & 0xff000000) | \
... |
"""
Read a rvcf file with stability selection scores for taxa.
Sort the dataframe by rsq_median.
Print results.
usage:
python sort_results.py \
../example/stability_selection_example_output.vcf \
../example/hominid_example_taxon_table_input.txt \
arcsinsqrt \
0.5 \
10
"""
im... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# aiobotocore documentation build configuration file, created by
# sphinx-quickstart on Sun Dec 11 17:08:38 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
... |
import eventlet
from pyVmomi import vim
from vmwarelib import inventory
from vmwarelib.actions import BaseAction
class VMCheckTools(BaseAction):
def run(self, vm_id):
# convert ids to stubs
vm = inventory.get_virtualmachine(self.si_content, moid=vm_id)
# To correctly understand tools s... |
#!/usr/bin/python
from ..states.leader import Leader
from ..messages.client import ClientMessage
import zmq
import threading
import pickle
import Queue
import time
import math
class Server(threading.Thread):
def __init__(self, name, state, log, messageBoard, neighbors):
super(Server, self).__init__()
... |
# -*- coding: utf-8 -*-
# This code is part of Amoco
# Copyright (C) 2014 Axel Tillequin (bdcht3@gmail.com)
# published under GPLv2 license
# spec_xxx files are providers for instruction objects.
from amoco.arch.x86 import env
from amoco.arch.core import *
# for ia32 arch we want some specialized 'modrm' format
# ... |
########################
## PATTERN PARAMETERS ##
########################
PATTERN_DT = 1e-3 # timestep precision - should be identical to the simulation step!
PATTERN_CLASS = "BarRatePatterns" # other pattern classes: SpatioTemporalPatterns (requires different settings)
PATTERN_N_CHANNELS = 64 # number of ... |
from django import forms
from django.core.exceptions import ValidationError
from django.urls import reverse
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Div, Field, HTML, Layout, Reset, Submit
from cognitive.apps.atlas.query import Assertion, Disorder, Task, Battery, ConceptClass, Concep... |
# 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... |
"""Routes configuration
The more specific and detailed routes should be defined first so they
may take precedent over the more generic routes. For more information
refer to the routes manual at http://routes.groovie.org/docs/
"""
from routes import Mapper
def make_map(config):
"""Create, configure and return the ... |
"""
API for the gating djangoapp
"""
from collections import defaultdict
import json
import logging
from lms.djangoapps.courseware.entrance_exams import get_entrance_exam_content
from openedx.core.lib.gating import api as gating_api
from opaque_keys.edx.keys import UsageKey
from util import milestones_helpers
log = ... |
# -*- coding: utf-8 -*-
# configurations for the production server
# https://docs.djangoproject.com/en/dev/ref/settings/
DEBUG = False
TEMPLATE_DEBUG = DEBUG
TIMTEC_THEME = 'tecsaladeaula'
SITE_HOME = '/'
SITE_DOMAIN = 'teste.tecsaladeaula.com.br'
SITE_URL = 'https://teste.tecsaladeaula.com.br'
ALLOWED_HOSTS = [
... |
#move the GUI-window from its initial position to see how it stays there only with the new version
#note also the flickering happens only in the old version
# comment out and in as necessary
################################# easygui with callback
import easygui_callback
def controller(user_input):
print "controller... |
FORMATTER_PERCENT = "function() { return (this.value > 0 ? ' + ' : '') + this.value + '%'; }"
FORMATTER_OTHER = "function() { return (this.value > 0 ? ' + ' : '') + this.value; }"
TOOLTIP_HEADER_FORMAT = '<b>{series.name}</b><br>'
TOOLTIP_POINT_FORMAT_PERCENT = '<span style="color:{series.color}">{series.name}</spa... |
import numpy as np
import cv2
import glob
import math as m
import time
import timeout_decorator as tm
def draw(img, corners, imgpts):
corner = tuple(corners[0].ravel())
img = cv2.line(img, corner, tuple(imgpts[0].ravel()), (255,0,0), 5)
img = cv2.line(img, corner, tuple(imgpts[1].ravel()), (0,255,0), 5)
... |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
# Library import
import numpy as np
import tensorflow as tf
import autokeras as ak
# Prepare example Data - Shape 1D
num_instances = 100
num_features = 5
x_train = np.random.rand(num_instances, num_features).astype(np.float32)
y_train = np.zeros(num_instances).astype(np.float32)
y_train[0 : int(num_instances / 2)] = ... |
"""
Tasks for the messages application.
"""
# Django
from celery.exceptions import SoftTimeLimitExceeded
from celery.schedules import crontab
from celery.task import periodic_task, task
from django.contrib.auth.models import User
from django.utils import timezone
# Standard Library
import logging
from random import r... |
#!/usr/bin/python
# Loading window opens
# Exits if connection to server fails
import loading
load = loading.loading()
if load.status['loading'] == 'fail':
exit()
goto = 'login'
# Loop so that one window can refer several other windows
while goto != None:
nextGoto = None
# Login window
if goto == 'login':
impor... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'setgoaldialog.ui'
#
# Created: Tue Dec 23 18:15:13 2014
# by: PyQt4 UI code generator 4.11.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except ... |
#! /usr/bin/env python
import argparse
import numpy as np
if __name__ == '__main__':
parser = argparse.ArgumentParser(description="Choosen regions from the reference genome randomly")
parser.add_argument("-i", "--inFai", dest="fai", type=str, metavar="InputFai", required=True, help='Input fai file.')
par... |
# (C) British Crown Copyright 2014, Met Office
#
# This file is part of Iris.
#
# Iris 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 3 of the License, or
# (at your option) any later ve... |
"""
Code generator for C constructs.
"""
from ctree.codegen import CodeGenVisitor
from ctree.c.nodes import Op
from ctree.types import codegen_type, get_suffix
from ctree.precedence import UnaryOp, BinaryOp, TernaryOp, Cast
from ctree.precedence import get_precedence, is_left_associative
from numbers import Number
f... |
#!/usr/bin/python
#
# Copyright (c) 2011 The Bitcoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import time
import json
import pprint
import hashlib
import struct
import re
import base64
import httplib
import... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Interpreter version: python 2.7
#
# !!! DO NOT EDIT THIS FILE - THIS IS GENERATED FILE !!!
# Imports =====================================================================
from collections import namedtuple
# Functions and classes =====================================... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.