CombinedText stringlengths 4 3.42M |
|---|
# Copyright 2018 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/python
import numpy as np
import math
import sys
import os
import random
from PIL import Image
def overlapDistances(refPatch, patches):
'''
This function computes the distance of refPatch to all patches in patches, returning a 1D array of all distances.
Returns 1-D array of distances over all patches.
... |
from mythril.rpc.client import EthJsonRpc
from mythril.ipc.client import EthIpc
from mythril.ether.ethcontract import ETHContract, InstanceList
import hashlib
import os
import persistent
import persistent.list
import transaction
from BTrees.OOBTree import BTree
import ZODB
from ZODB import FileStorage
def get_persist... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division
import os
import sys
from scipy.odr.odrpack import Model, RealData, ODR
from numpy import *
from pylab import *
# from scipy import optimize
def read_cd_data(cd_file):
data = []
for line in cd_file:
if "$" in line:
continue
... |
from urllib.error import URLError
import numpy
import smopy
import matplotlib.pyplot as plt
from matplotlib import colors as mcolors
import math
from gtfspy.gtfs import GTFS
from gtfspy.stats import get_spatial_bounds, get_percentile_stop_bounds, get_median_lat_lon_of_stops
from gtfspy.route_types import ROUTE_TYPE_TO... |
#!/usr/bin/python
"""
Copyright 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 appli... |
__version__ = "2.25.1"
class ConfigError(Exception):
"""Raised when the configuration of a tool contains some invalid values."""
rc = 100 # sys.exit(rc)
class CustomDatabaseNotFound(Exception):
"""Raised when the InputLocator can't find a user-provided database (region=='custom')"""
rc = 101 # sys... |
#!/usr/bin/python2.5
#
# Copyright 2009 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... |
#!/usr/bin/env python
# Based on previous work by
# Charles Menguy (see: http://stackoverflow.com/questions/10217067/implementing-a-full-python-unix-style-daemon-process)
# and Sander Marechal (see: http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/)
# Adapted by M.Hendrix [2015]
# daemon13.... |
##############################################################################
#
# Copyright (C) 2015 Comunitea Servicios Tecnológicos All Rights Reserved
# $Omar Castiñeira Saavedra <omar@comunitea.com>$
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GN... |
from sorl.thumbnail.engines.base import EngineBase
from sorl.thumbnail.compat import BufferIO
try:
from PIL import Image, ImageFile, ImageDraw, ImageChops, ImageFilter
except ImportError:
import Image, ImageFile, ImageDraw, ImageChops
def round_corner(radius, fill):
"""Draw a round corner"""
corner =... |
from os import mkdir
from os import listdir
from os import link
from os import unlink
from os import symlink
from os import readlink
from os import rmdir
from os import stat
from os import chmod
from os import rename
from os import lstat
from errno import ENOENT as FileDoesNotExist
from errno import EEXIST as FileExist... |
#!/bin/sh
# -*- python -*-
################################################################################
# This file is python bilingual: The next line starts a comment in Python,
# and is a no-op in shell
""":"
# Find a suitable python interpreter (adapt for your specific needs)
for cmd in python3 python python2;... |
#!/usr/bin/env python
from __future__ import print_function, division
from fractions import gcd
import operator, cmath
import math as rmath
import random, itertools, sys, string
from types import *
from base64 import *
from copy import copy
def template_specialize(fname, *args):
if fname not in globals():
... |
Fix for admin error when trying to delete object with a GenericRelation
|
# -*- coding: utf-8 -*-
"""Family module for Meta Wiki."""
#
# (C) Pywikibot team, 2005-2016
#
# Distributed under the terms of the MIT license.
#
from __future__ import absolute_import, unicode_literals
__version__ = '$Id$'
from pywikibot import family
# The meta wikimedia family
class Family(family.WikimediaOrgFa... |
import os
import guild.cli
import guild.op
import guild.project
DEFAULT_PROJECT_LOCATION = "."
def main(args):
model_name, op_name = _parse_opspec(args.opspec)
model = _resolve_model(model_name, args)
project_op = _resolve_op(op_name, model)
_apply_flags(args, project_op)
op = guild.op.from_proje... |
from importlib import import_module
from io import BytesIO
import json
from math import ceil, sqrt
import os
from random import random, randrange
import numpy as np
from PIL import Image
from shapeworld import util
class Dataset(object):
def __init__(self, values, world_size, pixel_noise_stddev=None, vectors=Non... |
# -*- coding: utf-8 -*-
import inspect
import os
from django.conf import settings
from django.core.management import color
from django.core.management import BaseCommand
from django.utils import termcolors
from django.utils.encoding import smart_text
from django_extensions.compat import load_tag_library
from django_e... |
#!/usr/bin/env python3
import argparse
from collections import OrderedDict
import json
import os
def list_files(input_dir):
"""
Go through each file in the input_dir
If it ends in a .conf suffix, add it to a set
For each element in set open it with json.load()
If it works, add it to a list
If... |
#!/usr/bin/env python
from ..common import *
from ..extractor import VideoExtractor
from xml.dom.minidom import parseString
class YouTube(VideoExtractor):
name = "YouTube"
# YouTube media encoding options, in descending quality order.
# http://en.wikipedia.org/wiki/YouTube#Quality_and_codecs. Retrieved ... |
from asyncio import gather, sleep
from contextlib import contextmanager
from datetime import datetime, timedelta
from itertools import chain
from logging import getLogger
from discord import (
CategoryChannel, Colour, Forbidden, HTTPException,
Member, PermissionOverwrite, Role, TextChannel
)
from discord.ext.c... |
# -*- coding: utf-8 -*-
"""
This module contains the code completion mode and the related classes.
"""
import os
try:
from future.builtins import chr
except:
pass # python 3.2 not supported
import logging
import re
import sys
import time
from pyqode.core.api.mode import Mode
from pyqode.core.backend import No... |
# Copyright 2017 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 logging
import json
from django.http import HttpResponse
from myuw_mobile.views.rest_dispatch import RESTDispatch
from myuw_mobile.dao.notice import get_notices_for_current_user
from myuw_mobile.logger.timer import Timer
from myuw_mobile.logger.logresp import log_success_response
class Notices(RESTDispatch):
... |
from warnings import warn
import numpy as np
from sklearn.metrics import auc
from sklearn.utils import check_random_state
__all__ = ['negative_mv_auc_score', 'mv_curve']
MAX_N_FEATURES = 8
def negative_mv_auc_score(
detector, X=None, y=None, interval=(0.9, 0.999),
n_uniform_samples=10000
):
"""C... |
import visa
from re import match
from numpy import array
class StanfordSR785:
def __init__(self, gpib):
''' Initialize device '''
error = False
self.__type = "dynamic signal analyzer"
try:
# Needs terminator char, manual p422
self. device = visa.instrument("... |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... |
import sys
if 'gevent' in sys.modules:
from gevent import monkey
monkey.patch_all()
from biicode.server.rest.rest_api_server import RestApiServer
from biicode.server.conf import BII_MONGO_URI, BII_MEMCACHE_SERVERS,\
BII_MEMCACHE_USERNAME, BII_MEMCACHE_PASSWORD, BII_MAX_MONGO_POOL_SIZE
from biicode.server.s... |
__version__ = "3.18.0"
class ConfigError(Exception):
"""Raised when the configuration of a tool contains some invalid values."""
rc = 100 # sys.exit(rc)
class CustomDatabaseNotFound(Exception):
"""Raised when the InputLocator can't find a user-provided database (region=='custom')"""
rc = 101 # sys... |
#!/usr/bin/env python
# Based on previous work by
# Charles Menguy (see: http://stackoverflow.com/questions/10217067/implementing-a-full-python-unix-style-daemon-process)
# and Sander Marechal (see: http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/)
# Adapted by M.Hendrix [2015]
# daemon18.... |
from .files import (reader, tokens, nopen, header, is_newer_b,
basestring, int_types)
import sys
from .pool import pool, pmap
try:
from optimize import shedskinner
except ImportError:
pass
from itertools import groupby as igroupby
from operator import itemgetter
__version__ = "0.3.9"
def groupby(iterabl... |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2014 Pexego Sistemas Informáticos All Rights Reserved
# $Jesús Ventosinos Mayor <jesus@pexego.es>$
#
# This program is free software: you can redistribute it and/or modify
# it under the ... |
added recursive algorithm for merge sort
def merge(left, right):
"""Merge sort merging function."""
left_index, right_index = 0, 0
result = []
while left_index < len(left) and right_index < len(right):
if left[left_index] < right[right_index]:
result.append(left[left_index])... |
from __future__ import print_function
import farmfs
from farmfs import getvol
from docopt import docopt
from functools import partial
from farmfs import cwd
from farmfs.util import empty_default, fmap, ffilter, pipeline, concat, identify, uncurry, count, groupby, consume, concatMap, zipFrom, safetype, ingest, first, ma... |
'''
Copyright 2020 The Rook 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 applicable law or agreed to... |
__author__ = "pyton_guy"
"""
Commands for the #/r/nyc Freenode IRC bot
This module is used by bot.py and is separate so that it can be hot-swapped.
So if a command breaks, or a new one needs to be added, we don't need to
disconnect the bot from IRC to fix it. This bot is built for five-nines!
"""
import sys
import r... |
# GUI Application automation and testing library
# Copyright (C) 2006 Mark Mc Mahon
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation; either version 2.1
# of the License, or (at your opti... |
Cambios
|
#!/usr/bin/env python2.7
# Copyright (c) 2012 Jonathan Warren
# Copyright (c) 2012 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. It does... |
#!/usr/bin/env python
from ..common import *
from ..extractor import VideoExtractor
from xml.dom.minidom import parseString
class YouTube(VideoExtractor):
name = "YouTube"
# YouTube media encoding options, in descending quality order.
# http://en.wikipedia.org/wiki/YouTube#Quality_and_codecs. Retrieved ... |
# Licensed to the StackStorm, Inc ('StackStorm') 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 use t... |
__author__ = 'Brandon C. Kelly'
import numpy as np
import matplotlib.pyplot as plt
from scipy.linalg import solve
from scipy.optimize import basinhopping
import samplers
import multiprocessing
import _carmcmc as carmcmcLib
class CarmaModel(object):
"""
Class for running the MCMC sampler assuming a CARMA(p,q)... |
# Copyright (c) 2012 Jonathan Warren
# Copyright (c) 2012 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. It doesn't yet contain logic to ... |
from __future__ import division
import requests
import json
import re
from bs4 import BeautifulSoup
tags_to_rating_sum = {}
tags_to_count = {}
baseString = "http://store.steampowered.com/app/"
review_to_score = {
"Overwhelmingly Positive": 8,
"Very Positive": 7,
"Positive": 6,
"Mostly Positive": 5,
... |
import unittest
import numpy as np
from chainer import testing
from chainer.testing import attr
from chainercv.datasets import cub_label_names
from chainercv.datasets import CUBLabelDataset
from chainercv.utils import assert_is_bbox
from chainercv.utils import assert_is_classification_dataset
@testing.parameterize... |
#!/usr/bin/env python
# Based on previous work by
# Charles Menguy (see: http://stackoverflow.com/questions/10217067/implementing-a-full-python-unix-style-daemon-process)
# and Sander Marechal (see: http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/)
# Adapted by M.Hendrix [2015]
# daemon19.... |
#!/usr/bin/env python3
# This file is part of the GOsa framework.
#
# http://gosa-project.org
#
# Copyright:
# (C) 2010-2012 GONICUS GmbH, Germany, http://www.gonicus.de
#
# License:
# GPL-2: http://www.gnu.org/licenses/gpl-2.0.html
#
# See the LICENSE file in the project's top-level directory for details.
import ar... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... |
import pandas as pd
import numpy as np
import inspect
from matplotlib import pyplot as plt
plt.style.use('bmh')
import RuleSet
import r_funcs as rf
def make_rsets(df, params_dict,
xtrap=False, return_sum = False, return_setting_sums=False,
trim=False, ann_sum=False):
'''Helper fun... |
# Copyright 2018 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... |
"""
Copyright (c) 2008 Marian Tietz
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following... |
# Copyright (c) 2010-2014, 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 License, or
# (at your option) any later version.
#
# OpenQuake is distri... |
#!/usr/bin/env python
# encoding: utf-8
""" executable to interact with notifo.com using the notifo.py library """
import notifo
from optparse import OptionParser
def init_parser():
""" function to init option parser """
usage = "usage: %prog -u user -s secret -n name [-l label]\
[-t title] [-c callback] TE... |
"""Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "5a10618f10f9b35269aea32772afb017af27f81a"
TFRT_SHA256 = "a06e0b59c4d5a7515bf1db2dfa5a... |
"""Base functionality of ffmpeg HA wrapper."""
import logging
import shlex
import subprocess
_LOGGER = logging.getLogger(__name__)
ITER_STDOUT = 'OUT'
ITER_STDERR = 'ERR'
class HAFFmpeg(object):
"""Base HA FFmpeg process.
Object is iterable but only for data streams! For other things use the
process pr... |
import ConfigParser
import sys
import time
import logging
import logging.handlers
import os
from campus_factory.ClusterStatus import ClusterStatus
from campus_factory.ClusterStatus import CondorConfig
from campus_factory.Parsers import RunExternal
from campus_factory.OfflineAds.OfflineAds import OfflineAds
class Fac... |
from tests.utils import pool, storage
from tests.utils.wallet import create_and_open_wallet
from indy import ledger, wallet, signus
from indy.pool import close_pool_ledger
from indy.error import ErrorCode, IndyError
import json
import pytest
import logging
logging.basicConfig(level=logging.DEBUG)
@pytest.fixture(au... |
#!/usr/bin/env python3
# coding=utf-8
import sys
import urllib.request
from utils import Fore, parse_image_arg, chunked_copy, clear_progress, handle_sigint, ensure_ca_load
# handle arguments
handle_sigint()
ensure_ca_load()
if len(sys.argv) < 2:
print('usage: ./get-source.py image[:tag]')
sys.exit(-1)
image, tag,... |
"""Output streaming, processing and formatting.
"""
import json
from functools import partial
from itertools import chain
import pygments
from pygments import token, lexer
from pygments.styles import get_style_by_name, STYLE_MAP
from pygments.lexers import get_lexer_for_mimetype, get_lexer_by_name
from pygments.forma... |
# MIT License
# Copyright (c) 2017 MassChallenge, Inc.
from __future__ import unicode_literals
import swapper
from django.db import models
from accelerator_abstract.models.accelerator_model import AcceleratorModel
ACTIVE_PROGRAM_STATUS = "active"
ENDED_PROGRAM_STATUS = "ended"
HIDDEN_PROGRAM_STATUS = "hidden"
UPCOM... |
import requests
import logging
import os
import time
import threading
import queue
import json
from urllib.parse import quote_plus
from cis_profile.common import WellKnown
from cis_profile import User
from cis_publisher import secret
from cis_publisher import common
logger = logging.getLogger(__name__)
class Publish... |
#!/usr/bin/env python3
# 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.
"""
ACUTE-Eval Analyzer.
FOR ANALYSIS!!
"""
import hashlib
import json
import os
from copy import deepcopy
from datetim... |
#!/usr/bin/env AFDKOPython
# encoding: UTF-8
from __future__ import division, absolute_import, print_function, unicode_literals
import os, collections, itertools, re
import WriteFeaturesKernFDK, WriteFeaturesMarkFDK
import hindkit as kit
class BaseFeature(kit.BaseFile):
def __init__(self, project, name, style, f... |
import logging
log = logging.getLogger(__name__)
import numpy as np
import matplotlib.pyplot as plt
from copy import deepcopy
from qcodes.instrument.parameter import (
ManualParameter, InstrumentRefParameter)
from qcodes.utils import validators as vals
from pycqed.analysis_v2.readout_analysis import Singleshot_Re... |
"""
Serve test runner pages and included JavaScript files on a local port.
"""
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
from SocketServer import ThreadingMixIn
import threading
import re
import pkg_resources
import os.path
import logging
import json
import time
import mimetypes
import shutil
impor... |
Need some works before publishing this
|
#! /usr/bin/env python
import praw
import re
import os
def reply(comment, text):
text += "\n\n Got any problems with this bot? Message /u/faerbit"
print("Replying:")
print(text)
comment.reply(text)
already_done.add(comment.id)
user_agent=("Non-mobile link 0.1 by /u/faerbit")
r = praw.Reddit(user_... |
"""
Python representations of the JSON Schema Test Suite tests.
"""
import json
import os
import re
import subprocess
import sys
from bp.filepath import FilePath
from pyrsistent import pmap
import attr
from jsonschema.compat import PY3
from jsonschema.validators import validators
import jsonschema
def _find_suite... |
import collections
import os
import h5py
import numpy as np
from shutil import copyfile
from annotypes import add_call_types, TYPE_CHECKING, Anno
from malcolm.core import APartName, Info, PartRegistrar
from malcolm.modules import builtin, scanning, pmac, pandablocks
if TYPE_CHECKING:
from typing import List, D... |
# The MIT License (MIT)
#
# Copyright (c) 2015 WUSTL ZPLAB
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modif... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
#!/usr/bin/env python
"""
Created as part of the StratusLab project (http://stratuslab.eu),
co-funded by the European Commission under the Grant Agreement
INSFO-RI-261552.
Copyright (c) 2011, Centre National de la Recherche Scientifique (CNRS)
Licensed under the Apache License, Version 2.0 (the "License");
you ... |
# Copyright 2021, The TensorFlow Federated Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
"""Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "c67d273ef0b41c041eb2f3e29be4f9b08326055e"
TFRT_SHA256 = "ec584108567e85cdfeb9208f0b4d... |
##########################################################################
#
# Copyright (c) 2013-2015, John Haddon. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions ... |
import utils
def on_mode(irc, conn, event):
if irc.is_channel(event.target):
channel = event.target
modes = utils.split_modes(event.arguments)
for mode in modes:
if mode.startswith("+b"):
mask = mode.split()[1]
irc.state["channels"][channel]["bans... |
# MIT License
# Copyright (c) 2017 MassChallenge, Inc.
from __future__ import unicode_literals
import logging
import swapper
from django.conf import settings
from django.core.validators import RegexValidator
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from embed_video.... |
"""
Range of numeric values
"""
import datetime
import pscheduler
from jsonval import json_validate
class NumericRange():
"Range of numbers"
def __init__(self, nrange):
"""Construct a range from a JSON NumericRange."""
# TODO: Would be nice if this class could treat missing
# lo... |
from datetime import datetime, date
import six
from uuid import UUID
import delorean
from radar.serializers.core import Field
from radar.validation.core import ValidationError
class StringField(Field):
default_error_messages = {
'invalid': 'A valid string is required.'
}
def __init__(self, **kw... |
import pandas as pd
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output, State
import plotly.graph_objs as go
from parsl.monitoring.web_app.app import app, get_db, close_db
from parsl.monitoring.web_app.utils import dropdown
def display_workflow(workflow_... |
"""Utility to write simple reports in HTML format."""
import re
import subprocess
import sys
from jinja2 import Environment, PackageLoader
from sympy.printing.latex import LatexPrinter
class Report:
"""Simple report for output drudge results.
This class helps to write symbolic results to files for batch pr... |
#!/usr/bin/env python
import csv
import sqlite3
class GffReader:
## Loads the gff file into a sqlite database
def load(self, filename):
database = sqlite3.connect(':memory:')
c = database.cursor()
# Create the sqlite database: id | seq_id | source | type | start | stop | score | strand | phase | name | pare... |
# -*- coding: utf-8 -*-
"""
Created on Sun Nov 5 14:48:19 2017
Author: Josef Perktold
License: BSD-3
"""
import numpy as np
from scipy import stats
from statsmodels.stats.moment_helpers import cov2corr
from statsmodels.stats.base import HolderTuple
# shortcut function
logdet = lambda x: np.linalg.slogdet(x)[1] #... |
# -*- encoding: utf-8 -*-
"""Highlighted unittest command line interface.
"""
import sys
import argparse
import os
import unittest
import operator
import time
from textwrap import dedent
import subprocess
from hunittest.line_printer import LinePrinter
from hunittest.unittestresultlib import HTestResult
from hunittest... |
# Giles: chat.py
# Copyright 2012 Phil Bordelon
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# This program... |
from unittest import TestCase
import json
import subprocess
import sys
from jsonschema import Draft4Validator, ValidationError, cli, __version__
from jsonschema.validators import _LATEST_VERSION as LatestValidator
from jsonschema.tests._helpers import captured_output
from jsonschema.compat import JSONDecodeError, Nati... |
import webnotes
def execute():
from patches.april_2013.p05_update_file_data import update_file_list, get_single_doctypes
singles = get_single_doctypes()
for doctype in webnotes.conn.sql_list("""select table_name from `information_schema`.`columns`
where table_schema=%s and column_name='file_list'""", webnotes.co... |
#!/usr/bin/python
'''The MIT License (MIT)
Copyright (c) 2017 Yu Xiong Wei(try.dash.now@gmail.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation... |
# The MIT License (MIT)
#
# Copyright (c) 2014-2016 WUSTL ZPLAB
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, ... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
# Copyright 2018 PerfKitBenchmarker Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
"""Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "c27b720c93f76662ab6d0e0e507d1fc66ab22119"
TFRT_SHA256 = "a60737a17bf074e4f3d6eeb97fa1... |
#* This file is part of the MOOSE framework
#* https://www.mooseframework.org
#*
#* All rights reserved, see COPYRIGHT for full restrictions
#* https://github.com/idaholab/moose/blob/master/COPYRIGHT
#*
#* Licensed under LGPL 2.1, please see LICENSE for details
#* https://www.gnu.org/licenses/lgpl-2.1.html
import plat... |
from __future__ import print_function
from facepy import GraphAPI
import facepy
import re
import json
from frontend import write_html
from dateutil.parser import parse
# You need to have the Access Token is stored in a plain text file ACCESS_TOKEN
# to get an access token follow this SO answer: http://stackoverflow.co... |
# -*- coding: utf-8 -*-
from odoo import models, fields, api
from odoo.tools.float_utils import float_round
from odoo.addons import decimal_precision as dp
import logging
_logger = logging.getLogger(__name__)
class ProductTemplate(models.Model):
_inherit = 'product.template'
list_price = fields.Float(
... |
# -*- coding: utf-8 -*-
# Copyright (C) 2008-2014, Luis Pedro Coelho <luis@luispedro.org>
# vim: set ts=4 sts=4 sw=4 expandtab smartindent:
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software... |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2016 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emanuel Cino <ecino@compassion.ch>
#
# The licence is in the file __manifest__.py... |
placements = r'''
>>> from django.contrib import admin
>>> from django.utils.datastructures import MultiValueDict
>>> from ella.core.models import Placement
>>> from ella.core.admin import PlacementInlineOptions
>>> from coretest.admin_tests.models import SampleAdminObject, EmptyAdminObject
>>> empty_data = MultiValue... |
import os.path
import time
from collections import namedtuple
from evdev import UInput, UInputError, ecodes
from .exceptions import DeviceError
BUTTON_MODIFIERS = ("+", "-")
DEFAULT_A2D_DEADZONE = 50
DEFAULT_AXIS_OPTIONS = (0, 255, 0, 5)
DEFAULT_MOUSE_SENSITIVTY = 0.6
DEFAULT_MOUSE_DEADZONE = 5
DEFAULT_SCROLL_REPE... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.