src
stringlengths
721
1.04M
# Copyright 2013 Huawei Technologies Co.,LTD. # # 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 os from setuptools import find_packages from setuptools import setup import django_xmlrpc setup(name='django-xmlrpc', version=django_xmlrpc.__version__, description='XML-RPC Server App for the Django framework.', long_description=open(os.path.join('README.rst')).read(), keywords='dja...
""" This page is in the table of contents. The gts.py script is an import translator plugin to get a carving from an gts file. An import plugin is a script in the interpret_plugins folder which has the function getCarving. It is meant to be run from the interpret tool. To ensure that the plugin works on platforms wh...
# This script joins mutation of all patients to one file # Use the following arguments: # [1] - regular expression for variants files # [2] - name for resultFile ## v4 - added argparse ## v5 - join mutations of avinput (annovar input) import glob import sys import argparse import re def showPercWork(done,allWork): ...
import copy import echidna import echidna.output.plot as plot import echidna.core.spectra as spectra from echidna.output import store import matplotlib.pyplot as plt import argparse import glob import numpy as np import os def convertor(path): flist=np.array(glob.glob(path)) for ntuple in flist: os.sy...
#!/usr/bin/env python from crawler import WebCrawler, log import logging import os import hashlib from miner.text.util import strip_control_characters import MySQLdb from MySQLdb import cursors class FeedItemWebCrawler(WebCrawler): temp_outfile_path = '/tmp/feed_items' outfile_base_path = '/tmp/scraped' ...
import argparse import calendar from datetime import datetime import glob import os import shutil import subprocess import sys import gzip import unifyQueryTypes from utility import utility import config os.nice(19) months = {'january': [1, 31], 'february': [2, 28], 'march': [3, 31], 'ap...
# This file is part of Archivematica. # # Copyright 2010-2013 Artefactual Systems Inc. <http://artefactual.com> # # Archivematica 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 ...
""" Defines Linkers that deal with C implementations. """ from __future__ import print_function # Python imports from copy import copy import os import sys import logging import numpy import theano from theano import config from theano.compat import PY3 from theano.compat import izip from six import string_types, r...
try: from itertools import izip except ImportError: izip = zip from django import forms from django import template from django.template import loader, Context from django.conf import settings from crispy_forms.utils import TEMPLATE_PACK, get_template_pack register = template.Library() @register.filter def...
from operator import itemgetter import sys import urllib import urlparse sys.path.append('./resources/lib') import requests def build_url(query): return base_url + '?' + urllib.urlencode(dict([k.encode('utf-8'),unicode(v).encode('utf-8')] for k,v in query.items())) class Subsonic(object): def __init__(self...
import unittest import sys sys.path.append('LeetCode/_051_100') sys.path.append('LeetCode.Test') from _068_TextJustification import Solution import AssertHelper class Test_068_TextJustification(unittest.TestCase): def test_fullJustify_1(self): solution = Solution() result = solution.fullJustify([...
""" This collection of routines are alternatives to those in subprocess.py but which create additional controlling threads. Since this feature is not needed in the GUI as a separate thread is spawned of to handle each job they are no longer needed, but retained for possible future use. """ import os,sys if __name__ =...
""" [2016-03-23] Challenge #259 [Intermediate] Mahjong Hands https://www.reddit.com/r/dailyprogrammer/comments/4bmdwz/20160323_challenge_259_intermediate_mahjong_hands/ # Description You are the biggest, baddest mahjong player around. Your enemies tremble at your presence on the battlefield, and you can barely walk t...
import os import bpy from bpy.props import * bl_info = { "name": "PMK PBR Materials", "author": "Karol Wajs", "version": (0, 0, 1), "blender": (2, 7, 6), "location": "Viewport", "description": "Adds panel in material properties that allows editing material PBR properties.", "category": "Mat...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 Ruijie network, 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-...
# # ***** BEGIN LICENSE BLOCK ***** # Zimbra Collaboration Suite Server # Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Zimbra, Inc. # # The contents of this file are subject to the Zimbra Public License # Version 1.3 ("License"); you may not use this file except in # compliance with the License. You may obtain a c...
# Copyright 2012 Red Hat, Inc # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
# -*- python -*- # -*- coding: utf-8 -*- # # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2011-2012 Serge Noiraud # # 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; eithe...
from datetime import date, datetime, timedelta import dateutil.parser import calendar """ Utility class for date and time conversion. """ class DateUtility(object): RFC_822_GMT_FORMAT = "%a, %d %b %Y %H:%M:%S GMT" @staticmethod def convertTimeLongToIso(time): isoTime = '' try: ...
import os from pathlib import Path from typing import List, Optional, TypedDict, Any from OpenSSL import SSL from mitmproxy import certs, ctx, exceptions, connection from mitmproxy.net import tls as net_tls from mitmproxy.options import CONF_BASENAME from mitmproxy.proxy import context from mitmproxy.proxy.layers impo...
#!/usr/bin/env python3 """Script to create a source/binary RPM. """ # $Id: make_rpm.py 496124 2016-03-23 20:34:27Z camacho $ from __future__ import print_function import sys, os, shutil from optparse import OptionParser import subprocess import tarfile SCRIPT_DIR = os.path.dirname(os.path.abspath(sys.argv[0])) sys.pat...
""" Tests for credentials rendering views. """ import uuid from unittest.mock import PropertyMock, patch import ddt import responses from django.template import Context, Template from django.template.loader import select_template from django.test import TestCase from django.urls import reverse from django.utils.text i...
import logging from collections import UserDict import pymysql import re log = logging.getLogger('tyggbot') class Emote: def __init__(self): self.id = -1 # An ID of -1 means the emote will be inserted on sync self.emote_id = None self.code = None # This value will be inserted when the u...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # https://github.com/monkeymia/ # # Copyright (c) 2014, monkeymia, All rights reserved. # # 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; e...
# Copyright 2018 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 or agreed to in writing, s...
# Copyright 2015 Mirantis 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...
# Copyright (C) 2008-2010 Adam Olsen # # 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, or (at your option) # any later version. # # This program is distributed in the hope that...
#!/usr/bin/python3 """A script for casting spells on cgf files. This script is essentially a cgf specific wrapper around L{pyffi.spells.toaster}.""" # -------------------------------------------------------------------------- # ***** BEGIN LICENSE BLOCK ***** # # Copyright (c) 2007-2012, Python File Format Interface ...
from django import template from django.forms import ChoiceField from django.utils.safestring import mark_safe from .templatetags.sitetree import sitetree_tree from .utils import get_tree_model, get_tree_item_model MODEL_TREE_CLASS = get_tree_model() MODEL_TREE_ITEM_CLASS = get_tree_item_model() class TreeItemChoi...
import socket import logging import time from asyncore import dispatcher from transport import Transport import transportStream from magimessage import DefaultCodec log = logging.getLogger(__name__) class TCPServer(Transport): """ Simple TCP Server that returns new TCP clients as 'messages' """ def __init__(self,...
#!/usr/local/bin/python # ------------------------------------------------------------------------------ # OCCAM # # Copyright © 2011-2012, SRI International # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following condit...
# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
import pytest REPOSITORY = 'MarekSuchanek/pyplayground' NOT_REPOSITORY = 'MarekSuchanek/pyplaygroundzzzz7' def test_login_bad(github_api): assert not github_api.login('random_code') def test_get_user_self(github_api): user = github_api.get('/user') assert user.is_ok assert 'login' in user.data de...
# 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 ...
import time import unittest from withings import WithingsMeasureGroup, WithingsMeasures class TestWithingsMeasures(unittest.TestCase): def test_withings_measures_init(self): """ Check that WithingsMeasures create groups correctly and that the update time is parsed correctly """ ...
# # # Copyright (C) 2007, 2011, 2012, 2013 Google 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 progr...
from functools import wraps import logging from django.conf import settings logger = logging.getLogger(__name__) def is_segment_configured(): """Returns a Boolean indicating if Segment has been configured for use.""" return bool(settings.SEGMENT_KEY) def parse_tracking_context(user): """Extract user ...
from distutils.core import setup, Extension import sys err = "" try: import gtk except ImportError: err += "gtk (apt-get install python-gtk2)\n" try: import cairo except ImportError: err += "cairo (apt-get install python-cairo)\n" try: import Crypto except ImportError: err += "crypto (apt-ge...
#!/usr/bin/env python3 # -*- encoding: 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...
#!/usr/bin/env python3 import unittest from unittest.mock import patch from tmc import points from tmc.utils import load, get_out module_name="src.correlation" correlations = load(module_name, "correlations") lengths = load(module_name, "lengths") def patch_name(m, d): import importlib parts=d.split(".") ...
# Taken and modified from: # http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/ import threading import Queue import atexit import os import signal import sys import time import logging import logging.handlers from DTL.api import loggingUtils if (hasattr(os, "devnull")): DEVNULL = os.de...
from .util import run class Git(object): name = "git" directory_name = ".git" default_branch = "origin/master" def clone(self, repository_uri, local_path): _git(["clone", repository_uri, local_path]) return GitRepository(local_path) def local_repo(self, working_direct...
# -*- coding: iso-8859-1 -*- from ConectorDriverComando import ConectorDriverComando import unicodedata import importlib import logging import string import types from array import array class ValidationError(Exception): pass class FiscalPrinterError(Exception): pass class ComandoException(RuntimeError): ...
# -* coding: utf-8 -*- import tornado.escape import tornado.ioloop import tornado.web import json import random import os from handlers.basehandler import BaseHandler, ExceptionHandler from core.experiment import Experiment from db.database import Database from db.mongolog import MongoLog from db.users import Users ...
from .placeholder import Placeholder from .template import TemplateItem, ItemCallback from widgets.layoutint import GridLayoutInt from kivy.properties import StringProperty, ObjectProperty, NumericProperty, AliasProperty, OptionProperty from utilities.formatting import get_formatted_when from kivy.logger import Logger ...
""" PyAudio exmple: Record a few seconds of audio and save to a WAVE file. """ import pyaudio import wave import sys from dejavu import Dejavu CHUNK = 8192 FORMAT = pyaudio.paInt16 CHANNELS = 1L RATE = 48000 RECORD_SECONDS = 5 WAVE_OUTPUT_FILENAME = "/sounds/output.wav" if sys.platform == 'darwin': CHANNELS = 1 ...
""" Default Forum settings to import/define in your project settings """ # Categories pagination in 'Category index' (=forum index) view FORUM_CATEGORY_INDEX_PAGINATE = 6 # Threads pagination in 'Last threads' view FORUM_LAST_THREAD_PAGINATE = 15 # Threads pagination in 'Category detail' view FORUM_CATEGORY_THREAD_PAG...
from consts import ZMQ_SERVER_NETWORK, ZMQ_PUBSUB_KV17 from network import network from helpers import serialize import zmq import sys # Initialize the cached network sys.stderr.write('Caching networkgraph...') net = network() sys.stderr.write('Done!\n') # Initialize a zeromq context context = zmq.Context() # Set up...
#!/usr/bin/env python from SettingsWidgets import * PREF_MEDIA_AUTORUN_NEVER = "autorun-never" PREF_MEDIA_AUTORUN_X_CONTENT_START_APP = "autorun-x-content-start-app" PREF_MEDIA_AUTORUN_X_CONTENT_IGNORE = "autorun-x-content-ignore" PREF_MEDIA_AUTORUN_X_CONTENT_OPEN_FOLDER = "autorun-x-content-open-folder" CUSTOM_ITEM...
#!/usr/bin/python # -*- coding: cp1252 -*- # Telegraph Fantasy Football Team Picker # version 1.2.1 (11 March 2011) # by Ian Renton and Mark Harris # For details, see http://www.onlydreaming.net/software/telegraph-fantasy-football-team-picker # This code is released under the GPLv3 licence (http://www.gnu.org/licenses...
import connexion from swagger_server.models.upload_file import UploadFile from swagger_server.models.upload_file_data import UploadFileData from swagger_server.models.error import Error from datetime import date, datetime from typing import List, Dict from six import iteritems from ..util import deserialize_date, dese...
#!/usr/bin/env python import numpy as np import os def read_column(file, firstline): """read a column from first line (e.g. n01c001) to *eof""" column = list() line = firstline # register methods for faster evaluation f_readline = file.readline column_append = column.append # r...
# Copyright 2019 Virgil Dupras # # This software is licensed under the "GPLv3" License as described in the "LICENSE" file, # which should be included with this package. The terms are also available at # http://www.gnu.org/licenses/gpl-3.0.html from datetime import date from ..testutil import eq_, with_app from ..bas...
# -*- coding: utf-8 -*- # Copyright 2008 Jaap Karssenberg <jaap.karssenberg@gmail.com> '''This module handles parsing and dumping input in plain text''' import re import zim.parser from zim.parser import prepare_text, Rule from zim.formats import * from zim.parsing import url_re info = { 'name': 'plain', 'desc...
# coding=utf-8 from autosubliminal.core.movie import MovieDetails, MovieSettings from autosubliminal.core.subtitle import Subtitle, EXTERNAL from autosubliminal.db import FailedMoviesDb, MovieDetailsDb, MovieSettingsDb from autosubliminal.server.api.movies import MoviesApi from tests.server.api.test_api import pickle...
# -*- coding: utf-8 -*- import copy import six from odin import exceptions, registration from odin.exceptions import ValidationError from odin.fields import NOT_PROVIDED from odin.utils import cached_property, field_iter_items DEFAULT_TYPE_FIELD = '$' META_OPTION_NAMES = ( 'name', 'namespace', 'name_space', 'verb...
"""Tests for load_pytd.py.""" from pytype import load_pytd from pytype import utils import unittest class ImportPathsTest(unittest.TestCase): """Tests for load_pytd.py.""" PYTHON_VERSION = (2, 7) def testBuiltinSys(self): loader = load_pytd.Loader("base", python_version=self.PYTHON_VERSION) ast = l...
from __future__ import unicode_literals, print_function from six import BytesIO from lxml import html from operator import itemgetter from wex.cache import Cache from wex.response import Response, parse_headers from wex import etree as e from wex.iterable import first, flatten example = b"""HTTP/1.1 200 OK X-wex-reque...
#! /usr/bin/env python import os from setuptools import setup os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'test_settings') CLASSIFIERS = [ 'Environment :: Web Environment', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Progr...
# Orbotor - arcade with orbit mechanics # Copyright (C) 2014 mr555ru # # 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) an...
from itertools import product, islice from joblib import Parallel, delayed import json import requests from requests.exceptions import ConnectionError, Timeout from simplejson import JSONDecodeError import string CLIENT_ID = 'a48b4d0f6e0745e2ba68902a1f68f8d5' URL = 'https://api.instagram.com/oembed/media/?url=http://i...
from django.shortcuts import render_to_response from django.http import HttpResponseRedirect from django.template import RequestContext from django.utils.datastructures import SortedDict from instance.models import Host from webvirtmgr.server import ConnServer from dashboard.forms import HostAddTcpForm, HostAddSshForm ...
#!/usr/bin/env python from os.path import dirname, abspath, join from setuptools import setup here = abspath(dirname(__file__)) readme = open(join(here, "README.rst")) setup( name="mls", version="1.2.2", py_modules=["mls"], url="https://github.com/rembish/mls", license="BSD", author="Aleksey R...
# # Copyright (c) SAS Institute Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w...
# Copyright 2015 Quantopian, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
""" A number of function that enhance IDLE on MacOSX when it used as a normal GUI application (as opposed to an X11 application). """ import sys import tkinter from os import path _appbundle = None def runningAsOSXApp(): """ Returns True if Python is running from within an app on OSX. If so, assume that ...
import zeit.cms.browser import zeit.cms.browser.interfaces import zeit.cms.browser.resources import zeit.cms.checkout.interfaces import zeit.cms.repository.interfaces import zeit.cms.section.interfaces import zope.app.basicskin.standardmacros import zope.component import zope.location.interfaces import zope.security.pr...
########################################################################## # # Copyright (c) 2008-2010, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redis...
import sys from cyvcf2 import VCF from collections import defaultdict def parse_caller_vcfs(sample_dict, caller_list): caller_vcf_records = defaultdict(lambda: dict()) for caller in caller_list: parse_vcf(sample_dict[caller], caller, caller_vcf_records) return caller_vcf_records def parse_vcf(v...
import datetime import mock import unittest import six from six.moves import urllib import gocardless from gocardless import utils, urlbuilder class ExpiringLimitTestCase(object): """superclass factoring out tests for expiring limit param objects""" def test_interval_length_is_positive(self): pars =...
# -*- coding: utf-8 *-* # Copyright (c) 2013 Tisserant Pierre # # This file is part of Dragon dice simulator. # # Dragon dice simulator 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 ve...
#!/usr/bin/env python # -*- coding: utf-8 -*- import re from .dependency import Dependency class Ifconfig(Dependency): dependency_required = True dependency_name = 'ifconfig' dependency_url = 'apt-get install net-tools' @classmethod def up(cls, interface, args=[]): '''Put interface up'''...
# 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 ...
from setuptools import setup readme = open('README.rst').read() version = "0.15.0" setup(name='jicbioimage', packages=['jicbioimage', ], version=version, description='Python package designed to make it easy to work with bio images.', long_description=readme, author='Tjelvar Olsson', ...
# -*- 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 or...
from submission import Submission def calculate_length(permutation, matrix): n = len(permutation) length = 0 for i in range(n-1): length += matrix[permutation[i]][permutation[i+1]] length += matrix[permutation[-1]][permutation[0]] return length def glouton(graphe, depart=None): sommets...
# -*- 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): # Changing field 'TestCaseAssert.operator' db.alter_column('feditor_testcaseassert', 'operator', self.gf('d...
import unittest from mock import patch, Mock from twilio.rest.resources.ip_messaging import Channels, Channel from tests.tools import create_mock_json BASE_URI = "https://ip-messaging.twilio.com/v1/Services/ISxxx" ACCOUNT_SID = "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" AUTH = (ACCOUNT_SID, "token") CHANNEL_SID = "C...
# coding: utf-8 """ Wavefront REST API <p>The Wavefront REST API enables you to interact with Wavefront servers using standard REST API tools. You can use the REST API to automate commonly executed operations such as automatically tagging sources.</p><p>When you make REST API calls outside the Wavefront REST ...
""" Created on Thursday 16 April 2015 @author: Andrew Horsfield, Marc Coury and Max Boleininger This module contains functions that are needed once the molecular orbitals are populated by electrons. """ # # Import the modules that will be needed import numpy as np import math import TBH import sys import time import ...
import unittest import time from pymongo import MongoClient from moquag import MongoQueryAggregator from time import sleep from .settings import MONGO_DB_SETTINGS, logger from collections import Counter class TestBulk(unittest.TestCase): def setUp(self): self.conn = MongoClient(**MONGO_DB_SETTINGS) ...
"""Changing table name from 'group' to 'device_group' Revision ID: d43655797899 Revises: 38f3c80e9932 Create Date: 2017-08-24 15:17:10.671537 """ import textwrap from alembic import op # revision identifiers, used by Alembic. revision = 'd43655797899' down_revision = '38f3c80e9932' branch_labels = None depends_on =...
# Plot Empirical Cumulative Distribution Function for Object Size import os import cv2 import pandas as pd from plantcv.plantcv import params from plantcv.plantcv._debug import _debug from statsmodels.distributions.empirical_distribution import ECDF from plotnine import ggplot, aes, geom_point, labels, scale_x_log10 ...
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
from sqlalchemy import Column, String, Integer, DateTime, PickleType, Boolean from mcmeAPI.db import Base class User(Base): __tablename__ = 'users' name = Column(String(20), primary_key=True) group = Column(String(15)) #rank updated = Column(DateTime()) ob = Column(Boolean) staff = Column(Bool...
#!/usr/bin/env python # Python 3 # LinkFinder # By Gerben_Javado # Fix webbrowser bug for MacOS import os os.environ["BROWSER"] = "open" # Import libraries import re, sys, glob, html, argparse, jsbeautifier, webbrowser, subprocess, base64, ssl, xml.etree.ElementTree from gzip import GzipFile from string import Templ...
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe.utils import add_days, cint, cstr, flt, getdate, nowdate, rounded, date_diff, money_in_words from frappe.model.naming import ...
import re from urllib import urlencode from urllib2 import urlopen import sys from corehq.apps.sms.mixin import SMSBackend, BackendProcessingException from corehq.apps.sms.forms import BackendForm from corehq.apps.reminders.forms import RecordListField from django.forms.fields import * from django.core.exceptions impor...
# -*- coding: utf-8 -*- from frontera.tests.backends import BackendSequenceTest, TEST_SITES from frontera.utils.tester import DownloaderSimulator, BaseDownloaderSimulator from urlparse import urlparse class DFSOverusedBackendTest(BackendSequenceTest): EXPECTED_SEQUENCES = { "SEQUENCE_01_A": [ ...
# This file is part of Archivematica. # # Copyright 2010-2013 Artefactual Systems Inc. <http://artefactual.com> # # Archivematica 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 ...
# -*- coding:utf8 -*- """Upload build package """ from __future__ import unicode_literals import zipfile import json import logging __author__ = 'attakei' def upload_functions(registry, config, args): import boto3 client = boto3.client('lambda') functions_list = [] with zipfile.ZipFile(args.path) a...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # NorNet Experiment Toolbox # Copyright (C) 2016-2021 by Thomas Dreibholz # # 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 t...
# -*- coding: utf-8 -*- # Copyright (c) 2011, Sebastian Wiesner <lunaryorn@googlemail.com> # 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...
#!/usr/local/bin/python3 import mytimer from multiprocessing import Process # (a) ############################################################# def stem_search(stems, stem_size): best_stem = "" best_count = 0 for (stem,count) in stems.items(): if stem_size == len(stem) and count > best_count: ...
# # Copyright (C) 2017, 2018, 2019 Smithsonian Astrophysical Observatory # # # 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 late...
# coding=utf-8 # Copyright 2014-2016 F5 Networks 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 o...
# -*- coding: utf-8 -*- # # Picard, the next-generation MusicBrainz tagger # # Copyright (C) 2006-2008, 2012 Lukáš Lalinský # Copyright (C) 2008 Hendrik van Antwerpen # Copyright (C) 2008-2010, 2014-2015, 2018-2020 Philipp Wolfer # Copyright (C) 2012-2013 Michael Wiencek # Copyright (C) 2012-2014 Wieland Hoffmann # Cop...
# thrown when there isn't enough data from _codecs import utf_8_decode import struct big_endian, little_endian = range(2) packEndians = { big_endian: '>', little_endian: '<' } class ReadException(Exception): pass # endian is here for automatic struct.packing purposes def packByte(b, endian=big_endian): return s...
import base64 import os from pyramid.authorization import Authenticated, Everyone from pyramid.interfaces import IAuthenticationPolicy, IDebugLogger from zope.interface import implementer from .util import _find_services, _session_registered, add_vary_callback def _clean_principal(princid): """Utility function ...