text stringlengths 475 200k |
|---|
# Copyright (C) 2020 OpenMotics BV
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distribu... |
print("Se for votar no candidato A coloque 100")
print("Se for votar no candidato B coloque 101")
print("Se for votar no candidato C coloque 102")
CandidatoA = 0
CandidatoB = 0
CandidatoC = 0
for numero in range (0,99999):
voto = int(input("Qual é o seu voto? "))
if (voto == 100) :
CandidatoA... |
#!/usr/bin/env python3
#
# Copyright (c) 2016, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# ... |
from django.db import models
from django.contrib.auth.models import User
class Author(models.Model):
"""
Author of a Book
"""
first_name = models.CharField(
max_length=40,
verbose_name=u'First Name')
last_name = models.CharField(
max_length=40,
verbose_name=u'Last N... |
# Copyright 2015: Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... |
from nassl.ssl_client import ClientCertificateRequested
from sslyze.plugins.fallback_scsv_plugin import FallbackScsvScanResult, FallbackScsvImplementation
from sslyze.server_connectivity import ServerConnectivityTester
from sslyze.server_setting import (
ServerNetworkLocationViaDirectConnection,
ServerNetwork... |
# -*- coding: utf-8 -*-
'''
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 option) any later version.
This program is distributed in... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright © 2012 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public
# License as published by the Free Software Foundation; either version
# 2 of the License (GPLv2) or (at your option) any later version.
# There is NO WARRANTY for this soft... |
#!/usr/bin/python3
import env
import json, os
from functools import wraps
from log import logger
class settingsClass:
setting = {}
def __init__(self):
settingPath = env.getenv('FS_PREFIX') + '/local/settings.conf'
if not os.path.exists(settingPath):
settingFile = open(settingPath,... |
from django.core.exceptions import ImproperlyConfigured
from django import forms
from django.forms.extras import SelectDateWidget
from django.utils.translation import ugettext_lazy as _
from mezzanine.conf import settings
from mezzanine.core.forms import SplitSelectDateTimeWidget
from mezzanine.utils.importing import... |
# Copyright 2010 OpenStack Foundation
# 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 requ... |
################################################################################
# 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... |
##############################################################################
# Copyright (c) 2013, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Written by Todd Gamblin, [EMAIL], All rights reserved.
# LLNL-CODE-647188
#
# For de... |
import configparser, os, csv, re, numpy, pickle, logging, time
from collections import OrderedDict
from scipy import spatial
class indexer:
def __init__(self, terms, docs, matrix):
self.terms = terms
self.documents = docs
self.matrix = matrix
class query:
def __init__(self, query_num... |
# encoding: utf8
import os
import sys
import unittest
try:
import tkinter as tk
import tkinter.ttk as ttk
except:
import Tkinter as tk
import ttk
pygubu_basedir = os.path.abspath(os.path.dirname(
os.path.dirname(os.path.realpath(sys.argv[0]))))
if pygubu_basedir not in sys.path:
... |
# Author: Krist Jin
# Reviewer: mlr
# History:
# - 2013-08-03: Created.
# - 2014-08-05: Updated by mlr.
import re
from lxml import html
import time
from datetime import date
from juriscraper.OpinionSite import OpinionSite
from juriscraper.lib.string_utils import titlecase
class Site(OpinionSite):... |
import numpy as np
import tensorflow as tf
import time
import logging
import os
try:
from collections.abc import Sequence as SequenceCollection
except:
from collections import Sequence as SequenceCollection
from deepchem.data import Dataset, NumpyDataset
from deepchem.metrics import Metric
from deepchem.models.lo... |
#!/usr/bin/env python
#coding=utf-8
import rospy
from geometry_msgs.msg import Twist
from kobuki_msgs.msg import BumperEvent
bumper_state_flag = False #True represent 'pressed', False represent 'released'
bumper_left_flag = False
bumper_center_flag = False
bumper_right_flag = False
def bumper_eventCB(msg):
globa... |
# -*- coding: utf8 -*-
#
# Copyright (C) 2015 NDP Systèmes (<http://www.ndp-systemes.fr>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# Licen... |
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2014-2017 Vincent Noel ([EMAIL])
#
# This file is part of libSigNetSim.
#
# libSigNetSim 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 versi... |
# -*- 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... |
'''
Created on Jun 30, 2013
@author: kickban
'''
import os, sys
import shutil
import zipfile
from commands import Commands
import MinecraftDiscovery
def copyAssets(src, dst):
if os.path.exists(dst):
shutil.rmtree(dst)
try:
shutil.copytree(src, dst)
except:
print ("Error c... |
## $id: webstatadmin.py,v 1.28 2007/04/01 23:46:46 tibor exp $
##
## This file is part of Invenio.
## Copyright (C) 2007, 2008, 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; ... |
'''
/*******************************************************************************
*
* Copyright (c) 2015 Fraunhofer FOKUS, All rights reserved.
*
* 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 Sof... |
import sys
import os
import re
import time
import timeit
import numpy as np
import numpy.random as rdn
from qtools.qtpy import QtCore, QtGui
from qtools.qtpy.QtCore import Qt, pyqtSignal
from galry import DEBUG, log_debug, log_info, log_warn
try:
from qtools.qtpy.QtOpenGL import QGLWidget, QGLFormat
except Exceptio... |
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from builtins import *
from builtins import object
import logging
import enum as enum
class EntryTy... |
from unittest import TestCase
from mock import patch, MagicMock
from configuration_py.parser_lookup import _find_parser_class_by_extension
class TestFindParserClassByExtension(TestCase):
@patch('configuration_py.parser_lookup._lookup_for_available_parsers')
def test_should_return_parser_class_when_extension... |
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
# Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Login handler for using App Engine authentication with Flask-Login
Assumes app.yaml is configured with:
..
handlers:
- url: /login
script: <wsgi_app path>
login: required
E.g., ``logi... |
import numpy as np
from .partition import LabelSpacePartitioningClassifier
from ..cluster.random import RandomLabelSpaceClusterer
from ..problem_transform import LabelPowerset
from ..base import MLClassifierBase
class RakelD(MLClassifierBase):
"""Distinct RAndom k-labELsets multi-label classifier.
Divides t... |
# -*- coding: utf-8 -*-
import urllib
import json
from odm.catalogs.utils import datautils
from odm.catalogs.utils import metautils
from odm.catalogs.CatalogReader import CatalogReader
import os.path
dir = os.path.dirname(__file__)
portalname = 'daten.rlp.de'
def mapData(data, city=True):
returndata = []
... |
from astropy.table import Table
import pyradex
import numpy as np
R = pyradex.Radex(column=1e16,abundance=1e-4,species='ph2co-h2')
fortho = 0.75
nFWHM = 5
FHWMmin = 0.5
FHWMmx = 5
nDens = 21
nlower = 2
nupper = 6
nCol = 41
Nlower = 10
Nupper = 16
nTemp = 31
Tlower = 10
Tupper = 300
Temps = np.logspace(1,2.5,nTem... |
# -----------------------------------------------------------------------------
# Copyright (c) 2014--, The Qiita Development Team.
#
# Distributed under the terms of the BSD 3-clause License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... |
# 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
# d... |
from __future__ import unicode_literals
from django.utils.encoding import python_2_unicode_compatible
import uuid
from django.db import models
from django.conf import settings
class BaseProfile(models.Model):
user = models.OneToOneField(settings.AUTH_USER_MODEL,
primary_key=True)
... |
import torchfile
import argparse
import torch
from torch.nn.parameter import Parameter
import numpy as np
import models.crnn as crnn
layer_map = {
'SpatialConvolution': 'Conv2d',
'SpatialBatchNormalization': 'BatchNorm2d',
'ReLU': 'ReLU',
'SpatialMaxPooling': 'MaxPool2d',
'SpatialAveragePooling': ... |
#!/usr/bin/python
#
# Copyright (C) Citrix Systems Inc.
#
# This program 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; version 2.1 only.
#
# This program is distributed in the hope that it will be u... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# This module is also sponsored by E.T.A.I. (www.etai.fr)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version... |
import os
import platform
from twisted.internet import defer
from . import data
from p2pool.util import math, pack, jsonrpc
@defer.inlineCallbacks
def check_genesis_block(bitcoind, genesis_block_hash):
try:
yield bitcoind.rpc_getblock(genesis_block_hash)
except jsonrpc.Error_for_code(-5):
def... |
"""
Access to the RELIC multiple precision integer type bn_t detailed in relic_bn.h
"""
from relic import librelic
from common import *
from ctypes import Structure, byref, sizeof, c_int, c_ulonglong
class BigInt(Structure):
"""
Multiple precision integer used by RELIC.
"""
BN_SIZE = 34
POSITIVE_FL... |
import types
import pytest as pytest
from plenum.common.messages.node_messages import PrePrepare
from stp_core.loop.eventually import eventually
from stp_core.common.log import getlogger
from plenum.common.types import f
from plenum.common.constants import DOMAIN_LEDGER_ID
from plenum.common.util import compareNamedT... |
# -*- coding: utf-8 -*-
# Part of the psychopy.iohub library.
# Copyright (C) 2012-2016 iSolver Software Solutions
# Distributed under the terms of the GNU General Public License (GPL).
from __future__ import division, absolute_import, print_function
from builtins import str
from collections import deque
import math
i... |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
QGIS Web Processing Service Plugin
-------------------------------------------------------------------
Date : 09 November 2009
Copyright : (C) 2009 by Dr. Horst Duester
email ... |
import os
import cv2
import numpy as np
import tensorflow as tf
from PIL import Image
import config
FLAGS = tf.app.flags.FLAGS
class Dataset:
def __init__(self):
self.zip_options = tf.python_io.TFRecordOptions(tf.python_io.TFRecordCompressionType.GZIP)
@staticmethod
def from_BRG_to_RGB(img):
... |
# (C) Copyright 2017 Inova Development Inc.
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2014 Therp BV (<http://therp.nl>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... |
#!/usr/bin/env python3
# Copyright (c) 2018-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test createwallet arguments.
"""
from test_framework.test_framework import BitcoinTestFramework
from t... |
# /***********************************************************************
# Copyright 2019 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/LICE... |
"""High level summaries of samples and programs with MultiQC.
https://github.com/ewels/MultiQC
"""
import collections
import glob
import io
import json
import mimetypes
import os
import pandas as pd
import shutil
import numpy as np
from collections import OrderedDict
import pybedtools
import six
import toolz as tz
im... |
# 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
# d... |
#!/usr/bin/env python
###################################################################################
#
# Copyright (c) 2010-2016 Motsai
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Softwa... |
#
# Copyright (c) 2018 Juniper Networks, Inc. All rights reserved.
#
import base64
import docker
import gevent
import os
import re
import socket
from netaddr import IPAddress, IPNetwork
class DeviceZtpManager(object):
EXCHANGE = 'device_ztp_exchange'
CONFIG_FILE_ROUTING_KEY = 'device_ztp.config.file'
TF... |
# Copyright 2019 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... |
import StringIO
from twisted.trial import unittest
from twisted.trial import reporter, runner
class TrialTest(unittest.TestCase):
def setUp(self):
self.output = StringIO.StringIO()
self.reporter = reporter.TestResult()
self.loader = runner.TestLoader()
class TestInterruptInTest(TrialTest... |
"""
Subdivide Cells
~~~~~~~~~~~~~~~
Increase the number of triangles in a single, connected triangular mesh.
The :func:`pyvista.PolyDataFilters.subdivide` filter utilitizes three different
subdivision algorithms to subdivide a mesh's cells: `butterfly`, `loop`,
or `linear`.
"""
from pyvista import examples
import pyv... |
"""
Oracle database backend for Django.
Requires cx_Oracle: http://cx-oracle.sourceforge.net/
"""
from __future__ import unicode_literals
import datetime
import decimal
import sys
import warnings
def _setup_environment(environ):
import platform
# Cygwin requires some special voodoo to set the environment va... |
#!/usr/bin/env python
# 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 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that ... |
# -*- coding: utf-8 -*-
# Copyright 2014-17 Neil Freeman [EMAIL]
# 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 option) any later version.
# This... |
# Copyright 2008 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 applicable law or agreed to in writing, ... |
__all__ = ['Pricer','sensitivity','PricerNotAvailable']
from jflow.utils.observer import lazyobject
class PricerNotAvailable(Exception):
"Pricer not available"
def __init__(self, element):
self.element = str(element)
def __str__(self):
return 'Pricer not available for %... |
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,... |
# -*- coding: utf-8 -*-
"""
Settings for Bok Choy tests that are used when running Studio.
Bok Choy uses two different settings files:
1. test_static_optimized is used when invoking collectstatic
2. bok_choy is used when running the tests
Note: it isn't possible to have a single settings file, because Django doesn't
... |
#!/usr/bin/env python
# Test whether a client sends a correct PUBLISH to a topic with QoS 0.
# The client should connect to port 1888 with keepalive=60, clean session set,
# and client id publish-qos0-test
# The test will send a CONNACK message to the client with rc=0. Upon receiving
# the CONNACK and verifying that ... |
# -*- coding: utf-8 -*-
from mock import patch, MagicMock
from typing import Optional, Text
from zerver.lib.webhooks.git import COMMITS_LIMIT
from zerver.lib.test_classes import WebhookTestCase
class GitlabHookTests(WebhookTestCase):
STREAM_NAME = 'gitlab'
URL_TEMPLATE = "/api/v1/external/gitlab?&api_key={api... |
from __future__ import unicode_literals, division, absolute_import
from builtins import * # pylint: disable=unused-import, redefined-builtin
from collections import defaultdict
import logging
import re
from datetime import datetime
from sqlalchemy.orm import relationship
from sqlalchemy.orm.exc import NoResultFound
... |
# -*- coding:utf-8 -*-
import operator
import string
import operator
import itertools
import snowballstemmer
from textblob import TextBlob, Word
LOWER_MAP = {
'tr': {
ord('I'): u'ı'
}
}
STEMMERS = {
'en': snowballstemmer.stemmer('english'),
'tr': snowballstemmer.stemmer('turkish'),
}
def no... |
"""
You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality check. Since each version is developed based on the previous version, all the versions after a bad version are also bad.
Suppose you have n versions [1, 2, ..., n] an... |
# -*- coding: utf-8 -*-
#
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... |
"""Sine Wave
This script draws a sine wave on the LEDs.
References:
http://jsfiddle.net/veEyM/5/
"""
import argparse
from copy import deepcopy
from math import sin
import socket
from time import sleep
parser = argparse.ArgumentParser(description='Sine wave example.')
parser.add_argument('--ip', dest='ip', action... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
# Copyright (C) 2012 StartOS(www.startos.org) Ltd.
# This application is released under the GNU General Public License
# v3 (or, at your option, any later version). You can find the full
# text of the license under http://www.gnu.org/licenses/gpl.txt.
# By using, editing a... |
# -*- coding: utf-8 -*-
"""
Created on Tue Jan 14 17:57:18 2014
@author: ciaran
"""
try:
from setuptools import setup
from setuptools import Extension
except ImportError:
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
i... |
"""SCons.Tool.gcc
Tool-specific initialization for gcc.
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, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foun... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
# coding: utf-8
# In[1]:
get_ipython().magic(u'pylab inline')
import matplotlib.pyplot as plt
import numpy as np
from charistools.readers import read_tile
pylab.rcParams['figure.figsize'] = (10.0, 8.0)
# In[2]:
get_ipython().magic(u'cd /Users/brodzik/projects/CHARIS_FTP_copy/main_training/data/basin_masks')
get_... |
# coding=utf-8
# Copyright 2016 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants.backend.j... |
# Copyright (c) 2011 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2011 Amazon.com, Inc. or its affiliates. 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 ... |
'''
Url Request
===========
.. versionadded:: 1.0.8
You can use the :class:`UrlRequest` to make asynchronous requests on the
web and get the result when the request is completed. The spirit is the
same as the XHR object in Javascript.
The content is also decoded if the Content-Type is
application/json and the result... |
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2016 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emanuel Cino <[EMAIL]>
#
# The licence is in the file __openerp__.py
#
########... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from celery import group
from celery.utils.log import get_task_logger
import time
from lib.inspection import WebScanInspector
from wselasticsearch.ops import update_web_service_scan_from_report, get_latest_web_service_report_ids, \
get_web_service_sca... |
#!/usr/bin/env python
'''
useful extra functions for use by mavlink clients
Copyright Andrew Tridgell 2011
Released under GNU GPL version 3 or later
'''
import os, sys
from math import *
try:
# rotmat doesn't work on Python3.2 yet
from rotmat import Vector3, Matrix3
except Exception:
pass
def kmh(mps):... |
from datetime import datetime, timedelta
from pytz import utc
from django.contrib.sitemaps import Sitemap
from django.core.urlresolvers import reverse
from main.models import Package
from news.models import News
from packages.utils import get_group_info, get_split_packages_info
from releng.models import Release
from ... |
# -*- coding: utf-8 -*-
from cPickle import load
from datetime import datetime, timedelta
from flask import Flask, jsonify, render_template, request
app = Flask("Simple C'n'C")
events = None
def get_events(date):
global events
if events == None:
try:
events_file = open("events.pickled", ... |
# Copyright 2019 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... |
from test import test_support
import time
import unittest
import sys
class TimeTestCase(unittest.TestCase):
def setUp(self):
self.t = time.time()
def test_data_attributes(self):
time.altzone
time.daylight
time.timezone
time.tzname
def test_clock(... |
# -*- coding: utf-8 -*-
import redis
class RedisClient(object):
def __init__(self, host='localhost', port=6379, password=None,
db=0, default_timeout=None, key_prefix=None):
self.default_timeout = default_timeout
self._client = redis.Redis(host=host, port=port, password=password, ... |
#!/usr/bin/env python
# encoding=utf-8
import time
import pcap
from multiprocessing import Process
from database import Database
from interface import set_monitor
import sys
import signal
import getopt
import decode
def format_mac(mac):
output = ""
# Format MAC address like 'AABBCC001122' into 'AA:BB:CC:00:1... |
# ICE Revision: $Id$
"""Analyze a file with GNUPLOT-Data"""
import re
class GnuplotFile(object):
def __init__(self,fname):
"""
@param fname: The filename
"""
self.fname=fname
self.titles=[]
self.analyze()
def analyze(self):
"""
Find out how ma... |
import os
import sys
from setuptools import setup
if sys.version_info < (3, 3):
print("Sorry, pubmed-lookup currently requires Python 3.3+.")
sys.exit(1)
# From: https://hynek.me/articles/sharing-your-labor-of-love-pypi-quick-and-dirty/
def read(*paths):
"""Build a file path from *paths* and return the co... |
# coding=utf-8
# Copyright 2017 The DLT2T 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 applicable law or ... |
import server
import json
import mock
import requests
from testutils import stubbed_get, fake_response
from types import StringType
import sys
from nose.tools import *
def test_make_httpfs_url():
eq_('http://localhost:14000/webhdfs/v1/datasets/foo.bam?user.name=igv&op=OPEN',
server.make_httpfs_url('... |
# Copyright (c) 2020 PaddlePaddle 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 appli... |
#
# Copyright 2012 Red Hat, Inc.
#
# 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 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in th... |
"""Provides Sun-related parameters
The following code is heavily based on IDL function get_sun.pro which itself
is based on algorithms presented in the book Astronomical Formulae for
Calculators, by Jean Meeus.
Every function returning a quantity is of type astropy.units.Quantity
A correct answer set to compare to
S... |
# -*- coding: utf-8 -*-
# Copyright (c) 2010 - 2014 Detlev Offenbach <[EMAIL]>
#
"""
Module implementing a spinbox with textual entries.
"""
from __future__ import unicode_literals
from PyQt5.QtWidgets import QSpinBox
class E5TextSpinBox(QSpinBox):
"""
Class implementing a spinbox with textual entries.
... |
# This file is part of TRS (http://math.kompiler.org)
#
# TRS is free software: you can redistribute it and/or modify it under the
# terms of the GNU Affero General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your option) any
# later version.
#
# TRS is distrib... |
"""Retrieve data from PyPI."""
from distutils.version import LooseVersion
from logging import getLogger
import xmlrpclib
from flask.ext.celery import single_instance
from pypi_portal.extensions import celery, db, redis
from pypi_portal.models.pypi import Package
from pypi_portal.models.redis import POLL_SIMPLE_THROT... |
from lux.extensions.ui import *
from lux.utils import test
class TestVariables(test.TestCase):
def root(self, skins=False):
all = Css()
self.assertEqual(all.tag, None)
self.assertEqual(all.code, 'ROOT')
self.assertEqual(list(all.variables), [])
if skins:
add_sk... |
# Copyright (c) 2013 Mirantis 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 writ... |
##########################################################################
#
# Copyright (c) 2012-2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.