src stringlengths 721 1.04M |
|---|
# -*- coding: utf-8 -*-
"""
Defines the unit tests for the :mod:`colour.recovery.jakob2019` module.
"""
import numpy as np
import os
import shutil
import tempfile
import unittest
from colour.characterisation import SDS_COLOURCHECKERS
from colour.colorimetry import (CCS_ILLUMINANTS, SDS_ILLUMINANTS,
... |
from collections import defaultdict
from itertools import chain
from ..compat import iteritems, itervalues
from ..runloop import coro_return, runloop_coroutine
from ..batch_coroutine import class_batch_coroutine
class BatchMemcachedClient(object):
def __init__(self, real_client):
self.client = real_client... |
# Xlib.protocol.rq -- structure primitives for request, events and errors
#
# Copyright (C) 2000-2002 Peter Liljenberg <petli@ctrl-c.liu.se>
#
# 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 Fou... |
from django.test import TestCase
from django.db import IntegrityError
from nose.tools import raises, assert_equals, assert_is_not_none
from api.models import Concept
from utils import factories
class ConceptTest(TestCase):
def setUp(self):
self.name = 'SX SITE SWELLING'
self.display_name = 'Swelli... |
# TP/CON/MAS/BV-37-C [Master Data Length Update - minimum Receive Data Channel
# PDU length and time]
#
# Verify that the IUT as Master correctly handles reception of an LL_LENGTH_REQ
# PDU
import bluetool
from bluetool.core import HCIDataTransCoordinator, HCIDataTransWorker, LEHelper
import bluetool.bluez as bluez
im... |
#
# @BEGIN LICENSE
#
# Psi4: an open-source quantum chemistry software package
#
# Copyright (c) 2007-2019 The Psi4 Developers.
#
# The copyrights for code used from other parties are included in
# the corresponding files.
#
# This file is part of Psi4.
#
# Psi4 is free software; you can redistribute it and/or modify
#... |
# -*- coding: utf-8 -*-
"""
Created on Thu Sep 25 15:38:00 2014
@author: Yang Xuefeng
"""
from __future__ import division
import os
import numpy as np
import cPickle as cp
from collections import defaultdict as dd
def exist_number(w1,w2,s):
n = [1 for i in s if w1 in i and w2 in i]
return len(n)
#import gc
... |
import re
from django import forms
from django.http import str_to_unicode
from django.contrib.auth.models import User
from django.conf import settings
from django.utils.translation import ugettext as _
from django.utils.safestring import mark_safe
from askbot.conf import settings as askbot_settings
from askbot.utils.sl... |
# Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source
# & Institut Laue - Langevin
# SPDX - License - Identifier: GPL - 3.0 +
from __future__ import (absolute_import, divi... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from Http import Http
import logging
from Utils import ErrorSQLRequest, checkOptionsGivenByTheUser
from Constants import *
class HttpUriType (Http):
'''
Allow the user to send HTTP request
'''
def __init__(self,args):
'''
Constructor
'''
logging.debug("HttpUriTyp... |
from __future__ import division
import numpy as np
from box.mix import phival
from math import sin,cos
from weakref import proxy
import warnings
class ChiralWedge:
def __init__(self,atoms,type):
'''
Class for chiral+wedge boundary conditions.
@param: atoms hotbit.Atoms instance
... |
#
# CS2510 Chip-Specific code for CCLib
#
# Copyright (c) 2015 Simon Schulz - github.com/fishpepper
# Copyright (c) 2014-2016 Ioannis Charalampidis
#
# 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 Foundati... |
import celery
from celery import shared_task
from puzzles.models import Puzzle
from puzzles.spreadsheets import make_sheet
import slacker
import time
import sys
import logging
try:
from herring.secrets import SECRETS
# A token logged in as a legitimate user. Turns out that "bots" can't
# do the things we w... |
# -*- 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... |
import os
def cast_boolean(value):
if type(value) is bool:
return bool(value)
elif len(value) > 1:
return value == 'True'
else:
return bool(int(value))
def cast_string(value):
value = str(value).strip()
value = value.replace('\\n', '\n')
# unquote string
if value... |
#!/usr/bin/env python3
from adafruit.i2c import Adafruit_I2C
try:
from .component import *
except SystemError as err:
from component import *
class Melexis(LoopedComponent, I2CComponent):
_mswait = 50
_FN = "temp"
def init(self, fahrenheit=False):
super().init()
self._i2c = A... |
"""
Running mysql tests
-------------------
Create a database 'ut_nive' and assign all permissions for user 'root@localhost'.
File root is '/var/tmp/nive'.
To customize settings change 'dbconfMySql' in this file and 'conn' in
nive/utils/dataPool2/tests/t_MySql.py.
"""
import time
import unittest
from StringIO i... |
# -*- coding: utf-8 -*-
# Copyright (c) 2016 by Ecreall under licence AGPL terms
# available on http://www.gnu.org/licenses/agpl.html
# Source: https://github.com/narenaryan/Pyster
# licence: AGPL
# author: Amen Souissi
import sqlite3
import string
from flask import Flask, request, render_template, redirect, jsonify
f... |
# -*- coding: utf-8 -*-
"""
Created on Wed May 24 11:42:02 2017
@author: Wenlong Liu
wliu14@ncsu.edu
"""
import yagmail
import glob
import time
import os
import json
from smtplib import SMTPAuthenticationError
def _configuration(filename):
"""
Load configuration parameters from existing json file.
:para... |
import logging
import urllib
from django.http import HttpResponse, HttpResponseRedirect
from django.views.decorators.cache import never_cache
from django.views.decorators.csrf import csrf_view_exempt
from hiicart.gateway.base import GatewayError
from hiicart.gateway.paypal2 import api
from hiicart.gateway.paypal2.ipn i... |
# -*- coding: utf-8 -*-
"""
Copyright [2009-2017] EMBL-European Bioinformatics Institute
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... |
"""
`notipyserver` - User-Notification-Framework server
Provides test cases for the notipyserver main module.
:copyright: (c) by Michael Imfeld
:license: MIT, see LICENSE for details
"""
import sys
from threading import Thread
from mock import patch
from nose.tools import assert_equal
import notipyserver.__main__
... |
from django.core.urlresolvers import reverse
from rest_framework import status
from rest_framework.test import APITestCase
from tests.factories import NoteFactory, UserFactory
from notes.core.models import Note
class APITestNotAuthenticated(APITestCase):
def test_get_notes_not_authenticated(self):
url =... |
# -*- coding: us-ascii -*-
# asynchia - asynchronous networking library
# Copyright (C) 2009 Florian Mayer <florian.mayer@bitsrc.org>
# 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, eit... |
"""
KeepNote
Graphical User Interface for KeepNote Application
"""
#
# KeepNote
# Copyright (c) 2008-2009 Matt Rasmussen
# Author: Matt Rasmussen <rasmus@mit.edu>
#
# 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... |
"""Utilities for working with TMDb models."""
async def overlapping_movies(people, client=None):
"""Find movies that the same people have been in.
Arguments:
people (:py:class:`collections.abc.Sequence`): The
:py:class:`~.Person` objects to find overlapping movies for.
client (:py:class:`... |
from ...combinators import Lazy
from ...AST.expressions.logical import RelopBexp, NotBexp, AndBexp, OrBexp
from ...AST.expressions.arithmetic import IntAexp
"""
Precedence levels for binary operations.
"""
bexp_precedence_levels = [
['&&'],
['||', '!!'],
]
def process_relop(parsed):
"""
Convert bool... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
TestStar.py: Tests for the `star` module.
"""
import unittest
from physdata import star
class TestStar(unittest.TestCase):
def test_fetch_star_type(self):
# Test type of return
for data in [star.fetch_estar(13), star.fetch_astar(13), star.fetch_... |
# Copyright 2013 Douglas Linder
# 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... |
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2014 IBM Corp.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you... |
import itertools
import copy
import warnings
import re
import ecell4_base
from ecell4.extra import unit
def replace_parseobj(expr, substitutes=None):
substitutes = substitutes or {}
import ecell4.util.decorator_base
obj = ecell4.util.decorator_base.just_parse().eval(expr)
from ecell4.util.model_pa... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
chars =[
0x00, 0x00, 0x00, 0x00, 0x00,
0x3E, 0x5B, 0x4F, 0x5B, 0x3E,
0x3E, 0x6B, 0x4F, 0x6B, 0x3E,
0x1C, 0x3E, 0x7C, 0x3E, 0x1C,
0x18, 0x3C, 0x7E, 0x3C, 0x18,
0x1C, 0x57, 0x7D, 0x57, 0x1C,
0x1C, 0x5E, 0x7F, 0x5E, 0x1C,
... |
#!/usr/bin/env python3
import re
from reporter.connections import RedcapInstance
from reporter.emailing import (
RECIPIENT_LIMB_ADMIN as RECIPIENT_ADMIN,
RECIPIENT_LIMB_MANAGER as RECIPIENT_MANAGER,
)
from reporter.application_abstract_reports.redcap.data_quality import (
RedcapFieldMatchesRegular... |
#!/uns/bin/python
import os, sys, string, re, time, string
import pygale, gale_env, userinfo
#------------------------------------------------------------
# Global configuration
#------------------------------------------------------------
def bold_location(text):
if sys.platform == 'win32':
return text
else:
... |
# (c) 2016 Open Source Geospatial Foundation - all rights reserved
# (c) 2014 - 2015 Centre for Maritime Research and Experimentation (CMRE)
# (c) 2013 - 2014 German Aerospace Center (DLR)
# This code is licensed under the GPL 2.0 license, available at the root
# application directory.
import re
import UserDict as _Us... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2017-08-19 18:44
from __future__ import unicode_literals
import TCA.tasks.models
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('tasks', '0001_initial'),
]
operations = [
migrations.A... |
from kivy.uix.gridlayout import GridLayout
from UIElements.loadDialog import LoadDialog
from UIElements.pageableTextPopup import PageableTextPopup
from kivy.uix.popup import Popup
import re
from DataStructures.makesmithIni... |
"""Module with functions for management of installed APK lists."""
import glob
import re
import subprocess
import apkutils # needed for AndroidManifest.xml dump
import utils # needed for sudo
# Creates a APK/path dictionary to avoid the sluggish "pm path"
def create_pkgdict():
"""Creates a dict for fast pa... |
import re
import sys
import types
import appvalidator.unicodehelper as unicodehelper
from . import csstester
from appvalidator.contextgenerator import ContextGenerator
from appvalidator.constants import *
from appvalidator.csp import warn as message_csp
from appvalidator.python.HTMLParser import HTMLParser, HTMLParseE... |
#!/usr/bin/python
#
# Copyright 2016 Eder Perez https://github.com/eaperz
#
# 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
#
# Un... |
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import permissions
from oauth2_provider.ext.rest_framework import TokenHasScope
from api.settings import SCOPE_ANAGRAFICA_LETTURA_BASE, SCOPE_ANAGRAFICA_LETTURA_COMPLETA, SCOPE_APPARTENENZE_LETTURA
from api.v1 im... |
#!/usr/bin/env python
import datetime
import hashlib
import math
import operator
import optparse
import os
import re
import sys
import threading
import time
import webbrowser
from collections import namedtuple, OrderedDict
from functools import wraps
from getpass import getpass
from io import TextIOWrapper
# Py2k com... |
# (c) 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/licenses... |
# Copyright (c) 2001-2017, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobility and open public t... |
from vt_manager_kvm.communication.sfa.util.xrn import Xrn
from vt_manager_kvm.communication.sfa.util.xml import XmlElement
from vt_manager_kvm.communication.sfa.rspecs.elements.element import Element
from vt_manager_kvm.communication.sfa.rspecs.elements.sliver import Sliver
from vt_manager_kvm.communication.sfa.rspecs... |
import sys
import weakref
from _weakref import ref
try:
from _weakref import _remove_dead_weakref
except ImportError:
def _remove_dead_weakref(o, key):
del o[key]
import types
AIO_AVAILABLE = sys.version_info >= (3, 5)
if AIO_AVAILABLE:
import asyncio
else:
asyncio = None
PY2 = sys.version_inf... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2011 ~ 2012 Deepin, Inc.
# 2011 ~ 2012 Hou Shaohui
#
# Author: Hou Shaohui <houshao55@gmail.com>
# Maintainer: Hou Shaohui <houshao55@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the ter... |
# (C) British Crown Copyright 2013 - 2016, Met Office
#
# This file is part of iris-grib.
#
# iris-grib 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 opt... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
| This file is part of the web2py Web Framework
| Developed by Massimo Di Pierro <mdipierro@cs.depaul.edu>,
| limodou <limodou@gmail.com> and srackham <srackham@gmail.com>.
| License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
Debugger support classes
------------... |
#!/usr/local/bin/python -u
'''
Provide a Cloudera Manager benchmark pipeline
Usage: %s [options]
Options:
-h --help Show help
--user=<cloudera-user> The Cloudera services user
Defaults to 'admin'
--password=<cloudera-password> ... |
# standard imports
import numpy
import math
import copy
# our imports
from emission.core.wrapper.trip_old import Trip, Coordinate
import emission.storage.decorations.trip_queries as esdtq
import emission.storage.decorations.place_queries as esdpq
"""
This class creates a group of representatives for each... |
# Copyright Iris contributors
#
# This file is part of Iris and is released under the LGPL license.
# See COPYING and COPYING.LESSER in the root of the repository for full
# licensing details.
from iris.analysis._interpolation import get_xy_dim_coords, snapshot_grid
class AreaWeightedRegridder:
"""
This clas... |
# -*- test-case-name: twisted.test.test_tcp -*-
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
"""Various asynchronous TCP/IP classes.
End users shouldn't use this module directly - use the reactor APIs instead.
Maintainer: U{Itamar Shtull-Trauring<mailto:twisted@itamarst.org>}
"... |
#! /usr/bin/env python3
# Name: PySongGen
#
# Version: 0.0.1
#
# Author: Sinuhe Jaime Valencia
#
# Author_email: sierisimo@gmail.com
#
# Description:
# Main code for running instances of pysonggen
from pysonggen import grammar
from pysonggen.songgen import SongG
gram = grammar.Grammar('./examples/example.mgram')... |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import random
import werkzeug.urls
from collections import defaultdict
from datetime import datetime, timedelta
from odoo import api, exceptions, fields, models, _
class SignupError(Exception):
pass
def random_to... |
# Задача 12. Вариант 22.
# Разработайте игру "Крестики-нолики". (см. М.Доусон Программируем на Python
# гл. 6).
# Щербаков Р.А.
# 22.05.2016
print("""
Добро пожаловать на игру крестики нолики
чтобы сделать ход введите число от 0 до 8
0 | 1 | 2
---------
3 | 4 | 5
------... |
import hashlib
from CommonServerPython import *
class Client:
"""
Client to use in the APN-OS Policy Optimizer integration.
"""
def __init__(self, url: str, username: str, password: str, vsys: str, device_group: str, verify: bool, tid: int):
# The TID is used to track individual commands sen... |
# Copyright 2015 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 py
import time
from rsqueakvm import constants
from rsqueakvm.model.compiled_methods import W_PreSpurCompiledMethod
from rsqueakvm.model.variable import W_BytesObject
from rsqueakvm.primitives import prim_table
from rsqueakvm.primitives.constants import EXTERNAL_CALL
from rsqueakvm.error import PrimitiveFailedE... |
"""
Created on Wed Apr 15 19:33:09 2020
@author: ahinoamp@gmail.com
This script shows how to generate a 3d visualization of a pynoddy model
in a vtk popup window.
note: every time the window pops out, you need to close it to free the terminal
There is another ipynb file which shows how to visualize such models in... |
import torch
from queue import Queue
from .functions import *
from .abn import ABN
class InPlaceABN(ABN):
"""InPlace Activated Batch Normalization"""
def forward(self, x):
exponential_average_factor = 0.0
if self.training and self.track_running_stats:
self.num_batches_tracked +... |
"""Renderers convert model objects into a visual representation that
can be shown on the UI."""
class Renderer(object):
def attach_to_terminal(self, terminal):
"""Attaches the renderer to the given terminal."""
pass
def render(self, obj, selected=False):
"""Renders the given object in... |
# -*- coding: utf8 -*-
__author__ = 'sergey'
import hashlib
from time import time
from dedupsqlfs.db.mysql.table import Table
class TableSubvolume( Table ):
_table_name = "subvolume"
def create( self ):
c = self.getCursor()
# Create table
c.execute(
"CREATE TABLE IF NOT... |
# coding: utf-8
#
# Copyright © 2012-2014 Ejwa Software. All rights reserved.
#
# This file is part of gitinspector.
#
# gitinspector 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 Lic... |
#!/usr/bin/env python3.6
"""
This code is the AmLight OpenFlow Sniffer
Author: AmLight Dev Team <dev@amlight.net>
"""
import sys
import logging.config
import time
import threading
import yaml
from libs.core.printing import PrintingOptions
from libs.core.sanitizer import Sanitizer
from libs.core.topo_reader im... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-01-16 09:51
from __future__ import unicode_literals
import django.contrib.auth.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accounts', '0002_activate_users_20161014_0846'),
]... |
import datetime
from airflow.models import DAG
from airflow.operators.latest_only_operator import LatestOnlyOperator
import utils.helpers as helpers
args = {
'owner': 'airflow',
'depends_on_past': False,
'start_date': datetime.datetime(2017, 4, 1),
'retries': 1,
}
dag = DAG(
dag_id='pubmed',
d... |
# Copyright 2016-2017 Capital One Services, LLC
# Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
from c7n.exceptions import PolicyValidationError
from c7n.utils import local_session, type_schema
from .core import Filter, ValueFilter
from .related import RelatedResourceFilter
class Match... |
import bisect
import collections
import math
"""A class which defines a square by its upper and lower lat/lon bounds."""
LatLonSquare = collections.namedtuple('Square', ['lat_min', 'lat_max', 'lon_min', 'lon_max'])
class LatLonGrid(object):
"""
A data structure representing a rectangular grid of lati... |
# --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
"""Compute minibatch blobs for training a Fast R-CNN network."""
impor... |
from flask import redirect, request, session, url_for
from flask_admin import Admin, AdminIndexView, expose
from flask_admin.contrib import sqla
from flask_login import current_user
from .account.models import OAuth
from .auth import current_user_is_roadie
from .db import postgres
from .members.models import EmailAddr... |
# -*- coding: utf-8 -*-
"""
***************************************************************************
commitishtest.py
---------------------
Date : November 2013
Copyright : (C) 2013-2016 Boundless, http://boundlessgeo.com
***************************************************... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-01-30 19:14
from __future__ import unicode_literals
import autoslug.fields
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import enumfields.fields
import wurst.core.const... |
from flask import g
import telebot_login
from app import db, new_functions as nf
from app.constants import (
hide_answer, hide_lesson_answer, selected_lesson_answer,
selected_lesson_info_answer, ask_to_select_types_answer, how_to_hide_answer
)
from app.models import Lesson
from tg_bot import bot
from tg_bot.ke... |
#===============================================================================
# Copyright 2008 Matt Chaput
#
# 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... |
import uuid
from datetime import datetime, timedelta
from sqlalchemy import func, or_
from app import db
from app.dao.dao_utils import autocommit, version_class
from app.models import ApiKey
@autocommit
@version_class(ApiKey)
def save_model_api_key(api_key):
if not api_key.id:
api_key.id = uuid.uuid4() ... |
#!/usr/bin/python
import chess.pgn
import sys
import cjson
import time
def StudyGame(game):
headers = game.headers
node = game
ply = 0
positions = []
while True:
board = node.board()
node = node.variations[0]
p = {'ply': ply,
'num_legal_moves': len(boar... |
# Written by Andrea Reale
# see LICENSE.txt for license information
import unittest
from Tribler.Core.Subtitles.MetadataDomainObjects.MetadataDTO import MetadataDTO
import Tribler.Core.Subtitles.MetadataDomainObjects.MetadataDTO as MDUtil
from Tribler.Core.Overlay.permid import generate_keypair
from Tribler.Core.Cache... |
from __future__ import print_function, unicode_literals
import json
import logging
import mock
from django.core.urlresolvers import reverse
from .utils import TextItTest
logger = logging.getLogger(__name__)
class TextItViewTest(TextItTest):
disable_phases = True
def send_to_view(self, data):
""... |
"""SCons.Tool.ifort
Tool-specific initialization for newer versions of the Intel Fortran Compiler
for Linux/Windows (and possibly Mac OS X).
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) ... |
# -*- coding: utf-8 -*-
#
# django-cas-server documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 5 12:11:50 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
# autogenerated f... |
# -*- coding: windows-1252 -*-
'''
From BIFF8 on, strings are always stored using UTF-16LE text encoding. The
character array is a sequence of 16-bit values4. Additionally it is
possible to use a compressed format, which omits the high bytes of all
characters, if they are all zero.
The following tables ... |
# 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/.
import itertools
import ldap
import logging
from relengapi import p
from relengapi.lib.auth import permissions_stale
... |
# Copyright 2008 VPAC
#
# This file is part of django-pbs.
#
# django-pbs 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.
#
# django-pb... |
from rest_framework import serializers
from zentral.contrib.inventory.models import EnrollmentSecret
from zentral.contrib.inventory.serializers import EnrollmentSecretSerializer
from .models import Configuration, Enrollment, Pack, Platform
class ConfigurationSerializer(serializers.ModelSerializer):
class Meta:
... |
# -*- coding: utf-8 -*-
"""
Author: @sposs
Date: 19.08.16
"""
from fadds.base_file import BaseFile, BaseData
import re
value_re = re.compile(r"(?P<value>[0-9]+\.*[0-9]*)(?P<use>[A-Z ()0-9-/&]*)")
class TWRParser(BaseFile):
def __init__(self, twr_file):
super(TWRParser, self).__init__(twr_file)
se... |
import yaml
from task import RsyncTask
import asyncio
import logging
import argparse
class Application():
def __init__(self):
self.tasks = {}
def load_config(self, config):
with open(config) as fp:
data = yaml.safe_load(fp)
for i, j in data["task"].items():
... |
import os
import unittest
from tweet_check import Tweeter
class TestTweetCheck(unittest.TestCase):
""" Test TweetCheck """
def test_init_without_username(self):
""" Test TweetCheck with an empty username string. """
username = ""
twat = Tweeter(username)
self.assertEqual(twat... |
# 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.\n",
# 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... |
# -*- coding: utf-8 -*-
import telegram
import os
import logging
import json
from pokemongo_bot.base_task import BaseTask
from pokemongo_bot.base_dir import _base_dir
from pokemongo_bot.event_handlers import TelegramHandler
from pprint import pprint
import re
class TelegramTask(BaseTask):
SUPPORTED_TASK_API_VERSI... |
from setuptools import setup
setup(
name='libconf',
version='2.0.1',
description="A pure-Python libconfig reader/writer with permissive license",
long_description=open('README.rst').read(),
author="Christian Aichinger",
author_email="Greek0@gmx.net",
url='https://github.com/Grk0/python-libc... |
"""The tests for the Home Assistant HTTP component."""
# pylint: disable=protected-access,too-many-public-methods
import logging
import time
from ipaddress import ip_network
from unittest.mock import patch
import requests
from homeassistant import bootstrap, const
import homeassistant.components.http as http
from te... |
# -*- coding: utf-8 -*-
from ponyFiction.settings.base import *
INSTALLED_APPS += ('debug_toolbar',)
MIDDLEWARE_CLASSES += ('debug_toolbar.middleware.DebugToolbarMiddleware',)
JQUERY_URL = ''
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'stories',
'USER': 'celes... |
#!/usr/bin/python
import os, sys, unittest, tempfile
import common
from autotest_lib.client.common_lib import control_data
ControlData = control_data.ControlData
CONTROL = """
AUTHOR = 'Author'
DEPENDENCIES = "console, power"
DOC = \"\"\"\
doc stuff\"\"\"
# EXPERIMENTAL should implicitly be False
NAME = 'nA' "mE"
RU... |
#!/usr/bin/env python3
def rc4(chave, entrada, loops=1):
''' Algoritmo compatível com o RC4 '''
kbox = list(range(256)) # criar caixa para chave
for i, car in enumerate(chave): # copiar chave e vetor
kbox[i] = car
j = len(chave)
for i in range(j, 256): # repetir ate preencher
... |
#!/usr/bin/env python3
#
# Copyright (c) Bo Peng and the University of Texas MD Anderson Cancer Center
# Distributed under the terms of the 3-clause BSD License.
import copy
import os
import fasteners
import pickle
import time
import lzma
import math
import struct
from enum import Enum
from collections import namedtupl... |
from django.core.management.base import CommandError
from django.core.management.templates import TemplateCommand
from django.utils.importlib import import_module
from optparse import Option
# http://djangosnippets.org/snippets/1617/
class DictOption(Option):
"""
A parseopt option that let's me define a dicti... |
import os
import tensorflow as tf
from configparser import ConfigParser
from utilities.set_dirs import get_conf_dir
conf_dir = get_conf_dir(debug=False)
parser = ConfigParser(os.environ)
parser.read(os.path.join(conf_dir, 'neural_network.ini'))
# AdamOptimizer
beta1 = parser.getfloat('optimizer', 'beta1')
beta2 = pa... |
"""Split dependency changes table
Revision ID: 14ef9d47d314
Revises: 31d647dbc4c5
Create Date: 2015-09-07 16:23:42.789628
"""
# revision identifiers, used by Alembic.
revision = '14ef9d47d314'
down_revision = '31d647dbc4c5'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.create_table('unappli... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Text the basic chronos module"""
import unittest
import datetime
from .api import parse
class EmptyTestCase(unittest.TestCase):
"""Test for empty values passed - should return a empty list."""
def test_empty_string(self):
"""Tests for a empty string.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.