repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
txomon/SpockBot | spock/mcp/mcpacket.py | 1 | 4216 | try:
basestring
except NameError:
basestring = str
import copy
import logging
import zlib
from time import gmtime, strftime
from spock import utils
from spock.mcp import datautils, mcdata
from spock.mcp.mcdata import MC_VARINT
from spock.mcp.mcpacket_extensions import hashed_extensions
logger = logging.getL... | mit |
anyweez/regis | face/offline/Terms/Term.py | 2 | 1150 |
class BaseTerm(object):
def __init__(self):
# TODO: Move term_focus code into constructors in Terms.
self.user = None
self.template = None
def execute(self, params):
raise NotImplementedError
'''
Some library functions that can be used by other terms.
'''
# get_contents fetches the c... | gpl-2.0 |
fedorpatlin/ansible | lib/ansible/modules/cloud/ovirt/ovirt_templates.py | 26 | 11499 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (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
#... | gpl-3.0 |
thinkopensolutions/tkobr-addons | unported/tko_partner_sequence/__openerp__.py | 2 | 1846 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# ThinkOpen Solutions Brasil
# Copyright (C) Thinkopen Solutions <http://www.tkobr.com>.
#
# This... | agpl-3.0 |
elmerdpadilla/iv | addons/mrp_repair/__init__.py | 380 | 1087 | # -*- 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... | agpl-3.0 |
jfelectron/python-driver | tests/unit/test_host_connection_pool.py | 7 | 10033 | # Copyright 2013-2015 DataStax, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | apache-2.0 |
tensorflow/models | research/object_detection/inference/detection_inference.py | 2 | 5516 | # 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... | apache-2.0 |
Salat-Cx65/python-for-android | python3-alpha/python3-src/Lib/test/test_pep263.py | 62 | 1846 | # -*- coding: koi8-r -*-
import unittest
from test import support
class PEP263Test(unittest.TestCase):
def test_pep263(self):
self.assertEqual(
"ðÉÔÏÎ".encode("utf-8"),
b'\xd0\x9f\xd0\xb8\xd1\x82\xd0\xbe\xd0\xbd'
)
self.assertEqual(
"\ð".encode("utf-8")... | apache-2.0 |
TopherGopher/aws-infra.jenkins-scripts | s3trim.py | 1 | 7063 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Example usage:
# python s3trim.py --count 14 --key=AWS_KEY --secret=AWS_SECRET_KEY nmdarchive christest/production
import argparse
import logging
import operator
import re
import time
from collections import OrderedDict as Dict
from boto.s3.connection import S3Connection... | mit |
andersinno/foosball | config/settings/common.py | 1 | 9129 | # -*- coding: utf-8 -*-
"""
Django settings for foosball project.
For more information on this file, see
https://docs.djangoproject.com/en/dev/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/dev/ref/settings/
"""
from __future__ import absolute_import, unicode_li... | mit |
cyb0/volatility | contrib/plugins/scanprof.py | 55 | 1965 | # Volatility
#
# Authors:
# Mike Auty <mike.auty@gmail.com>
#
# 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 op... | gpl-2.0 |
quentinlautischer/291MiniProject2 | lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/filepost.py | 551 | 2512 | # urllib3/filepost.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
import codecs
import mimetypes
from uuid import uuid4
from io import BytesIO
from .packages ... | apache-2.0 |
switchboardOp/ansible | lib/ansible/module_utils/_text.py | 23 | 12327 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
jrversteegh/softsailor | deps/scipy-0.10.0b2/scipy/fftpack/tests/test_basic.py | 5 | 29597 | #!/usr/bin/env python
# Created by Pearu Peterson, September 2002
""" Test functions for fftpack.basic module
"""
__usage__ = """
Build fftpack:
python setup_fftpack.py build
Run tests if scipy is installed:
python -c 'import scipy;scipy.fftpack.test()'
Run tests if fftpack is not installed:
python tests/test_bas... | gpl-3.0 |
bolkedebruin/airflow | airflow/providers/apache/spark/hooks/spark_jdbc.py | 1 | 11610 | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | apache-2.0 |
arantebillywilson/python-snippets | microblog/flask/lib/python3.5/site-packages/sqlalchemy/testing/util.py | 15 | 7540 | # testing/util.py
# Copyright (C) 2005-2017 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 ..util import jython, pypy, defaultdict, decorator, py2k
import decimal
import ... | mit |
Tehsmash/nova | nova/tests/unit/console/test_websocketproxy.py | 18 | 12608 | # 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 agreed to in... | apache-2.0 |
maciekcc/tensorflow | tensorflow/python/estimator/canned/parsing_utils_test.py | 74 | 8522 | # 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... | apache-2.0 |
a-veitch/grpc | tools/buildgen/bunch.py | 44 | 2469 | # Copyright 2015, 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... | bsd-3-clause |
a10networks/a10sdk-python | a10sdk/core/A10_file/file_geo_location_oper.py | 2 | 2101 | from a10sdk.common.A10BaseClass import A10BaseClass
class FileList(A10BaseClass):
"""This class does not support CRUD Operations please use parent.
:param file: {"type": "string", "format": "string"}
:param DeviceProxy: The device proxy for REST operations and session handling. Refer to `common/devi... | apache-2.0 |
12wang3/python | JiYouMCC/0013/0013.py | 26 | 1432 | import urllib2
import urllib
import re
import os
import uuid
def get_images(html_url='http://ycool.com/post/ae3u4zu',
folder_name='jiyou_blog_PingLiangRoad',
extensions=['gif', 'jpg', 'png']):
request_html = urllib2.Request(html_url)
try:
response = urllib2.urlopen(reques... | mit |
NoahFlowa/glowing-spoon | venv/lib/python2.7/site-packages/psycopg2/tests/test_extras_dictcursor.py | 7 | 17453 | #!/usr/bin/env python
#
# extras_dictcursor - test if DictCursor extension class works
#
# Copyright (C) 2004-2010 Federico Di Gregorio <fog@debian.org>
#
# psycopg2 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... | apache-2.0 |
arborh/tensorflow | tensorflow/python/keras/distribute/multi_worker_testing_utils.py | 11 | 3136 | # Copyright 2019 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 |
datacommonsorg/data | scripts/india_census/common/generic_base.py | 1 | 5322 | # 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 |
AlphaSmartDog/DeepLearningNotes | Note-1 RNN-DNC择时/Note-1-2 PonderingDNCore L2正则化示例/DNCore.py | 3 | 46187 |
# coding: utf-8
# # DNCore
#
# #### Hybrid computing using a neural network with dynamic external memory
# #### differentiable neural computer
#
# ##### 2017-09-02 DNCore封装
# - calculate 该模块不参与时序间传递
# - update 该模块参与时序间传递,需要上一时刻模块状态
# In[ ]:
import numpy as np
import tensorflow as tf
from sonnet.python.modules.ba... | mit |
kchodorow/tensorflow | tensorflow/python/training/optimizer_test.py | 74 | 8790 | # 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 |
fxcebx/sumatrapdf | scripts/gen_settings_html.py | 14 | 9864 | #!/usr/bin/env python
import os
import util2
import gen_settingsstructs
import trans_langs
"""
TODO:
* for gen_langs_html, show languages that don't have enough translations
in a separate table
"""
g_version = util2.get_sumatrapdf_version()
html_tmpl = """\
<!doctype html>
<html>
<head>
<me... | gpl-3.0 |
peguin40/zulip | zerver/views/webhooks/papertrail.py | 3 | 2157 | from __future__ import absolute_import
from django.utils.translation import ugettext as _
from zerver.lib.actions import check_send_message
from zerver.lib.response import json_success, json_error
from zerver.decorator import REQ, has_request_variables, api_key_only_webhook_view
from zerver.lib.validator import check_d... | apache-2.0 |
hryamzik/ansible | lib/ansible/modules/network/vyos/vyos_config.py | 1 | 8948 | #!/usr/bin/python
#
# 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 distribut... | gpl-3.0 |
2ndy/RaspIM | usr/lib/python2.7/xml/dom/xmlbuilder.py | 239 | 12337 | """Implementation of the DOM Level 3 'LS-Load' feature."""
import copy
import xml.dom
from xml.dom.NodeFilter import NodeFilter
__all__ = ["DOMBuilder", "DOMEntityResolver", "DOMInputSource"]
class Options:
"""Features object that has variables set for each DOMBuilder feature.
The DOMBuilder class uses a... | gpl-2.0 |
n0trax/ansible | lib/ansible/parsing/metadata.py | 41 | 10025 | # (c) 2017, Toshio Kuratomi <tkuratomi@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 version 3 of the License, or
# (at your option) any later... | gpl-3.0 |
bundgus/python-playground | matplotlib-playground/examples/event_handling/looking_glass.py | 1 | 1280 | import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as patches
x, y = np.random.rand(2, 200)
fig, ax = plt.subplots()
circ = patches.Circle((0.5, 0.5), 0.25, alpha=0.8, fc='yellow')
ax.add_patch(circ)
ax.plot(x, y, alpha=0.2)
line, = ax.plot(x, y, alpha=1.0, clip_path=circ)
class EventHand... | mit |
cgar/servo | tests/wpt/mozilla/tests/mozilla/referrer-policy/generic/tools/common_paths.py | 238 | 1823 | import os, sys, json, re
script_directory = os.path.dirname(os.path.abspath(__file__))
generic_directory = os.path.abspath(os.path.join(script_directory, '..'))
template_directory = os.path.abspath(os.path.join(script_directory,
'..',
... | mpl-2.0 |
bask/or-tools | examples/python/sendmore.py | 32 | 1840 | # Copyright 2010-2014 Google
# 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, so... | apache-2.0 |
yatinkumbhare/openstack-nova | nova/pci/manager.py | 26 | 11491 | # Copyright (c) 2013 Intel, Inc.
# Copyright (c) 2013 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/li... | apache-2.0 |
zbarge/zeex | zeex/core/views/actions/merge_purge.py | 1 | 33284 | """
MIT License
Copyright (c) 2016 Zeke Barge
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, di... | mit |
touqir14/Cmput_692_project | Extract_Context_From_Snippets_Surrounding_6_Words.py | 1 | 1310 | from sys import getsizeof
import collections
import pickle
# import timeit
from sys import getsizeof
import time
import csv
import io
output = io.StringIO()
with open('../dictionary_Nikon_Snippet_Surroundings.pickle', 'rb') as f:
d = (pickle.load(f))
with open('/Users/sasa/Dropbox/1-Uni/CMPUT 692/Project/Code... | apache-2.0 |
sayedmohamed/pomodora-todo | pomotodo/mytodo/migrations/0001_initial.py | 1 | 6658 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as 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 'Project'
db.create_table(u'mytodo_project', (
... | gpl-2.0 |
daltonsena/eyed3 | examples/chapters.py | 2 | 3470 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
################################################################################
# Copyright (C) 2012 Travis Shirk <travis@pobox.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publi... | gpl-2.0 |
jokkebk/euler | p59.py | 1 | 5359 | cipher = [79, 59, 12, 2, 79, 35, 8, 28, 20, 2, 3, 68, 8, 9, 68, 45, 0, 12, 9,
67, 68, 4, 7, 5, 23, 27, 1, 21, 79, 85, 78, 79, 85, 71, 38, 10, 71, 27,
12, 2, 79, 6, 2, 8, 13, 9, 1, 13, 9, 8, 68, 19, 7, 1, 71, 56, 11, 21,
11, 68, 6, 3, 22, 2, 14, 0, 30, 79, 1, 31, 6, 23, 19, 10, 0, 73, 79,
... | mit |
HTCKernels/One-SV-international-k2u | 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 |
splotz90/urh | src/urh/models/PluginListModel.py | 1 | 1635 | from PyQt5.QtCore import QAbstractListModel, Qt, QModelIndex
from PyQt5.QtGui import QFont
from urh import constants
from urh.plugins import Plugin
class PluginListModel(QAbstractListModel):
def __init__(self, plugins, highlighted_plugins = None, parent=None):
"""
:type plugins: list of Plugin
... | gpl-3.0 |
commagere/commagere.com | main.py | 1 | 1348 | import os
import jinja2
import webapp2
"""
For Unit testing:
https://cloud.google.com/appengine/docs/python/tools/handlertesting
"""
JINJA_ENVIRONMENT = jinja2.Environment(
loader=jinja2.FileSystemLoader(os.path.dirname(__file__)),
extensions=['jinja2.ext.autoescape'],
autoescape=True)
def prep_template... | mit |
vesellov/bitdust.devel | services/service_my_ip_port.py | 1 | 1681 | #!/usr/bin/python
# service_my_ip_port.py
#
# Copyright (C) 2008-2018 Veselin Penev, https://bitdust.io
#
# This file (service_my_ip_port.py) is part of BitDust Software.
#
# BitDust is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# t... | agpl-3.0 |
lliendo/PyZ80 | pyz80/tests/test_cpu.py | 1 | 1256 | # -*- coding: utf-8 -*-
"""
This file is part of PyZ80.
PyZ80 is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
PyZ80 is distributed ... | lgpl-3.0 |
dangillet/cocos | tools/view_skeleton.py | 6 | 1215 | from __future__ import division, print_function, unicode_literals
# This code is so you can run the samples without installing the package
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
#
import imp
## import all the stuff we need from cocos
import cocos
from cocos.director im... | bsd-3-clause |
Alexanau/table | table.py | 1 | 1041 | #!/usr/bin/python
import getopt as g
import sys
optlist, args = g.getopt(sys.argv[1:],'d:')
delim = ','
for o,a in optlist:
if o == '-d':
delim = a
max_width = [0]
with open(args[0],'r') as fh:
for line in fh:
line = line.rstrip()
fields = line.split(delim)
for idx,field in enumerate(fields):
... | mit |
SDSG-Invenio/invenio | invenio/modules/formatter/format_elements/bfe_photos.py | 13 | 5832 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2008, 2009, 2010, 2011, 2014 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 (a... | gpl-2.0 |
heliazandi/volttron-applications | pnnl/PGnE/pgne/agent.py | 3 | 12179 | # -*- coding: utf-8 -*- {{{
# vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et:
# Copyright (c) 2016, Battelle Memorial Institute
# 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. Redistri... | bsd-3-clause |
nazavode/automaton | src/automaton.py | 2 | 24218 | # -*- coding: utf-8 -*-
#
# Copyright 2015 Federico Ficarelli
#
# 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 |
LaynePeng/magnum | magnum/db/sqlalchemy/migration.py | 8 | 3663 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... | apache-2.0 |
miguelgaio/parameter-framework | tools/xmlGenerator/EddParser.py | 2 | 30382 | #!/usr/bin/python2
# -*-coding:utf-8 -*
# Copyright (c) 2011-2014, Intel Corporation
# 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 co... | bsd-3-clause |
philsch/ansible | lib/ansible/module_utils/splitter.py | 197 | 9433 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
AmrnotAmr/zato | code/zato-web-admin/src/zato/admin/web/forms/scheduler.py | 7 | 2074 | # -*- coding: utf-8 -*-
"""
Copyright (C) 2010 Dariusz Suchojad <dsuch at zato.io>
Licensed under LGPLv3, see LICENSE.txt for terms and conditions.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
# Django
from django import forms
# Zato
from zato.admin.web.forms import add_se... | gpl-3.0 |
pquentin/django | tests/expressions_case/models.py | 14 | 2855 | from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
try:
from PIL import Image
except ImportError:
Image = None
@python_2_unicode_compatible
class CaseTestModel(models.Model):
integer = models.IntegerField()
integer2 = mo... | bsd-3-clause |
mlperf/training_results_v0.7 | Fujitsu/benchmarks/resnet/implementations/implementation_open/mxnet/3rdparty/tvm/python/tvm/autotvm/database.py | 1 | 6064 | # 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 u... | apache-2.0 |
b3j0f/schema | b3j0f/schema/utils.py | 1 | 13398 | # -*- coding: utf-8 -*-
# --------------------------------------------------------------------
# The MIT License (MIT)
#
# Copyright (c) 2016 Jonathan Labéjof <jonathan.labejof@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation fi... | mit |
getbraincloud/braincloud-cpp | tests/gtest-1.7.0/test/gtest_filter_unittest.py | 2826 | 21261 | #!/usr/bin/env python
#
# Copyright 2005 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... | apache-2.0 |
iuliat/nova | nova/consoleauth/manager.py | 58 | 5302 | #!/usr/bin/env python
# Copyright (c) 2012 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/LICEN... | apache-2.0 |
kittiu/odoo | addons/auth_ldap/__init__.py | 442 | 1049 | ##############################################################################
#
# 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 GNU Affero General Publ... | agpl-3.0 |
csrocha/OpenUpgrade | addons/crm_helpdesk/report/crm_helpdesk_report.py | 309 | 4633 | # -*- 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 |
pombredanne/ghost-tree | ghosttree/silva/tests/test_filter.py | 1 | 3455 | # ----------------------------------------------------------------------------
# Copyright (c) 2015--, ghost-tree development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the LICENSE file, distributed with this software.
# ------------------------------------------------... | bsd-3-clause |
mattvick/phantomjs | src/qt/qtwebkit/Source/WebCore/inspector/compile-front-end.py | 116 | 15388 | #!/usr/bin/env python
# Copyright (c) 2012 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 |
sserrot/champion_relationships | venv/Lib/site-packages/setuptools/_distutils/command/check.py | 28 | 5637 | """distutils.command.check
Implements the Distutils 'check' command.
"""
from distutils.core import Command
from distutils.errors import DistutilsSetupError
try:
# docutils is installed
from docutils.utils import Reporter
from docutils.parsers.rst import Parser
from docutils import frontend
from d... | mit |
lxybox1/MissionPlanner | Lib/logging/handlers.py | 53 | 46301 | # Copyright 2001-2010 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this perm... | gpl-3.0 |
hdoria/namcap | Namcap/perllocal.py | 2 | 1251 | #
# namcap rules - perllocal
# Copyright (C) 2003-2007 Jason Chu <jason@archlinux.org>
#
# 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 ... | gpl-2.0 |
interaktiviti/cookiecutter-django | {{cookiecutter.repo_name}}/docs/conf.py | 38 | 8103 | # -*- coding: utf-8 -*-
#
# {{ cookiecutter.project_name }} documentation build configuration file, created by
# sphinx-quickstart.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All con... | bsd-3-clause |
Sarah-Alsinan/muypicky | lib/python3.6/site-packages/django/views/generic/base.py | 115 | 7583 | from __future__ import unicode_literals
import logging
from functools import update_wrapper
from django import http
from django.core.exceptions import ImproperlyConfigured
from django.template.response import TemplateResponse
from django.urls import NoReverseMatch, reverse
from django.utils import six
from django.uti... | mit |
zhouxiao-coder/Paddle | demo/gan/gan_conf_image.py | 3 | 8238 | # Copyright (c) 2016 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 applic... | apache-2.0 |
40223133/2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/multiprocessing/process.py | 694 | 2304 | #
# Module providing the `Process` class which emulates `threading.Thread`
#
# multiprocessing/process.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
__all__ = ['Process', 'current_process', 'active_children']
#
# Imports
#
import os
import sys
import signal
import itert... | gpl-3.0 |
ashmastaflash/IDCOAS | integration/heatmaps/heatmap-2.2.1/build/lib.macosx-10.9-x86_64-2.7/heatmap/colorschemes.py | 6 | 33688 | """ color scheme source data """
schemes = {'classic': [(255, 237, 237),
(255, 224, 224),
(255, 209, 209),
(255, 193, 193),
(255, 176, 176),
(255, 159, 159),
(255, 142, 142),
(255, 126, 126),
(255, 110, 110),
... | gpl-2.0 |
chrber/dcache-docker | dcache/deps/.vim/bundle/jedi-vim/jedi/test/completion/descriptors.py | 13 | 3399 | class RevealAccess(object):
"""
A data descriptor that sets and returns values
normally and prints a message logging their access.
"""
def __init__(self, initval=None, name='var'):
self.val = initval
self.name = name
def __get__(self, obj, objtype):
print('Retrieving', s... | gpl-3.0 |
michelts/lettuce | tests/integration/lib/Django-1.2.5/django/conf/locale/no/formats.py | 236 | 1277 | DATE_FORMAT = 'j. F Y'
TIME_FORMAT = 'H:i'
DATETIME_FORMAT = 'j. F Y H:i'
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORMAT = 'j. F'
SHORT_DATE_FORMAT = 'd.m.Y'
SHORT_DATETIME_FORMAT = 'd.m.Y H:i'
FIRST_DAY_OF_WEEK = 1 # Monday
DATE_INPUT_FORMATS = (
'%Y-%m-%d', '%j.%m.%Y', '%j.%m.%y', # '2006-10-25', '25.10.2006', '25.10... | gpl-3.0 |
Juanvulcano/zulip | bots/jabber_mirror.py | 21 | 2196 | #!/usr/bin/env python
# Copyright (C) 2014 Zulip, Inc.
#
# 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, m... | apache-2.0 |
Immortalin/python-for-android | python-modules/twisted/twisted/protocols/stateful.py | 61 | 1722 | # -*- test-case-name: twisted.test.test_stateful -*-
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
from twisted.internet import protocol
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
class StatefulProtocol(protocol.Protocol):
"... | apache-2.0 |
Denisolt/Tensorflow_Chat_Bot | local/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/estimators/random_forest_test.py | 15 | 2949 | # 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... | gpl-3.0 |
jmighion/ansible | test/units/modules/network/junos/test_junos_config.py | 7 | 7467 | #
# (c) 2017 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 d... | gpl-3.0 |
WASPACDC/hmdsm.repository | plugin.video.playlistLoader/resources/lib/chardet/big5prober.py | 2931 | 1684 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | gpl-2.0 |
edxzw/edx-platform | cms/djangoapps/contentstore/views/library.py | 36 | 9259 | """
Views related to content libraries.
A content library is a structure containing XBlocks which can be re-used in the
multiple courses.
"""
from __future__ import absolute_import
import json
import logging
from contentstore.views.item import create_xblock_info
from contentstore.utils import reverse_library_url, add... | agpl-3.0 |
devs1991/test_edx_docmode | openedx/core/djangoapps/user_api/course_tag/tests/test_api.py | 14 | 1402 | """
Test the user course tag API.
"""
from django.test import TestCase
from student.tests.factories import UserFactory
from nose.plugins.attrib import attr
from openedx.core.djangoapps.user_api.course_tag import api as course_tag_api
from opaque_keys.edx.locations import SlashSeparatedCourseKey
@attr('shard_2')
clas... | agpl-3.0 |
jwiegley/offlineimap | offlineimap/folder/Maildir.py | 2 | 12410 | # Maildir folder support
# Copyright (C) 2002 - 2007 John Goerzen
# <jgoerzen@complete.org>
#
# 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
# (a... | gpl-2.0 |
joelbrock/NOFC_CORE | documentation/Reference Code/Wedge/installation/install_server.py | 10 | 1189 | #!/usr/bin/env python
import warnings
from installers import *
def install_server_db(username, password, sample_data=False):
import MySQLdb
connection = MySQLdb.connect("localhost", username, password)
exec_script(connection, "script/create_server_db.sql")
warnings.filterwarnings("i... | gpl-2.0 |
esten/StoriTell | StoriTell/tastypie/http.py | 2 | 1162 | """
The various HTTP responses for use in returning proper HTTP codes.
"""
from django.http import HttpResponse
class HttpCreated(HttpResponse):
status_code = 201
def __init__(self, *args, **kwargs):
if 'location' in kwargs:
location = kwargs['location']
del(kwargs['locati... | bsd-3-clause |
openlabs/nereid-project | __init__.py | 2 | 1518 | # -*- coding: utf-8 -*-
'''
nereid_project
:copyright: (c) 2010-2014 by Openlabs Technologies & Consulting (P) Ltd.
:license: GPLv3, see LICENSE for more details
'''
from trytond.pool import Pool
from website import WebSite
from project import (
ProjectWorkMember, ProjectInvitation, ProjectWorkInvita... | gpl-3.0 |
davits/ycmd | ycmd/tests/typescript/debug_info_test.py | 4 | 1812 | # Copyright (C) 2016-2020 ycmd contributors
#
# This file is part of ycmd.
#
# ycmd 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.
#
#... | gpl-3.0 |
uskudnik/ggrc-core | src/ggrc_basic_permissions/migrations/versions/20131116190735_18bf74925b9_public_programs_are_.py | 2 | 1885 |
"""Public programs are ownable.
Revision ID: 18bf74925b9
Revises: 4148ce155e54
Create Date: 2013-11-16 19:07:35.284837
"""
# revision identifiers, used by Alembic.
revision = '18bf74925b9'
down_revision = '4148ce155e54'
import json
import sqlalchemy as sa
from alembic import op
from datetime import datetime
from s... | apache-2.0 |
SrNetoChan/QGIS | tests/src/python/test_qgslocaldefaultsettings.py | 36 | 2306 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsLocalDefaultSettings.
.. note:: 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 versio... | gpl-2.0 |
mindriot101/bokeh | tests/integration/tools/test_poly_draw_tool.py | 5 | 9020 | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2017, Anaconda, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#---------------------------------------------------... | bsd-3-clause |
argivaitv/argivaitv | repo/plugin.video.phstreams/resources/lib/sources/onlinemoviesv2_mv.py | 7 | 3174 | # -*- 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 |
antb/TPT----My-old-mod | src/python/stdlib/encodings/cp852.py | 593 | 35258 | """ Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP852.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_map)
def decode(self,input,errors='strict'):
... | gpl-2.0 |
ehashman/oh-mainline | vendor/packages/python-social-auth/social/apps/django_app/middleware.py | 70 | 2285 | # -*- coding: utf-8 -*-
import six
from django.conf import settings
from django.contrib import messages
from django.contrib.messages.api import MessageFailure
from django.shortcuts import redirect
from django.utils.http import urlquote
from social.exceptions import SocialAuthBaseException
from social.utils import soc... | agpl-3.0 |
ssh-odoo/psd-tools | tests/test_layer_effects.py | 5 | 3253 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import pytest
from .utils import decode_psd
from psd_tools.constants import BlendMode
psd = decode_psd('layer_params.psd')
layer_records = psd.layer_and_mask_data.layers.layer_records
EFFECTS_COUNT = (
(1, 7),
(2, 7)
)
EFFECTS... | mit |
javachengwc/hue | desktop/core/ext-py/cx_Oracle-5.1.2/test/Cursor.py | 34 | 11221 | """Module for testing cursor objects."""
import cx_Oracle
import sys
class TestCursor(BaseTestCase):
def testExecuteNoArgs(self):
"""test executing a statement without any arguments"""
result = self.cursor.execute("begin null; end;")
self.failUnlessEqual(result, None)
def testExecute... | apache-2.0 |
lunyang/pylearn2 | pylearn2/utils/tests/test_pooling.py | 49 | 4239 | """Test pooling-related code in pooling.py"""
import numpy as np
from pylearn2.utils.pooling import pooling_matrix
from pylearn2.testing.skip import skip_if_no_scipy
def test_pooling_no_topology():
mat = pooling_matrix(4, 5)
assert mat.shape == (4, 20)
expected = np.array([[1] * 5 + [0] * 15,
... | bsd-3-clause |
aio-libs/aiobotocore | tests/test_response.py | 1 | 5549 | import io
import pytest
from aiobotocore import response
from botocore.exceptions import IncompleteReadError
# https://github.com/boto/botocore/blob/develop/tests/unit/test_response.py
async def assert_lines(line_iterator, expected_lines):
for expected_line in expected_lines:
line = await line_iterator._... | apache-2.0 |
tomevans/pyphotom | photom_class.py | 1 | 14267 | import numpy as np
import matplotlib.pyplot as plt
import pdb
import os
import cPickle
import numpy as np
import shutil
from photom import photom_inspect, photom_reduce, photom_absolute, photom_relative, photom_checks, photom_optimise
homestr = os.path.expanduser( '~' )
class photom():
"""
"""
def __init_... | gpl-2.0 |
taedla01/MissionPlanner | Lib/encodings/cp1251.py | 93 | 13924 | """ Python Character Mapping Codec cp1251 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1251.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def d... | gpl-3.0 |
brunogamacatao/portalsaladeaula | django/test/client.py | 9 | 20915 | import urllib
from urlparse import urlparse, urlunparse, urlsplit
import sys
import os
import re
import mimetypes
import warnings
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
from django.conf import settings
from django.contrib.auth import authenticate, login
from djang... | bsd-3-clause |
OmarIthawi/edx-platform | common/djangoapps/course_groups/views.py | 9 | 8261 | from django_future.csrf import ensure_csrf_cookie
from django.views.decorators.http import require_POST
from django.contrib.auth.models import User
from django.core.paginator import Paginator, EmptyPage
from django.core.urlresolvers import reverse
from django.http import Http404, HttpResponse, HttpResponseBadRequest
im... | agpl-3.0 |
Akasurde/ansible | test/support/network-integration/collections/ansible_collections/vyos/vyos/plugins/module_utils/network/vyos/facts/interfaces/interfaces.py | 47 | 4433 | #
# -*- coding: utf-8 -*-
# Copyright 2019 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
"""
The vyos interfaces fact class
It is in this file the configuration is collected from the device
for a given resource, parsed, and the facts tree is populated
based on th... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.