repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
x2Ident/x2Ident_test
mitmproxy/examples/sslstrip.py
2
1283
import re from six.moves import urllib # set of SSL/TLS capable hosts secure_hosts = set() def request(flow): flow.request.headers.pop('If-Modified-Since', None) flow.request.headers.pop('Cache-Control', None) # proxy connections to SSL-enabled hosts if flow.request.pretty_host in secure...
gpl-3.0
jeremiahyan/odoo
addons/hr_holidays/tests/common.py
5
2162
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo.addons.mail.tests.common import mail_new_test_user from odoo.tests import common class TestHrHolidaysCommon(common.TransactionCase): def setUp(self): super(TestHrHolidaysCommon, self).setUp() ...
gpl-3.0
yonatang/networks-pa1
tests/unit/openflow/switch_impl_test.py
6
5487
#!/usr/bin/env python import unittest import sys import os.path from copy import copy sys.path.append(os.path.dirname(__file__) + "/../../..") from pox.openflow.libopenflow_01 import * from pox.openflow.switch_impl import * class MockConnection(object): def __init__(self): self.ofp_handlers = {} self.rece...
gpl-3.0
largelymfs/paragraph2vec
gensim/scripts/make_wiki.py
76
4327
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz> # Copyright (C) 2012 Lars Buitinck <larsmans@gmail.com> # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """ USAGE: %(program)s WIKI_XML_DUMP OUTPUT_PREFIX [VOCABULARY_SIZE] Convert a...
gpl-3.0
eric-haibin-lin/mxnet
tools/coreml/converter/_mxnet_converter.py
7
8982
from __future__ import print_function # 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, Versio...
apache-2.0
kingmotley/SickRage
lib/hachoir_core/field/helper.py
95
1897
from hachoir_core.field import (FieldError, RawBits, RawBytes, PaddingBits, PaddingBytes, NullBits, NullBytes, GenericString, GenericInteger) from hachoir_core.stream import FileOutputStream def createRawField(parent, size, name="raw[]", description=None): if size <= 0: raise FieldError("Un...
gpl-3.0
jendap/tensorflow
tensorflow/contrib/gan/__init__.py
11
1979
# Copyright 2017 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 agree...
apache-2.0
prashanthpai/swift
swift/proxy/controllers/obj.py
1
114923
# 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 agree...
apache-2.0
roidelapluie/Lexpage
app/blog/views.py
1
13694
from django.contrib.auth.models import User from django.http import Http404 from django.core.urlresolvers import reverse_lazy, reverse from django.template.defaultfilters import force_escape from django.views.generic import ListView, TemplateView, RedirectView from django.views.generic.edit import FormView from djang...
gpl-3.0
calou/compose
compose/cli/docker_client.py
26
1124
from docker import Client from docker import tls import ssl import os def docker_client(): """ Returns a docker-py client configured using environment variables according to the same logic as the official Docker client. """ cert_path = os.environ.get('DOCKER_CERT_PATH', '') if cert_path == '':...
apache-2.0
tumbl3w33d/ansible
lib/ansible/modules/cloud/misc/proxmox_kvm.py
3
44852
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2016, Abdoul Bah (@helldorado) <bahabdoul at gmail.com> # 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 = {'m...
gpl-3.0
lmazuel/ansible
lib/ansible/modules/cloud/docker/docker_service.py
47
36552
#!/usr/bin/python # # Copyright 2016 Red Hat | Ansible # # 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 la...
gpl-3.0
YYMo/sdn_project
pox/web/webcore.py
40
15724
# Copyright 2011,2012 James McCauley # # 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 ...
apache-2.0
joariasl/odoo
openerp/addons/test_workflow/models.py
337
2268
# -*- coding: utf-8 -*- import openerp.osv.orm class m(openerp.osv.orm.Model): """ A model for which we will define a workflow (see data.xml). """ _name = 'test.workflow.model' def print_(self, cr, uid, ids, s, context=None): print ' Running activity `%s` for record %s' % (s, ids) return ...
agpl-3.0
GuidoZhang/PyVC
PyVC/env/Lib/linecache.py
107
4027
"""Cache lines from files. This is intended to read lines from modules imported -- hence if a filename is not found, it will look down the module search path for a file by that name. """ import sys import os __all__ = ["getline", "clearcache", "checkcache"] def getline(filename, lineno, module_globals=None): li...
mit
aburan28/elements
qa/rpc-tests/rpcbind_test.py
166
5743
#!/usr/bin/env python2 # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Test for -rpcbind, as well as -rpcallowip and -rpcconnect # Add python-bitcoinrpc to module search path: im...
mit
markYoungH/chromium.src
chrome/test/chromedriver/server/server.py
121
2131
# 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. import atexit import os import socket import subprocess import time import urllib2 class Server(object): """A running ChromeDriver server.""" def __in...
bsd-3-clause
ofermend/medicare-demo
socialite/jython/Lib/test/test_wsgiref.py
23
17925
from __future__ import nested_scopes # Backward compat for 2.1 from unittest import TestSuite, TestCase, makeSuite from wsgiref.util import setup_testing_defaults from wsgiref.headers import Headers from wsgiref.handlers import BaseHandler, BaseCGIHandler from wsgiref import util from wsgiref.validate import validat...
apache-2.0
b-deng/mailinabox
management/backup.py
2
15036
#!/usr/bin/python3 # This script performs a backup of all user data: # 1) System services are stopped while a copy of user data is made. # 2) An incremental encrypted backup is made using duplicity into the # directory STORAGE_ROOT/backup/encrypted. The password used for # encryption is stored in backup/secret_k...
cc0-1.0
uw-it-aca/spotseeker_server
spotseeker_server/test/uw_spot/spot_put.py
1
12914
# Copyright 2021 UW-IT, University of Washington # SPDX-License-Identifier: Apache-2.0 from django.test import TransactionTestCase from django.conf import settings from django.test.client import Client from spotseeker_server.models import Spot, SpotExtendedInfo import simplejson as json import random from django.test....
apache-2.0
PaddlePaddle/Paddle
python/paddle/fluid/tests/unittests/mkldnn/test_matmul_bf16_mkldnn_op.py
1
6388
# Copyright (c) 2020 PaddlePaddle 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 appli...
apache-2.0
catapult-project/catapult-csm
third_party/mapreduce/mapreduce/tools/gcs_file_seg_reader.py
41
3152
#!/usr/bin/env python """A simple reader for file segs produced by GCS output writer.""" from mapreduce import output_writers # pylint: disable=protected-access # pylint: disable=invalid-name # pylint: disable=g-import-not-at-top # TODO(user): Cleanup imports if/when cloudstorage becomes part of runtime. try: # Ch...
bsd-3-clause
greatscottgadgets/greatfet
host/greatfet/interfaces/i2c/pca6408a.py
2
4062
# # This file is part of GreatFET # from ..gpio import GPIOProvider, Directions from .register_based import I2CRegisterBasedDevice class PCA6048A(I2CRegisterBasedDevice, GPIOProvider): """ Class representing a PCA6048A I/O expander. """ # Default to an address of 0x20. This can also be set to 0x21 by pulling...
bsd-3-clause
renyi533/tensorflow
third_party/toolchains/preconfig/ubuntu16.04/gcc7_manylinux2010-nvcc-cuda10.0/windows/msvc_wrapper_for_nvcc.py
4
7067
#!/usr/bin/env python # 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 # # Unle...
apache-2.0
mancoast/CPythonPyc_test
cpython/272_test_mutants.py
109
8502
from test.test_support import verbose, TESTFN import random import os # From SF bug #422121: Insecurities in dict comparison. # Safety of code doing comparisons has been an historical Python weak spot. # The problem is that comparison of structures written in C *naturally* # wants to hold on to things like the size ...
gpl-3.0
DirkHoffmann/indico
indico/core/settings/models/settings.py
4
1398
# This file is part of Indico. # Copyright (C) 2002 - 2021 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from sqlalchemy.ext.declarative import declared_attr from indico.core.db.sqlalchemy import db from indico...
gpl-3.0
johankaito/fufuka
microblog/venv/lib/python2.7/site-packages/pip/_vendor/requests/structures.py
1160
2977
# -*- coding: utf-8 -*- """ requests.structures ~~~~~~~~~~~~~~~~~~~ Data structures that power Requests. """ import collections class CaseInsensitiveDict(collections.MutableMapping): """ A case-insensitive ``dict``-like object. Implements all methods and operations of ``collections.MutableMapping...
apache-2.0
ThinkOpen-Solutions/odoo
addons/account/wizard/account_move_line_unreconcile_select.py
385
1864
# -*- 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...
agpl-3.0
georgecpr/openthread
tests/scripts/thread-cert/Cert_7_1_02_BorderRouterAsRouter.py
3
4675
#!/usr/bin/env python # # Copyright (c) 2016, The OpenThread Authors. # 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 copyright # ...
bsd-3-clause
FredLoney/nipype
nipype/interfaces/meshfix.py
1
7183
from nipype.interfaces.base import (CommandLine, CommandLineInputSpec, traits, TraitedSpec, isdefined, File) import os, os.path as op from nipype.utils.filemanip import split_filename class MeshFixInputSpec(CommandLineInputSpec): number_of_biggest_shells = traits.Int(argstr='--shells %d', desc="Onl...
bsd-3-clause
iouri-s/azure-quickstart-templates
elasticsearch-centos-3node/elasticinstall.py
168
2840
#!/usr/bin/env python import subprocess import socket import sys clustername = sys.argv[1] number_nodes = sys.argv[2] accountname = sys.argv[3] accountkey = sys.argv[4] print"inputs:\n" print "clustername = " + clustername print "accontname = " + accountname print "accountkey = " + accountkey hostname = socket...
mit
germanop/sm
drivers/DummySR.py
2
11586
#!/usr/bin/env python # # Copyright (C) Citrix Systems Inc. # # This program 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; version 2.1 only. # # This program is distributed in the hope that it will ...
lgpl-2.1
robertmattmueller/sdac-compiler
sympy/mpmath/functions/hypergeometric.py
18
51574
from ..libmp.backend import xrange from .functions import defun, defun_wrapped def _check_need_perturb(ctx, terms, prec, discard_known_zeros): perturb = recompute = False extraprec = 0 discard = [] for term_index, term in enumerate(terms): w_s, c_s, alpha_s, beta_s, a_s, b_s, z = term h...
gpl-3.0
iamroot12D/linux
Documentation/networking/cxacru-cf.py
14668
1626
#!/usr/bin/env python # Copyright 2009 Simon Arlott # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the Free # Software Foundation; either version 2 of the License, or (at your option) # any later version. # # This program i...
gpl-2.0
dracony/scrapy
tests/test_dupefilters.py
110
2315
import hashlib import tempfile import unittest import shutil from scrapy.dupefilters import RFPDupeFilter from scrapy.http import Request from scrapy.utils.python import to_bytes class RFPDupeFilterTest(unittest.TestCase): def test_filter(self): dupefilter = RFPDupeFilter() dupefilter.open() ...
bsd-3-clause
harta55/EnTAP
libs/TransDecoder-v5.3.0/util/misc/select_TD_orfs.py
2
8463
#!/usr/bin/env python import sys, os, re import collections ORIG_TRANSDECODER_FLAG = False def main(): import argparse parser = argparse.ArgumentParser(description="transdecoder orf selection algorithm", formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument("--long_orfs_cds"...
gpl-3.0
txemi/ansible
test/units/modules/network/ios/ios_module.py
59
3255
# (c) 2016 Red Hat 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 your option) any later version. # # Ansible is dis...
gpl-3.0
moble/sympy
sympy/liealgebras/type_b.py
76
4651
from __future__ import print_function, division from .cartan_type import Standard_Cartan from sympy.core.compatibility import range from sympy.matrices import eye class TypeB(Standard_Cartan): def __new__(cls, n): if n < 2: raise ValueError("n can not be less than 2") return Standard_...
bsd-3-clause
ultimanet/nifty
rg/nifty_power_conversion_rg.py
1
5663
## NIFTY (Numerical Information Field Theory) has been developed at the ## Max-Planck-Institute for Astrophysics. ## ## Copyright (C) 2014 Max-Planck-Society ## ## Author: Maksim Greiner, Marco Selig ## Project homepage: <http://www.mpa-garching.mpg.de/ift/nifty/> ## ## This program is free software: you can redistribu...
gpl-3.0
janezhango/BigDataMachineLearning
py/testdir_single_jvm/test_GLM2_syn_eqns_data.py
2
11570
import unittest, random, sys, time, math sys.path.extend(['.','..','py']) import h2o, h2o_cmd, h2o_hosts, h2o_browse as h2b, h2o_import as h2i, h2o_glm BINS = 100 def gen_rand_equation(colCount, INTCPT_VALUE_MIN, INTCPT_VALUE_MAX, COEFF_VALUE_MIN, COEFF_VALUE_MAX, SEED): r1 = random.Random(SEED) coeffi...
apache-2.0
hsharsha/depot_tools
third_party/protobuf26/text_format.py
26
26949
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions o...
bsd-3-clause
DazWorrall/ansible
test/units/modules/network/cumulus/test_nclu.py
55
9561
# -*- coding: utf-8 -*- # (c) 2016, Cumulus Networks <ce-ceng@cumulusnetworks.com> # # This file is part of Ansible # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, o...
gpl-3.0
doganov/edx-platform
lms/djangoapps/notifier_api/serializers.py
61
2580
from django.contrib.auth.models import User from django.http import Http404 from rest_framework import serializers from openedx.core.djangoapps.course_groups.cohorts import is_course_cohorted from notification_prefs import NOTIFICATION_PREF_KEY from lang_pref import LANGUAGE_KEY class NotifierUserSerializer(serializ...
agpl-3.0
huntxu/neutron
neutron/tests/unit/objects/test_network.py
1
8758
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
apache-2.0
ftomassetti/intellij-community
python/lib/Lib/dbexts.py
74
25541
# $Id: dbexts.py 6638 2009-08-10 17:05:49Z fwierzbicki $ """ This script provides platform independence by wrapping Python Database API 2.0 compatible drivers to allow seamless database usage across implementations. In order to use the C version, you need mxODBC and mxDateTime. In order to use the Java version, you n...
apache-2.0
cesarmarinhorj/phantomjs
src/qt/qtwebkit/Source/ThirdParty/gtest/test/gtest_throw_on_failure_test.py
2917
5766
#!/usr/bin/env python # # Copyright 2009, 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...
bsd-3-clause
OCA/social
mass_mailing_partner/tests/test_partner_mail_list_wizard.py
1
1684
# Copyright 2015 Pedro M. Baeza <pedro.baeza@tecnativa.com> # Copyright 2015 Antonio Espinosa <antonio.espinosa@tecnativa.com> # Copyright 2015 Javier Iniesta <javieria@antiun.com> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from . import base from odoo.exceptions import UserError class Part...
agpl-3.0
semonte/intellij-community
python/lib/Lib/distutils/archive_util.py
85
6231
"""distutils.archive_util Utility functions for creating archive files (tarballs, zip files, that sort of thing).""" # This module should be kept compatible with Python 2.1. __revision__ = "$Id: archive_util.py 37828 2004-11-10 22:23:15Z loewis $" import os from distutils.errors import DistutilsExecError from distu...
apache-2.0
sdopoku/flask-hello-world
venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/_collections.py
310
3111
# urllib3/_collections.py # Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt) # # This module is part of urllib3 and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php from collections import MutableMapping try: from threading import RLock except ImportE...
gpl-2.0
datakortet/django-cms
cms/plugins/text/widgets/tinymce_widget.py
6
4065
from cms.utils import cms_static_url from cms.utils.conf import get_cms_setting from django.forms.widgets import flatatt from django.template.defaultfilters import escape from django.template.loader import render_to_string from django.utils import simplejson from django.utils.encoding import smart_unicode from django.u...
bsd-3-clause
karstenw/nodebox-pyobjc
examples/Extended Application/matplotlib/examples/api/quad_bezier.py
1
1362
""" ============ Bezier Curve ============ This example showcases the PathPatch object to create a Bezier polycurve path patch. """ import matplotlib.path as mpath import matplotlib.patches as mpatches import matplotlib.pyplot as plt # nodebox section if __name__ == '__builtin__': # were in nodebox import os...
mit
elastic/elasticsearch-lang-groovy
dev-tools/build_release.py
4
29058
# Licensed to Elasticsearch under one or more contributor # license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright # ownership. Elasticsearch licenses this file to you under # the Apache License, Version 2.0 (the "License"); you may # not use this file except...
apache-2.0
GhostThrone/django
django/utils/timezone.py
338
11027
""" Timezone-related classes and functions. This module uses pytz when it's available and fallbacks when it isn't. """ import sys import time as _time from datetime import datetime, timedelta, tzinfo from threading import local from django.conf import settings from django.utils import lru_cache, six from django.util...
bsd-3-clause
popazerty/try
lib/python/Components/Converter/PliExtraInfo.py
5
25013
# shamelessly copied from pliExpertInfo (Vali, Mirakels, Littlesat) from enigma import iServiceInformation, iPlayableService from Components.Converter.Converter import Converter from Components.Element import cached from Components.config import config from Tools.Transponder import ConvertToHumanReadable from Tools.Ge...
gpl-2.0
robovm/robovm-studio
plugins/hg4idea/testData/bin/mercurial/branchmap.py
91
8953
# branchmap.py - logic to computes, maintain and stores branchmap for local repo # # Copyright 2005-2007 Matt Mackall <mpm@selenic.com> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. from node import bin, hex, nullid, nullrev imp...
apache-2.0
shenzebang/scikit-learn
sklearn/feature_extraction/image.py
263
17600
""" The :mod:`sklearn.feature_extraction.image` submodule gathers utilities to extract features from images. """ # Authors: Emmanuelle Gouillart <emmanuelle.gouillart@normalesup.org> # Gael Varoquaux <gael.varoquaux@normalesup.org> # Olivier Grisel # Vlad Niculae # License: BSD 3 clause fro...
bsd-3-clause
lduarte1991/edx-platform
openedx/core/djangoapps/programs/utils.py
1
31934
# -*- coding: utf-8 -*- """Helper functions for working with Programs.""" import datetime import logging from collections import defaultdict from copy import deepcopy from itertools import chain from urlparse import urljoin from dateutil.parser import parse from django.conf import settings from django.contrib.auth imp...
agpl-3.0
ArthurGarnier/SickRage
lib/tmdb_api/test_tmdb_api.py
52
5468
""" test.py contains unit tests for tmdbsimple.py Fill in Global Variables below before running tests. Created by Celia Oakley on 2013-11-05 """ import unittest import sys from tmdb_api import TMDB # # Global Variables (fill in or put in keys.py) # TMDB_API_KEY = 'edc5f123313769de83a71e157758030b' try: from k...
gpl-3.0
blockstack/pybitcoin
pybitcoin/passphrases/english_words.py
2
753213
# -*- coding: utf-8 -*- """ pybitcoin ~~~~~ :copyright: (c) 2014 by Halfmoon Labs :license: MIT, see LICENSE for more details. """ # 2048 words english_words_bip39 = 'abandon,ability,able,about,above,absent,absorb,abstract,absurd,abuse,access,accident,account,accuse,achieve,acid,acoustic,acquire,acros...
mit
marnnie/Cable-buenaventura
plugin.video.adryanlist/genesisresolvers.py
266
64370
# -*- coding: utf-8 -*- ''' Genesis Add-on Copyright (C) 2015 lambda 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 ...
gpl-2.0
okwow123/djangol2
allauth/socialaccount/providers/draugiem/tests.py
3
4823
from hashlib import md5 from django.contrib.auth.models import User from django.contrib.sites.models import Site from django.utils.http import urlencode from allauth.compat import reverse from allauth.socialaccount import providers from allauth.socialaccount.models import SocialApp, SocialToken from allauth.tests imp...
mit
jorik041/plaso
plaso/parsers/android_app_usage.py
1
3669
# -*- coding: utf-8 -*- """This file contains a parser for the Android usage-history.xml file.""" import os from xml.etree import ElementTree from dfvfs.helpers import text_file from plaso.lib import errors from plaso.lib import event from plaso.lib import eventdata from plaso.lib import timelib from plaso.parsers i...
apache-2.0
tkaitchuck/nupic
py/nupic/math/logarithms.py
1
6004
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have purchased from # Numenta, Inc. a separate commercial license for this software code, the # following terms and conditions apply: # # This pro...
gpl-3.0
wilvk/ansible
test/units/modules/network/iosxr/test_iosxr_facts.py
22
3344
# (c) 2016 Red Hat 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 your option) any later version. # # Ansible is dis...
gpl-3.0
MERegistro/meregistro
tests/regressiontests/forms/localflavor/fi.py
40
16282
from django.contrib.localflavor.fi.forms import (FIZipCodeField, FISocialSecurityNumber, FIMunicipalitySelect) from utils import LocalFlavorTestCase class FILocalFlavorTests(LocalFlavorTestCase): def test_FIMunicipalitySelect(self): f = FIMunicipalitySelect() out = u'''<select name="municipal...
bsd-3-clause
xh-xiao/PomodoroTimer
TimerApp.py
1
5374
# -*- coding: utf-8 -*- from MainFrm import * from TaskbarIcon import * import wx import sqlite3 import logging from R import * from State import * class TimerApp(wx.App, OnStateChangeListener): # Work for every 25 min __work_time = wx.TimeSpan(0,25,0) # Rest for 5 min, not used by now __rest_time = wx...
mit
gurneyalex/odoo
addons/stock/wizard/stock_warn_insufficient_qty.py
6
1807
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import api, fields, models from odoo.tools import float_compare class StockWarnInsufficientQty(models.AbstractModel): _name = 'stock.warn.insufficient.qty' _description = 'Warn Insufficient Quantity' ...
agpl-3.0
pra85/calibre
src/calibre/devices/utils.py
4
5352
#!/usr/bin/env python # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:fdm=marker:ai from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>' __docformat__ = 'restructuredtext en' ...
gpl-3.0
dimagol/trex-core
scripts/external_libs/python-daemon-2.0.5/daemon/_metadata.py
11
4527
# -*- coding: utf-8 -*- # daemon/_metadata.py # Part of ‘python-daemon’, an implementation of PEP 3143. # # Copyright © 2008–2015 Ben Finney <ben+python@benfinney.id.au> # # This is free software: you may copy, modify, and/or distribute this work # under the terms of the Apache License, version 2.0 as published by the...
apache-2.0
angstwad/ansible
test/units/modules/core/test_apt.py
16
1568
import collections import mock import os import sys from ansible.compat.tests import unittest try: from ansible.modules.core.packaging.os.apt import ( expand_pkgspec_from_fnmatches, ) except: # Need some more module_utils work (porting urls.py) before we can test # modules. So don't error out...
gpl-3.0
jptomo/rpython-lang-scheme
rpython/jit/backend/arm/opassembler.py
1
60137
from __future__ import with_statement from rpython.jit.backend.arm import conditions as c from rpython.jit.backend.arm import registers as r from rpython.jit.backend.arm import shift from rpython.jit.backend.arm.arch import WORD, DOUBLE_WORD, JITFRAME_FIXED_SIZE from rpython.jit.backend.arm.helper.assembler import (gen...
mit
dsfsdgsbngfggb/odoo
addons/base_report_designer/installer.py
318
3088
# -*- 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...
agpl-3.0
whitepyro/debian_server_setup
lib/sqlalchemy/testing/schema.py
76
3438
# testing/schema.py # Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php from . import exclusions from .. import schema, event from . import config __all__ ...
gpl-3.0
vitan/hue
desktop/core/ext-py/guppy-0.1.10/guppy/etc/FSA.py
37
5043
#._cv_part guppy.etc.FSA class FiniteAutomaton: def __init__(self, start_state, dump_state=''): self.start_state = start_state self.dump_state = dump_state self.table = {self.dump_state:{}} self.unresolved_composites = [] self.resolved_composites = [] self.composite_memo = {} self.is_updated = 1 def __...
apache-2.0
darkleons/odoo
openerp/addons/base/res/res_country.py
57
4477
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
agpl-3.0
apache/allura
ForgeChat/forgechat/main.py
2
6812
# 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 (t...
apache-2.0
google/gps_building_blocks
py/gps_building_blocks/ml/statistical_inference/data_preparation.py
1
28872
# 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 agreed to in writing, ...
apache-2.0
victorbjorklund/flask-bootstrap
docs/conf.py
13
1169
# -*- coding: utf-8 -*- project = u'Flask-Bootstrap' copyright = u'2013, Marc Brinkmann' version = '3.3.5.7' release = '3.3.5.7.dev1' extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'alabaster'] source_suffix = '.rst' master_doc = 'index' exclude_patterns = ['_build'] pygments_style = 'monokai' html_t...
apache-2.0
rjt5008/e3_challenge-d8
themes/kaytee_dog/node_modules/node-gyp/gyp/tools/pretty_sln.py
1831
5099
#!/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...
gpl-2.0
tod31/pyload
module/plugins/hoster/MystoreTo.py
5
1608
# -*- coding: utf-8 -*- # # Test link: # http://mystore.to/dl/mxcA50jKfP import re from module.plugins.internal.SimpleHoster import SimpleHoster class MystoreTo(SimpleHoster): __name__ = "MystoreTo" __type__ = "hoster" __version__ = "0.07" __status__ = "testing" __pattern__ = r'https?:...
gpl-3.0
dhruvagarwal/django
tests/admin_filters/models.py
99
2009
from __future__ import unicode_literals from django.contrib.auth.models import User from django.contrib.contenttypes.fields import ( GenericForeignKey, GenericRelation, ) from django.contrib.contenttypes.models import ContentType from django.db import models from django.utils.encoding import python_2_unicode_compa...
bsd-3-clause
florentbrient/pycles
generate_namelist.py
1
31751
import argparse import json import pprint from sys import exit import uuid #florent def main(): parser = argparse.ArgumentParser(prog='Namelist Generator') parser.add_argument('case_name') args = parser.parse_args() case_name = args.case_name if case_name == 'StableBubble': namelist = Sta...
gpl-3.0
eratti/linux_SBC
tools/perf/scripts/python/syscall-counts-by-pid.py
11180
1927
# system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os, sys sys.path.append(os.env...
gpl-2.0
wacrea/DBStatusREST-nodejs
node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.py
601
12116
# 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. """New implementation of Visual Studio project generation.""" import os import random import gyp.common # hashlib is supplied as of Python 2.5 as the replacemen...
mit
nvoron23/scipy
scipy/optimize/nnls.py
116
1423
from __future__ import division, print_function, absolute_import from . import _nnls from numpy import asarray_chkfinite, zeros, double __all__ = ['nnls'] def nnls(A, b): """ Solve ``argmin_x || Ax - b ||_2`` for ``x>=0``. This is a wrapper for a FORTAN non-negative least squares solver. Parameters...
bsd-3-clause
dlazz/ansible
lib/ansible/modules/network/illumos/dladm_linkprop.py
52
7820
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Adam Števko <adam.stevko@gmail.com> # 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', ...
gpl-3.0
Multiscale-Genomics/mg-process-files
process_bed.py
1
5182
#!/usr/bin/python """ .. See the NOTICE file distributed with this work for additional information regarding copyright ownership. 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 ...
apache-2.0
kntem/webdeposit
modules/webdeposit/lib/webdeposit_validation_utils.py
1
5030
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2013 CERN. ## ## Invenio 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) a...
gpl-2.0
fatihzkaratana/intranet
backend/intranet/migrations/0010_auto__add_quote.py
2
15375
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Quote' db.create_table(u'intranet_quote', ( (u'id', self.gf('django.db.models.fi...
apache-2.0
azurestandard/django
django/db/models/sql/datastructures.py
118
1115
""" Useful auxilliary data structures for query construction. Not useful outside the SQL domain. """ class EmptyResultSet(Exception): pass class MultiJoin(Exception): """ Used by join construction code to indicate the point at which a multi-valued join was attempted (if the caller wants to treat that ...
bsd-3-clause
zepheira/zenpub
thirdparty/geopy_export/geopy/geocoders/wiki_gis.py
2
2315
from urllib import urlencode from urllib2 import urlopen try: import json as simplejson except ImportError: import simplejson import xml from xml.parsers.expat import ExpatError from geopy.geocoders.base import Geocoder,GeocoderError,GeocoderResultError from geopy import Point, Location, util class MediaWiki...
apache-2.0
linjoahow/w17test_1
static/Brython3.1.1-20150328-091302/Lib/opcode.py
714
5442
""" opcode module - potentially shared between dis and other modules which operate on bytecodes (e.g. peephole optimizers). """ __all__ = ["cmp_op", "hasconst", "hasname", "hasjrel", "hasjabs", "haslocal", "hascompare", "hasfree", "opname", "opmap", "HAVE_ARGUMENT", "EXTENDED_ARG", "hasnargs"] ...
gpl-3.0
Elandril/SickRage
lib/unidecode/x0a3.py
253
4521
data = ( 'nzup', # 0x00 'nzurx', # 0x01 'nzur', # 0x02 'nzyt', # 0x03 'nzyx', # 0x04 'nzy', # 0x05 'nzyp', # 0x06 'nzyrx', # 0x07 'nzyr', # 0x08 'sit', # 0x09 'six', # 0x0a 'si', # 0x0b 'sip', # 0x0c 'siex', # 0x0d 'sie', # 0x0e 'siep', # 0x0f 'sat', # 0x10 'sax', #...
gpl-3.0
naototty/pyflag
src/plugins_old/MemoryForensics/Volatility-1.3_Linux_rc.1/forensics/win32/rawreg.py
7
4989
# Volatility # Copyright (c) 2008 Volatile Systems # Copyright (c) 2008 Brendan Dolan-Gavitt <bdolangavitt@wesleyan.edu> # # 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...
gpl-2.0
larrybradley/astropy
astropy/io/ascii/qdp.py
1
20164
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This package contains functions for reading and writing QDP tables that are not meant to be used directly, but instead are available as readers/writers in `astropy.table`. See :ref:`astropy:table_io` for more details. """ import re import copy from col...
bsd-3-clause
mikewiebe-ansible/ansible
test/units/modules/remote_management/oneview/test_oneview_ethernet_network.py
23
14490
# -*- coding: utf-8 -*- # # Copyright (2016-2017) Hewlett Packard Enterprise Development LP # # 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 optio...
gpl-3.0
anchore/anchore-engine
anchore_engine/db/db_objectstorage.py
1
3240
import json from anchore_engine import db from anchore_engine.db import ObjectStorageRecord def put(userId, bucket, key, data, metadata=None, session=None): if not session: session = db.Session our_result = ( session.query(ObjectStorageRecord) .filter_by(userId=userId, bucket=bucket, ...
apache-2.0
lissarae/sumatrapdf
scripts/trans_langs.py
16
5002
# List of languages we support, their iso codes and id as understood # by Windows SDK (LANG_* and SUBLANG_*_*). # See http://msdn.microsoft.com/en-us/library/dd318693.aspx for the full list. g_langs = [ ('af', 'Afrikaans', '_LANGID(LANG_AFRIKAANS)'), ('am', 'Armenian (Հայերեն)', '_LANGID(LANG_ARMENIAN)'),...
gpl-3.0
gabyx/HPCJobConfigurator
HPCJobConfigurator/jobGenerators/jobGeneratorMPI/generatorToolPipeline/scripts/fileMove.py
2
3564
# ===================================================================== # HPClusterJobConfigurator # Copyright (C) 2014 by Gabriel Nützi <gnuetzi (at) gmail (dot) com> # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # fil...
mpl-2.0
vaginessa/FreeRDP
resources/conv_to_ewm_prop.py
80
1430
#!/usr/bin/python # Copyright 2011 Anthony Tong <atong@trustedcs.com> # 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...
apache-2.0