src stringlengths 721 1.04M |
|---|
"""Support for ThinkingCleaner."""
import logging
from datetime import timedelta
import blumate.util as util
from blumate.helpers.entity import Entity
_LOGGER = logging.getLogger(__name__)
REQUIREMENTS = ['https://github.com/TheRealLink/pythinkingcleaner'
'/archive/v0.0.2.zip'
'#pythi... |
#!/usr/bin/python2
"""
Statement:
The Fibonacci sequence is defined by the recurrence relation:
Fn = Fn-1 + Fn-2, where F1 = 1 and F2 = 1.
Hence the first 12 terms will be:
F1 = 1
F2 = 1
F3 = 2
F4 = 3
F5 = 5
F6 = 8
F7 = 13
F8 = 21
F9 = 34
F10 = 55
F11 = 89
F12 = 1... |
# Copyright (C) 2015 Randy Direen <nearside@direentech.com>
#
# This file is part of NearSide.
#
# NearSide 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 optio... |
# -*- coding: utf-8 -*-
# *****************************************************************************
# Marche - A server control daemon
# Copyright (c) 2015-2016 by the authors, see LICENSE
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public Licens... |
"""
sentry.utils.javascript
~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2013 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import time
from collections import defaultdict
from django.core.urlresolvers import reverse
from django.utils.html import escape
from sent... |
# -*- coding: utf-8 -*-
import web
import hashlib
from xml.etree import ElementTree
import logging
from datetime import datetime, timedelta
from db import LianjianLog
TOKEN = '855dde440a874ef798227147f6686f55'
welcom_txt = u'''改变世界,从改变自己开始,从现在开始每天"练剑"吧,总共5招。
(1): 每天睡个好觉
(2): 每天保持好心情
(3): 每天学习半小时
(4): 每天运动半小时
(5): 每... |
"""
# =============================================================================
Copyright Government of Canada 2015
Written by: Eric Enns, Public Health Agency of Canada,
National Microbiology Laboratory
Daniel Bouchard, Public Health Agency of Canada,
Nat... |
# encoding:utf-8
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2009 Benny Malengier
# Copyright (C) 2009 Douglas S. Blank
# Copyright (C) 2009 Nick Hall
# Copyright (C) 2011 Tim G L Lyons
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Gener... |
#from distutils.core import setup
#
from setuptools import setup
#
from distutils.command.install_data import install_data
from distutils.command.install import INSTALL_SCHEMES
import os
import sys
main_package = 'ehb_client'
class osx_install_data(install_data):
# On MacOS, the platform-specific lib dir is /Sys... |
# Copyright 2020 Makani Technologies LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
from sentry.utils.query import RangeQuerySetWrapperWithProgressBar
class Migration(DataMigration):
def forwards(self, orm):
db.commit_transact... |
# Copyright (c) 2015 Saul D Beniquez
# used to parse the output of perfect6502's measure test program and generate
# a table cycle timings per opcode
import re #regular expressions
import sys # stdio
timing_table = [int(-1)] * 256
addressmode_table = [int(-1)] * 256
lines = list()
def address_mode_value(x):
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on 31.07.2013
@author: LK@UofA
mtpy/uofa/bayesian1d.py
Module for handling the UofA Bayesian 1D inversion/modelling code.
"""
import os
import sys
import os.path as op
import mtpy.utils.filehandling as MTfh
import mtpy.core.edi as EDI
import mtpy.utils.exce... |
"""
Representations which use local bases function (e.g. kernels) distributed
in the statespace according to some scheme (e.g. grid, random, on previous
samples)
"""
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
from ... |
# -*- coding: utf-8 -*-
from copy import deepcopy
import logging
import time
from datetime import date
from collections import OrderedDict, defaultdict
from odoo import api, fields, models, _
from odoo.osv import expression
from odoo.exceptions import RedirectWarning, UserError, ValidationError
from odoo.tools.misc im... |
from django.shortcuts import render
from django.http import HttpResponse
from django.db import transaction, connection
from django.views.decorators.csrf import csrf_exempt
from django.contrib.auth import authenticate, login
from slm_db_interface.models import Book, Author, Publisher, Borrower, SLMUser
from bisect impor... |
import cv2
import numpy as np
import time
from matplotlib import pyplot as plt
x = 0
y = 0
def makematchpicture(Grayurl):
img = cv2.imread(Grayurl, 0)
img2 = img.copy()
template = cv2.imread('test.png', 0)
w, h = template.shape[::-1]
methods = ['cv2.TM_SQDIFF']
for me... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2019 Wolfgang Rohdewald <wolfgang@rohdewald.de>
# See LICENSE for details.
# The source in this file is inspired by and partially identical with paramiko.config
"""Configuration file for accounts in Backends."""
import os
import re
import copy
import te... |
#!/usr/bin/env python
# Author: Hung Nguyen Viet <hvn@familug.org>
# Code for Trello.com job at developer position
# Fri Jul 25 17:50:58 ICT 2014
import logging
logging.basicConfig(level=logging.INFO)
log = logging.getLogger(__name__)
LETTERS = 'acdegilmnoprstuw'
def trello(s):
h = 7
letters = LETTERS
l... |
#
#Copyright (c) 2017 Intel Corp.
#
"""
Interface for all diagnostic tests plugins.
"""
from control.console_log.mock_console_log.ipmi_mock import MockConsoleLog
from control.diagnostics.diagnostics import Diagnostics
from control.plugin import DeclarePlugin
@DeclarePlugin('mock', 100)
class MockDiagnostics(Diagnos... |
# -*- coding: utf-8 -*-
from __future__ import division
import numpy as np
from library import Hill_ratio_at_SP2
from gsw.utilities import match_args_return
__all__ = [
'SP_from_C',
'C_from_SP',
'SP_from_R',
'R_from_SP',
'SP_salinometer',
'SP_from_SK... |
from __future__ import absolute_import
import doctest
import unittest
from six.moves import range
import mingus.core.meter as meter
class test_meter(unittest.TestCase):
def setUp(self):
self.simple_meters = [
(2, 4),
(3, 4),
(4, 4),
(6, 4),
(8... |
# -*- coding: utf-8 -*-
import dateutil
import jsonpatch
import requests
'''
A parser object to work with our custom field configs and uncurated fields
'''
class CovertDateOperation(jsonpatch.PatchOperation):
"""Ensures that a data point is formatted correctly for a date field"""
def apply(self, obj):
... |
# This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... |
# -*- coding: utf-8 -*-
# Copyright 2017 GIG Technology NV
#
# 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... |
# -*- coding: utf-8 -*-
# Copyright (c) 2014 Ludo Visser
#
# mlbtv-control is distributed under the terms and conditions of the MIT
# license. The full license can be found in the LICENSE file.
import datetime
import flask
import os
import signal
import subprocess
import sys
import time
from MLBviewer import MLBCon... |
from flask import request
from cloudify.models_states import VisibilityState
from manager_rest import manager_exceptions
from manager_rest.security import SecuredResource
from manager_rest.constants import RESERVED_PREFIX
from manager_rest.utils import get_formatted_timestamp
from manager_rest.rest import rest_decora... |
# Copyright (c) 2013 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... |
from sys import exit
#from multiprocessing import Process
#from core.config import settings
from core.config.settings import logger
import zmq
class Daemon():
sock = None
bsock = None
response = {}
def __init__(self, name="undefined"):
"""docstring for __init__"""
context = zmq.Conte... |
# -*- coding: utf-8 -*-
import unittest
from pyparsing import ParseException
from tests.utils.grammar import get_record_grammar
"""
CWR Work conflict grammar tests.
"""
__author__ = 'Bernardo Martínez Garrido'
__license__ = 'MIT'
__status__ = 'Development'
class TestWorkValid(unittest.TestCase):
"""
Tests... |
"""
Metrics to evaluate recommendations:
* with hit rate, following e.g. Karypis lab SLIM and FISM papers
* with prec@k and MRR
"""
import numpy as np
from collections import defaultdict
# classes to access known items for each test user
class get_known_items_from_dict(object):
def __init__(self,data):
... |
# Copyright 2017,2018,2019,2020,2021 Sony 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 required by applicable law... |
# -*- coding: utf-8 -*-
"""
@file simulation.py
@author Michael Behrisch
@date 2011-03-15
@version $Id: simulation.py 13811 2013-05-01 20:31:43Z behrisch $
Python implementation of the TraCI interface.
SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
Copyright (C) 2008-2013 DLR (http://www.... |
from django.contrib.auth import get_user_model
from django.http import HttpResponseBadRequest
from django.core.urlresolvers import reverse
from django.test import Client, TestCase
from bootcamp.articles.models import Article
class TestViews(TestCase):
"""
Includes tests for all the functionality
associat... |
# Copyright 2014 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the ... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
"""RFC 2822 message manipulation.
Note: This is only a very rough sketch of a full RFC-822 parser; in particular
the tokenizing of addresses does not adhere to all the quoting rules.
Note: RFC 2822 is a long awaited update to RFC 822. This module should
conform to RFC 2822, and is thus mis-named (it's not wort... |
r"""
This module implements the softmax approximation for
a multivariate Gaussian truncated by affine constraints. The approximation
is an approximation of the normalizing constant in the
likelihood.
"""
from copy import copy
import numpy as np
from regreg.api import smooth_atom
class softmax_objective(smooth_at... |
import math
def snfs_vulnerable(n, distance=2**64):
"""
Check if number `n` is further away from any exact power than `distance`.
Test to verify if the number is vulnerable to Special Number Field Sieve
attack on discrete logarithm problem.
Return True if it is vulnerable, False if it is not vul... |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'UserProfile.entreprise'
db.add_column('accounts_userprofile', 'entreprise',
... |
#
# Copyright (c) 2014 The developers of Aqualid project - http://aqualid.googlecode.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 th... |
#!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# 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 a... |
"""
Sudoku class for the Insight Data Engineering coding challenge.
This class contains methods for generating and solving Sudoku puzzles as well
as methods for reading and writing puzzles and solutions to and from csv files.
Author: Jim Bridgewater
Written for Python 2.7.8
"""
# import required libraries
import csv
... |
from test.integration.base import DBTIntegrationTest, FakeArgs, use_profile
import random
import time
class TestBasePrestoRun(DBTIntegrationTest):
@property
def schema(self):
return "presto_test_41"
@property
def models(self):
return "models"
@property
def project_config(sel... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2014 Fredy Wijaya
#
# 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 t... |
# -*- encoding: utf-8 -*-
import tarfile
import tempfile
import os
from datetime import datetime
from getpass import getpass
import logging
import hashlib
import uuid
import socket
import re
import fnmatch
import mimetypes
import calendar
import functools
from contextlib import closing # for Python2.6 compatibility
fr... |
from matplotlib import pyplot as plt
from matplotlib.font_manager import FontProperties
from subprocess import call
import random
import sys
import math
from scipy.spatial import ConvexHull
from shapely import geometry
font = FontProperties()
font.set_family('Times New Roman')
font.set_size(12)
def generate_points_o... |
#!/usr/bin/env python3
# Copyright (c) 2014-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the -alertnotify, -blocknotify and -walletnotify options."""
import os
from test_framework.addres... |
#!/usr/bin/env python
from __future__ import print_function
import boto3
from botocore.exceptions import ClientError
from datetime import datetime
from datetime import timedelta
from datetime import tzinfo
DEFAULT_RETENTION_DAYS = None
"""If None, no default retention is applied"""
ZERO = timedelta(0)
class UTC(... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# IkaLog
# ======
# Copyright (C) 2015 Takeshi HASEGAWA
#
# 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/l... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2013 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.... |
"""Context processors tests"""
import json
import pytest
from django.contrib.auth.models import AnonymousUser
from django.test import RequestFactory
from main.context_processors import configuration_context, js_settings
from profiles.factories import UserFactory
# pylint: disable=redefined-outer-name
@pytest.fixture... |
import collections
import itertools
import json
import logging as logmodule
import os
import re
import sys
import tempfile
import uuid
import zipfile
from itertools import chain
from django.conf import settings
from django.core.files import File
from django.core.files.storage import default_storage as storage
from dja... |
# -*- coding: utf-8 -*-
# hypua2jamo: Convert Hanyang-PUA code to unicode Hangul Jamo
# Copyright (C) 2012 mete0r
#
# This file is part of hypua2jamo.
#
# hypua2jamo 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 Founda... |
#!/usr/bin/env python
"""
$push is similar to $addToSet. The difference is that rather than accumulating only unique values
it aggregates all values into an array.
Using an aggregation query, count the number of tweets for each user. In the same $group stage,
use $push to accumulate all the tweet texts for each user... |
# -*- coding: utf-8 -*-
# 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 Apach... |
# --------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the ""Software""),... |
# Copyright (c) 2017 Heiko Thiery
#
# 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 option) any later version.
#
# This library is distrib... |
from urllib.parse import urlparse
from allauth.account.utils import get_next_redirect_url
from allauth.socialaccount.providers.github.views import GitHubOAuth2Adapter
from allauth.socialaccount.providers.oauth2.views import (
OAuth2CallbackView,
OAuth2LoginView,
)
from kuma.core.decorators import redirect_in_... |
#!/usr/bin/env python
# coding=utf-8
import os
import sys
import subprocess
import urllib
import zipfile
import platform
import shlex
import time
import json
import datetime
# =======================================================================================================================
# Project pa... |
from rest_framework import serializers as ser
from api.base.serializers import (
JSONAPISerializer,
RelationshipField,
RestrictedDictSerializer,
LinksField,
is_anonymized,
DateByVersion,
)
from website.project.model import Node
from website.util import permissions as osf_permissions
from framew... |
from direct.gui.DirectGui import DirectButton, DirectLabel
from panda3d.core import TextNode, Vec4
Preloaded = {}
def loadModels():
if Preloaded:
return
gui = loader.loadModel('phase_3.5/models/gui/fishingBook.bam')
Preloaded['tab1'] = gui.find('**/tabs/polySurface1')
Preloaded['tab2'] = gui.f... |
# Copyright 2015 by Toben "Narcolapser" Archer. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its documentation for any purpose
# and without fee is hereby granted, provided that the above copyright notice appear in all copies and
# that both that copyright notice and this... |
#!/usr/bin/env python
#-*- coding: utf-8 -*-
"""
Modul dedicated for signal analysis.
Author: Dawid Laszuk
Contact: laszukdawid@gmail.com
"""
from scipy.signal import butter, buttord
from scipy.signal import filtfilt, lfilter
from scipy.signal import cheb2ord, cheby2
import numpy as np
import sys
class DataAnalysi... |
import argparse
import json
from commands.extract.extractor import PresetExtractor
def extract(args):
extractor = PresetExtractor(args.firmware, args.version, args.hexfile)
presets, image = extractor.extract()
with open(args.out, 'w') as outf:
outf.write(json.dumps(
presets,
... |
#!/usr/bin/env python
# Test finding storage pool source of 'netfs' type
from xml.dom import minidom
import libvirt
from libvirt import libvirtError
from src import sharedmod
from utils import utils
required_params = ('sourcehost',)
optional_params = {'xml' : 'xmls/netfs_pool_source.xml',
}
def c... |
from cartographer.resources import get_resource_registry
from cartographer.resources.resource_registry import ResourceRegistryKeys
class SchemaRelationship(object):
"""
`SchemaRelationship` describes how to translate related resources to and from JSON API and our Python models.
`SchemaRelationship` is ha... |
__source__ = 'https://leetcode.com/problems/minimum-genetic-mutation/'
# Time: O()
# Space: O()
#
# Description: Leetcode # 433. Minimum Genetic Mutation
#
# A gene string can be represented by an 8-character long string, with choices from "A", "C", "G", "T".
#
# Suppose we need to investigate about a mutation (mutati... |
# -*- coding: utf-8 -*-
"""Kontalk XMPP resolver component."""
"""
Kontalk XMPP server
Copyright (C) 2014 Kontalk Devteam <devteam@kontalk.org>
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, ... |
"""
This is a module to read in an HDF5 file with CCFs.
Use this to determine the best parameters, and plot the best CCF for each star/date
"""
from collections import defaultdict
import logging
import h5py
import numpy as np
import pandas as pd
from scipy.interpolate import InterpolatedUnivariateSpline as spline
cl... |
from pymongo import MongoClient
import multiprocessing
import datetime
import math
import time
db25 = MongoClient(host='10.8.8.111', port=27017, connect=False)['miner-prod25']
cache = MongoClient(host='10.8.8.111', port=27017, connect=False)['cache25']
cache2 = MongoClient(host='10.8.8.111', port=27017, connect=False... |
# -*- coding: utf-8 -*-
import base64
import json
import re
import time
import pycurl
from pyload.core.network.http.exceptions import BadHeader
from pyload.core.network.request_factory import get_request
from ..base.addon import BaseAddon, threaded
class DeathByCaptchaException(Exception):
DBC_ERRORS = {
... |
"""
Copyright [2009-2017] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... |
"""
Django settings for metapile project.
Generated by 'django-admin startproject' using Django 1.10.3.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
import o... |
## ENVISIoN
##
## Copyright (c) 2021 Gabriel Anderberg, Didrik Axén, Adam Engman,
## Kristoffer Gubberud Maras, Joakim Stenborg
## 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.... |
# -*- coding: utf-8 -*-
__author__ = 'isparks'
import uuid
from xml.etree import cElementTree as ET
from datetime import datetime
from string import ascii_letters
from rwslib.builder_constants import *
"""
builders.py provides convenience classes for building ODM documents for clinical data and metadata post messages... |
# THIS FILE IS PART OF THE CYLC SUITE ENGINE.
# Copyright (C) NIWA & British Crown (Met Office) & Contributors.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License,... |
# Copyright (C) 2014 Universidad Politecnica de Madrid
#
# 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 la... |
from myhdl import *
from mn.cores.usbext import fpgalink
from mn.cores.usbext import m_fpgalink_fx2
def fpgalink_nexys(
# ~~ FX2 interface signals ~~
IFCLK, # 48 MHz clock from FX2
RST, # active low async reset
SLWR, # active low write strobe
SLRD, # active low read stro... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Course',
fields=[
('id', models.AutoField(auto_... |
#!/usr/bin/env python
############################################################################
#
# MODULE: ssr_algore.py
# AUTHOR: Collin Bode, UC Berkeley
#
# PURPOSE:
# Al Gore Rhythm combines r.sun model with Light Penetration Index (LPI).
# Merges all the r.sun solar radiation runs into a single ... |
# EBNF specification for micro-ML. { x } means zero or more repetitions of x.
#
# The top-level is decl.
#
# decl: ID { ID } '=' expr
#
# expr: INT
# | bool
# | ID
# | ID '(' { expr ',' } ')'
# | ... |
import sys
import gzip
import time
import numpy
import json
import time
import logging
import operator
import config
import csv
import StringIO
import subprocess
import HTMLParser
#from py2neo import Graph, Path, Node, Relationship,authenticate
from scipy import stats
from django.shortcuts import render_to_response
f... |
import atexit
import functools
import gc
import socket
import database
import flask
import logging
import time
import json
import sys
from logging.handlers import SysLogHandler
from logging import StreamHandler
from datetime import datetime
from statsd import statsd
from flask import Flask
from ConfigParser import C... |
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... |
""" Accounting Cache
"""
__RCSID__ = "$Id$"
import os.path
import time
import threading
from DIRAC import S_OK, S_ERROR, gLogger, rootPath, gConfig
from DIRAC.Core.Utilities.DictCache import DictCache
class DataCache( object ):
def __init__( self ):
self.graphsLocation = os.path.join( gConfig.getValue( '/Lo... |
from __future__ import division, print_function,absolute_import
import pylab as plt
import amitgroup.plot as gr
import numpy as np
import amitgroup as ag
import os
import pnet
import matplotlib.pylab as plot
def extract(ims,allLayers):
print(allLayers)
curX = ims
for layer in allLayers:
curX = layer... |
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
"""This module performs parsing of SPICE-like netlists. It uses a
custom parser rather than lex/yacc to give better error messages.
Copyright 2015--2020 Michael Hayes, UCECE
"""
import re
# Could use a script to generate parser and parsing tables if speed
# was important.
def split(s, delimiters):
"""Split st... |
#-
# Copyright (c) 2012 Robert M. Norton
# All rights reserved.
#
# @BERI_LICENSE_HEADER_START@
#
# Licensed to BERI Open Systems C.I.C. (BERI) under one or more contributor
# license agreements. See the NOTICE file distributed with this work for
# additional information regarding copyright ownership. BERI licenses t... |
import argparse
import sys
import unittest
import shcomplete.__main__ as main
class MainTests(unittest.TestCase):
def test_handlers(self):
action2handler = {
"repos": "fetch_repos",
"filtering": "filter",
"tfdf": "filter_prediction_set",
"corpus": "write_co... |
# -*- coding: utf-8 -*-
"""
pygments.lexers._clbuiltins
~~~~~~~~~~~~~~~~~~~~~~~~~~~
ANSI Common Lisp builtins.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
BUILTIN_FUNCTIONS = set(( # 638 functions
'<', '<=', '=', '>', '>=', '-... |
# 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 3 of the
# License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be usefu... |
# Copyright (C) 2013 ABRT Team
# Copyright (C) 2013 Red Hat, Inc.
#
# This file is part of faf.
#
# faf 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) ... |
# -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in module root
# directory
##############################################################################
import string
from openerp import models, fields, ... |
# Copyright (c) 2016 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... |
from flask import request, render_template
import json
import traceback
import lib.es as es
import web.util.tools as tools
import web.modules.post.services.workflow as workflow
import web.modules.post.services.upload as upload
import web.util.jinja as jinja
import web.modules.admin.services.notification as notification... |
"""
WSGI config for ndim project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` set... |
import json
import logging
import os
from flask_appbuilder import ModelRestApi, SQLA
from flask_appbuilder.const import (
API_ADD_COLUMNS_RES_KEY,
API_ADD_COLUMNS_RIS_KEY,
API_ADD_TITLE_RIS_KEY,
API_DESCRIPTION_COLUMNS_RES_KEY,
API_DESCRIPTION_COLUMNS_RIS_KEY,
API_EDIT_COLUMNS_RES_KEY,
API_... |
#!/usr/bin/python2
import matplotlib, sys
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy
matplotlib.rc('font', **{'family': 'serif', 'serif': ['Computer Modern']})
matplotlib.rc('text', usetex=True)
import styles
if len(sys.argv) != 7:
print('useage: %s ww ff N min_T methods seed' % sys.argv[... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.