repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
mcepl/rope
rope/base/pynamesdef.py
3
1796
import rope.base.oi.soi from rope.base import pynames from rope.base.pynames import * class AssignedName(pynames.AssignedName): def __init__(self, lineno=None, module=None, pyobject=None): self.lineno = lineno self.module = module self.assignments = [] self.pyobject = _Inferred(se...
lgpl-3.0
dlazz/ansible
lib/ansible/plugins/action/copy.py
36
26315
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # (c) 2017 Toshio Kuratomi <tkuraotmi@ansible.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...
gpl-3.0
alexryndin/ambari
ambari-server/src/main/resources/scripts/check_ambari_permissions.py
1
11069
#!/usr/bin/env 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 "License")...
apache-2.0
millanp/django-paypal
paypal/standard/pdt/views.py
11
2337
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.shortcuts import render from django.views.decorators.http import require_GET from paypal.standard.pdt.models import PayPalPDT from paypal.standard.pdt.forms import PayPalPDTForm @require_GET def pdt(request, item_check_...
mit
dsoprea/PyEasyArchive
libarchive/library.py
1
1454
import logging import os import ctypes import ctypes.util _LOGGER = logging.getLogger(__name__) _LIBRARY_NAME = 'libarchive' _LIBRARY_FILENAME = 'libarchive.so' def find_and_load_library(): search_filepaths = [] # Search for the library using our own environment variable. filepath = os.environ.get('LA...
gpl-2.0
yetsky/extra
packages/my-application/python-all/files/usr/lib/python2.7/encodings/aliases.py
418
14848
""" Encoding Aliases Support This module is used by the encodings package search function to map encodings names to module names. Note that the search function normalizes the encoding names before doing the lookup, so the mapping will have to map normalized encoding names to module names. Con...
gpl-2.0
dustinrb/mezzanine
mezzanine/pages/models.py
10
11415
from __future__ import unicode_literals from future.builtins import filter, str try: from urllib.parse import urljoin except ImportError: # Python 2 from urlparse import urljoin from django.apps import apps from django.core.urlresolvers import resolve, reverse from django.db import models from django.utils.en...
bsd-2-clause
blueburningcoder/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_tkagg.py
69
24593
# Todd Miller jmiller@stsci.edu from __future__ import division import os, sys, math import Tkinter as Tk, FileDialog import tkagg # Paint image to Tk photo blitter extension from backend_agg import FigureCanvasAgg import os.path import matplotlib from matplotlib.cbook import is_string_like from ...
agpl-3.0
cindyyu/kuma
vendor/packages/translate/convert/po2csv.py
25
3743
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2003-2006 Zuza Software Foundation # # This file is part of translate. # # translate 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...
mpl-2.0
openspending/os-authz-service
conductor/blueprints/user/models.py
2
3975
import os import json import datetime from hashlib import md5 from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import Column, Unicode, create_engine from sqlalchemy.orm import sessionmaker from elasticsearch import Elasticsearch from elasticsearch.exceptions import NotFoundError # ## Elastic...
mit
denny820909/builder
lib/python2.7/site-packages/buildbot-0.8.8-py2.7.egg/buildbot/status/buildrequest.py
4
4990
# This file is part of Buildbot. Buildbot 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 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
mit
shubhdev/edx-platform
lms/djangoapps/staticbook/views.py
57
6333
""" Views for serving static textbooks. """ from django.contrib.auth.decorators import login_required from django.http import Http404 from edxmako.shortcuts import render_to_response from opaque_keys.edx.locations import SlashSeparatedCourseKey from xmodule.annotator_token import retrieve_token from courseware.acces...
agpl-3.0
matrix-org/synapse
tests/handlers/test_stats.py
1
26874
# Copyright 2019 New Vector Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
apache-2.0
joequery/django
django/template/library.py
348
12752
import functools import warnings from importlib import import_module from django.utils import six from django.utils.deprecation import RemovedInDjango20Warning from django.utils.html import conditional_escape from django.utils.inspect import getargspec from django.utils.itercompat import is_iterable from .base import...
bsd-3-clause
madjelan/scikit-learn
sklearn/feature_extraction/hashing.py
183
6155
# Author: Lars Buitinck <L.J.Buitinck@uva.nl> # License: BSD 3 clause import numbers import numpy as np import scipy.sparse as sp from . import _hashing from ..base import BaseEstimator, TransformerMixin def _iteritems(d): """Like d.iteritems, but accepts any collections.Mapping.""" return d.iteritems() if...
bsd-3-clause
SnappleCap/oh-mainline
vendor/packages/south/south/tests/__init__.py
93
3189
from __future__ import print_function #import unittest import os import sys from functools import wraps from django.conf import settings from south.hacks import hacks # Make sure skipping tests is available. try: # easiest and best is unittest included in Django>=1.3 from django.utils import unittest except I...
agpl-3.0
amjad-twalo/icsisumm
icsisumm-primary-sys34_v1/nltk/nltk-0.9.2/nltk/wordnet/brown_ic.py
9
12984
# Natural Language Toolkit: Brown Corpus Information Content Module # # Copyright (C) 2001-2008 University of Pennsylvania # Author: Oliver Steele <steele@osteele.com> # David Ormiston Smith <daosmith@csse.unimelb.edu.au>> # Steven Bird <sb@csse.unimelb.edu.au> # URL: <http://nltk.sf.net> # For license ...
gpl-3.0
voidcc/POXPOF
pox/proto/arp_responder.py
39
8783
# 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
xianggong/m2c_unit_test
test/operator/unary_minus_char16/compile.py
1861
4430
#!/usr/bin/python import os import subprocess import re def runCommand(command): p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) p.wait() return iter(p.stdout.readline, b'') def dumpRunCommand(command,...
gpl-2.0
laslabs/odoo-connector-carepoint
first_databank/models/fdb_pem_mogc.py
1
2756
# -*- coding: utf-8 -*- # © 2015 LasLabs Inc. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from collections import OrderedDict import re from odoo import models, fields, api class FdbPemMogc(models.Model): _name = 'fdb.pem.mogc' _description = 'Fdb Pem Mogc' gcn_id = fields.Many...
agpl-3.0
chris-klinger/Goat
databases/sets.py
1
1050
""" This module contains new code for dealing with sets in Goat. Idea is to have a generic set superclass with some default attributes and methods, and then to subclass out for additional attributes/functionality. """ from persistent import Persistent class Set(Persistent): def __init__(self, name): self....
gpl-3.0
home-assistant/home-assistant
homeassistant/components/elkm1/sensor.py
2
9308
"""Support for control of ElkM1 sensors.""" from elkm1_lib.const import ( SettingFormat, ZoneLogicalStatus, ZonePhysicalStatus, ZoneType, ) from elkm1_lib.util import pretty_const, username import voluptuous as vol from homeassistant.components.sensor import SensorEntity from homeassistant.const import...
apache-2.0
darrenbilby/grr
server/data_server/utils.py
6
1569
#!/usr/bin/env python """Data server utilities.""" import hashlib import struct from grr.lib.rdfvalues import data_server as rdf_data_server from grr.server.data_server import constants SIZE_PACKER = struct.Struct("I") PORT_PACKER = struct.Struct("I") def CreateStartInterval(index, total): """Create initial r...
apache-2.0
havt/odoo
addons/l10n_co/__init__.py
313
1180
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) David Arnold (devCO). # Author David Arnold (devCO), dar@devco.co # Co-Authors Juan Pablo Aries (devCO), jpa@devco.co # Hector Iva...
agpl-3.0
dgarage/bc2
test/functional/disconnect_ban.py
28
5506
#!/usr/bin/env python3 # Copyright (c) 2014-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. """Test node disconnect and ban behavior""" import time from test_framework.mininode import wait_until fr...
mit
matrixise/odoo
addons/account_budget/report/crossovered_budget_report.py
315
8657
# -*- 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
Changsung/Alphaman
alphaman/broker/Schedule.py
1
4978
# MIT License # # Copyright (c) 2017 Changsung # # 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, pu...
mit
3dfxmadscientist/odoo_vi
openerp/report/render/html2html/html2html.py
443
4238
# -*- 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
yephper/django
tests/sites_framework/migrations/0001_initial.py
1
1722
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('sites', '0001_initial'), ] operations = [ migrations.CreateModel( name='CustomArticle', ...
bsd-3-clause
NeuroML/pyNeuroML
pyneuroml/povray/OverlaySimulation.py
1
11444
# -*- coding: utf-8 -*- # # A simple file for overlaying recorded simulations on PovRay files # # Author: Padraig Gleeson & Matteo Farinella # # This file has been developed as part of the neuroConstruct project # This work has been funded by the Medical Research Council and Wellcome Trust # # imp...
lgpl-3.0
nebril/fuel-web
nailgun/nailgun/middleware/keystone.py
5
3851
# -*- coding: utf-8 -*- # Copyright 2014 Mirantis, 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 requi...
apache-2.0
nickleefly/youtube-dl
youtube_dl/extractor/naver.py
8
5031
# encoding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( ExtractorError, int_or_none, update_url_query, ) class NaverIE(InfoExtractor): _VALID_URL = r'https?://(?:m\.)?tvcast\.naver\.com/v/(?P<id>\d+)' _TESTS = [{ 'url':...
unlicense
wakatime/wakatime-unity
Editor/WakaTime/client/wakatime/packages/pygments_py3/pygments/lexers/php.py
72
9769
# -*- coding: utf-8 -*- """ pygments.lexers.php ~~~~~~~~~~~~~~~~~~~ Lexers for PHP and related languages. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, include, bygroups, default, us...
cc0-1.0
mrquim/mrquimrepo
plugin.video.castaway/resources/lib/sources/on_demand_sport/hockey/rutube_guy.py
4
1228
from __future__ import unicode_literals from resources.lib.modules import client,webutils,convert import re,urlparse,json from resources.lib.modules.log_utils import log class info(): def __init__(self): self.mode = 'rutube_guy' self.name = 'Rutube playlist (full games)' self.icon = 'rutube....
gpl-2.0
hjjeon0608/mbed_for_W7500P
workspace_tools/host_tests/tcpecho_client_auto.py
101
3319
""" mbed SDK Copyright (c) 2011-2013 ARM Limited 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 wr...
apache-2.0
ZazieTheBeast/oscar
oscar/lib/python2.7/site-packages/pip/_vendor/retrying.py
934
9972
## Copyright 2013-2014 Ray Holder ## ## 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 ...
bsd-3-clause
x111ong/django
django/conf/locale/de/formats.py
504
1100
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j. F Y' TIME_FORMAT = 'H:i' DATET...
bsd-3-clause
OpenDA-Association/OpenDA
course/exercise_black_box_calibration_polution_NOT_WORKING/plot_movie.py
1
1300
#! /usr/bin/python # -*- coding: utf-8 -*- """ Plot movie of model simulation output. Uses directly the output of the model, not the output from OpenDA @author: verlaanm """ import shutil import numpy as np import matplotlib.pyplot as plt from time import sleep #load data import reactive_pollution_model_original as ...
lgpl-3.0
wnoc-drexel/gem5-stable
src/arch/x86/isa/insts/simd64/integer/data_reordering/unpack_and_interleave.py
91
4097
# Copyright (c) 2007 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implemen...
bsd-3-clause
ambernetas/varnish-cache
lib/libvcl/generate.py
1
18104
#!/usr/local/bin/python3.1 #- # Copyright (c) 2006 Verdens Gang AS # Copyright (c) 2006-2011 Varnish Software AS # All rights reserved. # # Author: Poul-Henning Kamp <phk@phk.freebsd.dk> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following cond...
bsd-2-clause
gedaskir/qmeq
qmeq/__init__.py
1
2378
""" QmeQ: Quantum master equation for Quantum dot transport calculations ==================================================================== QmeQ is an open-source Python package for transport calculations through quantum dot devices. The so-called Anderson-type models are used to describe the quantum dot device, wh...
bsd-2-clause
golismero/golismero
golismero/api/data/vulnerability/infrastructure/vulnerable_webapp.py
8
1566
#!/usr/bin/env python # -*- coding: utf-8 -*- __license__= """ GoLismero 2.0 - The web knife - Copyright (C) 2011-2014 Golismero project site: https://github.com/golismero Golismero project mail: contact@golismero-project.com This program is free software; you can redistribute it and/or modify it under the terms of ...
gpl-2.0
maxrosan/NS-3-support-for-OBS
src/core/examples/sample-rng-plot.py
188
1246
# -*- Mode:Python; -*- # /* # * This program is free software; you can redistribute it and/or modify # * it under the terms of the GNU General Public License version 2 as # * published by the Free Software Foundation # * # * This program is distributed in the hope that it will be useful, # * but WITHOUT ANY WARRA...
gpl-2.0
potash/scikit-learn
sklearn/model_selection/_split.py
7
61646
""" The :mod:`sklearn.model_selection._split` module includes classes and functions to split the data based on a preset strategy. """ # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>, # Gael Varoquaux <gael.varoquaux@normalesup.org>, # Olivier Grisel <olivier.grisel@ensta.org> # Ragha...
bsd-3-clause
mariopro/youtube-dl
youtube_dl/extractor/cnet.py
101
3246
# coding: utf-8 from __future__ import unicode_literals import json from .common import InfoExtractor from ..utils import ( ExtractorError, ) class CNETIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?cnet\.com/videos/(?P<id>[^/]+)/' _TESTS = [{ 'url': 'http://www.cnet.com/videos/hands-on-wi...
unlicense
s-hertel/ansible
test/units/module_utils/common/test_network.py
103
1618
# -*- coding: utf-8 -*- # (c) 2017 Red Hat, Inc. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Make coding more python3-ish from __future__ import absolute_import, division, print_function __metaclass__ = type import pytest from ansible.module_utils.common.network imp...
gpl-3.0
knipknap/exscript
Exscript/stdlib/ipv4.py
3
5299
# # Copyright (C) 2010-2017 Samuel Abels # The MIT License (MIT) # # 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,...
mit
silverhack/triana
parse/DomainReputation.py
1
2509
#------------------------------------------------------------------------------- # Name: module1 # Purpose: # # Author: Silverhack # # Created: 28/05/2012 # Copyright: (c) Silverhack 2012 # Licence: <your licence> #------------------------------------------------------------------------------- im...
gpl-2.0
Big-B702/python-for-android
python-modules/twisted/twisted/words/test/test_toc.py
52
13511
# Copyright (c) 2001-2009 Twisted Matrix Laboratories. # See LICENSE for details. from twisted.trial import unittest from twisted.words.protocols import toc from twisted.internet import protocol, main from twisted.python import failure from twisted.test.proto_helpers import StringIOWithoutClosing from struct import...
apache-2.0
jjmleiro/hue
desktop/core/ext-py/cffi-1.5.2/demo/bsdopendirtype.py
12
1240
from _bsdopendirtype import ffi, lib def _posix_error(): raise OSError(ffi.errno, os.strerror(ffi.errno)) _dtype_to_smode = { lib.DT_BLK: 0o060000, lib.DT_CHR: 0o020000, lib.DT_DIR: 0o040000, lib.DT_FIFO: 0o010000, lib.DT_LNK: 0o120000, lib.DT_REG: 0o100000, lib.DT_SOCK: 0o140000...
apache-2.0
jean/python-docx
docx/document.py
9
7340
# encoding: utf-8 """ |Document| and closely related objects """ from __future__ import ( absolute_import, division, print_function, unicode_literals ) from .blkcntnr import BlockItemContainer from .enum.section import WD_SECTION from .enum.text import WD_BREAK from .section import Section, Sections from .shared...
mit
mincoin-project/mincoin
qa/rpc-tests/listsinceblock.py
2
2627
#!/usr/bin/env python3 # Copyright (c) 2017 The Bitcoin Core developers # Copyright (c) 2017-2019 The Mincoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from test_framework.test_framework import MincoinTestFra...
mit
alfasin/st2
st2common/st2common/util/ip_utils.py
10
3535
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
apache-2.0
rocxer/shadowsocks
shadowsocks/crypto/sodium.py
1032
3778
#!/usr/bin/env python # # Copyright 2015 clowwindy # # 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 ...
apache-2.0
gundalow/ansible-modules-extras
monitoring/honeybadger_deployment.py
48
4222
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2014 Benjamin Curtis <benjamin.curtis@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either versi...
gpl-3.0
fflewddur/tivolibre
batchTest.py
1
7706
#!/usr/bin/env python3 # # Copyright 2015 Todd Kulesza <todd@dropline.net>. # # Automate testing TivoLibre on directories of TiVo files. This program will run TivoLibre on # each TiVo file in the specified directory and compare it to a reference file. It will then # display a list of TiVo files that TiVoLibre decoded ...
gpl-3.0
bjwbell/servo
tests/wpt/css-tests/tools/html5lib/html5lib/tests/test_treeadapters.py
451
1852
from __future__ import absolute_import, division, unicode_literals from . import support # flake8: noqa import html5lib from html5lib.treeadapters import sax from html5lib.treewalkers import getTreeWalker def test_to_sax(): handler = support.TracingSaxHandler() tree = html5lib.parse("""<html xml:lang="en">...
mpl-2.0
pombredanne/jip
jip/util.py
2
4057
#! /usr/bin/env jython # Copyright (C) 2011 Sun Ning<classicning@gmail.com> # # 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...
mit
quoclieu/codebrew17-starving
env/lib/python3.5/site-packages/google/api/distribution_pb2.py
17
15758
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/api/distribution.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import refl...
mit
smartscheduling/scikit-learn-categorical-tree
doc/tutorial/text_analytics/skeletons/exercise_02_sentiment.py
256
2406
"""Build a sentiment analysis / polarity model Sentiment analysis can be casted as a binary text classification problem, that is fitting a linear classifier on features extracted from the text of the user messages so as to guess wether the opinion of the author is positive or negative. In this examples we will use a ...
bsd-3-clause
oneminot/audacity
lib-src/lv2/lv2/plugins/eg03-metro.lv2/waflib/extras/doxygen.py
105
4815
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file from fnmatch import fnmatchcase import os,os.path,re,stat from waflib import Task,Utils,Node,Logs from waflib.TaskGen import feature DOXY_STR='${DOXYGEN} - ' DOXY_FMTS='html l...
gpl-2.0
tayfun/django
tests/migrations/test_writer.py
76
23489
# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime import functools import math import os import re import tokenize import unittest import custom_migration_operations.more_operations import custom_migration_operations.operations from django.conf import settings from django.core.validator...
bsd-3-clause
kinwahlai/phantomjs-ghostdriver
src/breakpad/src/third_party/protobuf/protobuf/python/google/protobuf/internal/message_test.py
253
15707
#! /usr/bin/python # # 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: # # ...
bsd-3-clause
trabacus-softapps/openerp-8.0-cc
openerpcommand/call.py
16
1241
""" Call an arbitrary model's method. """ import ast import os import pprint import sys import time import xmlrpclib import client class Call(client.Client): """\ Call an arbitrary model's method. Example: > oe call res.users.read '[1, 3]' '[]' -u 1 -p admin """ # TODO The above docstring i...
agpl-3.0
CodEnFisH/palantir
hadoop/src/contrib/hod/hodlib/Common/logger.py
182
28370
#Licensed to the Apache Software Foundation (ASF) under one #or more contributor license agreements. See the NOTICE file #distributed with this work for additional information #regarding copyright ownership. The ASF licenses this file #to you under the Apache License, Version 2.0 (the #"License"); you may not use thi...
apache-2.0
manazhao/tf_recsys
tensorflow/python/training/proximal_adagrad_test.py
65
9042
# 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...
apache-2.0
Titan-C/scikit-learn
sklearn/externals/joblib/numpy_pickle.py
56
23237
"""Utilities for fast persistence of big data, with optional compression.""" # Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org> # Copyright (c) 2009 Gael Varoquaux # License: BSD Style, 3 clauses. import pickle import os import sys import warnings try: from pathlib import Path except ImportError:...
bsd-3-clause
darjus-amzn/boto
boto/ec2/autoscale/tag.py
173
3379
# Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. 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 ...
mit
0Chencc/CTFCrackTools
Lib/site-packages/pip/_vendor/html5lib/constants.py
354
83387
from __future__ import absolute_import, division, unicode_literals import string EOF = None E = { "null-character": "Null character in input stream, replaced with U+FFFD.", "invalid-codepoint": "Invalid codepoint in stream.", "incorrectly-placed-solidus": "Solidus (/) incorrectly ...
gpl-3.0
neilhan/tensorflow
tensorflow/contrib/factorization/examples/mnist.py
4
11223
# Copyright 2016 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...
apache-2.0
repotvsupertuga/repo
plugin.video.specto/resources/lib/resolvers/thevideo.py
7
1455
# -*- coding: utf-8 -*- ''' Specto 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 l...
gpl-2.0
zero-ui/miniblink49
v8_5_7/src/inspector/build/rjsmin.py
100
11056
#!/usr/bin/env python # # Copyright 2011 - 2013 # Andr\xe9 Malo or his licensors, as applicable # # 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-...
gpl-3.0
ebrelsford/growing_cities
growing_cities/growing_places/views.py
1
5554
import json from django.contrib.gis.geos import Point, Polygon from django.contrib.gis.measure import D from django.core.urlresolvers import reverse from django.http import Http404, HttpResponse from django.views.generic import CreateView, ListView, TemplateView, View from fiber.views import FiberPageMixin from inpla...
gpl-3.0
paynejacob21/points-tracker
points_tracker/views.py
2
5140
# -*- coding: utf-8 -*- """Main UI section.""" import wave import contextlib from . import utils import os, json, md5 from soco import SoCo from mutagen.mp3 import MP3 from mutagen.mp4 import MP4 from pydub import AudioSegment from mutagen.apev2 import APEv2 from models import Audio, AudioTag from werkzeug import secur...
mit
dev-life/GT-I9300_Kernel
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py
11088
3246
# Core.py - Python extension for perf script, core functions # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. from collections import defaultdict def aut...
gpl-2.0
undefinedv/Jingubang
sqlmap/lib/request/httpshandler.py
2
3847
#!/usr/bin/env python """ Copyright (c) 2006-2016 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ import distutils.version import httplib import socket import urllib2 from lib.core.common import getSafeExString from lib.core.data import kb from lib.core.data import logger...
gpl-3.0
fafaman/django
django/contrib/auth/tokens.py
433
2803
from datetime import date from django.conf import settings from django.utils import six from django.utils.crypto import constant_time_compare, salted_hmac from django.utils.http import base36_to_int, int_to_base36 class PasswordResetTokenGenerator(object): """ Strategy object used to generate and check token...
bsd-3-clause
tboyce1/home-assistant
tests/components/http/test_ban.py
13
3276
"""The tests for the Home Assistant HTTP component.""" # pylint: disable=protected-access import asyncio from ipaddress import ip_address from unittest.mock import patch, mock_open import pytest from homeassistant import const from homeassistant.setup import async_setup_component import homeassistant.components.http ...
apache-2.0
hexfet/deviation
src/target/drivers/filesystems/devofs/buildfs.py
3
5690
#!/usr/bin/env python2 import os import sys import struct from optparse import OptionParser FILEOBJ_NONE = 0x00 FILEOBJ_DIR = 0x41 FILEOBJ_FILE = 0x43 FILEOBJ_DELDIR = 0xC1 FILEOBJ_DELFILE = 0xC1 START_SECTOR = 0xFF def main(): usage = """ %prog [opts] """ parser = OptionParser(usage=usage) ...
gpl-3.0
rds0751/colinkers
env/Lib/site-packages/django/core/files/move.py
34
3105
""" Move a file in the safest way possible:: >>> from django.core.files.move import file_move_safe >>> file_move_safe("/tmp/old_file", "/tmp/new_file") """ import errno import os from shutil import copystat from django.core.files import locks __all__ = ['file_move_safe'] def _samefile(src, dst): # Mac...
agpl-3.0
KSanthanam/rethinkdb
external/v8_3.30.33.16/tools/check-name-clashes.py
42
2977
#!/usr/bin/env python # Copyright 2014 the V8 project 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 js2c import os import re import sys FILENAME = "src/runtime/runtime.h" LISTHEAD = re.compile(r"#define\s+(\w+LIST\w*)\((\w+)\...
agpl-3.0
Tejal011089/paypal_erpnext
erpnext/shopping_cart/cart.py
10
11574
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe import throw, _ import frappe.defaults from frappe.utils import cint, flt, get_fullname, fmt_money, cstr from erpnext.utilitie...
agpl-3.0
naturali/tensorflow
tensorflow/python/kernel_tests/one_hot_op_test.py
25
13164
# 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...
apache-2.0
andela-ooladayo/django
tests/test_client_regress/tests.py
154
67625
# -*- coding: utf-8 -*- """ Regression tests for the Test Client, especially the customized assertions. """ from __future__ import unicode_literals import datetime import itertools import os from django.contrib.auth.models import User from django.contrib.auth.signals import user_logged_in, user_logged_out from django...
bsd-3-clause
damien-dg/horizon
openstack_dashboard/dashboards/admin/aggregates/views.py
29
4207
# 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
SoftwareKing/zstack-utility
kvmagent/kvmagent/plugins/localstorage.py
2
9857
__author__ = 'frank' import os.path import traceback from kvmagent import kvmagent from zstacklib.utils import jsonobject from zstacklib.utils import http from zstacklib.utils import log from zstacklib.utils import shell from zstacklib.utils import linux import zstacklib.utils.uuidhelper as uuidhelper l...
apache-2.0
mtagle/airflow
airflow/providers/google/cloud/example_dags/example_sftp_to_gcs.py
5
2915
# # 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...
apache-2.0
atila1974/AK-OnePlusOne-CM
scripts/build-all.py
1474
10189
#! /usr/bin/env python # Copyright (c) 2009-2013, The Linux Foundation. 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 # ...
gpl-2.0
ema/conpaas
conpaas-services/src/conpaas/services/cds/manager/network_monitor.py
3
4622
#!/usr/bin/python import logging from optparse import OptionParser import select import socket import time from edge import EdgeLocation, NetworkSnapshot from map import GlobalMap class NetworkMonitor: def __init__(self, port, map_filename): self.port = port self.map_filename = map_filename ...
bsd-3-clause
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-2.4/Lib/test/test_hexoct.py
34
4922
"""Test correct treatment of hex/oct constants. This is complex because of changes due to PEP 237. """ import sys platform_long_is_32_bits = sys.maxint == 2147483647 import unittest from test import test_support import warnings warnings.filterwarnings("ignore", "hex/oct constants", FutureWarning, ...
mit
wheldom01/privacyidea
migrations/versions/4023571658f8_.py
3
1822
"""Add the DB table password reset in version 2.10 Revision ID: 4023571658f8 Revises: 2ac117d0a6f5 Create Date: 2016-01-07 16:45:35.708951 """ # revision identifiers, used by Alembic. revision = '4023571658f8' down_revision = '2ac117d0a6f5' from alembic import op import sqlalchemy as sa from sqlalchemy.exc import O...
agpl-3.0
huangtao2003/androguard
tests/test_session.py
2
2675
import unittest import sys from androguard.core.bytecodes.apk import APK from androguard import session class SessionTest(unittest.TestCase): def testSessionDex(self): s = session.Session() with open("examples/android/TestsAndroguard/bin/classes.dex", "rb") as fd: s...
apache-2.0
h4r5h1t/django-hauthy
tests/db_functions/tests.py
37
10228
from __future__ import unicode_literals from django.db.models import CharField, TextField, Value as V from django.db.models.functions import ( Coalesce, Concat, Length, Lower, Substr, Upper, ) from django.test import TestCase from django.utils import six, timezone from .models import Article, Author lorem_ipsum...
bsd-3-clause
sylvestre/bedrock
bedrock/wordpress/migrations/0001_initial.py
9
1070
# -*- coding: utf-8 -*- from django.db import migrations, models import django_extensions.db.fields.json class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='BlogPost', fields=[ ('id', models.AutoField(verb...
mpl-2.0
khertan/ownNotes
Desktop/python/markdown/serializers.py
2
9821
# markdown/searializers.py # # Add x/html serialization to Elementree # Taken from ElementTree 1.3 preview with slight modifications # # Copyright (c) 1999-2007 by Fredrik Lundh. All rights reserved. # # fredrik@pythonware.com # http://www.pythonware.com # # --------------------------------------------------...
gpl-3.0
youfoh/webkit-efl
Source/WebKit/chromium/scripts/generate_devtools_extension_api.py
8
2278
#!/usr/bin/env python # # Copyright (C) 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...
lgpl-2.1
rob356/SickRage
lib/unidecode/x06b.py
252
4608
data = ( 'Xiang ', # 0x00 'Nong ', # 0x01 'Bo ', # 0x02 'Chan ', # 0x03 'Lan ', # 0x04 'Ju ', # 0x05 'Shuang ', # 0x06 'She ', # 0x07 'Wei ', # 0x08 'Cong ', # 0x09 'Quan ', # 0x0a 'Qu ', # 0x0b 'Cang ', # 0x0c '[?] ', # 0x0d 'Yu ', # 0x0e 'Luo ', # 0x0f 'Li ', # 0x10 ...
gpl-3.0
mbed-ci/mbed-os-fork-ci
tools/export/kds/__init__.py
16
1603
""" mbed SDK Copyright (c) 2011-2016 ARM Limited 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 wr...
apache-2.0
sharkerz/deluge-yarss-plugin
yarss2/include/uuid.py
8
20944
r"""UUID objects (universally unique identifiers) according to RFC 4122. This module provides immutable UUID objects (class UUID) and the functions uuid1(), uuid3(), uuid4(), uuid5() for generating version 1, 3, 4, and 5 UUIDs as specified in RFC 4122. If all you want is a unique ID, you should probably call uuid1() ...
gpl-3.0
timbalam/GroopM
groopm/classification.py
1
7125
#!/usr/bin/env python ############################################################################### # # # classification.py # # ...
gpl-3.0