text stringlengths 17 737k |
|---|
# 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... |
#!/usr/bin/env python
"""
Southern California Earthquake Center Broadband Platform
Copyright 2010-2017 Southern California Earthquake Center
Program to set up a full BBP scenario simulation run on HPCC
$Id: bbp_hpcc_scenario.py 1644 2016-04-19 18:54:19Z fsilva $
"""
# Import Python modules
import os
import sys
import... |
# Copyright 2020 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 applicab... |
"""base class creation for all the schemas that exist."""
from functools import lru_cache
from pyramid.view import (
view_config,
)
from pyramid.security import (
# ALL_PERMISSIONS,
Allow,
Authenticated,
Deny,
# DENY_ALL,
Everyone,
)
from pyramid.traversal import (
find_root,
travers... |
# 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... |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2011, 2012, 2013, 2014, 2015 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
# License, or (a... |
#!/usr/bin/env python
from uuid import uuid4
from flask import Flask, abort, jsonify, request
from oauth2client.client import *
from sqlalchemy.sql import and_, func, literal, select, text
import json
from pyfiles.common_helpers import (
simplify_geometry, trace_linestrings, trace_split_sparse)
from pyfiles.cons... |
import argparse
import builtins
import inspect
import itertools
import re
import sys
import time
from collections import OrderedDict
from enum import Enum
from .const import DEFAULT_ENV
from .exc import CommandError, RunCommandsError
from .util import Hide, cached_property, get_hr, printer
__all__ = ['command']
cl... |
'''
@author David Stuebe
@file ion/services/dm/transformation/example/ion_seawater.py
@description Transforms using the csiro/gibbs seawater toolbox
'''
from pyon.ion.transform import TransformFunction
from pyon.service.service import BaseService
from pyon.core.exception import BadRequest
from pyon.public import IonOb... |
# -*- coding: utf-8 -*-
from openprocurement.api.utils import (
json_view,
context_unpack,
get_now,
)
from openprocurement.tender.core.utils import (
optendersresource,
save_tender
)
from openprocurement.tender.core.validation import (
validate_lot_data,
validate_tender_period_extension,
... |
# -*- coding: utf-8 -*-
from openprocurement.tender.belowthreshold.views.lot import TenderLotResource
from openprocurement.api.utils import (
json_view,
context_unpack,
error_handler
)
from openprocurement.tender.core.validation import (
validate_lot_data,
validate_patch_lot_data,
validate_lot_o... |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2014-2019 GEM Foundation
#
# OpenQuake 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
# -*- coding: utf-8 -*-
"""
manage metadata file
"""
from arglogger import arglogger
import logging
import os
import re
import shutil
from validate_path import validate_path
import xml.etree.ElementTree as ET
R = re.compile(r"\s+", re.MULTILINE)
def cleanval(raw):
try:
cooked=raw.str... |
#
# Kontron IpmiLibrary
#
# author: Michael Walle <michael.walle@kontron.com>
# author: Heiko Thiery <heiko.thiery@kontron.com>
#
import array
from robot.utils import asserts
import pyipmi
from utils import int_any_base
from mapping import *
class Fru:
def _fru_data(self, fru_id):
if ('prefetched_fru_da... |
""" Module to handle attributes related to the storage """
import os
import shutil
import stat
import logging
from osg_configure.modules import utilities
from osg_configure.modules import configfile
from osg_configure.modules import validation
from osg_configure.modules.baseconfiguration import BaseConfiguration
__a... |
# -*- coding: UTF-8 -*-
# Copyright (C) 2008 Samuel Abels, http://debain.org
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2, as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will... |
#
# Collective Knowledge (program)
#
# See CK LICENSE.txt for licensing details
# See CK COPYRIGHT.txt for copyright details
#
# Developer: Grigori Fursin, Grigori.Fursin@cTuning.org, http://fursin.net
#
cfg={} # Will be updated by CK (meta description of this module)
work={} # Will be updated by CK (temporal data)
c... |
import time
from datetime import datetime
import re
import ConfigParser
import MySQLdb
from MySQLdb import cursors
from webob import Response
import webob.exc
from common.apiversion import APIVersion
class APIv1App(APIVersion):
def __init__(self, config_file):
self.config = config_file
self.dbname = self.config.... |
#!/usr/bin/env python3
# Copyright (c) 2015-2020 The Dash Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.mininode import *
from test_framework.test_framework import DashTestFramework
from test_f... |
#!/usr/bin/env python
# CHANGED:2015-03-05 17:53:32 by Brian McFee <brian.mcfee@nyu.edu>
"""Test the util module"""
import tempfile
from jams import util
import os
from nose.tools import eq_
def test_read_lab():
fid, fpath = tempfile.mkstemp(suffix='.lab')
lab_data = [[0, 1.5, 'a\tblah blah'],
... |
#
# Collective Knowledge (program)
#
# See CK LICENSE.txt for licensing details
# See CK Copyright.txt for copyright details
#
# Developer: Grigori Fursin, Grigori.Fursin@cTuning.org, http://cTuning.org/lab/people/gfursin
#
cfg={} # Will be updated by CK (meta description of this module)
work={} # Will be updated by ... |
from django.db import models
from django.db.models.signals import post_save
from xml.sax.handler import ContentHandler
from xml.sax import parseString
from odk_dropbox.models import Submission
from eav.models import Attribute, Value
from eav.fields import EavSlugField
class EAVHandler(ContentHandler):
def __ini... |
import os
import re
from flask import Flask, request, session, redirect, url_for, render_template, flash
import forms as fs
from werkzeug import secure_filename
import tempfile
import copath_nls
import meditech_nls
if __name__ == "__main__":
ALLOWED_EXTENSIONS = set(['txt'])
fapp = Flask(__name__)
... |
import pkgutil
import sys
from importlib import import_module
from pathlib import Path
from types import ModuleType
from typing import List, Set
def get_path(module: ModuleType) -> str:
if getattr(sys, 'frozen', False):
# frozen
if getattr(sys, '_MEIPASS', False):
# PyInstaller
... |
#!/usr/bin/python
# Copyright (c) 2012 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""NEXE building script
This module will take a set of source files, include paths, library paths, and
additional arguments, and ... |
#
# Collective Knowledge (program)
#
# See CK LICENSE.txt for licensing details
# See CK COPYRIGHT.txt for copyright details
#
# Developer: Grigori Fursin, Grigori.Fursin@cTuning.org, http://fursin.net
#
cfg={} # Will be updated by CK (meta description of this module)
work={} # Will be updated by CK (temporal data)
c... |
from functools import reduce
from operator import and_
from warnings import warn
from jax import lax
from jax.util import safe_map, safe_zip
import jax.numpy as np
from jax.scipy import special
from jax.util import curry
from jax.interpreters import xla
from jax.ops import index_update
from jax.core import Tracer
imp... |
#!/usr/bin/env /usr/bin/python
# -*- coding: UTF-8 -*-
import csv, sys, time, os, datetime
import ConfigParser
reload(sys)
sys.setdefaultencoding('utf-8')
def getStyle(schemacolor1):
return '''
<style type="text/css">
body { margin:10px 10px 0px 10px; font-family: Arial, Helvetica, sans-serif; }
table { }
td { p... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Hive Appier Framework
# Copyright (C) 2008-2012 Hive Solutions Lda.
#
# This file is part of Hive Appier Framework.
#
# Hive Appier Framework is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published ... |
"""
Legacy mid-level functions.
"""
from __future__ import absolute_import, division, print_function
import os
from ._util import Type
from ._password_hasher import (
DEFAULT_HASH_LENGTH,
DEFAULT_MEMORY_COST,
DEFAULT_PARALLELISM,
DEFAULT_RANDOM_SALT_LENGTH,
DEFAULT_TIME_COST,
)
from .low_level i... |
#!/usr/bin/env python3
#
# common.py - part of the FDroid server tools
# Copyright (C) 2010-13, Ciaran Gultnieks, ciaran@ciarang.com
# Copyright (C) 2013-2014 Daniel Martí <mvdan@mvdan.cc>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public Lice... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import functools
import six
import selenium.common.exceptions as selenium_exc
from selenium.webdriver import *
from selenium.webdriver.common.alert import Alert
from selenium.webdriver.common.by import By
from selenium.webdriver.remote.webelement import ... |
from time import sleep
class FaqGenerator:
def __init__(self, r, subreddit):
sleep(3)
self.r = r
self.subreddit = subreddit
self.wiki_page = self.r.get_wiki_page(self.subreddit, "faq")
def wiki_append(self, string, newline=True):
new_wiki = self.wiki_page.content_md... |
# This file is part of fedimg.
# Copyright (C) 2014 Red Hat, Inc.
#
# fedimg 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.
#
#... |
import prjxray.db
from prjxray.roi import Roi
from prjxray import grid_types
import simplejson as json
from lib import progressbar_utils
import datetime
import functools
from collections import namedtuple
from lib.rr_graph import tracks
from lib.rr_graph import graph2
from prjxray.site_type import SitePinDirection
from... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Darryl Stoflet <stoflet@gmail.com>
#
# This file is part of Ansible
#
# Ansible 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 Li... |
# Copyright 2021 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... |
'''
..
Red9 Studio Pack: Maya Pipeline Solutions
Author: Mark Jackson
email: rednineinfo@gmail.com
Red9 blog : http://red9-consultancy.blogspot.co.uk/
MarkJ blog: http://markj3d.blogspot.co.uk
This is the General library of utils used throughout the modules
These are abstract gene... |
# note: this module named xossite.py instead of site.py due to conflict with
# /usr/lib/python2.7/site.py
import os
import pdb
import sys
import tempfile
sys.path.append("/opt/tosca")
from translator.toscalib.tosca_template import ToscaTemplate
from core.models import User,Controller,Deployment
from xosresource i... |
# websocket_server -- WebSocket/HTTP server/client library
# https://github.com/CylonicRaider/websocket-server
"""
Cookie management utilities.
(Mostly) compliant to RFC 6265. The alternatives present in the standard
library are too tightly coupled to be used outside it.
"""
import os, re, time
from . import tools
... |
import argparse
import configparser
import re
import PyPDF2
import ftfy
# also needs win-unicode-console imported to display unicode characters?
# dumb extra characters present that will need to be fixed in output: ╦ø£Ø
# will need to add legendary/pseudolegendary/fossil tags later
parser = argparse.ArgumentParser(de... |
# future
from __future__ import annotations
# stdlib
import asyncio
import os
import time
from typing import Any
from typing import Dict
from typing import List
from typing import Optional
from typing import Tuple
from typing import Union
# third party
import ascii_magic
from nacl.signing import SigningKey
from nacl.... |
#!/usr/bin/python3
import praw
import OAuth2Util
import time
import requests
import json
import os
import humanize
import struct
import re
from bs4 import BeautifulSoup
# sweet mother of imports
def get_cia_info(url):
"""
Takes a CIA url, and collects the titleID as well as the SMDH title/creator text in eng... |
import requests
from pyOutlook.core.message import Message
from pyOutlook.internal.utils import check_response
__all__ = ['Folder']
class Folder(object):
"""An object representing a Folder in the OutlookAccount provided.
Attributes:
account: The :class:`OutlookAccount <pyOutlook.core.main.OutlookAc... |
# -*- coding: utf-8 -*-
# Copyright (c) 2015 The Pycroft Authors. See the AUTHORS file.
# This file is part of the Pycroft project and licensed under the terms of
# the Apache License, Version 2.0. See the LICENSE file for details.
"""
pycroft.model.session
~~~~~~~~~~~~~~
This module contains the session s... |
""" Current version of the package
"""
__version__ = '0.6.4'
__author__ = 'Vladimir Filimonov'
__email__ = 'vladimir.a.filimonov@gmail.com'
|
print('Hello World')
salse = 'tomato'
#string multiline
order_description = """
The client asked for pizza with less cheese.
Instead of cheese he would like to have more ham.
"""
order_number = 42
order_number = 'other thing'
if salse.startswith('toma'):
print("it's probably tomato...")
else:
print("not t... |
#!/usr/bin/python2.5
# Copyright 2010 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 ... |
"""Support for the PostgreSQL database via the psycopg2 driver.
Driver
------
The psycopg2 driver is supported, available at http://pypi.python.org/pypi/psycopg2/ .
The dialect has several behaviors which are specifically tailored towards compatibility
with this module.
Note that psycopg1 is **not** supported.
Un... |
import copy
import json
import logging
import os
import sys
from uuid import uuid4
import boto3
import sqlalchemy
import yaml
from botocore.config import Config
from flask import Flask, url_for
from flask_babel import Babel
from flask_caching import Cache
from flask_talisman import Talisman
from flask_themes2 import T... |
# -*- coding: utf-8 -*-
"""
pygments.lexers.agile
~~~~~~~~~~~~~~~~~~~~~
Lexers for agile languages.
:copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import Lexer, RegexLexer, ExtendedRegexLexer, \
Le... |
from celery.task.schedules import crontab
from celery.decorators import periodic_task
from celery.utils.log import get_task_logger
from app.business.statistics_business import StatisticsBusiness
from app.collectors.matches_collector import MatchesCollector
from app.collectors.patches_crawler import PatchesCrawler
from... |
Version = "1.8.5.6"
|
# (C) Copyright 2014-2016 Hewlett Packard Enterprise Development LP
#
# 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 ap... |
"""
Helper functions for determining which tests to skip.
"""
__authors__ = "Ian Goodfellow"
__copyright__ = "Copyright 2010-2012, Universite de Montreal"
__credits__ = ["Ian Goodfellow"]
__license__ = "3-clause BSD"
__maintainer__ = "Ian Goodfellow"
__email__ = "goodfeli@iro"
from nose.plugins.skip import SkipTest
im... |
# -*- coding: utf-8 -*-
"""
This is the Windows backend for keyboard events, and is implemented by
invoking the Win32 API through the ctypes module. This is error prone
and can introduce very unpythonic failure modes, such as segfaults and
low level memory leaks. But it is also dependency-free, very performant
well doc... |
# coding=utf-8
# Copyright 2021 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 ... |
import ast
from knights.library import Library
register = Library()
@register.tag
def static(parser, token):
src = parser.parse_expression(token)
return ast.Yield(value=ast.BinOp(
left=ast.Str(s='/static/%s'),
op=ast.Mod(),
right=src,
))
@register.helper
def safe(value):
re... |
#!/usr/bin/python2.7
# Copyright (c) 2012-2016 Jonathan Warren
# Copyright (c) 2012-2016 The Bitmessage developers
# Distributed under the MIT/X11 software license. See the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Right now, PyBitmessage only support connecting to stream 1. ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is subject to the terms and conditions defined in
# file 'LICENSE.md', which is part of this source code package.
#
from kubernetes.K8sContainer import K8sContainer
from kubernetes.K8sObject import K8sObject
from kubernetes.K8sVolume import K8sVolume
from ku... |
#!/usr/bin/env python
from jinja2 import Environment, FileSystemLoader
from distutils.spawn import find_executable
import errno
import fileinput
import socket
import urllib2
import json
import os
import sys
import yaml
binary_types = ['bz2', 'deb', 'jpg', 'gz', 'jpeg', 'iso', 'png', 'rpm', 'tgz', 'zip']
def symlink... |
from django.conf.urls import url
from kwue.controllers import food
from kwue.controllers import home
from kwue.controllers import tag
from kwue.controllers import search
from kwue.controllers import user
from kwue.controllers import consumption_history
urlpatterns = (
### REQUEST
# POST
# 'tagged_user_id'... |
# Copyright (C) 2019 - Raphaël Valyi Akretion
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from odoo import SUPERUSER_ID, api
from odoo.tools.sql import column_exists, create_column
def pre_init_hook(cr):
"""
account.invoice and account.invoice.line inherits from
l10n_br_account.fisca... |
from PIL import Image, ImageTk
from numbers import Number
try:
import Tkinter as tk
import tkMessageBox as tkmb
except ImportError:
import tkinter as tk
import tkinter.messagebox as tkmb
import multiprocessing
import subprocess
import pyperclip
import tempfile
import platform
import numpy
import time
im... |
import uuid
from .mutables import *
dependencyGraph = {} #Define a central dependency graph that holds all relations between mutables
idVariableDict = {} #Define a dictionary that maps uuids to the relevant object eg: idVariableDict[self.id] = self
immutableList = [] #Define a list that holds all the ... |
#!/usr/bin/python
from mininet.net import Mininet
from mininet.node import RemoteController, OVSKernelSwitch
from mininet.link import TCLink
from mininet.cli import CLI
# from mininet.term import makeTerm
from mininet.log import setLogLevel
"""
Handorver example (based on proposed scenario)
"""
# Configurations
OF_... |
#!/usr/local/bin/python
import os
import sys
import glob
import time
import datetime
import csv
import exifread
import Image
from operator import itemgetter
thumbnail_size = 200
try:
# using join to get target-directory with a trailing slash.
directory = os.path.join(sys.argv[1],"")
if not os.path.isdir(... |
#----------------------------------------------------------------------
# Copyright (c) 2010 Raytheon BBN Technologies
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and/or hardware specification (the "Work") to
# deal in the Work without restriction, including witho... |
#!/usr/bin/env python
import curses, Queue, textwrap
import tx
import block
import monitor
def user_input(state, window, rpc_queue):
c = window.getch()
if c == ord('q') or c == ord('Q'):
return 1
if c == ord('d') or c == ord('D'):
state['mode'] = "monitor"
monitor.draw_window(st... |
#!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible 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.
#
# Ansible is distribut... |
from datetime import datetime
from flask import Flask, jsonify, request, url_for
import logging
import os
from util import initialize_logging
from promotion import Promotion
flask_app = Flask(__name__)
# Get bindings from the env
DEBUG = (os.getenv('DEBUG', 'False') == 'True')
PORT = os.getenv('PORT', '5001') # NOTI... |
#!/usr/bin/python2.5
# Copyright 2010 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 ... |
from __future__ import print_function, division
import os
import numpy as np
import numpy.random as rand
import logging
import pkg_resources
import orbitutils as ou
from scipy.optimize import leastsq
from scipy.ndimage import convolve1d
from scipy.interpolate import LinearNDInterpolator as interpnd
from starutil... |
"""
Pre-process DICOM files in a study folder
"""
import logging
import os
from datetime import datetime, timedelta
from functools import partial
from airflow import DAG
from airflow.operators.bash_operator import BashOperator
from airflow_spm.operators import SpmPipelineOperator
from airflow_freespace.operators im... |
from ctypes import sizeof
import array
import calendar
import collections
import itertools
import operator
import string
from msfat import TYPE_FAT12, TYPE_FAT16, TYPE_FAT32, \
ATTR_VOLUME_ID, ATTR_VALID_MASK, ATTR_RESERVED_MASK, \
MediaError, _inline_hexdump
from msfat.dir import FATDirEntry, assemble_long_entrie... |
# License under the MIT License - see LICENSE
from boto.manage.cmdshell import sshclient_from_instance
import warnings
from launch_instance import launch
def create_root_drive(name, path_to_key, region='us-west-2',
key_name='admin_root_maker',
orig_image_id="ami-5189a661... |
import datetime
from viaduct import db
page_ancestor = db.Table('page_ancestor',
db.Column('page_id', db.Integer, db.ForeignKey('page.id')),
db.Column('ancestor_id', db.Integer, db.ForeignKey('page.id'))
)
class Page(db.Model):
__tablename__ = 'page'
id = db.Column(db.Integer, primary_key=True)
parent_id = db.... |
import unittest
from unittest import TestCase
from slap.api import Api
from mock import PropertyMock, patch
class TestApi(TestCase):
api = None
def create_api(self):
api = Api(
ags_url='http://myserver/arcgis/admin',
token_url=None,
portal_url=None,
use... |
#! /usr/bin/python
from __future__ import print_function
from math import sqrt
# Project Euler # 21
def proper_divisors(n):
results = [1]
for i in xrange(2, int(sqrt(n))+1):
if n % i == 0:
results.append(i)
if i != n/i:
results.append(n/i)
return results
de... |
# Copyright 2016 Mycroft AI, Inc.
#
# This file is part of Mycroft Core.
#
# Mycroft Core 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 versio... |
# -*- coding: utf-8 -*-
import requests
from cryptotik.common import APIError, OutdatedBaseCurrenciesError, headers, ExchangeWrapper, NormalizedExchangeWrapper
from common import is_sale
from cryptotik.exceptions import InvalidBaseCurrencyError, InvalidDelimiterError
import time
import hmac
import hashlib
from datetim... |
from zope.interface import implements
from collections import namedtuple
from csp.impl import dispatch
from csp.impl.interfaces import IChannel
from csp.impl.buffers import RingBuffer, FixedBuffer
MAX_DIRTY = 64
MAX_QUEUE_SIZE = 1024
PutBox = namedtuple("PutBox", ["handler", "value"])
Box = namedtuple("Box", ["val... |
from itertools import groupby
import json
from operator import attrgetter, itemgetter
from datetime import timedelta
from django.http import HttpResponse
from django.shortcuts import redirect
from django.views.decorators.csrf import csrf_exempt
from django.views.generic import DetailView, View, FormView
from django.ut... |
# ===============================================================================
# Copyright 2017 dgketchum
#
# 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... |
from __future__ import absolute_import
from copy import copy
import logging
import os
from platform import node
from shutil import rmtree
from subprocess import PIPE, CalledProcessError, Popen
import sys
from tempfile import gettempdir
import traceback
from uuid import uuid4
from django.core.exceptions import Validat... |
#!/usr/bin/env python
__author__ = "John Kirkham"
__date__ = "$Apr 9, 2014 4:00:40PM$"
import os
import sys
import json
import itertools
import multiprocessing
import subprocess
import time
# Generally useful and fast to import so done immediately.
import numpy
import h5py
import lazyflow.utility.pathHelpers
# N... |
from unittest import TestCase
from is_valid import is_with, is_dict_where, is_list_of, is_str, is_number,\
is_transformed, Get, is_eq
class TestTablePred(TestCase):
def setUp(self):
self.pred = is_with(
{'len': lambda data: len(data['columns'])},
is_dict_where(
... |
# $Id$
## System modules
import sys, threading
## GNOME/Gtk modules
from gtk import *
from gnome.ui import *
## PycURL module
import pycurl
def progress(download_t, download_d, upload_t, upload_d):
global round, appbar
if download_t == 0:
appbar.get_progress().set_activity_mode(1)
round = r... |
from functools import partial as _partial
from .formatstring import fmtstr
dark = _partial(fmtstr, style='dark')
red = _partial(fmtstr, style='red')
green = _partial(fmtstr, style='green')
yellow = _partial(fmtstr, style='yellow')
blue = _partial(fmtstr, style='blue')
magenta = _partial(fmtstr, style='magenta')
cyan =... |
"""
Orchestrates the launch process by wrapping a launch plugin
"""
__license__ = """
This file is part of RAPD
Copyright (C) 2009-2017, Cornell University
All rights reserved.
RAPD 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... |
import numpy as np
import pytest
from unittest.mock import patch
from cached_property import cached_property
from conftest import skipif
from devito import (Grid, Constant, Function, TimeFunction, SparseFunction,
SparseTimeFunction, Dimension, ConditionalDimension, SubDimension,
... |
#!/usr/bin/env python
# vim: set fileencoding=utf8
# pylint: disable=attribute-defined-outside-init
from __future__ import unicode_literals
import srt
from datetime import timedelta
from nose.tools import eq_ as eq, assert_not_equal as neq, assert_raises, \
assert_false
from hypothesis import gi... |
import asyncio
import logging
import socket
import uvloop
import ssl
import warnings
from asyncio import test_utils
from uvloop import _testbase as tb
class MyDatagramProto(asyncio.DatagramProtocol):
done = None
def __init__(self, loop=None):
self.state = 'INITIAL'
self.nbytes = 0
if... |
# -*- coding: utf-8 -*-
# Copyright (C) 2015-2016 Peter Magnusson <peter@birchroad.net>
import unittest
import os, time
from nodemcu_uploader import Uploader
LOOPPORT = 'loop://'
#on which port should the tests be performed
SERIALPORT = os.environ.get('SERIALPORT', LOOPPORT)
def is_real():
if SERIALPORT.strip() ... |
"""Configuration parsing module for CLI --> JobFunnelConfig
"""
import argparse
import logging
import os
from typing import Dict, Any, List
import yaml
from jobfunnel.config import (
JobFunnelConfig, DelayConfig, SearchConfig, ProxyConfig,
SettingsValidator, SETTINGS_YAML_SCHEMA
)
from jobfunnel.backend.tools.... |
import itertools
import numpy
import unittest
import cupy
from cupy import testing
@testing.gpu
class TestArithmetic(unittest.TestCase):
_multiprocess_can_split_ = True
@testing.for_all_dtypes()
@testing.numpy_cupy_allclose(atol=1e-5)
def check_unary(self, name, xp, dtype):
a = testing.shap... |
# -*- coding: utf-8 -*-
# Copyright 2013-2017 Luc Saffre
# This file is part of Lino Voga.
#
# Lino Voga 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 op... |
import sys
import astroid.test_utils
import pylint.testutils
import pytest
from shopify_python import google_styleguide
class TestGoogleStyleGuideChecker(pylint.testutils.CheckerTestCase):
CHECKER_CLASS = google_styleguide.GoogleStyleGuideChecker
def test_importing_function_fails(self):
root = ast... |
from ..utils.gcp_environment import GcpEnvironment
from . import create_service_account, get_policy, set_policy, modify_policy_remove_member, modify_policy_add_binding
import logging
LOG = logging.getLogger(__name__)
GCP_IAM_ROLE_SECRETS = "roles/secretmanager.secretAccessor"
GCP_IAM_ROLE_DATASTORE = "roles/datastor... |
'''
_feature_
Command to create a new feature branch off of the develop branch
'''
import os
import sys
from argparse import ArgumentParser
from cirrus.configuration import load_configuration
from cirrus.git_tools import checkout_and_pull, branch, push
from cirrus.github_tools import create_pull_request
def build_p... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.