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 |
|---|---|---|---|---|---|
AdmiralNemo/ansible-modules-extras | system/alternatives.py | 8 | 5401 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Ansible module to manage symbolic link alternatives.
(c) 2014, Gabe Mulley <gabe.mulley@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 S... | gpl-3.0 |
gregdek/ansible | lib/ansible/modules/network/aci/aci_epg.py | 12 | 10462 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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',
'status': ['preview'],
... | gpl-3.0 |
guozhongxin/shadowsocks | shadowsocks/local.py | 1015 | 2248 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2012-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 r... | apache-2.0 |
cheza/ActivityDynamics | lib/network.py | 1 | 23860 | from __future__ import division
from time import sleep
from lib.util import *
from config import config
import math
import random
import numpy as np
from numpy.lib.type_check import real, imag
import datetime
from graph_tool.all import *
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from r... | gpl-2.0 |
philippeback/urbit | outside/commonmark/man/make_man_page.py | 23 | 3778 | #!/usr/bin/env python
# Creates a man page from a C file.
# Comments beginning with `/**` are treated as Groff man, except that
# 'this' is converted to \fIthis\fR, and ''this'' to \fBthis\fR.
# Non-blank lines immediately following a man page comment are treated
# as function signatures or examples and parsed into ... | mit |
clovett/MissionPlanner | Lib/encodings/cp1258.py | 93 | 13927 | """ Python Character Mapping Codec cp1258 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1258.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 |
thombashi/typepy | docs/conf.py | 1 | 5980 | import os
import sys
import sphinx_rtd_theme
from typepy import __author__, __copyright__, __name__, __version__
sys.path.insert(0, os.path.abspath('../typepy'))
# -- General configuration ------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be
# ext... | mit |
run2/citytour | 4symantec/Lib/site-packages/pip/_vendor/requests/packages/chardet/mbcsgroupprober.py | 2769 | 1967 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | mit |
ZenHarbinger/snapcraft | snapcraft/integrations/__init__.py | 7 | 1763 | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2015 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in the h... | gpl-3.0 |
arnavd96/Cinemiezer | myvenv/lib/python3.4/site-packages/boto/cloudsearch/sourceattribute.py | 153 | 3156 | # Copyright (c) 202 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 |
Eyeless95/samsung_g531_kernel | tools/perf/scripts/python/event_analyzing_sample.py | 4719 | 7393 | # event_analyzing_sample.py: general event handler in python
#
# Current perf report is already very powerful with the annotation integrated,
# and this script is not trying to be as powerful as perf report, but
# providing end user/developer a flexible way to analyze the events other
# than trace points.
#
# The 2 dat... | gpl-2.0 |
sandeepgupta2k4/tensorflow | tensorflow/examples/benchmark/sample_benchmark.py | 94 | 1605 | # 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 |
AfonsoFGarcia/swift | swift/common/middleware/list_endpoints.py | 29 | 10059 | # Copyright (c) 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | apache-2.0 |
Jgarcia-IAS/Fidelizacion_odoo | openerp/extras/jasper_reports/JasperReports/JasperServer.py | 2 | 4411 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2008-2012 NaN Projectes de Programari Lliure, S.L.
# http://www.NaN-tic.com
# Copyright (C) 2013 Tadeus Prastowo <tadeus.prastowo@infi-nity.com>
# Vi... | agpl-3.0 |
2013Commons/HUE-SHARK | apps/oozie/src/oozie/migrations/0015_auto__add_field_dataset_advanced_start_instance__add_field_dataset_ins.py | 39 | 24089 | # encoding: 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 field 'Dataset.advanced_start_instance'
db.add_column('oozie_dataset', 'advanced_start_instance', self.gf... | apache-2.0 |
idea4bsd/idea4bsd | python/lib/Lib/site-packages/django/contrib/localflavor/fr/fr_department.py | 314 | 3326 | # -*- coding: utf-8 -*-
DEPARTMENT_ASCII_CHOICES = (
('01', '01 - Ain'),
('02', '02 - Aisne'),
('03', '03 - Allier'),
('04', '04 - Alpes-de-Haute-Provence'),
('05', '05 - Hautes-Alpes'),
('06', '06 - Alpes-Maritimes'),
('07', '07 - Ardeche'),
('08', '08 - Ardennes'),
('09', '09 - Ar... | apache-2.0 |
lokI8/haas | haas/dev_support.py | 3 | 1857 | # Copyright 2013-2014 Massachusetts Open Cloud Contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | apache-2.0 |
jaronson/googletest | scripts/upload_gtest.py | 1963 | 2851 | #!/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 |
bobcyw/django | django/contrib/gis/db/backends/postgis/introspection.py | 330 | 5441 | from django.contrib.gis.gdal import OGRGeomType
from django.db.backends.postgresql.introspection import DatabaseIntrospection
class GeoIntrospectionError(Exception):
pass
class PostGISIntrospection(DatabaseIntrospection):
# Reverse dictionary for PostGIS geometry types not populated until
# introspectio... | bsd-3-clause |
motion2015/a3 | common/djangoapps/third_party_auth/tests/testutil.py | 38 | 3875 | """
Utilities for writing third_party_auth tests.
Used by Django and non-Django tests; must not have Django deps.
"""
from contextlib import contextmanager
import unittest
import mock
from third_party_auth import provider
AUTH_FEATURES_KEY = 'ENABLE_THIRD_PARTY_AUTH'
class FakeDjangoSettings(object):
"""A fa... | agpl-3.0 |
oscar810429/mysql-5.6_facebook | xtrabackup/test/kewpie/lib/test_mgmt/test_management.py | 22 | 11911 | #! /usr/bin/env python
# -*- mode: python; indent-tabs-mode: nil; -*-
# vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
#
# Copyright (C) 2010 Patrick Crews
#
# 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 ... | gpl-2.0 |
thruflo/ntorque | src/ntorque/work/requeue.py | 1 | 3511 | # -*- coding: utf-8 -*-
"""Provides ``RequeuePoller``, a utility that polls the db and add tasks
to the queue.
"""
__all__ = [
'RequeuePoller',
]
import logging
logger = logging.getLogger(__name__)
import time
import transaction
from datetime import datetime
from redis.exceptions import RedisError
from sqlal... | unlicense |
jacobraj/MAMA | site_scons/version_helper.py | 15 | 1706 | import os,re,posixpath
## Get the Module Versions
#
# Walk the project tree looking for VERSION.scons files. Read in these files
# and parse the versions accordingly, generating versions which can help
# facilitate building later. The dictionary is then passed to the environment
# for easy access
def get_project_vers... | lgpl-2.1 |
gganis/root | interpreter/llvm/src/docs/conf.py | 22 | 8481 | # -*- coding: utf-8 -*-
#
# LLVM documentation build configuration file.
#
# 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 configuration values have a default; values that are commented... | lgpl-2.1 |
AlanZatarain/urssus | urssus/postmodel.py | 4 | 11489 | # -*- coding: utf-8 -*-
# uRSSus, a multiplatform GUI news agregator
# Copyright (C) 2008 Roberto Alsina
#
# 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 distribu... | lgpl-2.1 |
eahneahn/free | lib/python2.7/site-packages/pip-1.5-py2.7.egg/pip/_vendor/colorama/ansi.py | 171 | 1089 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
'''
This module generates ANSI character codes to printing colors to terminals.
See: http://en.wikipedia.org/wiki/ANSI_escape_code
'''
CSI = '\033['
def code_to_chars(code):
return CSI + str(code) + 'm'
class AnsiCodes(object):... | agpl-3.0 |
CiscoSystems/nova | nova/compute/power_state.py | 47 | 2019 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Justin Santa Barbara
# All Rights Reserved.
# Copyright (c) 2010 Citrix Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# ... | apache-2.0 |
ricardoquesada/cocoslive | cocoslive/util.py | 2 | 2311 | #!/usr/bin/env python
#
# cocos live - (c) 2009 Ricardo Quesada
# http://www.cocoslive.net
#
# License: GNU GPL v3
# See the LICENSE file
#
__docformat__ = 'restructuredtext'
# GAE imports
from google.appengine.api import urlfetch
from google.appengine.api import memcache
# IMPORTNAT:
# geoutil contains the an URL w... | gpl-3.0 |
betaY/crawler | you-get-master/src/you_get/extractor.py | 3 | 8692 | #!/usr/bin/env python
from .common import match1, maybe_print, download_urls, get_filename, parse_host, set_proxy, unset_proxy
from .util import log
from . import json_output
import os
class Extractor():
def __init__(self, *args):
self.url = None
self.title = None
self.vid = None
s... | mit |
willbarton/observation-conditions | observation/conditions/map.py | 1 | 21998 | # -*- coding: utf-8 -*-
#
# Copyright 2010-2014 Will Barton.
# 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
# n... | bsd-3-clause |
cognitiveclass/edx-platform | lms/djangoapps/commerce/tests/__init__.py | 41 | 3664 | # -*- coding: utf-8 -*-
""" Commerce app tests package. """
import datetime
import json
from django.conf import settings
from django.test import TestCase
from django.test.utils import override_settings
from freezegun import freeze_time
import httpretty
import jwt
import mock
from edx_rest_api_client import auth
from ... | agpl-3.0 |
salilab/mdt | constr2005/bonds/asgl.py | 1 | 1074 | from modeller import *
import os
import mdt
import mdt.features
env = Environ()
mlib = mdt.Library(env)
mlib.bond_classes.read('${LIB}/bndgrp.lib')
xray = mdt.features.XRayResolution(mlib, bins=[(0.51, 2.001, 'High res(2.0A)')])
bond_type = mdt.features.BondType(mlib)
bond_length = mdt.features.BondLength(mlib,
... | gpl-2.0 |
Euphoria-OS-Devices/android_kernel_motorola_msm8226 | tools/perf/scripts/python/sched-migration.py | 11215 | 11670 | #!/usr/bin/python
#
# Cpu task migration overview toy
#
# Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com>
#
# perf script event handlers have been generated by perf script -g python
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Fre... | gpl-2.0 |
racmariano/skidom | backend/resorts/migrations/0006_auto_20171008_1416.py | 1 | 1078 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-10-08 18:16
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('dynamic_scraper', '0025_new_follow_pages_page_xpath_paginat... | mit |
kmee/l10n-brazil | sped_imposto/models/sped_cest.py | 2 | 2851 | # -*- coding: utf-8 -*-
#
# Copyright 2016 Taŭga Tecnologia
# Aristides Caldeira <aristides.caldeira@tauga.com.br>
# License AGPL-3 or later (http://www.gnu.org/licenses/agpl)
#
from __future__ import division, print_function, unicode_literals
import logging
from odoo import api, fields, models, _
from odoo.except... | agpl-3.0 |
richard-willowit/odoo | odoo/tools/mimetypes.py | 16 | 6661 | # -*- coding: utf-8 -*-
"""
Mimetypes-related utilities
# TODO: reexport stdlib mimetypes?
"""
import collections
import io
import logging
import re
import zipfile
__all__ = ['guess_mimetype']
_logger = logging.getLogger(__name__)
# We define our own guess_mimetype implementation and if magic is available we
# use ... | gpl-3.0 |
toymachine/concurrence | lib/concurrence/xmpp/sasl.py | 2 | 1493 | # Copyright (C) 2009, Hyves (Startphone Ltd.)
#
# This module is part of the Concurrence Framework and is released under
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
import binascii
import base64
import md5
import random
def H(s):
return md5.new(s).digest()
def KD(k, s):
return H... | bsd-3-clause |
mzadel/libmapper-sc | editors/sced/scedwin/py/Settings.py | 37 | 2412 | # sced (SuperCollider mode for gedit)
#
# Copyright 2012 Jakob Leben
# Copyright 2009 Artem Popov and other contributors (see AUTHORS)
#
# sced 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, ei... | gpl-3.0 |
cetic/ansible | lib/ansible/modules/network/avi/avi_gslb.py | 7 | 5653 | #!/usr/bin/python
#
# Created on Aug 25, 2016
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
# Avi Version: 17.1.1
#
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the te... | gpl-3.0 |
beezee/GAE-Django-base-app | django/conf/locale/it/formats.py | 232 | 1838 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'd F Y' # 25 Ottobre 2006
TIME_FORMAT = 'H:i:s' # 14:30:59
DATETIME_FORMAT... | bsd-3-clause |
TinLe/Diamond | src/collectors/ipvs/test/testipvs.py | 32 | 1828 | #!/usr/bin/python
# coding=utf-8
################################################################################
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from mock import Mock
from mock import patch
from diamond.collector import Collector
from ipvs import IPV... | mit |
hendrikx-itc/python-minerva | src/minerva/storage/outputdescriptor.py | 1 | 1040 | # -*- coding: utf-8 -*-
from minerva.storage.valuedescriptor import ValueDescriptor
from minerva.storage import datatype
class OutputDescriptor:
"""
Combines a value descriptor with configuration for serializing values.
"""
def __init__(
self, value_descriptor: ValueDescriptor,
... | gpl-3.0 |
mahendra-r/home-assistant | config/custom_components/mqtt_example.py | 19 | 1763 | """
custom_components.mqtt_example
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Shows how to communicate with MQTT. Follows a topic on MQTT and updates the
state of an entity to the last message received on that topic.
Also offers a service 'set_state' that will publish a message on the topic that
will be passed via MQTT to our mes... | mit |
jruben/jruben.github.io | node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/styles/default.py | 364 | 2532 | # -*- coding: utf-8 -*-
"""
pygments.styles.default
~~~~~~~~~~~~~~~~~~~~~~~
The default highlighting style.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token import Keyword, Name, Com... | mit |
petrjasek/superdesk-core | superdesk/media/image.py | 2 | 4149 | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
"""Utilities... | agpl-3.0 |
tpltnt/scapy | scapy/layers/llmnr.py | 4 | 2391 | from scapy.fields import *
from scapy.packet import *
from scapy.layers.inet import UDP
from scapy.layers.dns import DNSQRField, DNSRRField, DNSRRCountField
"""
LLMNR (Link Local Multicast Node Resolution).
[RFC 4795]
"""
#############################################################################
### ... | gpl-2.0 |
scikit-nano/scikit-nano | sknano/core/atoms/_poav_atoms.py | 2 | 20712 | # -*- coding: utf-8 -*-
"""
===============================================================================
Mixin Atom classes for POAV analysis (:mod:`sknano.core.atoms._poav_atoms`)
===============================================================================
.. currentmodule:: sknano.core.atoms._poav_atoms
"""
f... | bsd-2-clause |
xinwu/horizon | openstack_dashboard/test/integration_tests/tests/test_sahara_job_binaries.py | 50 | 3397 | # 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 |
freenas/samba | third_party/dnspython/dns/resolver.py | 47 | 43033 | # Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED "... | gpl-3.0 |
sergei-maertens/discord-bot | bot/plugins/remindme/tests/test_plugin.py | 1 | 3392 | from datetime import datetime
from unittest import TestCase, mock
from dateutil.relativedelta import relativedelta
from django.utils import timezone
from ..plugin import Plugin
class PluginTests(TestCase):
def test_parse_time(self):
plugin = Plugin(mock.MagicMock(), {})
def expected(**kwargs):... | mit |
nelmiux/CarnotKE | jyhton/lib-python/2.7/idlelib/ClassBrowser.py | 91 | 6369 | """Class browser.
XXX TO DO:
- reparse when source changed (maybe just a button would be OK?)
(or recheck on window popup)
- add popup menu with more options (e.g. doc strings, base classes, imports)
- show function argument list? (have to do pattern matching on source)
- should the classes and methods lists also... | apache-2.0 |
sergiopasra/megaradrp | megaradrp/instrument/components/lamps.py | 2 | 1718 | #
# Copyright 2016-2019 Universidad Complutense de Madrid
#
# This file is part of Megara DRP
#
# SPDX-License-Identifier: GPL-3.0+
# License-Filename: LICENSE.txt
#
import numpy as np
from astropy import units as u
from astropy.modeling.blackbody import blackbody_lambda
from numina.instrument.hwdevice import HWDevice... | gpl-3.0 |
racemidev/RegAdminForLinux | python/rregadmin/hive/key_cell_wrapper.py | 1 | 19637 | # generated by 'xml2py'
# flags '-c -d -v -k defst -lrregadmin -m rregadmin.util.glib_wrapper -m rregadmin.util.icu_wrapper -m rregadmin.util.path_wrapper -m rregadmin.util.icu_wrapper -m rregadmin.util.path_info_wrapper -m rregadmin.util.ustring_wrapper -m rregadmin.util.offset_wrapper -m rregadmin.util.value_wrapper ... | gpl-2.0 |
jonathonwalz/ansible | lib/ansible/modules/network/cloudengine/ce_bgp_neighbor_af.py | 26 | 109137 | #!/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 |
GbalsaC/bitnamiP | venv/lib/python2.7/site-packages/networkx/algorithms/vitality.py | 72 | 2488 | """
Vitality measures.
"""
# Copyright (C) 2012 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
import networkx as nx
__author__ = "\n".join(['Aric Hagberg (hagberg@lanl.gov)',
'Renato... | agpl-3.0 |
pawaranand/phrerp | erpnext/home/doctype/feed/feed.py | 37 | 1545 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
import frappe.defaults
import frappe.permissions
from frappe.model.document import Document
class Feed(Document):
pass
def on_doctyp... | agpl-3.0 |
Chilledheart/googletest | googlemock/scripts/upload_gmock.py | 770 | 2833 | #!/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 |
kamyu104/django | tests/aggregation_regress/tests.py | 102 | 55724 | from __future__ import unicode_literals
import datetime
import pickle
from decimal import Decimal
from operator import attrgetter
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import FieldError
from django.db import connection
from django.db.models import (
F, Q, Avg, Coun... | bsd-3-clause |
mick-d/nipype | doc/sphinxext/numpy_ext/docscrape.py | 10 | 15677 | # -*- coding: utf-8 -*-
"""Extract reference documentation from the NumPy source tree.
"""
from __future__ import print_function
from future import standard_library
standard_library.install_aliases()
from builtins import object
import inspect
import textwrap
import re
import pydoc
from warnings import warn
from io i... | bsd-3-clause |
gundalow/ansible | lib/ansible/utils/vars.py | 10 | 10215 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@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 version 3 of the License, or
# (at your option) an... | gpl-3.0 |
raymondnijssen/QGIS | tests/src/python/test_authmanager_pki_postgres.py | 11 | 9727 | # -*- coding: utf-8 -*-
"""
Tests for auth manager PKI access to postgres.
This is an integration test for QGIS Desktop Auth Manager postgres provider that
checks if QGIS can use a stored auth manager auth configuration to access
a PKI protected postgres.
Configuration from the environment:
* QGIS_POSTGRES_SERVE... | gpl-2.0 |
csmanjuvijay/usb-next | Documentation/target/tcm_mod_builder.py | 497 | 22865 | #!/usr/bin/python
# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
#
# Copyright (c) 2010 Rising Tide Systems
# Copyright (c) 2010 Linux-iSCSI.org
#
# Author: nab@kernel.org
#
import os, sys
import subprocess as sub
import string
import re
import optparse
tcm_dir = ""
fabric_ops... | gpl-2.0 |
rpavlik/chromium | progs/packertest/packertest.py | 4 | 45218 | #!/usr/bin/python
# Copyright (c) 2004, Red Hat.
# All rights reserved.
#
# See the file LICENSE.txt for information on redistributing this software.
# This script generates the packertest*.c files from the APIspec.txt file.
import sys, string, re
import copy
sys.path.append( "../../glapi_parser" )
import apiutil
... | bsd-3-clause |
sachintyagi22/spark | examples/src/main/python/streaming/flume_wordcount.py | 83 | 2032 | #
# 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 us... | apache-2.0 |
Petr-Kovalev/nupic-win32 | py/regions/KNNClassifierRegion.py | 2 | 42330 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# 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 conditi... | gpl-3.0 |
yghannam/teuthology | teuthology/beanstalk.py | 5 | 5121 | import beanstalkc
import yaml
import logging
import pprint
import sys
from collections import OrderedDict
from .config import config
from . import report
log = logging.getLogger(__name__)
def connect():
host = config.queue_host
port = config.queue_port
if host is None or port is None:
raise Runt... | mit |
TeamEOS/external_skia | tools/gen_bench_expectations_from_codereview.py | 67 | 5806 | #!/usr/bin/python
# Copyright (c) 2014 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.
"""Generate new bench expectations from results of trybots on a code review."""
import collections
import compare_codereview
import... | bsd-3-clause |
ZdenekM/artable | art_fake_nodes/src/grasping.py | 6 | 6629 | #!/usr/bin/env python
import rospy
from actionlib import SimpleActionServer
from art_msgs.msg import PickPlaceAction, PickPlaceGoal, PickPlaceResult, PickPlaceFeedback
import random
class FakeGrasping:
ALWAYS = 0
NEVER = 1
RANDOM = 2
def __init__(self):
self.left_server = SimpleActionServer(... | lgpl-2.1 |
faizan-barmawer/openstack_ironic | ironic/openstack/common/apiclient/client.py | 8 | 12937 | # Copyright 2010 Jacob Kaplan-Moss
# Copyright 2011 OpenStack Foundation
# Copyright 2011 Piston Cloud Computing, Inc.
# Copyright 2013 Alessio Ababilov
# Copyright 2013 Grid Dynamics
# Copyright 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you ... | apache-2.0 |
abhattad4/Digi-Menu | digimenu2/tests/template_tests/filter_tests/test_dictsort.py | 342 | 1477 | from django.template.defaultfilters import dictsort
from django.test import SimpleTestCase
class FunctionTests(SimpleTestCase):
def test_sort(self):
sorted_dicts = dictsort(
[{'age': 23, 'name': 'Barbara-Ann'},
{'age': 63, 'name': 'Ra Ra Rasputin'},
{'name': 'Jonny B... | bsd-3-clause |
petewarden/tensorflow | tensorflow/python/training/checkpoint_utils_test.py | 12 | 19687 | # 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 |
Rfam/rfam-production | scripts/release/genome_download_engine.py | 1 | 1660 | import os
import sys
import subprocess
from config import gen_config as gc
from config import rfam_local as rl
# ----------------------------------------------------------------------
def launch_genome_download(project_dir, upid_list):
fp = open(upid_list, 'r')
upids = [x.strip() for x in fp]
fp.close(... | apache-2.0 |
Factr/maya | test_maya.py | 1 | 2080 | import pytest
from datetime import datetime
import maya
def test_rfc2822():
r = maya.now().rfc2822()
d = maya.MayaDT.from_rfc2822(r)
assert r == d.rfc2822()
def test_iso8601():
r = maya.now().iso8601()
d = maya.MayaDT.from_iso8601(r)
assert r == d.iso8601()
def test_human_when():
r1 =... | mit |
karyon/django | tests/admin_filters/models.py | 39 | 2298 | 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 |
heracek/django-nonrel | django/contrib/localflavor/ie/ie_counties.py | 503 | 1127 | """
Sources:
Irish Counties: http://en.wikipedia.org/wiki/Counties_of_Ireland
"""
from django.utils.translation import ugettext_lazy as _
IE_COUNTY_CHOICES = (
('antrim', _('Antrim')),
('armagh', _('Armagh')),
('carlow', _('Carlow')),
('cavan', _('Cavan')),
('clare', _('Clare')),
('cork... | bsd-3-clause |
jeanpaul/bitbot | jsonrpc/serviceHandler.py | 61 | 3239 |
"""
Copyright (c) 2007 Jan-Klaas Kollhof
This file is part of jsonrpc.
jsonrpc 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 2.1 of the License, or
(at your option) any later... | mit |
retomerz/intellij-community | python/testData/refactoring/pullup/pyPullUpInfoModel.py | 80 | 1827 | class EmptyParent:pass
class SomeParent:
PARENT_CLASS_FIELD = 42
def __init__(self):
self.parent_instance_field = "egg"
def parent_func(self):
pass
class ChildWithDependencies(SomeParent, EmptyParent):
CLASS_FIELD_FOO = 42
CLASS_FIELD_DEPENDS_ON_CLASS_FIELD_FOO = CLASS_FIELD_FOO... | apache-2.0 |
akiellor/selenium | py/test/selenium/webdriver/common/alerts_tests.py | 4 | 3318 | #Copyright 2007-2009 WebDriver committers
#Copyright 2007-2009 Google Inc.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required b... | apache-2.0 |
pombredanne/dxr | dxr/plugins/clang/tests/test_operator_call.py | 7 | 2060 | from dxr.plugins.clang.tests import CSingleFileTestCase
class OperatorCallTests(CSingleFileTestCase):
source = """
struct Foo
{
void operator()(int)
{
}
void operator[](int)
{
}
};
int ... | mit |
harisibrahimkv/django | django/utils/crypto.py | 44 | 3092 | """
Django's standard crypto functions and utilities.
"""
import hashlib
import hmac
import random
import time
from django.conf import settings
from django.utils.encoding import force_bytes
# Use the system PRNG if possible
try:
random = random.SystemRandom()
using_sysrandom = True
except NotImplementedError:... | bsd-3-clause |
rhinstaller/anaconda | tests/unit_tests/pyanaconda_tests/modules/payloads/payload/test_flatpak_manager.py | 2 | 14244 | #
# Copyright (C) 2021 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distributed in the hope that it will be... | gpl-2.0 |
vbelakov/h2o | py/testdir_multi_jvm/notest_exec2_multi_node.py | 9 | 4457 | import unittest, sys, random, time
sys.path.extend(['.','..','../..','py'])
import h2o, h2o_cmd, h2o_browse as h2b, h2o_import as h2i, h2o_jobs, h2o_exec as h2e
import h2o_util
import multiprocessing, os, signal, time
from multiprocessing import Process, Queue
print "single writer, single reader flows (after sequenti... | apache-2.0 |
AndreasHeger/alignlib | python/bench/bench_Alignment.py | 1 | 2148 | import timeit
import alignlib
NUM_SAMPLES=1000
ALISIZE=2000
alignlib_vector = alignlib.makeAlignmentVector()
alignlib_vector.addDiagonal( 0, ALISIZE, 0)
python_vector = []
for x in xrange(ALISIZE):
python_vector.append(x)
def pythonBuildVector():
"""build vector alignment in python."""
vector = []
... | gpl-2.0 |
kenrachynski/powerline | tests/test_shells/postproc.py | 19 | 3660 | #!/usr/bin/env python
# vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, division, absolute_import, print_function)
import os
import socket
import sys
import codecs
import platform
import re
test_type = sys.argv[1]
test_client = sys.argv[2]
shell = sys.argv[3]
fname = os.path.join('tests', 'shel... | mit |
mayblue9/bokeh | examples/glyphs/daylight.py | 43 | 2889 | from __future__ import print_function
import numpy as np
import datetime as dt
from bokeh.browserlib import view
from bokeh.document import Document
from bokeh.embed import file_html
from bokeh.models.glyphs import Patch, Line, Text
from bokeh.models import (
ColumnDataSource, DataRange1d, DatetimeAxis,
Datet... | bsd-3-clause |
davenovak/mtasa-blue | vendor/google-breakpad/src/third_party/protobuf/protobuf/gtest/test/gtest_shuffle_test.py | 3023 | 12549 | #!/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 of... | gpl-3.0 |
jnerin/ansible | test/units/modules/network/onyx/test_onyx_config.py | 50 | 4600 | #
# (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 d... | gpl-3.0 |
BAGAsss/mrmc | tools/EventClients/lib/python/xbmcclient.py | 164 | 22913 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2008-2013 Team XBMC
#
# 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) ... | gpl-2.0 |
vishnugonela/boto | tests/integration/dynamodb/test_table.py | 136 | 3553 | # 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 restriction, including
# without limitation the rights ... | mit |
exowanderer/Charge-Carrier-Trapping-Comparison | Charge Carrier Trapping Experiment.py | 1 | 37127 |
# coding: utf-8
# # Charge Carrier Trapping Experiment
#
# CCT = Charge Carrier Trapping - This is a test of comparing the Zhou et al 2017 results with a data driven analysis using multinest
# In[ ]:
get_ipython().magic('matplotlib inline')
from pylab import *;ion()
from pandas import read_csv, DataFrame, concat
... | gpl-3.0 |
juangj/selenium | py/test/selenium/webdriver/common/frame_switching_tests.py | 2 | 17536 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
arista-eosplus/ansible | lib/ansible/modules/messaging/rabbitmq_binding.py | 69 | 7328 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Manuel Sousa <manuel.sousa@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 version 3 of the... | gpl-3.0 |
jmighion/ansible | lib/ansible/utils/module_docs_fragments/nxos.py | 87 | 4041 | #
# (c) 2015, Peter Sprygada <psprygada@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 late... | gpl-3.0 |
jinnykoo/wuyisj.com | src/oscar/apps/customer/notifications/views.py | 8 | 3485 | from django.utils.html import strip_tags
from django.utils.translation import ugettext_lazy as _, ungettext
from django.utils.timezone import now
from django.contrib import messages
from django.views import generic
from oscar.core.loading import get_model
from oscar.core.utils import redirect_to_referrer
from oscar.ap... | bsd-3-clause |
maartenq/ansible | lib/ansible/modules/database/misc/elasticsearch_plugin.py | 24 | 9640 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Mathew Davies <thepixeldeveloper@googlemail.com>
# (c) 2017, Sam Doran <sdoran@redhat.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__ = ... | gpl-3.0 |
gg7/sentry | src/sentry/migrations/0146_auto__add_field_auditlogentry_ip_address.py | 36 | 29197 | # -*- 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 field 'AuditLogEntry.ip_address'
db.add_column('sentry_auditlogentry', 'ip_address',
... | bsd-3-clause |
c-bit/c-bit | qa/rpc-tests/listtransactions.py | 1 | 10721 | #!/usr/bin/env python2
# Copyright (c) 2014-2015 The C-Bit Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Exercise the listtransactions API
from test_framework.test_framework import BitcoinTestFramework
from te... | mit |
mspark93/VTK | Rendering/Tk/Testing/Python/cursor3D.py | 5 | 9545 | #!/usr/bin/env python
'''
This little example shows how a cursor can be created in
image viewers, and renderers. The standard TkImageViewerWidget and
TkRenderWidget bindings are used. There is a new binding:
middle button in the image viewer sets the position of the cursor.
'''
import sys
from functools import p... | bsd-3-clause |
mvidalgarcia/indico | indico/modules/users/models/users_test.py | 2 | 5467 | # This file is part of Indico.
# Copyright (C) 2002 - 2019 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.
import itertools
import pytest
from speaklater import is_lazy_string
from sqlalchemy.exc import Integrity... | mit |
soellman/copernicus | cpc/dataflow/connection.py | 2 | 20714 | # This file is part of Copernicus
# http://www.copernicus-computing.org/
#
# Copyright (C) 2011, Sander Pronk, Iman Pouya, Erik Lindahl, and others.
#
# 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 Softwa... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.