text
stringlengths
475
200k
# # Scanvark -- a Gtk-based batch scanning program # # Copyright (c) 2012 Benjamin Gilbert # # This program is free software; you can redistribute it and/or modify # it under the terms of version 2 of the GNU General Public License as # published by the Free Software Foundation. # # This program is distributed in the h...
#!/usr/bin/env python # -*- coding: utf-8 -*- # author B-y [EMAIL] import os import re import json import sys class Singleton(type): """docstring for Singleton""" def __init__(self, name,bases,dic): super(Singleton, self).__init__(name,bases,dic) self.instance = None def __call__(self,*args,**kwargs): if s...
''' Data structures for (Steiner) tree networks ''' import networkx as nx class Net(object): '''Network''' def __init__(self, nodes, arcs): ''' nodes: node IDs arcs: tuples of node IDs (tail, head) ''' self.dg = nx.DiGraph() self.dg.add_nodes_from(nodes) ...
data = ( '', # 0x00 '', # 0x01 'C', # 0x02 '', # 0x03 '', # 0x04 '', # 0x05 '', # 0x06 '', # 0x07 '', # 0x08 '', # 0x09 '', # 0x0a '', # 0x0b '', # 0x0c 'H', # 0x0d '', # 0x0e '', # 0x0f '', # 0x10 '', # 0x11 '', # 0x12 '', # 0x13 '', # 0x14 'N', # 0x15 ...
#!/usr/bin/env python import new from plasTeX import Command, Environment from plasTeX.Base.LaTeX.Floats import Float, Caption class newfloat(Command): args = 'name:str pos:str capfile:str [ reset:str ]' def invoke(self, tex): Command.invoke(self, tex) name = str(self.attributes['name']) ...
""" ===================================================================== Decision boundary of label propagation versus SVM on the Iris dataset ===================================================================== Comparison for decision boundary generated on iris dataset between Label Propagation and SVM. This demon...
import json import uuid from rest_framework.authtoken.models import Token ALL_METHODS = ('get', 'post', 'put', 'patch', 'delete') def token_authenticate(api_client, user): token, _ = Token.objects.get_or_create(user=user) api_client.credentials(HTTP_AUTHORIZATION='ApiKey ' + token.key) return api_client...
# -*- coding: utf-8 -*- from django.db import models from admin_sort.models import SortableModelMixin class Author(SortableModelMixin, models.Model): """ SortableModelMixin: on save, intercept and first update needed other instances, then save """ name = models.CharField('Name', null=True, blank=...
# coding: utf-8 # Author: Johannes Schönberger # # License: BSD 3 clause import numpy as np import warnings from ..base import BaseEstimator, MetaEstimatorMixin, RegressorMixin, clone from ..utils import check_random_state, check_array, check_consistent_length from ..utils.random import sample_without_replacement fr...
from __future__ import unicode_literals import codecs import os import re from django.conf import settings from django.core.management.base import CommandError from django.db import models from django.db.models import get_models from django.utils._os import upath def sql_create(app, style, connection): "Returns...
# Authors: Dirko Coetsee # License: 3-clause BSD """ Implements a Hidden Alignment Conditional Random Field (HACRF). """ from __future__ import absolute_import import numpy as np import lbfgs from .algorithms import forward, backward from .algorithms import forward_predict, forward_max_predict from .algorithms import...
# -*- coding: utf-8 -*- # Copyright (c) 2010, Almar Klein, Ant1, Marius van Voorden # # This code is subject to the (new) BSD license: # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of s...
from __future__ import absolute_import, unicode_literals from distutils.version import LooseVersion from sqlalchemy.sql.expression import ClauseElement from flask import Flask import json import requests from gitlab_freak.models import db, ProjectDependency import gitlab app = Flask(__name__) app.config.from_envvar...
# # constants_text.py: text mode constants # # Copyright (C) 2000, 2001, 2002 Red Hat, Inc. All rights reserved. # # 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 Licen...
# Copyright (c) 2015 SONATA-NFV, UBIWHERE # 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 app...
from __future__ import absolute_import, division import time import os try: unicode except NameError: unicode = str from . import LockBase, NotLocked, NotMyLock, LockTimeout, AlreadyLocked class SQLiteLockFile(LockBase): "Demonstrate SQL-based locking." testdb = None def __init__(self, path, t...
""" Proxy Backends ------------------ Provides a utility and a decorator class that allow for modifying the behavior of different backends without altering the class itself or having to extend the base backend. .. versionadded:: 0.5.0 Added support for the :class:`.ProxyBackend` class. """ from .api import CacheBa...
# pylint: disable=missing-docstring from collections import OrderedDict, defaultdict import select import socket import sys class Style(object): RESET = 0 BOLD = 1 UNDERSCORE = 4 BLINK = 5 INVERT = 7 CONCEAL = 8 FG_BLACK = 30 FG_RED = 31 FG_GREEN = 32 FG_YELLOW = 33 FG_BLU...
#!/usr/bin/env python import os import subprocess import sys jq_paths = ["/usr/local/bin/jq", "/Users/nst/bin/jq"] dir_path = "/Users/nst/Projects/dropbox/JSON/test_cases/" existing_jq_paths = [p for p in jq_paths if os.path.exists(p)] if len(existing_jq_paths) == 0: print "-- cannot find jq" sys.exit(1) jq...
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
from contextlib import contextmanager from logbook import FileHandler from zipline.finance.blotter import ORDER_STATUS from six import itervalues import pandas as pd def to_utc(time_str): return pd.Timestamp(time_str, tz='US/Eastern').tz_convert('UTC') def setup_logger(test, path='test.log'): test.log_han...
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_str, compat_urllib_parse_urlencode, ) from ..utils import ( ExtractorError, int_or_none, try_get, ) class SohuIE(InfoExtractor): _VALID_URL = r'https?://(?P<mytv>...
# -*- coding: utf-8 -*- """ flask.app ~~~~~~~~~ This module implements the central WSGI application object. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import os import sys from threading import Lock from datetime import timedelta from itertools import...
""" plugins """ from __future__ import absolute_import, division, print_function from collections import defaultdict import logging import itertools import os import imp import traceback from mcedit2 import editortools from mcedit2.editortools import generate from mcedit2.util import load_ui from mcedit2.util.setti...
from __future__ import unicode_literals import base64 import calendar import datetime import re import sys from binascii import Error as BinasciiError from email.utils import formatdate from django.utils.datastructures import MultiValueDict from django.utils.encoding import force_str, force_text from django.utils.fu...
# Volatility # Copyright (C) 2007-2013 Volatility Foundation # # This file is part of Volatility. # # Volatility 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 o...
""" Analyze a historical week to understand Firefox churn. """ import healthreportutils from datetime import date, datetime, timedelta import os, shutil, csv import sys, codecs import traceback import mrjob from mrjob.job import MRJob import tempfile try: import simplejson as json except ImportError: import ...
#!/usr/bin/python2.5 # Copyright 2009 Google Inc. # All Rights Reserved. """Prints the information in a sln file in a diffable way. It first outputs each projects in alphabetical order with their dependencies. Then it outputs a possible build order. """ __author__ = 'nsylvain (Nicolas Sylvain)' import os ...
import math import json import weakref from jmespath import exceptions from jmespath.compat import string_type as STRING_TYPE from jmespath.compat import get_methods # python types -> jmespath types TYPES_MAP = { 'bool': 'boolean', 'list': 'array', 'dict': 'object', 'NoneType': 'null', 'unicode':...
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. import itertools import json import os import unittest import numpy as np from monty.json import MontyDecoder from pymatgen.core.periodic_table import Element from pymatgen.core.lattice import Lattice from p...
#!/usr/bin/env python # # Copyright 2007 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...
# ----------------------------------------------------------------------- # This is an example illustrating how to implement a CLI # (c) Hex-Rays # from idaapi import NW_OPENIDB, NW_CLOSEIDB, NW_TERMIDA, NW_REMOVE, COLSTR, cli_t #<pycode(ex_cli_ex1)> class mycli_t(cli_t): flags = 0 sname = "pycli" ...
# Copyright (c) 2006,2007,2008 Mitch Garnaat http://garnaat.org/ # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy,...
#-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # d$ # # This program is free software: you can redistribute it and/or modify # it ...
#-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # d$ # # This program is free software: you can redistribute it and/or modify # it ...
# -*- coding: utf-8 -*- # Copyright 2017, Digital Reasoning # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# Copyright 2011 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
from django.test import TestCase,Client from httmock import urlmatch, response, HTTMock import os from django.contrib.auth.models import User from django.template.defaultfilters import slugify from .models import * def register_valid_proxy(name,url,refresh=100): p = SourceDocument.objects.create(Name=name,Source...
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2021, Anaconda, Inc. All rights reserved. # # Powered by the Bokeh Development Team. # # The full license is in the file LICENSE.txt, distributed with this software. #---------------------------------------------------...
# -*- coding: utf-8 -*- # Copyright (c) 2011 Mitch Garnaat http://garnaat.org/ # 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 # witho...
from __future__ import unicode_literals import json import re from .common import InfoExtractor from ..compat import compat_str from ..utils import ( int_or_none, try_get, ) class TEDIE(InfoExtractor): IE_NAME = 'ted' _VALID_URL = r'''(?x) (?P<proto>https?://) (?P<type>www|embed(?:-...
# Copyright 2011, Google 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: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
import json import logging import mongoengine as me import rmc.shared.util as util class AggregateRating(me.EmbeddedDocument): rating = me.FloatField(min_value=0.0, max_value=1.0, default=0.0) count = me.IntField(min_value=0, default=0) sorting_score_positive = me.FloatField( min_value=0.0, max_...
# -*- coding: utf-8 -*- """ *************************************************************************** GdalAlgorithmTests.py --------------------- Date : January 2016 Copyright : (C) 2016 by Matthias Kuhn Email : [EMAIL] ***********************************...
# -*- coding: utf-8 -*- # Copyright 2012 Dag Wieers <[EMAIL]> # # 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)...
""" Django settings for example project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) im...
# -*- coding: utf-8 -*- """ requests.models ~~~~~~~~~~~~~~~ This module contains the primary objects that power Requests. """ import collections import datetime from io import BytesIO, UnsupportedOperation from .hooks import default_hooks from .structures import CaseInsensitiveDict from .auth import HTTPBasicAuth ...
# Copyright (C) 2010-2011 Richard Lincoln # # 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...
# encoding: utf-8 # Copyright 2011 Tree.io Limited # This file is part of Treeio. # License www.tree.io/license # -*- coding: utf-8 -*- import handlers from treeio.core.api.auth import auth_engine from treeio.core.api.doc import documentation_view from treeio.core.api.resource import CsrfExemptResource from django.c...
# Copyright (C) 2014-2015 LiuLang <[EMAIL]> # Use of this source code is governed by GPLv3 license that can be found # in http://www.gnu.org/licenses/gpl-3.0.html import os import time from gi.repository import Gtk from bcloud import Config _ = Config._ from bcloud import util from bcloud.Widgets import LeftLabel f...
# -*- coding: utf-8 -*- import logging import pprint import werkzeug from openerp import http, SUPERUSER_ID from openerp.http import request _logger = logging.getLogger(__name__) class OgoneController(http.Controller): _accept_url = '/payment/ogone/test/accept' _decline_url = '/payment/ogone/test/decline' ...
# Copyright (c) 2013 Dell Inc. # Copyright 2013 OpenStack 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 # # Unle...
""" The :mod:`sklearn.covariance` module includes methods and algorithms to robustly estimate the covariance of features given a set of points. The precision matrix defined as the inverse of the covariance is also estimated. Covariance estimation is closely related to the theory of Gaussian Graphical Models. """ from ...
import re from datetime import datetime from html import unescape from pathlib import Path from random import choice, random from typing import List, Tuple, Union from aiohttp_wrapper import SessionManager from discord import Embed, File from minoshiro import Medium, Site from bot.anime_searcher import AnimeSearcher ...
#!/usr/bin/python """Create new scenario test instance from an existing results directory. This automates creation of regression tests for the results parsers. There are 2 primary use cases for this. 1) Bug fixing: Parser broke on some input in the field and we want to start with a test that operates on that input an...
# # 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 django.db.backends.sqlite3.schema import DatabaseSchemaEditor from django.db.utils import DatabaseError class SpatialiteSchemaEditor(DatabaseSchemaEditor): sql_add_geometry_column = ( "SELECT AddGeometryColumn(%(table)s, %(column)s, %(srid)s, " "%(geom_type)s, %(dim)s, %(null)s)" ) sq...
# -*- coding: utf-8 -*- """Django CMS come with a set of ready to use widgets that you can enable in the admin via a placeholder tag in your template.""" from pages.settings import PAGES_MEDIA_URL, PAGE_TAGGING from pages.settings import PAGE_TINYMCE, PAGE_LANGUAGES from pages.models import Page from pages.widgets_reg...
# Ask vnc text spoke # # Copyright (C) 2013 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. # This program is distributed in the...
#!/usr/bin/python # Copyright 2014 Jens Carl, Hothead Games Inc. # 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', 'stat...
#!/usr/bin/env python2 # #Copyright 2016 Allan Haldane. #This file is part of IvoGPU. #IvoGPU is free software: you can redistribute it and/or modify #it under the terms of the GNU General Public License as published by #the Free Software Foundation, version 3 of the License. #IvoGPU is distributed in the hope that ...
#!/usr/bin/env python # coding: utf-8 """ Tests for metrics module in machine learning. """ import unittest from simpleai.machine_learning.metrics import Counter, OnlineEntropy, \ OnlineLogProbability, \ OnlineInformationGain ...
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
from future import standard_library standard_library.install_aliases() import logging import json import re import fnmatch import configparser from urllib.parse import urlparse import boto from boto.s3.connection import S3Connection from boto.sts import STSConnection boto.set_stream_logger('boto') logging.getLogger("b...
from __future__ import print_function, division from itertools import product from sympy.core.sympify import _sympify, sympify from sympy.core.basic import Basic from sympy.core.singleton import Singleton, S from sympy.core.evalf import EvalfMixin from sympy.core.numbers import Float from sympy.core.compatibility imp...
from collections import namedtuple from contextlib import contextmanager from threading import Barrier from typing import List, Callable import numpy from ._dtype import DType, combine_types SolveResult = namedtuple('SolveResult', [ 'method', 'x', 'residual', 'iterations', 'function_evaluations', 'converged', '...
"""Lattice module. In this module the lattice of the corresponding accelerator is defined. """ import math as _math from pyaccel import lattice as _pyacc_lat, elements as _pyacc_ele, \ accelerator as _pyacc_acc, optics as _pyacc_opt from . import segmented_models as _segmented_models energy = 0.150e9 # [eV] def...
INITIALISED = False babel = None babelPresetEs2015 = None def js6_to_js5(code): global INITIALISED, babel, babelPresetEs2015 if not INITIALISED: import signal, warnings, time warnings.warn('\nImporting babel.py for the first time - this can take some time. \nPlease note that currently Javascrip...
#!/usr/bin/python # Copyright (c) 2010 [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 version 3 of the License, or (at your option) any later # version. # # This program is di...
# Copyright (c) 2012, Willow Garage, 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: # # * Redistributions of source code must retain the above copyright # notice, this list of cond...
# Copyright 2013 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 ag...
# Copyright 2007 by Michiel de Hoon. All rights reserved. # This code is part of the Biopython distribution and governed by its # license. Please see the LICENSE file that should have been included # as part of this package. """Code to work with the sprotXX.dat file from SwissProt. http://www.expasy.ch/sprot/sprot-t...
import platform, os, logging_subprocess, random, string, logging, sys, json, urllib2, fileinput logger = logging.getLogger() string_pool = string.ascii_letters + string.digits gen_random_text = lambda s: ''.join(map(lambda _: random.choice(string_pool), range(s))) def run_command(cmd): return not (logging_subpro...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.template.defaultfilters import truncatewords_html from django.test import SimpleTestCase class FunctionTests(SimpleTestCase): def test_truncate_zero(self): self.assertEqual(truncatewords_html('<p>one <a href="#">two - three <br>...
#################################################################################################### # Copyright 2013 John Crawford # # This file is part of PatchCorral. # # PatchCorral is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by ...
#!/usr/bin/python # # Copyright (C) 2008 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 ...
#!/usr/bin/env python # # Copyright 2008, Google 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: # # * Redistributions of source code must retain the above copyright # notice, this list...
""" WSGI config for cigar_example project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICAT...
import unittest, sys from ctypes import * import _ctypes_test ctype_types = [c_byte, c_ubyte, c_short, c_ushort, c_int, c_uint, c_long, c_ulong, c_longlong, c_ulonglong, c_double, c_float] python_types = [int, int, int, int, int, int, int, int, int, int, float, float] class PointersT...
#!/usr/bin/python2.7 # Copyright 2011 Google Inc. All Rights Reserved. """Targets class describes which languages/platforms we support.""" __author__ = '[EMAIL] (Will Clarkson)' import logging import os from googleapis.codegen.filesys import files from googleapis.codegen.utilities import json_expander from googlea...
"""Extensions to the 'distutils' for large or complex distributions""" import os import sys import distutils.core import distutils.filelist from distutils.core import Command as _Command from distutils.util import convert_path from fnmatch import fnmatchcase import setuptools.version from setuptools.extension import ...
import logging import traceback from datetime import date from django.conf import settings from django.contrib.sites.models import Site from django.db import connection, transaction # NOTE: This import is just so _fire_task gets registered with celery. import tidings.events # noqa from celery import task from multid...
# coding: utf-8 import logging import requests from odoo import api, fields, models, _ from odoo.addons.payment.models.payment_acquirer import ValidationError from odoo.exceptions import UserError from odoo.tools.safe_eval import safe_eval _logger = logging.getLogger(__name__) # Force the API version to avoid break...
# -*- coding: utf-8 -*- """ hyperframe/flags ~~~~~~~~~~~~~~~~ Defines basic Flag and Flags data structures. """ import collections Flag = collections.namedtuple("Flag", ["name", "bit"]) class Flags(collections.MutableSet): """ A simple MutableSet implementation that will only accept known flags as elements...
import re from io import BytesIO from time import sleep from livestreamer.exceptions import PluginError from livestreamer.packages.flashmedia import AMFPacket, AMFMessage from livestreamer.packages.flashmedia.types import AMF3ObjectBase from livestreamer.plugin import Plugin from livestreamer.plugin.api import http, ...
############################################################################## # # Copyright (c) 2005 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOF...
#!/usr/bin/env python # Copyright (c) 2010 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. """Unit tests for coverage_posix.py. Run a single test with a command such as: ./coverage_posix_unittest.py CoveragePosixTest.te...
from django.db import models from jsonfield import JSONField from .permissions import UserCanReadExamAssignmentData from .permissions import UserCanReadExamData from kolibri.core.auth.constants import role_kinds from kolibri.core.auth.models import AbstractFacilityDataModel from kolibri.core.auth.models import Collect...
# Util.py - Python extension for perf script, miscellaneous utility code # # Copyright (C) 2010 by Tom Zanussi <[EMAIL]> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. import errno, os FUTEX_WAIT = 0 FUTEX_WAKE...
"""Timezone helper functions. This module uses pytz when it's available and fallbacks when it isn't. """ from datetime import datetime, timedelta, tzinfo from threading import local import time as _time try: import pytz except ImportError: pytz = None from django.conf import settings __all__ = [ 'utc',...
#!/usr/bin/env python # # Copyright (c) 2015 Intel Corporation. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of works must retain the original copyright notice, this # list of conditions and t...
""" Tests to verify that CorrectMap behaves correctly """ import unittest from capa.correctmap import CorrectMap import datetime class CorrectMapTest(unittest.TestCase): """ Tests to verify that CorrectMap behaves correctly """ def setUp(self): super(CorrectMapTest, self).setUp() sel...
from .bases import _StandardStemmer from whoosh.compat import u class DutchStemmer(_StandardStemmer): """ The Dutch Snowball stemmer. :cvar __vowels: The Dutch vowels. :type __vowels: unicode :cvar __step1_suffixes: Suffixes to be deleted in step 1 of the algorithm. :type __step1_suffixes: t...
# Copyright (c) 2014 Adafruit Industries # Author: Tony DiCola # # 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, m...
#!/usr/bin/env python """ Python script for building documentation. To build the docs you must have all optional dependencies for pandas installed. See the installation instructions for a list of these. <del>Note: currently latex builds do not work because of table formats that are not supported in the latex generat...
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Prints the information in a sln file in a diffable way. It first outputs each projects in alphabetical order with their dependenci...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
# subprocess - Subprocesses with accessible I/O streams # # For more information about this module, see PEP 324. # # This module should remain compatible with Python 2.2, see PEP 291. # # Copyright (c) 2003-2005 by Peter Astrand <[EMAIL]> # # Licensed to PSF under a Contributor Agreement. # See http://www.pyth...
#!/usr/bin/env python ''' sweety.loader This module contains the functions for loading modules. @author: Chris Chou <m2chrischou AT gmail.com> @description: ''' import os import sys import traceback from sweety.log import get_logger def load_file(filename): ''' load_file(filename) -> module Loads...
# # 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 later version. # # Ansible is distributed in the hope tha...