src stringlengths 721 1.04M |
|---|
# coding: utf8
from .config import *
from .parseUtil import *
from .util import *
from .wordSim import *
##############################################################################################################################
def alignNouns(source, target, sourceParseResult, targetParseResult, existingAlignmen... |
"""
.. module: FilePickerCtrl
:platform: Windows
.. moduleauthor:: Daniel R. Dietze <daniel.dietze@berkeley.edu>
A simple file and path picker widget consisting of a text field and a button.
..
This file is part of the pyFSRS app.
This program is free software: you can redistribute it and/or modif... |
# 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, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# bu... |
# -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListTy... |
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... |
import random, heapq
import pdb
# by Qiyuan Gong
# qiyuangong@gmail.com
# @INPROCEEDINGS{
# author = {Xiao, Xiaokui and Tao, Yufei},
# title = {Anatomy: simple and effective privacy preservation},
# booktitle = {Proceedings of the 32nd international conference on Very large data
# bases},
# year = {2006},... |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
#author:doganaydin
#project:themoviedb
#repository:http://github.com/doganaydin/themoviedb
#license: LGPLv3 http://www.gnu.org/licenses/lgpl.html
"""An interface to the themoviedb.org API"""
__author__ = "doganaydin"
__version__ = "1.0b"
try:
import simplejson
except:
... |
# Copyright (C) 2001-2002 Bram Cohen
#
# 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, modify, merge,
# publish, ... |
from NetworkGraph.GraphObject import GraphObject
N = GraphObject()
print N.handle
M = GraphObject()
print M.handle
print N == M
print N is M
print N.handle == M.handle
from NetworkGraph.Graph import Graph
g = Graph()
from NetworkGraph.GraphObject import GraphNode
node1 = GraphNode()
node2 = GraphNode(label="blue")
prin... |
#!/usr/bin/env python2
# Copyright (c) 2014 The Moneta Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Exercise the getchaintips API. We introduce a network split, work
# on chains of different lengths, and join... |
# -*- coding: utf-8 -*-
# Copyright (c) Pilot Systems and Libération, 2010-2011
# This file is part of SeSQL.
# SeSQL is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (a... |
import pymongo
import bson
from bson import json_util
import warnings
from cStringIO import StringIO
from pymongo import Connection, uri_parser, ReadPreference
import bson.son as son
import json
import logging
'''
File: scheme_mongo_clean.py
Description:
'''
def open(uri, task=None):
#parses a mongodb uri and ret... |
# -*- coding: utf-8 -*-
import spidev
import math
def reverse_bit_order(x):
x_reversed = 0x00
if (x & 0x80):
x_reversed |= 0x01
if (x & 0x40):
x_reversed |= 0x02
if (x & 0x20):
x_reversed |= 0x04
if (x & 0x10):
x_reversed |= 0x08
if (x & 0x08):
x_reversed |= 0x10
if (x & 0x04):
x_... |
# -*- coding: utf-8 -*-
# Copyright (c) 2001-2018, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobilit... |
from copy import deepcopy
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.patches as mpa
import matplotlib.text as mpt
from . import Drawable
from .. import vectors
from .. import colors
from ..constants import tau
__all__ = ['Vertex', 'Verticle']
class Vertex(Drawabl... |
# coding: utf-8
#This file is part of numword. The COPYRIGHT file at the top level of
#this repository contains the full copyright notices and license terms.
"""numword for Russian language"""
# materials used:
# * http://www.gramota.ru/class/coach/tbgramota/45_110
# * http://www.gramota.ru/spravka/letters/?rub=rubr... |
import cv2
import numpy
from alpha_fill import alpha_fill
class BoundingBox(object):
def __init__(self, pil_img, show_plot=False):
self.mask_img = alpha_fill(pil_img)
self.set_bounding_box()
self.set_side_lengths()
self.set_areas()
if show_plot:
self.show_plot... |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
# -*- coding: utf-8 -*-
"""
A driver for our version of AW's gFlex component.
Created on Fri Feb 20 11:17:52 2015
@author: danhobley
"""
from __future__ import print_function
from landlab.components.gFlex.flexure import gFlex
from landlab.components.flow_routing.route_flow_dn import FlowRouter
from landlab.component... |
from pkg_resources import resource_filename
DEBUG = False
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@domain.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'web369',
'USER': 'root',
'PASSWORD': '',
}
}... |
'''
Copyright (c) 2012 Alexander Abbott
This file is part of the Cheshire Cyber Defense Scoring Engine (henceforth
referred to as Cheshire).
Cheshire 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 Sof... |
###############################################################################
# Copyright (C) 2013 Peter Krusche, The University of Warwick
# pkrusche@gmail.com
###############################################################################
import os
from SCons.Script import *
###########################... |
import asyncio
import pytest
@pytest.mark.asyncio
async def test_kv_presets(kivy_app, KvEventWaiter):
from vidhubcontrol.backends import DummyBackend
kv_waiter = KvEventWaiter()
config = kivy_app.vidhub_config
vidhub = await DummyBackend.create_async(device_id='dummy1', device_name='Dummy 1')
kv... |
from django.forms import CharField, ModelChoiceField, DateTimeField, Form
from django.utils.translation import ugettext as _
from sendinel.backend.authhelper import format_and_validate_phonenumber
from sendinel.backend.models import Sendable, \
WayOfCommunication, \
... |
#! /usr/bin/env python
# -*- encoding: utf-8 -*-
# vim:fenc=utf-8:
"""The file core submodule provide a useful way to create, delete and manage
files in the remote and local host."""
import os
import base64
import hashlib
import tempfile
import __builtin__
from jinja2 import Environment, FileSystemLoader
import fab... |
from subprocess import call
__all__ = [
'PlymouthOutput','message','progress','set_mode','ping'
]
PLYMOUTH = '/usr/bin/plymouth'
def message(msg):
return call([PLYMOUTH, "display-message", "--text", msg]) == 0
def progress(percent):
return call([PLYMOUTH, "system-update", "--progress", str(percent)]) ==... |
from __future__ import (absolute_import, division, print_function)
import unittest
import mantid
from sans.gui_logic.models.table_model import (TableModel, TableIndexModel)
class TableModelTest(unittest.TestCase):
def test_user_file_can_be_set(self):
self._do_test_file_setting(self._user_file_wrapper, ... |
#!/usr/bin/env python
# -*- mode: python; coding: utf-8; -*-
# ---------------------------------------------------------------------------##
#
# Copyright (C) 1998-2003 Markus Franz Xaver Johannes Oberhumer
# Copyright (C) 2003 Mt. Hood Playing Card Co.
# Copyright (C) 2005-2009 Skomoroh
#
# This program is free softwa... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
import warnings
from django.template import Library
from django.template import defaulttags
from django.utils.deprecation import RemovedInDjango19Warning
register = Library()
@register.tag
def ssi(parser, token):
warnings.warn(
"Loading the `ssi` tag from the `future` library is deprecated and "
... |
# -*- coding: utf-8 -*-
from django import forms
from django.contrib.auth.models import User
from django.core.files.uploadedfile import UploadedFile
from django.utils.translation import ugettext_lazy as _, ugettext as __
#from myapp.models import Person, File, Contract
from ragendja.auth.models import UserTraits
from r... |
#!/usr/bin/python
import time
import re
import logging
import socket
import ssl
from logging.handlers import RotatingFileHandler
from multiprocessing.dummy import Pool, Process
from multiprocessing import cpu_count
SSLPORTS = [6697, 7000, 7070]
NONSSLPORTS = [6665, 6666, 6667, 8000, 8001, 8002]
class CommandHandle(ob... |
from grslra import testdata
from grslra.grslra_online import grslra_online
from grslra.structures import Hankel
from grslra.scaling import Scaling
import numpy as np
# The goal of this experiment is to predict the impulse response of an LTV in an online manner by fitting LTI systems to the observations
PROFILE = 0
i... |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.sale_timesheet.tests.test_reporting import TestReporting
from odoo.tools import float_compare
from odoo.tests import tagged
@tagged('-at_install', 'post_install')
class TestSaleProject(TestReporting):
... |
# -*- coding: utf-8 -*-
############################################################################
#
# Copyright (C) 2009-2014
# Christian Kohlöffel
# Jean-Paul Schouwstra
#
# This file is part of DXF2GCODE.
#
# DXF2GCODE is free software: you can redistribute it and/or modify
# it under the terms of t... |
# Import the perl module so we can call the SPADS Plugin API
import perl
# perl.MyConfigurablePlugin is the Perl representation of the MyConfigurablePlugin plugin module
# We will use this object to call the plugin API
spads=perl.MyConfigurablePlugin
# This is the first version of the plugin
pluginVersion='0.1'
# T... |
# websocket_server -- WebSocket/HTTP server/client library
# https://github.com/CylonicRaider/websocket-server
"""
Exceptions.
"""
__all__ = ['WebSocketError', 'ProtocolError', 'InvalidDataError',
'ConnectionClosedError']
class WebSocketError(Exception):
"""
Base class for all exceptions.
"""
... |
#! /usr/bin/env python
#
# Presents the results of an Autobahn TestSuite run in TAP format.
#
# Copyright 2015 Jacob Champion
#
# 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://ww... |
import time
#from django.shortcuts import render
from django.views.generic import TemplateView, FormView
from django.shortcuts import redirect, render
from django.db import transaction
from agda.views import package_template_dict
from jobs.models import (JOB_STATUS_LEVEL_ACCEPTED,
JOB_STATUS_... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import time
from datetime import datetime
from .common import *
from .base import BaseZhihu
class Topic(BaseZhihu):
"""答案类,请使用``ZhihuClient.topic``方法构造对象."""
@class_common_init(re_topic_url)
def __init__(self, url, name=None, session=None):
"""创建话... |
prices = []
while True:
# User input
user_input = input("Enter price or stop: ")
# Show warning if there isn't enough prices
if user_input == 'stop':
if len(prices) < 4:
print("You must enter 4 or more prices.")
continue
else:
break
try:
p... |
# from builtins import range
# from builtins import object
import numpy as np
from cs231n.layers import *
from cs231n.layer_utils import *
class TwoLayerNet(object):
"""
A two-layer fully-connected neural network with ReLU nonlinearity and
softmax loss that uses a modular layer design. We assume an input... |
"""
Utility functions for language idenfication tasks
"""
from collections import defaultdict, namedtuple
from freki.serialize import FrekiDoc
import unicodedata
import re
import os
import logging
import unidecode
def read_language_table(path):
"""
Read language table at *path* and return the {name:[code]} m... |
"""
To create a new static mockup, some edits must be made:
- in views.py, use the workaround described in index()
- in tempates/contentpage.html, uncomment the bit of js for converting JSON
(search for a capital JSON in a jinja comment)
After the mockup is created, replace all ajax requests to _get_func... |
#!/usr/bin/env python
from boto.route53.record import ResourceRecordSets
from boto.route53.status import Status
import boto.route53 as r53
from collections import namedtuple
import argparse
import time
import yaml
# a DNS record for hesiod
# fqdn should include the trailing .
# value should contain the value without... |
from typing import List, Callable, Any, Dict, Optional, Set
from concurrent.futures import ThreadPoolExecutor
from cephlib.istorage import IStorage
from cephlib.node import NodeInfo, IRPCNode
from cephlib.ssh import ConnCreds
from cephlib.storage_selectors import DevRolesConfig
from .openstack_api import OSCreds, OSC... |
import numpy as np
import matplotlib.pyplot as plt
import sys
import os
sys.stdout.flush()
np.set_printoptions(precision=11)
path = '/Scratch/dataProcessing/crabData/'
path2 = '/Scratch/dataProcessing/crabData2/'
labels='BTOA Noise_Offset Noise_RMS Max_P2 Mean_P2 Index_P2 TestMax_P2 TestMean_P2 TestIndex_P2'
labels = ... |
# -*- coding: UTF-8 -*-
"""
Name: ffprobe_parser.py
Porpose: cross-platform parsing class for ffprobe
Compatibility: Python3, Python2
Platform: all platforms
Author: Gianluca Pernigotto <jeanlucperni@gmail.com>
Copyright: (c) 2018/2021 Gianluca Pernigotto <jeanlucperni@gmail.com>
license: GPL3
Rev: May.11.2021
Code che... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2009 Timoth?Lecomte
# This file is part of Friture.
#
# Friture is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as published by
# the Free Software Foundation.
#
# Friture is distribu... |
#! /usr/bin/env python
from __future__ import division,print_function
from lingpy.data.derive import compile_model
from scipy.spatial.distance import squareform
from time import sleep
from pickle import dump
asjp = {}
score = open('score','r').read()
score = score.split('\n')
del score[-1]
dicto = {}
for line in sco... |
import ply.lex as lex
class Scanner(object):
def find_tok_column(self, token):
last_cr = self.lexer.lexdata.rfind('\n', 0, token.lexpos)
if last_cr < 0:
last_cr = 0
return token.lexpos - last_cr
def build(self):
self.lexer = lex.lex(object=self)
def input(self, text):
... |
"""caching_query.py
Represent persistence structures which allow the usage of
Beaker caching with SQLAlchemy.
The three new concepts introduced here are:
* CachingQuery - a Query subclass that caches and
retrieves results in/from Beaker.
* FromCache - a query option that establishes caching
parameters on a Q... |
import pytest
from delphin.mrs import simplemrs, eds
from delphin.mrs.components import Node, Pred, Lnk
from delphin.mrs.config import CVARSORT
# empty
empty = simplemrs.loads_one('''[ ]''')
# "It rains."
it_rains = simplemrs.loads_one('''
[ LTOP: h0
INDEX: e2 [ e SF: prop TENSE: pres MOOD: indicative PROG: - PER... |
import os
from flask_appbuilder.security.manager import (
AUTH_OID,
AUTH_REMOTE_USER,
AUTH_DB,
AUTH_LDAP,
AUTH_OAUTH,
)
basedir = os.path.abspath(os.path.dirname(__file__))
CSRF_ENABLED = True
SECRET_KEY = "\2\1thisismyscretkey\1\2\e\y\y\h"
OPENID_PROVIDERS = [
{"name": "Yahoo", "url": "https... |
# 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... |
# -*- coding: utf-8 -*-
# Copyright (c) 2016, Niklas Hauser
# All rights reserved.
avr_groups = \
[
# AT90 devices
{
'family': ['90'],
'name': ['1', '2', '216'],
'type': ['pwm']
},{
'family': ['90'],
'name': ['3', '316'],
'type': ['pwm']
},{
'fami... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack LLC.
# 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/... |
from __future__ import unicode_literals
from builtins import range
from builtins import object
import pytz
import datetime
import calendar as standardlib_calendar
from django.conf import settings
from django.utils.encoding import python_2_unicode_compatible
from django.template.defaultfilters import date as date_filte... |
"""
mailthon.envelope
~~~~~~~~~~~~~~~~~
Implements the Envelope object.
:copyright: (c) 2015 by Eeo Jun
:license: MIT, see LICENSE for details.
"""
class Envelope(object):
"""
Enclosure adapter for encapsulating the concept of
an Envelope- a wrapper around some content in the
for... |
# -*- coding: utf-8 -*-
""" Module providing SSHFileSystem implementation."""
from __future__ import unicode_literals
from __future__ import absolute_import
import logging
import os
import os.path
from plumbum import ProcessExecutionError
from plumbum.cmd import sshfs
from plumbum.cmd import sudo
from plumbum.cmd imp... |
from django.test import TestCase
from django.contrib.auth.models import Group
from hs_tracking.models import Variable
from hs_core import hydroshare
from rest_framework import status
import socket
from django.test import Client
class TestDashboard(TestCase):
def setUp(self):
self.hostname = socket.gethos... |
'''
Entry point module to start the interactive console.
'''
from _pydev_bundle._pydev_getopt import gnu_getopt
from _pydev_comm.rpc import make_rpc_client, start_rpc_server, start_rpc_server_and_make_client
from _pydev_imps._pydev_saved_modules import thread
start_new_thread = thread.start_new_thread
try:
from c... |
# A configuration file for the fileprocess. We could do a .ini, but everybody
# knows python here
import logging
import os
from logging import handlers
config = {
'port': 48260,
'S3.accesskey': '17G635SNK33G1Y7NZ2R2',
'S3.secret': 'PHDzFig4NYRJoKKW/FerfhojljL+sbNyYB9bEpHs',
'S3.music_bucket': 'music.r... |
"""
Definition of urls for QandA.
"""
from datetime import datetime
from django.conf.urls import patterns, url
from app.forms import BootstrapAuthenticationForm
import app
import app.views
import django.contrib.auth.views
# Uncomment the next lines to enable the admin:
# from django.conf.urls import include
# from dj... |
#!/usr/bin/python
# -*- coding: utf8 -*-
import sys
import json
from log import *
from es_put import *
from ip2geo import *
### 常量定义
DUMP_PROCESS_NUM = 2000 # 当日志条数累计到DUMP_PROCESS_NUM数量,触发入库
INDICES_PREFIX = "cf-logs-"
DEFAULT_TYPE = "log"
CF_LOGS_WEB_FORMAT_SIZE = 24
CF_LOGS_RTMP_FORMAT_SIZE = 13
########... |
# -*- coding: utf-8 -*-
"""
Created on Mon May 22 18:29 2017
@author: ytsapras
"""
from os import getcwd, path, remove, environ
from sys import path as systempath
cwd = getcwd()
systempath.append(path.join(cwd,'../..'))
systempath.append(path.join(cwd,'..'))
from local_conf import get_conf
robonet_site = get_conf('ro... |
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: https://sickrage.github.io
# Git: https://github.com/SickRage/SickRage.git
#
# This file is part of SickRage.
#
# SickRage 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 Found... |
from freelancersdk.session import Session
from freelancersdk.resources.projects.projects import post_review
from freelancersdk.resources.projects.helpers import \
create_review_employer_object
from freelancersdk.resources.projects.exceptions import \
ReviewNotPostedException
import os
def sample_post_review()... |
# -*- encoding: utf-8 -*-
import bisect
import copy
from abjad.tools import durationtools
from abjad.tools import indicatortools
from abjad.tools import scoretools
from abjad.tools.abctools import AbjadObject
from abjad.tools.topleveltools import attach
class QGrid(AbjadObject):
r'''A rhythm-tree-based model for ... |
# coding=utf-8
from __future__ import absolute_import, division, print_function, \
unicode_literals
from collections import OrderedDict
import filters as f
from filters.test import BaseFilterTestCase
class FilterChainTestCase(BaseFilterTestCase):
def test_implicit_chain(self):
"""
Chaining t... |
import config
import discord
import os
import requests
from discord.ext import commands
from discord.ext.commands import Cog
from modules import strings, parser, audio_player
class Voice(Cog):
def __init__(self, bot):
self.bot = bot
self.parse = parser.Parser(tvmaze_object=self.bot.api, server_dat... |
# -*- coding: utf-8 -*-
from datetime import datetime
from watson.filters.string import Trim, RegEx, Numbers, Upper, Lower, StripTags, HtmlEntities, Date
class TestTrim(object):
def test_trim_string(self):
filter = Trim()
assert filter(' Test') == 'Test'
assert filter('Test') == 'Test'
... |
#!/usr/bin/env python2
#
# Extract rules for Unicode case conversion, specifically the behavior
# required by ECMAScript E5 in Sections 15.5.4.16 to 15.5.4.19. The
# bitstream encoded rules are used for the slow path at run time, so
# compactness is favored over speed.
#
# There is no support for context or local... |
from __future__ import division, print_function, absolute_import
import warnings
import numpy as np
from scipy.special import factorial
from scipy.lib.six import xrange
__all__ = ["KroghInterpolator", "krogh_interpolate", "BarycentricInterpolator",
"barycentric_interpolate", "PiecewisePolynomial",
... |
# coding: utf-8
# In[1]:
import numpy as np
import pandas as pd
def get_precip_data():
return pd.read_csv('precipitation.csv', parse_dates=[2])
def date_to_month(d):
return '%04i-%02i' % (d.year, d.month)
def pivot_months_pandas(data):
"""
Create monthly precipitation totals for each station in... |
# -*- coding: utf-8 -*-
# Copyright (c) 2014, Niklas Hauser
# All rights reserved.
#
# The file is part of my bachelor thesis and is released under the 3-clause BSD
# license. See the file `LICENSE` for the full license governing this code.
# -----------------------------------------------------------------------------... |
#!/usr/bin/env python3
import copy
from collections import defaultdict
import sys
import re
def extract(s):
return [int(x) for x in re.findall(r'-?\d+', s)]
def first(grid, x, y, dx, dy):
while True:
x += dx
y += dy
if x < 0 or x >= len(grid[0]) or y < 0 or y >= len(grid):
... |
# 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.
from sqlalchemy.schema import Column, ForeignKey
from sqlalchemy.types... |
import warnings
# import functools
class AltairDeprecationWarning(UserWarning):
pass
def _deprecated(obj, name=None, message=None):
"""Return a version of a class or function that raises a deprecation warning.
Parameters
----------
obj : class or function
The object to create a deprecat... |
# -*- coding: utf-8 -*-
"""X
The Hlt domain for Sphinx.
"""
def setup(Sphinx):
Sphinx.add_domain(HltDomain)
from sphinx import addnodes
from sphinx.domains import Domain, ObjType
from sphinx.locale import l_, _
from sphinx.directives import ObjectDescription
from sphinx.roles import XRefRole
from sphinx.util.... |
# coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base.instance_resource import InstanceResource
from twilio.base.list_resource import ListResource
from twilio.base.page import Page
from twilio.rest.api.v2010.account.sip.credential_list ... |
#!/usr/bin/env python3
#
# Copyright 2016 WebAssembly Community Group participants
#
# 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
#
# Unles... |
from __future__ import absolute_import
import unittest
import numpy as np
from tests.sample_data import SampleData
from pyti import stochastic
class TestStochastic(unittest.TestCase):
def setUp(self):
"""Create data to use for testing."""
self.data = SampleData().get_sample_close_data()
... |
# Copyright 2004-2008 Roman Yakovenko.
# Distributed under the Boost Software License, Version 1.0. (See
# accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
"""
defines class L{mdecl_wrapper_t} that allows to work on set of declarations,
as it was one declaration.
The L{class<mdecl_... |
import time
from django.contrib.auth import get_user_model
from django.core.management.base import BaseCommand
from misago.core.management.progressbar import show_progress
from misago.core.pgutils import batch_update
class Command(BaseCommand):
help = 'Synchronizes users'
def handle(self, *args, **options)... |
##############################################################################################
# Copyright 2014-2015 Cloud Media Sdn. Bhd.
#
# This file is part of Xuan Application Development SDK.
#
# Xuan Application Development SDK is free software: you can redistribute it and/or modify
# it under the terms of... |
class Heap:
def __init__(self):
self.bh = []
def pop(self):
if len(self.bh)==0: raise StandardError('No more elements in the heap')
if len(self.bh)==1:
return self.bh.pop()
return_value, self.bh[0] = self.bh[0], self.bh[-1]
self.bh = self.bh[:len(self.bh)-1]
... |
#!/usr/bin/python
# -*- encoding: utf-8 -*-
#
# author: javi santana
from fabric.api import *
from fabric.contrib.files import upload_template
from fabric.contrib.files import exists
def install(conf_folder):
sudo("apt-get -y install apache2 libapache2-mod-wsgi")
#sudo("rm -rf /etc/apache2/site-enabled/*")
de... |
import os
import math
import subprocess
########################################
f = open("wonkyworld-uniform.church")
ch_model = [l.rstrip() for l in f.readlines()]
f.close()
pfile = open("smoothed_15marbles_priors.txt") # get smoothed priors (kernel density estimates)
#pfile = open("fourstep_15marbles_priors.txt"... |
"""Functions to plot ICA specific data (besides topographies)
"""
from __future__ import print_function
# Authors: Denis Engemann <denis.engemann@gmail.com>
# Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Teon Brooks <teon.brooks@gmail.com>
#
# License: Simplified BSD
from functools... |
import unittest
import os
import binascii
import blocktrail
class ApiClientTestCase(unittest.TestCase):
def setUp(self):
self.cleanup_data = {}
def tearDown(self):
#cleanup any records that were created after each test
client = self.setup_api_client(debug=False)
#webhooks
... |
import os
import re
import os.path
from iptcinfo import IPTCInfo
from galleryitem import JpegPicture, JpegDirectory, directory_name_to_html_file_name
from ..utils.inject import assign_injectables
def is_jpeg_file(file_name):
"""
Determine if a file is labeled as a JPEG.
Args:
file_name the name of the file.... |
# This file is part of DQXServer - (C) Copyright 2014, Paul Vauterin, Ben Jeffery, Alistair Miles <info@cggh.org>
# This program is free software licensed under the GNU Affero General Public License.
# You can find a copy of this license in LICENSE in the top directory of the source code or at <http://opensource.org/... |
# This file is part of pyrasite.
#
# pyrasite is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# pyrasite is distributed in the hope t... |
#!/usr/bin/env python
import bs4 as BeautifulSoup
from .Node import Node
class Attr(Node):
_value = ""
def __init__(self, doc, parent, attr):
self.doc = doc
self.parent = parent
self.attr = attr
self.tag = BeautifulSoup.Tag(parser = self.doc, name = 'attr')
N... |
# coding: utf-8
from __future__ import unicode_literals
import unittest
import responses
from admitad.items import Campaigns, CampaignsForWebsite, \
CampaignsManage
from admitad.tests.base import BaseTestCase
class CampaignsTestCase(BaseTestCase):
def test_get_campaigns_request(self):
with response... |
from controllers.data_set_controller import DataSetController
from controllers.session_controller import SessionController
from utils.train.session_details import SessionDetails
import constants.cnn_constants as cnn_const
import neural_networks.cnn as cnn
import tensorflow as tf
import threading
import math
class... |
from vsg import parser
from vsg import rule
from vsg import token
from vsg import violation
from vsg.rules import utils as rules_utils
from vsg.vhdlFile import utils
lTokens = []
lTokens.append(parser.comment)
lSkip = []
lSkip.append(parser.comment)
oLeftToken = token.architecture_body.begin_keyword
oRightToken ... |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
import math
#from scipy.fftpack import dct,idct
import numpy as np
from scipy.spatial.distance import euclidean
from praatinterface import PraatLoader
def get_intensity(filename, praat = None):
if not praat:
praat = PraatLoader()
text = praat.run_script('intensity.praat',filename)
return praat.rea... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.