text
stringlengths
475
200k
import curses import weakref import npyscreen import email import mimetypes import os.path class EmailTreeLine(npyscreen.TreeLine): def display_value(self, vl): return vl if vl: return vl.getContent().get_content_type() else: return "" class EmailTree(npyscreen....
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 NEC Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # ...
import sys import scipy import numpy as np def read_pcm_file(file_path, file_type=scipy.complex64): with open(file_path, 'rb') as f: return scipy.fromfile(f, dtype=file_type) def write_pcm_file(file_path, signal_data, file_type='complex64'): np.array(signal_data).astype('complex64').tofile(file_path) ...
""" A context object for caching a function's return value each time it is called with the same input arguments. """ # Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org> # Copyright (c) 2009 Gael Varoquaux # License: BSD Style, 3 clauses. from __future__ import with_statement import os import shutil ...
""" Player datablock generator, written to test an experimental super-2046 DB count patch. """ import sys import math class PseudoNumber: _value = None _digits = None _decimal_value = None _converted = None def __init__(self, digits=None, value=None): self._digits = digits self._decimal_value = int(value)...
#!/usr/bin/env python # Author: Jon Trulson <[EMAIL]> # Copyright (c) 2016 Intel Corporation. # # 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 limita...
#!/usr/bin/python import time import os from random import randint GPIO.setmode(GPIO.BCM); BUTON_SUS=17;BUTON_JOS=22;BUTON_STANGA=27;BUTON_DREAPTA=4; LED0=23;LED1=24;LED2=25; GPIO.setup(BUTON_SUS,GPIO.IN); GPIO.setup(BUTON_JOS,GPIO.IN); GPIO.setup(BUTON_STANGA,GPIO.IN); GPIO.setup(BUTON_DREAPTA,GPIO.IN); GPIO.setup(...
#!/usr/bin/env python # # Copyright 2015 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
from __future__ import with_statement, absolute_import import re from contextlib import closing import MySQLdb import MySQLdb.cursors re_column_length = re.compile(r'\((\d+)\)') re_column_precision = re.compile(r'\((\d+),(\d+)\)') re_key_1 = re.compile(r'CONSTRAINT `(\w+)` FOREIGN KEY \(`(\w+)`\) REFERENCES `(\w+)`...
# Timer class for scheduling methods after some time. # # Copyright (C) 2018 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # the GNU General Public License v.2, or (at your option) any later version. # Th...
"""SCons.Tool.ifort Tool-specific initialization for newer versions of the Intel Fortran Compiler for Linux/Windows (and possibly Mac OS X). There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) ...
# Copyright (c) 2014 Cloudera, 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 o...
# # (c) 2015, Peter Sprygada <[EMAIL]> # # Copyright (c) 2016 Dell Inc. # # 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 yo...
from __future__ import absolute_import import six class EventError(object): INVALID_DATA = 'invalid_data' INVALID_ATTRIBUTE = 'invalid_attribute' VALUE_TOO_LONG = 'value_too_long' UNKNOWN_ERROR = 'unknown_error' SECURITY_VIOLATION = 'security_violation' RESTRICTED_IP = 'restricted_ip' JS...
""" ========================================================= Using FunctionTransformer to select columns ========================================================= Shows how to use a function transformer in a pipeline. If you know your dataset's first principle component is irrelevant for a classification task, you ca...
#!/usr/bin/env python ### DO NOT MODIFY THIS FILE ### ### DOWNLOAD NEW FILE FROM https://raw.github.com/simsong/dfxml/master/python/fiwalk.py # # fiwalk version 0.6.3 # # %%% BEGIN NO FILL """fiwalk module This is the part of dfxml that is dependent on fiwalk.py """ import dfxml from sys import stderr from subprocess...
#! /usr/bin/python """ test_frame.py Paul Malmsten, 2010 [EMAIL] Tests frame module for proper behavior """ import unittest from xbee.frame import APIFrame from xbee.python2to3 import byteToInt, intToByte class TestAPIFrameGeneration(unittest.TestCase): """ XBee class must be able to create a valid API frame...
# SPDX-License-Identifier: Apache-2.0 # # Copyright (C) 2015, ARM Limited and contributors. # # 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 # # ...
"""The mock module allows easy mocking of apitools clients. This module allows you to mock out the constructor of a particular apitools client, for a specific API and version. Then, when the client is created, it will be run against an expected session that you define. This way code that is not aware of the testing fr...
# -*- coding: utf-8 -*- # # This file is part of INSPIRE. # Copyright (C) 2014-2017 CERN. # # INSPIRE 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 ...
#!/usr/bin/python # -*- coding: utf-8 -*- # This file is part of Ansible # Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supp...
# # Copyright 2013 NEC Corporation. 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...
# -*- coding: utf-8 -*- import collections import mock import unittest2 from openerp.http import request as req from . import common from ..controllers import main class Placeholder(object): def __init__(self, **kwargs): for k, v in kwargs.iteritems(): setattr(self, k, v) class LoadTest(co...
# # Copyright 2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your option) # any later version. # #...
# -*- coding: utf-8 -*- # # This file is part of Lumberjack. # Copyright 2014 CERN. # # Lumberjack 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) an...
#!/usr/bin/env/python """ merge_filter.py -- find the courses in VIVO, and match them to the courses in the source. They must match on ccn There are two inputs: 1. Courses in VIVO. Keyed by ccn 2. UF courses in the source. Keyed the same. There are three cases 1. Course in VIVO and in ...
from __future__ import division from sympy import (Add, Basic, S, Symbol, Wild, Float, Integer, Rational, I, sin, cos, tan, exp, log, nan, oo, sqrt, symbols, Integral, sympify, WildFunction, Poly, Function, Derivative, Number, pi, NumberSymbol, zoo, Piecewise, Mul, Pow, nsimplify, ratsimp, trigsimp, radsim...
#!/usr/bin/env python # Simple script to filter lines of the input for meeting a numeric # threshold on one, or one of multiple (comma-separated) column numbers. # If threshold is required on each column, you can chain multiple # scorethresh.py calls with pipes. # by default, the column value has to be larger or equa...
# -*- coding: utf-8 -*- """ werkzeug.wsgi ~~~~~~~~~~~~~ This module implements WSGI related helpers. :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import re import os import sys import posixpath import mimetypes from itert...
import json import logging from django.http import HttpResponse from django.utils.translation import ugettext as _ from celery.states import FAILURE, REVOKED, READY_STATES from instructor_task.api_helper import (get_status_from_instructor_task, get_updated_instructor_task) fr...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
# Copyright 2016 Raytheon BBN Technologies # # 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 __all__ = ['BOP2020M'] from auspex.log import lo...
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, [EMAIL], All rights reserved. # LLNL-CODE-647188 # # F...
# -*- coding: utf-8 -*- import re from module.plugins.internal.SimpleCrypter import SimpleCrypter from module.plugins.internal.misc import json, uniqify class ImgurCom(SimpleCrypter): __name__ = "ImgurCom" __type__ = "crypter" __version__ = "0.59" __status__ = "testing" __pattern__ = r'h...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2011 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
""" Create and delete FILES_PER_THREAD temp files (via tempfile.TemporaryFile) in each of NUM_THREADS threads, recording the number of successes and failures. A failure is a bug in tempfile, and may be due to: + Trying to create more than one tempfile with the same name. + Trying to delete a tempfile that doesn't sti...
import json from social.tests.backends.oauth import OAuth2Test class TwitchOAuth2Test(OAuth2Test): backend_path = 'social.backends.twitch.TwitchOAuth2' user_data_url = 'https://api.twitch.tv/kraken/user/' expected_username = 'test_user1' access_token_body = json.dumps({ 'access_token': 'foobar...
# Copyright (c) 2009-2010 VMware, Inc. All Rights Reserved. # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modif...
#!/usr/bin/python # # 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 # "Lic...
#! /usr/bin/python #changelog: #10/13/2005b: replaced the # in tmp(.#*)* with alphanumeric and _, this will then remove #nodes such as %tmp.1.i and %tmp._i.3 #10/13/2005: exntended to remove variables of the form %tmp(.#)* rather than just #%tmp.#, i.e. it now will remove %tmp.12.3.15 etc, additionally fixed a spell...
# 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 from django import forms from django.contrib.auth.forms import (UserCreationForm, UserChangeForm, AdminPasswordChangeForm, PasswordChangeForm) from django.contrib.auth.models import Group, Permission from django.core.exceptions import PermissionDenied from dja...
from __future__ import division, print_function import numpy as np from bct.utils import BCTParamError, normalize, get_rng def ci2ls(ci): ''' Convert from a community index vector to a 2D python list of modules The list is a pure python list, not requiring numpy. Parameters ---------- ci : Nx...
#!/usr/bin/env python # Copyright (c) 2014, The MITRE Corporation. All rights reserved. # See LICENSE.txt for complete terms. ''' The following code requires python-stix v1.1.1.0 or greater installed. For installation instructions, please refer to https://github.com/STIXProject/python-stix. ''' import sys from stix.c...
# This file is part of the sos project: https://github.com/sosreport/sos # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # version 2 of the GNU General Public License. # # See the LICENSE file in the source distribution ...
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Request Handler to allow test mask updates.""" import webapp2 import re import sys import os from common import constants from common import image_tools...
from __future__ import unicode_literals import logging import os # TODO: Remove entirely if you don't register GStreamer elements below import pygst pygst.require('0.10') import gst import gobject from mopidy import config, ext __version__ = '0.1.0' # TODO: If you need to log, use loggers named after the current ...
"""SCons.Tool.Packaging.zip The zip SRC packager. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation # # 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 S...
''' The :mod:`pulsar.apps.wsgi.utils` module include several utilities used by various components in the :ref:`wsgi application <apps-wsgi>` ''' import time import re import textwrap import logging from datetime import datetime, timedelta from email.utils import formatdate from urllib.parse import parse_qsl from pulsa...
# Copyright 2012 OpenStack Foundation # # 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 ...
# Python Classes/Functions used to Import Tycho Datasets # ------------------------------------- # # Python Package Importing # # ------------------------------------- # # TO-DO: Add time back to the read state function for Tyler's code # Importing Necessary System Packages import math import io import ...
# -*- coding: utf-8 -*- """ pygments.lexers.sql ~~~~~~~~~~~~~~~~~~~ Lexers for various SQL dialects and related interactive sessions. Postgres specific lexers: `PostgresLexer` A SQL lexer for the PostgreSQL dialect. Differences w.r.t. the SQL lexer are: - keywords and dat...
# -*- coding: utf-8 -*- # Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1) # # (1) Kamaelia Contributors are listed in the AUTHORS file and at # http://www.kamaelia.org/AUTHORS - please extend this file, # not this notice. # # Licensed under the Apache License, Version 2.0 (the "Lic...
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor class RestudyIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?restudy\.dk/video/play/id/(?P<id>[0-9]+)' _TEST = { 'url': 'https://www.restudy.dk/video/play/id/1637', 'info_dict': { 'id': ...
########################################################################## # # Copyright (c) 2011, 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: # # * Redistribu...
# (c) 2005 Clark C. Evans # This module is part of the Python Paste Project and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php # This code was written with funding by http://prometheusresearch.com """ Cookie "Saved" Authentication This authentication middleware saves the curren...
# -*- coding: utf-8 -*- # # Copyright (C) 2008-2009 Christopher Lenz # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. """Utility code for managing design documents.""" from copy import deepcopy from inspect import get...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Detect Screens Copyright (C) 2016 Thomaz de Oliveira dos Reis <[EMAIL]> 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 ve...
""" Copyright (c) 2017, University of Southern Denmark All rights reserved. This code is licensed under BSD 2-clause license. See LICENSE file in the project root for license terms. """ import logging import random import pandas as pd import numpy as np import copy from modestpy.estim.error import calc_err class Indi...
#******************************************************************************** #* Dionaea #* - catches bugs - #* #* #* #* Copyright (C) 2010 Markus Koetter #* #* This program is free software; you can redistribute it and/or #* modify it under the terms of the...
# -*- coding: utf-8 -*- """ werkzeug.local ~~~~~~~~~~~~~~ This module implements context-local objects. :copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from werkzeug.wsgi import ClosingIterator from werkzeug._internal import...
#!/usr/bin/python from nltk.stem.snowball import SnowballStemmer import string def parseOutText(f): """ given an opened email file f, parse out all text below the metadata block at the top (in Part 2, you will also add stemming capabilities) and return a string that contains all the words ...
#!/usr/bin/env python ############################################################################ # # MODULE: m.proj # AUTHOR: M. Hamish Bowman, Dept. Marine Science, Otago Univeristy, # New Zealand # Converted to Python by Glynn Clements # PURPOSE: cs2cs reprojection frontend for a list of coor...
# # 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...
from sympy.functions import adjoint, conjugate, transpose from sympy.matrices.expressions import MatrixSymbol, Adjoint, trace, Transpose from sympy.matrices import eye, Matrix from sympy import symbols, S from sympy import refine, Q n, m, l, k, p = symbols('n m l k p', integer=True) A = MatrixSymbol('A', n, m) B = Mat...
# -*- coding: utf-8 -*- ############################################################################### # # GetBatchRelationships # Retrieves information about a batch of relationships in LittleSis according to the relationship IDs provided. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # License...
#!/usr/bin/env python # # Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Creates a TOC file from a Java jar. The TOC file contains the non-package API of the jar. This includes all public/protected clas...
#!/usr/bin/env python3 from app import create_app, db, graph, forge from app.email import send_email from app.models import Person, Link from app.faker import fake from flask_script import Manager, Shell from flask_migrate import Migrate, MigrateCommand import os app = create_app(os.getenv('HISTORIA_CONFIG') or 'defa...
#! /usr/bin/env python """Read/write support for Maildir, mbox, MH, Babyl, and MMDF mailboxes.""" # Notes for authors of new mailbox subclasses: # # Remember to fsync() changes to disk before closing a modified file # or returning from a flush() method. See functions _sync_flush() and # _sync_close(). import sys im...
from __future__ import absolute_import import sys from pip.basecommand import Command BASE_COMPLETION = """ # pip %(shell)s completion start%(script)s# pip %(shell)s completion end """ COMPLETION_SCRIPTS = { 'bash': """ _pip_completion() { COMPREPLY=( $( COMP_WORDS="${COMP_WORDS[*]}" \\ CO...
""" Django settings for {{ project_name }} project. Generated by 'django-admin startproject' using Django {{ django_version }}. For more information on this file, see https://docs.djangoproject.com/en/{{ docs_version }}/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.c...
# -*- coding: utf-8 -*- from nose.tools import * # flake8: noqa import mock # noqa import unittest from rest_framework import fields from rest_framework.exceptions import ValidationError from api.base import utils as api_utils from tests.base import ApiTestCase from framework.status import push_status_message clas...
import filecmp import hashlib import os import random import requests import string import tempfile import traceback import uuid from io import open from unittest import mock, skip from synapseclient import File import synapseclient.core.config import synapseclient.core.utils as utils from synapseclient.core.upload.m...
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import logging import pytz import time from datetime import datetime, timedelta from openerp import _, api, fields, models from openerp.exceptions import UserError _logger = logging.getLogger(__name__) def _create_seq...
"""Test that importing modules in Objective-C works as expected.""" import unittest2 import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil class ObjCModulesTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) def setUp(self)...
""" Square path. """ from __future__ import absolute_import #Init has to be imported first because it has code to workaround the python bug where relative imports don't work if the module is imported as a main module. import __init__ from fabmetheus_utilities.geometry.creation import lineation from fabmetheus_utilit...
# pyboard testing functions for CPython import time def delay(n): #time.sleep(float(n) / 1000) pass rand_seed = 1 def rng(): global rand_seed # for these choice of numbers, see P L'Ecuyer, "Tables of linear congruential generators of different sizes and good lattice structure" rand_seed = (rand_se...
""" Python Character Mapping Codec cp424 generated from 'MAPPINGS/VENDORS/MISC/CP424.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input,errors='...
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe from frappe.utils import cint @frappe.whitelist() def add(doctype, name, user=None, read=1, write=0, share=0, everyone=0, flags=None): """Share the given document ...
#! /usr/bin/env python # Python Serial Port Extension for Win32, Linux, BSD, Jython # see __init__.py # # (C) 2001-2008 Chris Liechti <[EMAIL]> # this is distributed under a free software license, see license.txt """\ Some tests for the serial module. Part of pyserial (http://pyserial.sf.net) (C)2001-2009 [EMAIL] In...
# Copyright (c) 2010-2012 OpenStack Foundation # 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 ...
from __future__ import absolute_import from collections import deque import contextlib import errno import io import locale # we have a submodule named 'logging' which would shadow this if we used the # regular name: import logging as std_logging import re import os import posixpath import shutil import stat import su...
# Copyright (C) 2009-2014 Wander Lairson Costa # # The following terms apply to all files associated # with the software unless explicitly disclaimed in individual files. # # The authors hereby grant permission to use, copy, modify, distribute, # and license this software and its documentation for any purpose, provided...
# -*- coding: utf-8 -*- # Copyright (c) 2012 Thomas Parslow http://almostobsolete.net/ # # 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/python # -*- coding: utf-8 -*- # (c) 2014, Anders Ingemann <[EMAIL]> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
#!/usr/bin/env python # Copyright 2014 BitPay Inc. # Copyright 2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from __future__ import division,print_function,unicode_literals import os import bctest...
""" Generic FileSystem class to be used by the Content Manager """ from s3contents.ipycompat import HasTraits class GenericFS(HasTraits): def ls(self, path=""): raise NotImplementedError( "Should be implemented by the file system abstraction" ) def isfile(self, path): rai...
############################################################################# ## ## Copyright (c) 2014 Riverbank Computing Limited <[EMAIL]> ## ## This file is part of PyQt5. ## ## This file may be used under the terms of the GNU General Public License ## version 3.0 as published by the Free Software Foundation and a...
r""" ``$ mwxml inflate -h`` :: Converts a stream of flat RevisionDocument JSON blobs into hierarchical JSON RevisionDocument JSON blobs. Usage: inflate (-h|--help) inflate [<input-file>...] [--threads=<num>] [--output=<path>] [--compress=<type>] [--verbose] [--debug] O...
import contextlib import os import tarfile import zipfile from .base import maybe_requirement from .common import safe_mkdtemp from .http.link import Link from .interpreter import PythonInterpreter from .pep425 import PEP425, PEP425Extras from .platforms import Platform from pkg_resources import ( EGG_NAME, p...
#!/usr/bin/python2.4 # # Copyright 2011 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...
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2016 OSGeo # # 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 ...
# FILE: autoload/conque_term/conque_sole_communicator.py # AUTHOR: Nico Raffo <[EMAIL]> # WEBSITE: http://conque.googlecode.com # MODIFIED: 2011-09-02 # VERSION: 2.3, for Vim 7.0 # LICENSE: # Conque - Vim terminal/console emulator # Copyright (C) 2009-2011 Nico Raffo # # MIT License # # Permission is hereby gra...
# Copyright (c) 2010-2013 OpenStack Foundation # # 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 agree...
# media files conversion stuff from .colortable import ColorTable, PlayerColorTable from collections import defaultdict from . import dataformat from .drs import DRS from . import filelist from .hardcoded import termcolors import os import os.path import pickle from string import Template import subprocess from .textu...
import micropython # viper function taking and returning ints @micropython.viper def viper_int(x:int, y:int) -> int: return x + y + 3 print(viper_int(1, 2)) # viper function taking and returning objects @micropython.viper def viper_object(x:object, y:object) -> object: return x + y print(viper_object(1, 2)) ...
""" Cached, database-backed sessions. """ import logging from django.conf import settings from django.contrib.sessions.backends.db import SessionStore as DBStore from django.core.cache import caches from django.core.exceptions import SuspiciousOperation from django.utils import timezone from django.utils.encoding imp...
#!/usr/bin/python # # Copyright 2012 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 b...
from django.test import TestCase from oscar.apps.address import models, forms from oscar.core.compat import get_user_model from oscar.test.factories import UserFactory class TestUserAddressForm(TestCase): def setUp(self): self.user = UserFactory() self.country = models.Country.objects.create( ...
"""Build a language detector model The goal of this exercise is to train a linear classifier on text features that represent sequences of up to 3 consecutive characters so as to be recognize natural languages by using the frequencies of short character sequences as 'fingerprints'. """ # Author: Olivier Grisel <[EMAIL...