src stringlengths 721 1.04M |
|---|
#!/usr/bin/env python
# Copyright (c) 2012-2013 Red Hat, 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 applicab... |
from django.urls import reverse
from django.http import HttpResponse
from django.shortcuts import redirect, render, get_object_or_404
from core.homepage_elements.featured import models
from submission import models as submission_models
from security.decorators import editor_user_required
@editor_user_required
def fe... |
#!/usr/bin/python -tt
"""
Libusers - a script that finds users of files that have been deleted/replaced
"""
# Released under the GPL-2
# -*- coding: utf8 -*-
import argparse
import sys
import glob
import fnmatch
import os
from collections import defaultdict
from lib_users_util import common
DELSUFFIX = " (deleted)"
P... |
#!/bin/env python2.7
# -*- coding: utf-8 -*-
# This file is part of AP - Assistive Prototypes.
#
# AP 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... |
import itertools
import numpy as np
import os
import png
import sys
import poisson
############################### Data ###########################################
def load_png(fname):
reader = png.Reader(fname)
w, h, pngdata, params = reader.read()
image = np.vstack(itertools.imap(np.uint16, pngdata))
... |
#!/usr/bin/env python
# using the CRF suite to create the prediction model
import argparse
import load
import split
import sys
import pycrfsuite
import numpy as np
from sklearn.cross_validation import KFold, StratifiedKFold
import json
import gzip
data_loc_str = '../data/kasteren/2010/datasets/house{house}/{featur... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
import unittest
from w3lib.url import (is_url, safe_url_string, safe_download_url,
url_query_parameter, add_or_replace_parameter, url_query_cleaner,
file_uri_to_path, parse_data_uri, path_to_file_uri, any_to_uri,
urljoin_rfc, canonical... |
from django.db import models
from webcore.models import Profile
from django.core.exceptions import ValidationError
# Create your models here.
class Pair(models.Model):
"""
This class defines a mentor-mentee pair
It contains mentor name matched with mentee name
"""
name = models.CharField(max_len... |
# Copyright 2009 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Tests for runlaunchpad.py"""
__metaclass__ = type
__all__ = [
'CommandLineArgumentProcessing',
'ServersToStart',
]
import os
import shutil
import tempfile
import... |
#!/usr/bin/env python
#
# Copyright (c) 2015 - 2021, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, thi... |
def get_socketio_args(response):
return response['args'][0]
def get_question_group(response):
return get_socketio_args(response)['question'][1]
def test_init(app, session, client, client_socketio):
"""Tests that the app is initialized correctly (no errors)"""
pass
def check_status_code(client, end... |
# coding=utf-8
# Copyright 2013 Hewlett-Packard Development Company, L.P.
# 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/li... |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Removing unique constraint on 'Url', fields ['url', 'site']
db.delete_unique('seo_url', ['url', 'site_id']... |
# -*- coding: utf-8 -*-
# Copyright 2015 Kevin Reid <kpreid@switchb.org>
#
# This file is part of ShinySDR.
#
# ShinySDR 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
# (... |
from mnist import MNIST
import numpy as np
import tensorflow as tf
from src.my.lib.utils import montage
import matplotlib.pyplot as plt
from PIL import Image
src = '../../../../data/mnist/'
output='./content/1/%s.jpg'
mndata = MNIST(src)
data = np.array(mndata.load_testing())
X = data[0]
Y = data[1]
items = 100
im... |
#!/usr/bin/env python
# VMware vSphere Python SDK
# Copyright (c) 2008-2013 VMware, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/lic... |
"""
Segmentation creation and prediction
"""
import numpy as np
from sklearn.ensemble import GradientBoostingRegressor
from sklearn import metrics
from sklearn.cross_validation import train_test_split
from crankshaft.analysis_data_provider import AnalysisDataProvider
# NOTE: added optional param here
class Segmenta... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-02-01 10:43
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('app', '0063_auto_20160201_1830'),
]
operations = [
... |
# Copyright 2015 SimpliVity Corp.
#
# 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... |
"""
Python programm to study the robustness of TITO systems.
Identitfies the system, computes the controller and analysis the controller using the state space - transfer function relation.
Computes the singular values.
Use this script from the terminal / console with
./python FILENAME.py --file_storage = FOLDERNAME
t... |
#!/usr/bin/env python3
import scheduler as s
import worker as w
from cluster import Cluster
from gevent import sleep
from time import time
class EC2Task(s.Task):
def execute(self):
self.machine.worker.execute(task=w.Task(self.runtime))
class EC2Comm(s.Comm):
def execute(self):
self.rproc = ... |
# ccm node
from __future__ import absolute_import, with_statement
import os
import re
import shutil
import signal
import stat
import subprocess
import time
import yaml
from six import iteritems, print_
from ccmlib import common, extension, repository
from ccmlib.node import (Node, NodeError, ToolError,
... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals # py2
from datetime import datetime
from django.utils import timezone as tz
from django.utils.timezone import is_naive, make_aware
msk_tz = tz.pytz.timezone('Europe/Moscow')
date_mapping = {
'января': '1',
'февраля': '2',
'марта': '3',
... |
"""
Previously in TextTools
Created by adam on 11/11/15
"""
__author__ = 'adam'
class NgramGetter(object):
"""
Abstract parent class for extracting ngrams.
Attributes:
collocation_finder: One of the nltk's collocation finder tools (e.g., BigramCollocationFinder)
top_likelihood_ratio:
... |
import datetime
from django.core import signing
from django.test import SimpleTestCase
from django.test.utils import freeze_time
from django.utils.crypto import InvalidAlgorithm
class TestSigner(SimpleTestCase):
def test_signature(self):
"signature() method should generate a signature"
signer = ... |
import logging
class TelegramHandler(logging.Handler):
"""
A handler class which sends a Telegram message for each logging event.
"""
def __init__(self, token, ids):
"""
Initialize the handler.
Initialize the instance with the bot's token and a list of chat_id(s)
of the... |
from threading import Thread
import json, urllib.request, urllib.parse, configparser, re, base64, sys, os, time, atexit, signal, logging, subprocess, collections, argparse, grp, pwd, shutil
from threading import Lock
import threading;
from collections import namedtuple
import random, atexit, signal, inspect
import time... |
# -*- coding: utf-8 -*-
# Copyright 2020 Green Valley Belgium NV
#
# 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 appl... |
import os
from coalib.parsing.Globbing import glob_escape
from coala_quickstart.generation.Utilities import get_gitignore_glob
from coala_utils.Question import ask_question
from coala_quickstart.Strings import GLOB_HELP
from coalib.collecting.Collectors import collect_files
def get_project_files(log_printer,
... |
"""
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, software
distributed ... |
import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_raises
from sklearn.decomposition import PCA, KernelPCA
from sklearn.datasets import make_circles
from sklearn.linear_model i... |
# coding: utf-8
# # TensorFlow Tutorial
#
# Welcome to this week's programming assignment. Until now, you've always used numpy to build neural networks. Now we will step you through a deep learning framework that will allow you to build neural networks more easily. Machine learning frameworks like TensorFlow, Paddle... |
# -*- coding: UTF-8 -*-
from matplotlib import pyplot as plt
import numpy as np
################################################################################
def logistic(x, r):
"""Logistic map, with parameter r."""
return r * x * (1 - x)
def bif_plot(x0, rs, axes):
"""Bifurcation plot for the logist... |
#!/usr/bin/env python
##############################################################################################
#
#
# regrid_emissions_N96e.py
#
#
# Requirements:
# Iris 1.10, cf_units, numpy
#
#
# This Python script has been written by N.L. Abraham as part of the UKCA Tutorials:
# http://www.ukca.ac.uk/wiki... |
from __future__ import division
import logging
import os
import random
import time
# Set up logger
log = logging.getLogger(__name__)
ch = logging.StreamHandler()
log.addHandler(ch)
# Word list file path info
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
WORD_LIST_FILENAME = 'word_list_en.txt'
WORD_LIST_PATH ... |
# -*- coding: utf-8 -*-
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
"""Support for Arlo Alarm Control Panels."""
import logging
import voluptuous as vol
from homeassistant.components.alarm_control_panel import (
PLATFORM_SCHEMA, AlarmControlPanel)
from homeassistant.const import (
ATTR_ATTRIBUTION, STATE_ALARM_ARMED_AWAY, STATE_ALARM_ARMED_HOME,
STATE_ALARM_ARMED_NIGHT, S... |
"""
Django settings for tutorial project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
i... |
#! /usr/bin/env python3
#
# Copyright (C) 2012, 2014, 2015, 2016, 2017, 2018, 2019 David Maxwell
#
# This file is part of PISM.
#
# PISM 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 ... |
# -*- coding: utf-8 -*-
import os
import json
# turbogears imports
from tg import expose, redirect, validate, flash, session, request, config
from tg.decorators import *
# third party imports
from repoze.what import authorize
from repoze.what.predicates import not_anonymous, in_group, has_permission
from sqlalchemy.... |
'''
Created on Aug 3, 2015
@author: Mikhail
@summary: Sort list of strings by latest letter
'''
def sort_by_latest_letter(list_of_strings):
"""
>>> sort_by_latest_letter(["abc", "cab", "bca"])
['bca', 'cab', 'abc']
"""
return [sorted_element[::-1] for sorted_element in sorted([element[::-1] for e... |
# coding=utf-8
"""Test certbot.display.ops."""
import os
import sys
import tempfile
import unittest
import mock
import zope.component
from acme import jose
from acme import messages
from certbot import account
from certbot import errors
from certbot import interfaces
from certbot.display import util as display_util... |
from ._fixtures import _GenericBackendTest, _GenericMutexTest
from . import eq_, winsleep
from unittest import TestCase
from threading import Thread
import time
from nose import SkipTest
from dogpile.cache import compat
class _TestMemcachedConn(object):
@classmethod
def _check_backend_available(cls, backend):... |
#################################################################################
# Collection of routines to update the RoboNet database tables
# Keywords match the class model fields in ../robonet_site/events/models.py
#
# Written by Yiannis Tsapras Oct 2016
# Last update:
###########################################... |
# -*- coding: utf-8 -*-
import pandas as pd
import numpy as np
import re
from urlparse import urlparse
fx_path_pattern = re.compile('(/firefox/)([0-9a-z\.]+)/(whatsnew|firstrun|releasenotes)')
blog_path_pattern = re.compile('(/posts/[0-9]+)(/.*)')
def actual_path(url):
#print url
path = urlparse(url).path
... |
#!/usr/bin/env python2.7
# scrub.py 1.0.0
#
# Scrub.py will remove all files for an experiment [replicate] and genome/annotation
#
# 1) Lookup experiment type from encoded, based on accession
# 2) Locate the experiment accession named folder
# 3) Given the experiment type, determine the expected results
# 4) Given expe... |
import mock
from datetime import datetime, timezone
import pytz
from nose.tools import assert_equals, assert_raises
from vogeltron import baseball
from bs4 import BeautifulSoup
YEAR = datetime.today().year
def date_for_month(month, day, hour, minute):
timez = pytz.timezone('US/Pacific')
return timez.localize... |
#!/usr/bin/env python
from tornado.web import authenticated
from tornado.escape import json_encode
from amgut.util import AG_DATA_ACCESS
from amgut.lib.mail import send_email
from amgut.handlers.base_handlers import BaseHandler
from amgut import media_locale, text_locale
# login code modified from https://gist.githu... |
import SourceBase
class DesktopprPlugin(SourceBase.SourceBase):
pluginid = '_fsiplugin_desktoppr' #OVERRIDE THIS IN YOUR SUBCLASS. If you don't, the program will ignore your plugin.
sourcename = 'Desktoppr'
sourceurl = 'http://Desktoppr.co'
def __init__(self):
'''Your plugin will b... |
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# 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 ... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
################################################################################
# Anceps Copyright (C) 2014 Suizokukan
# Contact: suizokukan _A.T._ orange dot fr
#
# This file is part of Anceps.
# Anceps is free software: you can redistribute it and/or modify
# ... |
from PyObjCTools.TestSupport import *
import Quartz
try:
unicode
except NameError:
unicode = str
try:
long
except NameError:
long = int
class TestCGImageSource (TestCase):
def testConstants(self):
self.assertEqual(Quartz.kCGImageStatusUnexpectedEOF, -5)
self.assertEqual(Quartz.kC... |
# !/usr/bin/env python3
"""
Game Support Modules should be located in this package
Names should be all lowercase, unique, and code should follow the template,
The template represents the bare miniumum API you are required to conform to.
You are allowed to add new files and extend it.
"""
# ====================== GPL ... |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models, _
from odoo.exceptions import ValidationError, UserError
class StockWarehouse(models.Model):
_inherit = 'stock.warehouse'
manufacture_to_resupply = fields.Boolean(
... |
# Copyright 2015 NEC 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 ... |
import pexpect
import optparse
import os
from threading import *
maxConnections = 5
connection_lock = BoundedSemaphore(value = maxConnections)
Stop = False
Fails = 0
def connect(user, host, keyfile, release):
global Stop, Fails
try:
perm_denied = 'Permission denied'
ssh_newkey = 'Are you su... |
"""
Django settings for projetoMaster project.
Generated by 'django-admin startproject' using Django 1.9.6.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import... |
"""
Project: Parallel.Archive
Date: 02/16/2017
Author: Demian D. Gomez
Main routines to load the RINEX files to the database, load station information, run PPP on the archive files and obtain
the OTL coefficients
usage: pyScanArchive.py [-h] [-rinex] [-otl]
[-stninfo [argument [argument ...]]]... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division, print_function, unicode_literals
from sys import version_info
PY3 = version_info[0] == 3
if PY3:
bytes = bytes
unicode = str
else:
bytes = str
unicode = unicode
string_types = (bytes, unicode,)
try:
... |
from lymph.core.decorators import rpc
from lymph.core.interfaces import Interface
from lymph.discovery.zookeeper import ZookeeperServiceRegistry
from lymph.events.null import NullEventSystem
from lymph.testing import LymphIntegrationTestCase
class Upper(Interface):
service_type = 'upper'
@rpc()
def upper... |
from django import forms
from django.core.exceptions import ValidationError
from django.contrib.auth.models import User
from bootcamp.settings import ALLOWED_SIGNUP_DOMAINS
def Validardominio(value):
if '*' not in ALLOWED_SIGNUP_DOMAINS:
try:
dominio = value[value.index("@"):]
if do... |
import numpy as np
from gpaw.utilities.blas import gemm
from gpaw.utilities import pack, unpack2
from gpaw.utilities.timing import nulltimer
class EmptyWaveFunctions:
def __nonzero__(self):
return False
def set_eigensolver(self, eigensolver):
pass
def set_orthonormalized(self, flag)... |
from django.template.loader import render_to_string
from debug_toolbar.panels import DebugPanel
class HeaderDebugPanel(DebugPanel):
"""
A panel to display HTTP headers.
"""
name = 'Header'
has_content = True
# List of headers we want to display
header_filter = (
'CONTENT_TYPE',
... |
from Timeline.Server.Constants import TIMELINE_LOGGER, PACKET_TYPE, PACKET_DELIMITER, LOGIN_SERVER, WORLD_SERVER, LOGIN_SERVER_ALLOWED
from Timeline.Utils.Events import PacketEventHandler
from twisted.internet import threads
from twisted.internet.defer import Deferred
from collections import deque
import loggi... |
# Authors:
# Petr Viktorin <pviktori@redhat.com>
# Tomas Babej <tbabej@redhat.com>
#
# Copyright (C) 2013 Red Hat
# see file 'COPYING' for use and warranty information
#
# 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
# t... |
import os
import requests
import viewsenators.cityToFbCode as cityToFbCode
import viewsenators.stateToFbCode as stateToFbCode
from .models import Party, City, State, Senator, Congressmember, ContactList
from .getPopulations import getCityStatePopulations
def populateParties(partyModel, partyObjects):
""" Takes in ... |
# -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, unicode_literals, division,
print_function)
from ..representation import SphericalRepresentation
from ..baseframe import (BaseCoordinateFrame, frame_transform_graph,
... |
# -*- coding: utf-8 -*-
# ------------------------------------------------------------
# pelisalacarta 4
# Copyright 2015 tvalacarta@gmail.com
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#
# Distributed under the terms of GNU General Public License v3 (GPLv3)
# http://www.gnu.org/licenses/gpl-3.0.html
# --... |
#!/usr/bin/python3
#
# test-messages.py - This script publish a random MQTT messages every 2 s.
#
# Copyright (c) 2013-2020, Fabian Affolter <fabian@affolter-engineering.ch>
# Released under the MIT license. See LICENSE file for details.
#
import random
import time
import paho.mqtt.client as mqtt
timestamp = int(time.... |
from django.utils.translation import ugettext as _
from django.utils.safestring import mark_safe
from django.contrib.auth.models import User
from django import forms
from blango.models import Comment
from blango.jsforms import JSModelForm
# This violates the DRY principe, but it's the only
# way I found for editing ... |
import json
def required(param_list, args):
for param in param_list:
if type(param) != str:
raise Exception("param must be a string value")
if param not in args:
raise Exception("%s is required." % (param,))
def semi_required(param_variations, args):
atleast = False
... |
"""
Save Levels
Save the view dependant properties -
endpoint locations, level heads and leaders
of the selected building levels for re-use
Non-level elements will be skipped with dialog,
so it's advisable to apply filtering beforehead
TESTED REVIT API: 2020
@ejs-ejs
This script is part of PyRevitPlus: Extensions... |
#!/usr/bin/env python3
#-*- coding: utf-8 -*-
##This software is available to you under the terms of the GPL-3, see "/usr/share/common-licenses/GPL-3".
##Copyright:
##- Tomasz Makarewicz (makson96@gmail.com)
import os, shutil
from subprocess import check_output
recultis_dir = os.getenv("HOME") + "/.recultis/"
self_d... |
"""
manages the files on the mp3 player
"""
import os
import re
import logging
import shutil
import pyres.utils as utils
def _double_digit_name(name):
""" Makes all numbers two digit numbers by adding a leading 0 where
necessary. Three digit or longer numbers are unaffected. """
# do a little clean up to... |
import subprocess
from subprocess import Popen, PIPE
from . import celery
@celery.task(bind=True)
def deploy_running_task(self, cmd, type='Deploy'):
has_error = False
result = None
output = ""
self.update_state(state='PROGRESS',
meta={'output': output,
... |
# Organic Photovoltaic Device Model - a drift diffusion base/Shockley-Read-Hall
# model for organic solar cells.
# Copyright (C) 2012 Roderick C. I. MacKenzie
#
# roderick.mackenzie@nottingham.ac.uk
# www.opvdm.com
# Room B86 Coates, University Park, Nottingham, NG7 2RD, UK
#
# This program is free softwar... |
import os
import tempfile
from unittest import TestCase
from cStringIO import StringIO
from clangcomplete.libclang import setup
from clangcomplete.api import (
mainloop,
AsyncSession,
)
from clangcomplete.util import source_for_autocomplete
TEST_SOURCE = """
struct Foo {
int bar;
int baz;
};
int... |
"""
Misc utility functions required by several modules in the ligpy program.
"""
import os
import numpy as np
from constants import GAS_CONST, MW
def set_paths():
"""
Set the absolute path to required files on the current machine.
Returns
-------
reactionlist_path : str
... |
""" Automatic refining of astrometry calibration. The initial astrometric calibration is needed, which will be
refined by using all stars from a given night.
"""
from __future__ import print_function, division, absolute_import
import os
import sys
import copy
import shutil
import random
import argparse
import n... |
#!/usr/bin/env python
import os
import subprocess
import sys
# Versions here must match what is bundled with the package (see package.json)
packages = [
'astroid-2.2.5.tar.gz',
'isort-4.3.17.tar.gz',
'lazy-object-proxy-1.3.1.tar.gz',
'mccabe-0.6.1.tar.gz',
'pylint-2.3.1.tar.gz',
'six-1.12.0.ta... |
#!/usr/bin/env python
import unittest
from paranoia.fundamentals import *
class FundamentalsModuleTest(unittest.TestCase):
def test_crt(self):
self.assertNotEqual(malloc, None)
self.assertNotEqual(realloc, None)
self.assertNotEqual(free, None)
self.assertNotEqual(memset, None)
... |
##
# Copyright 2012-2018 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# Flemish Research Foundation (F... |
"""
tests.tests_cli
~~~~~~~~~~~~~~~
"""
import pytest
from subprocess import Popen, PIPE
from jsonspec import cli
import json
from . import move_cwd
def runner(cmd, args, success, result):
try:
args = cmd.parse_args(args)
response = cmd(args)
if not success:
raise Exc... |
#
# Copyright (c) 2010-2014, MIT Probabilistic Computing Project
#
# Lead Developers: Dan Lovell and Jay Baxter
# Authors: Dan Lovell, Baxter Eaves, Jay Baxter, Vikash Mansinghka
# Research Leads: Vikash Mansinghka, Patrick Shafto
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may... |
from django import forms
from helios.shipping.models import ShippingMethodRegions
class ShippingChoiceField(forms.ModelChoiceField):
def label_from_instance(self, obj):
return u'%s, %s - %s' % (obj.method.name, obj.method.shipper, obj.cost)
# todo this needs to be handled either here
# or in the checkou... |
# -*- coding: utf-8 -*-
# wasp_general/cli/curses_commands.py
#
# Copyright (C) 2016 the wasp-general authors and contributors
# <see AUTHORS file>
#
# This file is part of wasp-general.
#
# Wasp-general is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public Licens... |
import unittest
from conans.test.utils.tools import TestServer, TestClient
from conans.model.ref import ConanFileReference
import platform
import os
from conans.test.utils.context_manager import CustomEnvPath
from conans.test.utils.test_files import hello_conan_files
from nose.plugins.attrib import attr
@attr('golang... |
"""OpenSSL utilities module - contains OpenSSLConfig class for
parsing OpenSSL configuration files
NERC Data Grid Project
"""
__author__ = "P J Kershaw"
__date__ = "08/02/07"
__copyright__ = "(C) 2009 Science and Technology Facilities Council"
__license__ = "BSD - see LICENSE file in top-level directory"
__contact__ =... |
# -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsServer GetFeatureInfo WMS.
From build dir, run: ctest -R PyQgsServerWMSGetFeatureInfo -V
.. note:: 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; ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from sys import argv
import re
# Si el numero de parametros del programa es menor que 3 o los parametros primero y segundo son el mismo archivo
if len(argv) < 3 or argv[1] == argv[2]:
print "Error la sintaxis es:"
print "\t$",argv[0]," output/floydS.dat"," output/floyd1... |
# -*- coding: utf-8 -*-
# Copyright 2007-2011 The HyperSpy developers
#
# This file is part of HyperSpy.
#
# HyperSpy 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... |
import os
import random
import sys
import datetime
from urllib import urlencode
import mailpile.auth
from mailpile.defaults import CONFIG_RULES
from mailpile.i18n import ListTranslations, ActivateTranslation, gettext
from mailpile.i18n import gettext as _
from mailpile.i18n import ngettext as _n
from mailpile.plugins ... |
import datetime
# Django specific
from django.core.management.base import BaseCommand
from django.db import connection
from iati.models import Activity, Budget
import logging
logger = logging.getLogger(__name__)
class Command(BaseCommand):
option_list = BaseCommand.option_list
counter = 0
def handle(sel... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 1.0.2.7202 on 2016-06-23.
# 2016, SMART Health IT.
import io
import json
import os
import unittest
from . import operationdefinition
from .fhirdate import FHIRDate
class OperationDefinitionTests(unittest.TestCase):
def instantiate_from(sel... |
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 CERN.
##
## Invenio 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
## ... |
## Copyright 2003-2009 Luc Saffre
## This file is part of the TimTools project.
## TimTools 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 v... |
import datetime
import logging
import math
import os
import re
import time
import traceback
from contextlib import contextmanager
from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, Type, Union
from allennlp.common.util import int_to_device
import torch
import torch.distributed as dist
from torch... |
"""
TabsExtra.
Copyright (c) 2014 - 2016 Isaac Muse <isaacmuse@gmail.com>
License: MIT
"""
import sublime_plugin
import sublime
import time
import sys
from TabsExtra import tab_menu
import os
import functools
from operator import itemgetter
import sublime_api
from urllib.parse import urljoin
from urllib.request impor... |
from django import template
register = template.Library()
from backend.models import *
slider_principal = WpPosts.objects.all().filter(
post_status="publish",
post_type="post",
wptermrelationships__term_taxonomy__term__name="Slider Principal",
)
slider_principal.filter(wppostmeta__meta_key__in=["data-icon","da... |
"""
Flask-Pusher
------------
Flask-Pusher is a wrapper around `pusher-http-python` and
adds Pusher support for your Flask application.
Easy Setup
``````````
Quickstart:
.. code:: python
from flask_pusher import Pusher
app = Flask(__name__)
pusher = Pusher(app)
# Use any `pusher.Pusher` method.
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.