text stringlengths 12 6.59M |
|---|
# -*- coding: utf-8 -*-
import json
import os
import tempfile
from datetime import datetime
from datetime import timedelta
import hglib
import requests
from cli_common.log import get_logger
from cli_common.taskcluster import get_service
from cli_common.utils import ThreadPoolExecutorResult
from code_coverage_bot imp... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# visa.py - High-level object-oriented VISA implementation
#
# Copyright © 2005 Gregor Thalhammer <gth@users.sourceforge.net>,
# Torsten Bronger <bronger@physik.rwth-aachen.de>.
#
# This file is part of PyVISA.
#
# PyVISA is free software; you can redis... |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
"""Production settings and globals."""
from os import environ
from base import *
# Normally you should not import ANYTHING from Django directly
# into your settings, but ImproperlyConfigured is an exception.
from django.core.exceptions import ImproperlyConfigured
def get_env_setting(setting):
""" Get the envi... |
"""Production settings and globals."""
from os import environ
from base import *
# Normally you should not import ANYTHING from Django directly
# into your settings, but ImproperlyConfigured is an exception.
from django.core.exceptions import ImproperlyConfigured
def get_env_setting(setting):
""" Get the envi... |
#!/usr/bin/env python
# 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 logging
import os
import subprocess
import uuid
import stoneridge
class StoneRidgeMaster... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: Florian Lambert <flambert@redhat.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2... |
"""
Stackado
===============================================================================
Stack-a-do, a task management system that lets you get distracted or dig
deeper into the task at hand and come back to whatever you were doing.
From as many levels deep as you choose to go.
This module exp... |
import configparser
import logging
import math
import os
import time
import fairseq
import numpy as np
import torch
from fairseq.models.transformer import TransformerModel
from fairseq.sequence_generator import SequenceGenerator
from mmt import textencoder
from mmt.alignment import make_alignment
from mmt.tuning impo... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Interpreter version: python 2.7
#
# Imports =====================================================================
import time
import transaction
from persistent import Persistent
from BTrees.OOBTree import OOSet
from database_handler import DatabaseHandler
# Variab... |
"""Configuration for imitation.scripts.train_adversarial."""
import os
import sacred
from imitation.policies import base
from imitation.scripts.config.common import DEFAULT_INIT_RL_KWARGS
from imitation.util import util
train_ex = sacred.Experiment("train_adversarial", interactive=True)
@train_ex.config
def train... |
## @file
# This file is used to define checkpoints used by ECC tool
#
# Copyright (c) 2008 - 2015, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. T... |
import json, time, os, argparse, re, sys, logging, math, random
from datetime import datetime
from apscheduler.schedulers.background import BackgroundScheduler
import datetime as dt
import pymysql
import wolframalpha
from dispatch import Dispatch
from kvidata import KVIData
from tbmath import TBMath
from pytz import ... |
#!/usr/bin/env python
"""%prog [options] -x|-t|-c marfile [files]
Utility for managing mar files"""
# The canonical location for this file is
# https://hg.mozilla.org/build/tools/file/default/buildfarm/utils/mar.py
#
# Please update the copy in puppet to deploy new changes to
# stage.mozilla.org, see
# https://wiki... |
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2014 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 (at your option) a... |
# -*- coding: utf-8 -*-
"""
>>> pingpong = thriftpy.load("pingpong.thrift")
>>>
>>> class Dispatcher(object):
>>> def ping(self):
>>> return "pong"
>>> server = make_server(pingpong.PingPong, Dispatcher())
>>> server.listen(6000)
>>> client = ioloop.IOLoop.current().run_sync(
lambda: make_client(pingp... |
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2014 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 (at your option) a... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/globocom/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com timehome@corp.globo.com
'''This is the main module in thumbor'''
__version__ = "5.0.0"
|
import os
import json
import urllib2
from httplib import BadStatusLine
from datetime import datetime, timedelta
import time
from socket import error as SocketError
from bus import Bus
from trajectory import Trajectory, Base
from operator import attrgetter
from sqlalchemy import Column, ForeignKey, Integer, String, Tex... |
from cities_light.models import Country
from rest_framework.serializers import (HyperlinkedModelSerializer,
PrimaryKeyRelatedField)
from contact import models
from persons.models import PhysicalAddress
from persons.serializers import PhysicalAddressSerializer
class ContactSeri... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/thumbor/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com timehome@corp.globo.com
'''This is the main module in thumbor'''
__version__ = "6.0.0rc1"
__... |
import json
import requests
import os
import sys
from os.path import join, dirname
from dotenv import load_dotenv
load_dotenv(join(dirname(__file__), '.env'))
BUSTIME_API_KEY = os.environ.get('BUSTIME_API_KEY')
if not BUSTIME_API_KEY:
sys.exit('BUSTIME_API_KEY enviroment variable must be present')
"""
Query the M... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Hive Netius System
# Copyright (C) 2008-2012 Hive Solutions Lda.
#
# This file is part of Hive Netius System.
#
# Hive Netius System is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Hive Netius System
# Copyright (c) 2008-2016 Hive Solutions Lda.
#
# This file is part of Hive Netius System.
#
# Hive Netius System is free software: you can redistribute it and/or modify
# it under the terms of the Apache License as published by the Apache
# Foun... |
# -*- coding: utf-8 -*-
import click
# bitmerchant
from bitmerchant.wallet import Wallet
from bitmerchant.wallet.keys import PrivateKey
from blockcypher import (create_hd_wallet, get_wallet_details,
create_unsigned_tx, get_input_addresses, make_tx_signatures,
broadcast_signed_transaction, get_blockch... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Hive Netius System
# Copyright (c) 2008-2016 Hive Solutions Lda.
#
# This file is part of Hive Netius System.
#
# Hive Netius System is free software: you can redistribute it and/or modify
# it under the terms of the Apache License as published by the Apache
# Foun... |
# 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 it will be useful, but ... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
from twisted.words.protocols import irc
from twisted.internet import reactor, protocol, ssl, task
from twisted.python import logfile, log
from bytebot_config import BYTEBOT_NICK, BYTEBOT_PASSWORD, BYTEBOT_CHANNEL, \
BYTEBOT_SSL, BYTEBOT_PORT, BYTEBOT_SERVER, BYTEBOT_... |
import cv2
import numpy as np
from numpy.core.umath_tests import inner1d
from itertools import combinations
from argparse import ArgumentParser
# color tuples
BLACK = (0, 0, 0)
WHITE = (255, 255, 255)
RED = (0, 0, 255)
GREEN = (0, 255, 0)
def _main_static(imgfile, debug=False):
img = cv2.imread(imgfile)
if img i... |
#!/usr/bin/python
## Heavily inspired by /usr/share/bcc/tools/tcptop
import sys
import time
import datetime
from bcc import BPF
from socket import inet_ntop, AF_INET, AF_INET6
from struct import pack
prog="""
#include <linux/types.h>
#include <uapi/linux/ptrace.h>
#include <uapi/linux/bpf_perf_event.h>
#include <l... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import sys
import re
import inspect
import json
import resource
from socket import socket, AF_INET, SOCK_STREAM
from urllib import urlopen
from bytebot_config import *
from time import time
BYTEBOT_DEBUG_DEBUG = 0b00001
BYTEBOT_DEBUG_INFO = 0b... |
"""
The idea for this module is to keep it separate from bzt codebase as much as possible,
it may become separate library in the future. Things like imports and logging should be minimal.
"""
import base64
import json
import logging
from collections import OrderedDict
import requests
from bzt import TaurusNetworkErro... |
from . import database
from . import themes
DEFAULT_SETTINGS = {
"title": "Timpani",
"subtitle": "Your blog, run using Timpani.",
"display_name": "full_name",
"theme": "default",
"posts_per_page": "5"
}
#Contains lambda functions that return true when the condition is valid
#Name of the game is keep them simple
... |
#!/usr/bin/env python
import threading
import time
import webbrowser
import tempfile
import os.path
from Tkinter import *
NB_SOURCE = '/Users/tstromberg/namebench'
sys.path.append(NB_SOURCE)
from lib import benchmark
from lib import nameserver_list
class BenchmarkThread(threading.Thread):
"""Quickly test the healt... |
{
'name': "TMC Base",
'summary': 'Main TMC models and functionality',
'version': '13.0.1.0.0',
'website': 'https://www.tmcrosario.gob.ar',
'author': 'Tribunal Municipal de Cuentas - Municipalidad de Rosario',
'license': 'AGPL-3',
'sequence': 150,
'depends': [
'web_x2many_delete_... |
from .primitive_generators import *
from .derived_generators import *
from .generator_dispatch import *
from .custom_generator import *
from .logging import logger as tohu_logger |
#-*- encoding: utf-8 -*-
# python client for openstf STFService & Agent.
#
# Api:
# start(adbprefix=None, service_port=1100, agent_port=1090)
# stop(adbprefix=None, service_port=1100, agent_port=1090)
#
# wake() # return None
# type(text) # return None
# ascii_type(text) ... |
"""
.. See the NOTICE file distributed with this work for additional information
regarding copyright ownership.
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.... |
##############################################################################
#
# Copyright (C) 2014-2017 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emanuel Cino, Cyril Sester
#
# The licence is in the file __manifest__.py
#
########################... |
#__author__ = 'WeiFu'
from __future__ import division
import sys, pdb,os
import numpy as np
from scipy.integrate import simps
def area(result):
X = result[0]
Y = result[1]
# X = np.array([0,50,100])
# Y = np.array([0,50,0])
if len(X)== 0 or len(Y) == 0: return 0
if 100 not in X:
X = np.append(X,[100])... |
import discord
import requests
import asyncio
from modules.botModule import BotModule
class RedditPost(BotModule):
name = 'RedditPost' # name of your module
description = 'RedditPost automatically posts recent posts from r/scuba' # description of its function
help_text = 'This module has no callable f... |
import json
import sys
import os
import requests
from urlparse import urljoin, urlparse
class HttpRequests(object):
def __init__(self, server_http_url = '', *args, **kwargs):
self.server_http_url = server_http_url
self.session = requests.session()
self.session.headers = {"Accept": "applica... |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2019, the cclib development team
#
# This file is part of cclib (http://cclib.github.io) and is distributed under
# the terms of the BSD 3-Clause License.
"""Test single point logfiles in cclib."""
import os
import unittest
import numpy
import packaging
from ... |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017, the cclib development team
#
# This file is part of cclib (http://cclib.github.io) and is distributed under
# the terms of the BSD 3-Clause License.
"""Test single point time-dependent logfiles in cclib"""
import os
import unittest
import numpy
from skip import skipFo... |
# Copyright (c) 2016 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
from PyQt5.QtCore import pyqtSignal, pyqtProperty, pyqtSlot, QObject, QVariant #For communicating data and events to Qt.
import UM.Application #To get the global container stack to find the current machine.
import UM.Logge... |
# coding=utf-8
from proposition import *
from establish import establish
from org.opentreeoflife.taxa import Rank
this_source = 'https://github.com/OpenTreeOfLife/reference-taxonomy/blob/master/taxonomies.py'
# Don't change the otc() ids!
# ----- Difficult polysemies -----
def deal_with_polysemies(ott):
# Cte... |
#!/usr/bin/env python
# Copyright 2016 Stanford University, NVIDIA Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... |
"""
Commands bot subclass.
"""
import random
import re
import inspect
import importlib
import traceback
import typing
import curio
import sys
from curious.client import Client
from curious.commands.command import Command
from curious.commands.context import Context
from curious.commands.plugin import Plugin
from curi... |
__author__ = "Andre Merzky, Ole Weidner"
__copyright__ = "Copyright 2012-2013, The SAGA Project"
__license__ = "MIT"
""" Task interface
"""
import inspect
import Queue
import radical.utils.signatures as rus
import radical.utils as ru
import base as sbase
import exceptions ... |
import imp
from django.utils.importlib import import_module
from django.conf.urls.defaults import include as urlconf_include
from django.core.urlresolvers import RegexURLResolver, RegexURLPattern
from django.conf import settings
"""
Provides a framework for Molly application objects.
An Application object wraps a Dj... |
# coding: utf-8
from __future__ import unicode_literals, division
import glob
import logging
import shlex
import socket
import re
import time
from pkg_resources import parse_version
"""
This module implements basic kinds of jobs for QChem runs.
"""
import os
import shutil
import copy
import subprocess
from pymatgen... |
import imp
from django.utils.importlib import import_module
from django.conf.urls.defaults import include as urlconf_include
from django.core.urlresolvers import RegexURLResolver, RegexURLPattern
"""
Provides a framework for Molly application objects.
An Application object wraps a Django application, and allows Moll... |
import os
import shutil
import yaml
import glob
from momo.utils import run_cmd, mkdir_p, utf8_encode, txt_type, eval_path
from momo.plugins.base import Plugin
BASE_CONFIG_NAME = '__base__'
class Mkdocs(Plugin):
mkdocs_configs = {
'theme': 'readthedocs',
}
momo_configs = {
'momo_root_name... |
"""cdm - Cassandra Data Manager
Usage:
cdm search [<term>]
cdm show <dataset>
cdm install [--host=<host>] [--keyspace=<keyspace>] [--dry-run] <dataset>
cdm update
Examples:
cdm install medialens
"""
import sys
sys.path.append("")
import os
import os.path
from docopt import docopt
DEBUG = False
D... |
# coding:utf-8
import numpy as np
class ClassifierStat(object):
def __init__(self):
self.stats = {}
def add(self, x, label):
if label not in self.stats:
self.stats[label] = {
'sum': np.zeros(len(x)),
'sq_sum': 0,
'count': 0,
... |
"""Module to handle the operations within the aggregate pipeline."""
import bisect
import collections
import copy
import datetime
import decimal
import itertools
import math
import numbers
import random
import re
import warnings
from sentinels import NOTHING
import six
from six import moves, raise_from
from mongomoc... |
from pdb import Pdb, line_prefix
import sys
import StringIO
from vimpdb.proxy import ProxyToVim
def capture(method):
def decorated(self, line):
self.capture_stdout()
result = method(self, line)
self.stop_capture()
self.vim.showFeedback(self.pop_output())
return result
... |
from __future__ import unicode_literals
import hashlib
import logging
import pykka
import requests
import time
from urlparse import urljoin, urlsplit, parse_qs, urlunsplit
from urllib import urlencode
from mopidy import backend, models, httpclient
import mopidy_emby
logger = logging.getLogger(__name__)
class Em... |
"""
Customadmin is an application that allow admin interface's customization.
"""
VERSION = (0, 7)
__version__ = '.'.join(map(str, VERSION))
DATE = "2014-04-17" |
import warnings
from collections import Counter, defaultdict, deque, abc
from collections.abc import Sequence
from functools import partial, wraps
from heapq import merge, heapify, heapreplace, heappop
from itertools import (
chain,
compress,
count,
cycle,
dropwhile,
groupby,
islice,
rep... |
import warnings
from collections import Counter, defaultdict, deque, abc
from collections.abc import Sequence
from concurrent.futures import ThreadPoolExecutor
from functools import partial, wraps
from heapq import merge, heapify, heapreplace, heappop
from itertools import (
chain,
compress,
count,
cyc... |
# Copyright (c) 2013, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
import itertools
import cybox
__all__ = ['Namespace', 'NamespaceParser', 'META', 'UnknownObjectType']
class UnknownObjectType(Exception):
pass
class Namespace(object):
"""An XML namespace used to defin... |
#!/usr/bin/env python
"""Generates Cyclus Type System bindings.
Module history:
- 2016-10-12: scopatz: This file used to be called genapi.py in cymetric.
"""
from __future__ import print_function, unicode_literals
import io
import os
import sys
import imp
import json
import argparse
import platform
import warnings
i... |
import os
import json
import shutil
from contextlib import contextmanager
import click
import daemon
from erroremail import ErrorEmail
from dadd import client
from dadd.worker import app
from dadd.worker.child_process import create_env, ProcessEnv
from dadd.worker.processes.python import PythonWorkerProcess
from da... |
#
# CORE
# Copyright (c)2011-2012 the Boeing Company.
# See the LICENSE file included in this distribution.
#
# author: Jeff Ahrenholz <jeffrey.m.ahrenholz@boeing.com>
#
'''
mobility.py: mobility helpers for moving nodes and calculating wireless range.
'''
import sys, os, time, string, math, threading
import heapq
from... |
#!/usr/bin/env python
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import absolute_import, division, print_function
import bisect
import copy
import numbers
import oper... |
# Copyright 2011-2015 MongoDB, 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 writin... |
from django.conf import settings
from django.urls import reverse
def get_curation():
return {
'publisher': settings.SITE_PUBLISHER,
'date': settings.SITE_UPDATED,
'creator': {
'name': settings.SITE_CREATOR
},
'contact': settings.SITE_CONTACT
}
def get_reso... |
#!/usr/bin/env python
'''
Diego Martins de Siqueira
download all images from a Tumblr
'''
import urllib2
import re
import os
import sys
import argparse
API_URL = "http://#subdomain#.tumblr.com/api/read?type=photo&num=#chunck#&start=#start#"
def createfolder(name):
'''
if folder does not exist, create it.
'''... |
# coding: utf-8
# Copyright 2012 Christian Hergert
#
# 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 agre... |
import os
import pwd
os.getlogin = lambda: pwd.getpwuid(os.getuid())[0]
import requests
from django.db import models
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from unicoremc import constants, exceptions
from unicoremc.manager import ConfigManager, SettingsManager
from... |
#!/usr/bin/env python
# encoding: utf-8
"""
minutes.py
Created by Karl Dubost on 2014-09-25.
Copyright (c) 2014 La Grange. All rights reserved.
MIT License
We want:
1. Import
https://etherpad.mozilla.org/ep/pad/export/webcompat/latest?format=txt
2. Extract the effective minutes from the text
3. Extract the date
4. C... |
__author__ = 'mFoxRU'
from time import sleep
from win32gui import FindWindow, EnumChildWindows, GetClassName, \
GetWindowText, IsWindow
class Hook(object):
def __init__(
self,
window='MediaPlayerClassicW',
class_name='#32770',
fields=('Title', 'Author')
)... |
# -*- coding: utf-8 -*-
from setuptools import setup
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name="mpcontribs-io",
author="Patrick Huck",
author_email="phuck@lbl.gov",
description="MPContribs I/O Library",
long_description=long_description,
long_description_... |
r"""
>>> from mptt.tests.models import Genre
>>> def print_tree_details(nodes):
... print '\n'.join(['%s %s %s %s %s %s' % \
... (n.pk, n.parent_id or '-', n.tree_id, n.level, n.lft, n.rght) \
... for n in nodes])
# Creation #################################################... |
# coding: utf-8
"""Base components of XWorkflows."""
import functools
import inspect
import logging
import re
class WorkflowError(Exception):
"""Base class for errors from the xworkflows module."""
class InvalidTransitionError(WorkflowError):
"""Raised when trying to perform a transition not available from... |
# -*- coding: utf-8 -*-
"""SQLAlchemy models for OCSPdash."""
import operator
from datetime import datetime, timedelta, timezone
from enum import Enum
from oscrypto import asymmetric
from sqlalchemy import Binary, Boolean, Column, DateTime, ForeignKey, Integer, String, Text
from sqlalchemy.ext.declarative import dec... |
# -*- coding: utf-8 -*-
"""SQLAlchemy models for OCSPdash."""
import operator
import uuid
from base64 import urlsafe_b64decode as b64decode
from base64 import urlsafe_b64encode as b64encode
from datetime import datetime, timedelta, timezone
from enum import Enum
from oscrypto import asymmetric
from sqlalchemy import... |
# Copyright 2011 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,... |
import time
import string
import zlib
import struct
import __builtin__
# implements a python function that reads and writes a gzipped file
# the user of the file doesn't have to worry about the compression,
# but random access is not allowed
# based on Andrew Kuchling's minigzip.py distributed with the zlib module
F... |
"""Makefile for the go project.
${common_task_list}
See `mk -h' for options.
"""
import sys
import os
from os.path import join, dirname, normpath, abspath, exists, basename
import re
from glob import glob
import webbrowser
from mklib.common import MkError
from mklib import Task
from mklib import sh
class bugs(T... |
import numpy as np
from scipy import sparse as sp
from SimPEG.Utils import mkvc, sdiag, speye, kron3, spzeros, ddx, av, avExtrap
def checkBC(bc):
"""
Checks if boundary condition 'bc' is valid.
Each bc must be either 'dirichlet' or 'neumann'
"""
if(type(bc) is str):
bc = [bc, bc... |
from __future__ import annotations
import numpy as np
import scipy.sparse as sp
import warnings
import copy
from ..utils import (
speye,
sdiag,
mkvc,
timeIt,
Identity,
)
from ..maps import IdentityMap, Wires
from ..objective_function import ComboObjectiveFunction
from .base import (
BaseRegular... |
#!/usr/bin/env python
# PYTHON_ARGCOMPLETE_OK
# Common tools:
# pip/pip3 : install packages
# pylint/pychecker : verify syntax
# unittest package for xUnit.
''' Implements code to support my templating system for source files.
For autocomplete functionality, see the docs which contain setup info.
'''
import argpars... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# todo:
# - writing html
# - pruning of dstats to match running time
# - when comparing benchmarks; use 1 color for all plots from 1 benchmark
# - if no latency info is found; print warning
# - when not a lot of data points, them time issues in gnuplot (use WORKER_PERFORMA... |
import datetime
import json
from django.contrib.auth import get_user
from django.contrib.auth.models import User
from django.test import TestCase
from mock import patch
from oauth2client import client
from rest_framework.reverse import reverse
from distributionviewer.api.models import (CategoryCollection, CategoryPo... |
"""
Creates permissions for all installed apps that need permissions.
"""
from django.contrib.auth import models as auth_app
from django.db.models import get_models, signals
def _get_permission_codename(action, opts):
return u'%s_%s' % (action, opts.object_name.lower())
def _get_all_permissions(opts):
"Retu... |
"""
Django settings for crashreport project.
Generated by 'django-admin startproject' using Django 1.9.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import os
... |
from django.db.backends import BaseDatabaseIntrospection
import cx_Oracle
import re
foreign_key_re = re.compile(r"\sCONSTRAINT `[^`]*` FOREIGN KEY \(`([^`]*)`\) REFERENCES `([^`]*)` \(`([^`]*)`\)")
class DatabaseIntrospection(BaseDatabaseIntrospection):
# Maps type objects to Django Field types.
data_types_re... |
import csv
import datetime
import calendar
# from datetime import datetime
from datetime import date
import codecs
import time
import hashlib
from time import strftime, strptime
# Import smtplib for the actual sending function
import smtplib
# Here are the email package modules we'll need
# from email... |
# pylint: disable=missing-docstring
import os
import sys
import logging
import warnings
import percy
from selenium import webdriver
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdri... |
# coding=utf-8
"""
© 2015 LinkedIn Corp. 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 applicable law or agreed ... |
#!/usr/bin/env python
#
# autoprop_tests.py: testing automatic properties
#
# Subversion is a tool for revision control.
# See http://subversion.tigris.org for more information.
#
# ====================================================================
# Copyright (c) 2000-2003 CollabNet. All rights reserved.
#
# Th... |
'''Python implementation of NI-DM (for statistical results)
@author: Camille Maumet <c.m.j.maumet@warwick.ac.uk>
@copyright: University of Warwick 2013-2014
'''
from prov.model import ProvBundle, ProvRecord, ProvExceptionCannotUnifyAttribute, graph, ProvEntity
import prov.model.graph
import os
import numpy as np
impo... |
# Copyright 2022 Google
#
# 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, soft... |
#!/usr/bin/env python3
import json
import requests
import re
import itertools
from contextlib import contextmanager
import pprint
import time
import socket
import logging
logger = logging.getLogger(__name__)
def pairwise(iterable):
"s -> (s0,s1), (s2,s3), (s4, s5), ..."
a = iter(iterable)
return zip(a, a... |
#!/usr/bin/env python
#
# schedule_tests.py: testing working copy scheduling
# (adds, deletes, reversion)
#
# Subversion is a tool for revision control.
# See http://subversion.tigris.org for more information.
#
# ====================================================================
# Copyr... |
#
# Copyright (c) 2008-2009 rPath, Inc.
#
# This program is distributed under the terms of the Common Public License,
# version 1.0. A copy of this license should have been distributed with this
# source file in a file called LICENSE. If it is not present, the license
# is always available at http://www.rpath.com/perma... |
import MySQLdb
import re
import sys
import json
import os
from subprocess import call
# These three libraries define the Bookworm-specific methods.
from CreateDatabase import *
from ImportNewLibrary import *
from WordsTableCreate import WordsTableCreate
from tokenizeAndEncodeFiles import bookidlist
# Import our data ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.