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 |
|---|---|---|---|---|---|
archf/ansible | lib/ansible/modules/network/f5/bigip_monitor_tcp_echo.py | 16 | 16338 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2017 F5 Networks 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 |
sebrandon1/nova | nova/db/sqlalchemy/migrate_repo/versions/229_add_extra_resources_in_compute_nodes.py | 25 | 1358 | # Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
# 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 |
danmergens/mi-instrument | mi/dataset/driver/moas/gl/dosta/driver_common.py | 7 | 1132 | ##
# OOIPLACEHOLDER
#
# Copyright 2014 Raytheon Co.
##
__author__ = "mworden"
from mi.core.log import get_logger
from mi.dataset.dataset_driver import DataSetDriver
from mi.dataset.parser.glider import GliderParser
class DostaAbcdjmGliderDriver:
def __init__(self, source_file_path, particle_data_handler, parse... | bsd-2-clause |
syphar/django | tests/model_regress/models.py | 281 | 2293 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
CHOICES = (
(1, 'first'),
(2, 'second'),
)
@python_2_unicode_compatible
class Article(models.Model):
headline = models.CharField(max_length=100, defa... | bsd-3-clause |
lukeiwanski/tensorflow | tensorflow/python/ops/losses/losses.py | 61 | 1102 | # 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 |
5GExchange/escape | mininet/examples/test/test_multipoll.py | 2 | 1105 | #!/usr/bin/env python
"""
Test for multipoll.py
"""
import unittest
import pexpect
class testMultiPoll( unittest.TestCase ):
def testMultiPoll( self ):
"Verify that we receive one ping per second per host"
p = pexpect.spawn( 'python -m mininet.examples.multipoll' )
opts = [ "\*\*\* (h\d)... | apache-2.0 |
albertomurillo/ansible | lib/ansible/modules/network/f5/bigip_config.py | 15 | 13150 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
Beyond-Imagination/BlubBlub | ChatbotServer/ChatbotEnv/Lib/site-packages/konlpy/tag/_mecab.py | 1 | 3616 | #! /usr/bin/python
# -*- coding: utf-8 -*-
import sys
try:
from MeCab import Tagger
except ImportError:
pass
from .. import utils
__all__ = ['Mecab']
attrs = ['tags', # 품사 태그
'semantic', # 의미 부류
'has_jongsung', # 종성 유무
'read', # 읽기
'type', # 타입
... | gpl-3.0 |
CenturylinkTechnology/ansible-modules-extras | network/dnsimple.py | 16 | 11833 | #!/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 distributed... | gpl-3.0 |
cherylyli/stress-aid | env/lib/python3.5/site-packages/pymongo/server_selectors.py | 20 | 5307 | # Copyright 2014-2016 MongoDB, 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... | mit |
mcanthony/rethinkdb | external/v8_3.30.33.16/build/gyp/test/mac/gyptest-installname.py | 244 | 2512 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that LD_DYLIB_INSTALL_NAME and DYLIB_INSTALL_NAME_BASE are handled
correctly.
"""
import TestGyp
import re
import subprocess
... | agpl-3.0 |
jmptrader/dirigible-spreadsheet | dirigible/sheet/tests/parser/test_fl_cell_reference_parse_node.py | 2 | 6314 | # Copyright (c) 2005-2010 Resolver Systems Ltd, PythonAnywhere LLP
# See LICENSE.md
#
try:
import unittest2 as unittest
except ImportError:
import unittest
from sheet.parser.parse_node import ParseNode
from sheet.parser.fl_cell_reference_parse_node import FLCellReferenceParseNode
from sheet.parser.fl_referenc... | mit |
cristiandima/highlights | highlights/extractive/erank.py | 1 | 3576 | """
This is in many ways identical to the textrank algorithms. The only difference
is that we expand the sentence graph to also include the title of the text,
the topics associated with the text, and the named entitites present
The output is still an importance score for each sentence in the original text
but these ne... | mit |
SerialShadow/SickRage | autoProcessTV/lib/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.py | 2360 | 3778 | """The match_hostname() function from Python 3.3.3, essential when using SSL."""
# Note: This file is under the PSF license as the code comes from the python
# stdlib. http://docs.python.org/3/license.html
import re
__version__ = '3.4.0.2'
class CertificateError(ValueError):
pass
def _dnsname_match(dn, host... | gpl-3.0 |
jbzdak/edx-platform | cms/djangoapps/contentstore/views/tests/test_course_index.py | 5 | 35844 | """
Unit tests for getting the list of courses and the course outline.
"""
import ddt
import json
import lxml
import datetime
import mock
import pytz
from django.conf import settings
from django.core.exceptions import PermissionDenied
from django.utils.translation import ugettext as _
from contentstore.courseware_ind... | agpl-3.0 |
ujenmr/ansible | lib/ansible/modules/database/misc/kibana_plugin.py | 52 | 7252 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2016, Thierno IB. BARRY @barryib
# Sponsored by Polyconseil http://polyconseil.fr.
#
# 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__ = t... | gpl-3.0 |
nhejazi/scikit-learn | sklearn/neural_network/_base.py | 50 | 6856 | """Utilities for the neural network modules
"""
# Author: Issam H. Laradji <issam.laradji@gmail.com>
# License: BSD 3 clause
import numpy as np
from scipy.special import expit as logistic_sigmoid
def identity(X):
"""Simply return the input array.
Parameters
----------
X : {array-like, sparse matri... | bsd-3-clause |
isyippee/oslo.messaging | oslo_messaging/_drivers/protocols/amqp/drivertasks.py | 7 | 4058 | # Copyright 2014, Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | apache-2.0 |
amenonsen/ansible | lib/ansible/modules/storage/netapp/netapp_e_facts.py | 4 | 27761 | #!/usr/bin/python
# (c) 2016, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
Mactory/easy-thumbnails | easy_thumbnails/south_migrations/0009_auto__del_storage.py | 20 | 2337 | # 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):
# Deleting model 'Storage'
db.delete_table('easy_thumbnails_storage')
def backwards(self, orm):
... | bsd-3-clause |
embray/numpy | numpy/core/tests/test_ufunc.py | 1 | 43039 | from __future__ import division, absolute_import, print_function
import sys
import numpy as np
from numpy.testing import *
import numpy.core.umath_tests as umt
import numpy.core.operand_flag_tests as opflag_tests
from numpy.compat import asbytes
from numpy.core.test_rational import *
class TestUfunc(TestCase):
d... | bsd-3-clause |
diorcety/intellij-community | plugins/hg4idea/testData/bin/mercurial/help.py | 91 | 18018 | # help.py - help data for mercurial
#
# Copyright 2006 Matt Mackall <mpm@selenic.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from i18n import gettext, _
import itertools, sys, os, error
import extensions, revset, fileset,... | apache-2.0 |
toslunar/chainerrl | chainerrl/links/empirical_normalization.py | 1 | 3685 | from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
from builtins import * # NOQA
from future import standard_library
standard_library.install_aliases() # NOQA
import chainer
import numpy as np
class EmpiricalNormaliza... | mit |
jgiannuzzi/pypi-server | pypi_server/handlers/pypi/proxy/client.py | 2 | 4592 | # encoding: utf-8
import hashlib
import logging
from copy import copy
from slimurl import URL
from tornado.gen import coroutine, Return
from tornado.httpclient import AsyncHTTPClient
from tornado.ioloop import IOLoop
from tornado.locks import Lock
from tornado.options import options
from tornado_xmlrpc.client import Se... | mit |
talha81/TACTIC-DEV | src/client/tactic_client_lib/tactic_server_stub.py | 4 | 146424 | ###########################################################
#
# Copyright (c) 2005, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without written permi... | epl-1.0 |
JaronArmiger/tenshi | angel-player/src/chrome/content/angelic/test.py | 11 | 4815 | #!/usr/bin/env python
# Licensed to Pioneers in Engineering under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Pioneers in Engineering licenses
# this file to you under the Apache License, Version 2.0 (the
#... | apache-2.0 |
binhqnguyen/lena-local | src/visualizer/visualizer/higcontainer.py | 189 | 3560 | import gtk
import gobject
try:
from gazpacho.widgets.base.base import SimpleContainerAdaptor
except ImportError:
pass
#root_library = 'hig'
class HIGContainer(gtk.Bin):
__gtype_name__ = 'HIGContainer'
__gproperties__ = {
'title': (str, 'Group Title', 'the group title',
'', g... | gpl-2.0 |
dednal/chromium.src | net/data/ssl/scripts/crlsetutil.py | 75 | 5856 | #!/usr/bin/env 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.
"""
This utility takes a JSON input that describes a CRLSet and produces a
CRLSet from it.
The input is taken on stdin and is a di... | bsd-3-clause |
apagac/cfme_tests | cfme/scripting/appliance.py | 2 | 6850 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Script to encrypt config files.
Usage:
scripts/encrypt_conf.py confname1 confname2 ... confnameN
scripts/encrypt_conf.py credentials
"""
from functools import partial
import click
from cached_property import cached_property
from cfme.utils.conf import cfme_dat... | gpl-2.0 |
glemaitre/UnbalancedDataset | imblearn/ensemble/tests/test_classifier.py | 2 | 17981 | """Test the module ensemble classifiers."""
# Authors: Guillaume Lemaitre <g.lemaitre58@gmail.com>
# Christos Aridas
# License: MIT
import numpy as np
from sklearn.datasets import load_iris, make_hastie_10_2
from sklearn.model_selection import (GridSearchCV, ParameterGrid,
... | mit |
iddqd1/django-cms | cms/models/titlemodels.py | 50 | 5426 | # -*- coding: utf-8 -*-
from datetime import timedelta
from django.db import models
from django.utils import timezone
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
from cms.constants import PUBLISHER_STATE_DIRTY
from cms.models.managers import Ti... | bsd-3-clause |
savfod/ptset | ptset.py | 1 | 14571 | #!/usr/bin/python3
DESCRIPTION = '''
Program for ptset drawing.
Some examples of usage:
python ptset.py -h
python ptset.py --curve 9 --draw_points A,0.199,True B,0.412,True
python ptset.py --curve 8 --draw_points A,-0.36,True X1,-0.26 B,0,True X2,0.26 C,0.36,True
python ptset.py --curve 7 --tangent_curve
python ... | mit |
nwchandler/ansible | lib/ansible/cli/__init__.py | 15 | 33623 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2016, 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, eithe... | gpl-3.0 |
kaustubh-kabra/modified-xen | tools/python/logging/logging-0.4.9.2/test/log_test12.py | 42 | 1951 | #!/usr/bin/env python
#
# Copyright 2001-2002 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 n... | gpl-2.0 |
markpudd/logistic_regression | logisticReg.py | 1 | 1904 | # Helper functions to do logistic regression
# To use the logRegCost function needs to be minimised, use the logRegGrad method to provide derivative
#
import cv2
import numpy as np
import scipy.io as sio
import csv as csv
from sklearn.preprocessing import normalize
def featureNormalize(data):
mu = data.mean(0)
... | mit |
alex/boto | boto/sns/__init__.py | 131 | 2117 | # Copyright (c) 2010-2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2010-2011, Eucalyptus Systems, 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, includin... | mit |
tinloaf/home-assistant | homeassistant/components/media_player/cast.py | 3 | 24944 | """
Provide functionality to interact with Cast devices on the network.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.cast/
"""
import asyncio
import logging
import threading
from typing import Optional, Tuple
import attr
import voluptuous... | apache-2.0 |
Juniper/nova | nova/virt/powervm/host.py | 2 | 2812 | # Copyright 2014, 2017 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | apache-2.0 |
raildo/nova | nova/tests/unit/test_cinder.py | 14 | 6997 | # Copyright 2011 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 l... | apache-2.0 |
whitehorse-io/encarnia | pyenv/lib/python2.7/site-packages/twisted/python/_shellcomp.py | 15 | 24327 | # -*- test-case-name: twisted.python.test.test_shellcomp -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
No public APIs are provided by this module. Internal use only.
This module implements dynamic tab-completion for any command that uses
twisted.python.usage. Currently, only zsh is s... | mit |
MadCat34/Sick-Beard | sickbeard/clients/requests/status_codes.py | 252 | 3043 | # -*- coding: utf-8 -*-
from .structures import LookupDict
_codes = {
# Informational.
100: ('continue',),
101: ('switching_protocols',),
102: ('processing',),
103: ('checkpoint',),
122: ('uri_too_long', 'request_uri_too_long'),
200: ('ok', 'okay', 'all_ok', 'all_okay', 'all_good', '\\o/'... | gpl-3.0 |
richardgroves/namebench | nb_third_party/jinja2/environment.py | 199 | 43213 | # -*- coding: utf-8 -*-
"""
jinja2.environment
~~~~~~~~~~~~~~~~~~
Provides a class that holds runtime and parsing time options.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
from jinja2 import nodes
from jinja2.defaults import *
from ... | apache-2.0 |
smartshark/serverSHARK | smartshark/urls.py | 1 | 1884 | from django.conf.urls import url
from django.core.urlresolvers import reverse_lazy
from django.contrib.auth.views import login, logout
from smartshark.views import analysis, common, collection, visualizations, remote
urlpatterns = [
# Frontend
url(r'^login/$', login, name='mysite_login'),
url(r'^logout/$'... | apache-2.0 |
pawaranand/phr_frappe | frappe/website/statics.py | 17 | 5584 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe, os, time
def sync_statics(rebuild=False):
s = sync()
s.verbose = True
# s.start(rebuild)
# frappe.db.commit()
while True:
s.start(rebuild)
frappe.db.c... | mit |
kbran420/android-quill | jni/libhpdf-2.3.0RC2/if/python/demo/slide_show_demo.py | 32 | 6231 | ###
## * << Haru Free PDF Library 2.0.6 >> -- slideshow_demo.c
## *
## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
## *
## * Permission to use, copy, modify, distribute and sell this software
## * and its documentation for any purpose is hereby granted without fee,
## * provided that ... | gpl-3.0 |
thepug/Speeqe | speeqeweb/speeqe/templatetags/splib.py | 1 | 1687 | from django.contrib.sites.models import Site
from django.template import Library, Node
import speeqeweb.xmpp.muc as muc
import speeqeweb.settings as settings
register = Library()
@register.simple_tag
def current_domain():
return settings.HTTP_DOMAIN
#return all active muc rooms
class ActiveRoomsNode(Node):
... | agpl-3.0 |
calberti/models | resnet/resnet_main.py | 2 | 7036 | # 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 |
thurt/arangodb | 3rdParty/V8-4.3.61/third_party/python_26/Lib/test/test_datetime.py | 52 | 133995 | """Test date/time type.
See http://www.zope.org/Members/fdrake/DateTimeWiki/TestCases
"""
import os
import pickle
import cPickle
import unittest
from test import test_support
from datetime import MINYEAR, MAXYEAR
from datetime import timedelta
from datetime import tzinfo
from datetime import time
from datetime impo... | apache-2.0 |
sexroute/commandergenius | project/jni/python/src/Lib/encodings/iso2022_kr.py | 816 | 1053 | #
# iso2022_kr.py: Python Unicode Codec for ISO2022_KR
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_iso2022, codecs
import _multibytecodec as mbc
codec = _codecs_iso2022.getcodec('iso2022_kr')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEncod... | lgpl-2.1 |
GustavoHennig/ansible | lib/ansible/modules/cloud/misc/xenserver_facts.py | 69 | 5402 | #!/usr/bin/python -tt
# 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 distrib... | gpl-3.0 |
babyliynfg/cross | tools/project-creator/Python2.6.6/Lib/email/mime/message.py | 73 | 1320 | # Copyright (C) 2001-2006 Python Software Foundation
# Author: Barry Warsaw
# Contact: email-sig@python.org
"""Class representing message/* MIME documents."""
__all__ = ['MIMEMessage']
from email import message
from email.mime.nonmultipart import MIMENonMultipart
class MIMEMessage(MIMENonMultipart):... | mit |
yjmade/odoo | openerp/addons/base/res/res_partner.py | 22 | 39855 | # -*- 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 GNU... | agpl-3.0 |
bowlofstew/code-for-blog | 2009/plotting_data_monitor/com_monitor.py | 15 | 2988 | import Queue
import threading
import time
import serial
class ComMonitorThread(threading.Thread):
""" A thread for monitoring a COM port. The COM port is
opened when the thread is started.
data_q:
Queue for received data. Items in the queue are
(data, ti... | unlicense |
dgoedkoop/QGIS | python/plugins/processing/algs/gdal/proximity.py | 2 | 8834 | # -*- coding: utf-8 -*-
"""
***************************************************************************
proximity.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
*****************************... | gpl-2.0 |
podhmo/boto | boto/route53/__init__.py | 145 | 3103 | # Copyright (c) 2006-2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2010, Eucalyptus Systems, 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
# w... | mit |
JCBarahona/edX | lms/djangoapps/shoppingcart/migrations/0009_auto__del_coupons__add_courseregistrationcode__add_coupon__chg_field_c.py | 114 | 16498 | # -*- 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):
# Deleting model 'Coupons'
db.delete_table('shoppingcart_coupons')
# Adding model 'CourseRegistrati... | agpl-3.0 |
nhicher/ansible | test/runner/injector/injector.py | 7 | 7490 | #!/usr/bin/env python
"""Interpreter and code coverage injector for use with ansible-test.
The injector serves two main purposes:
1) Control the python interpreter used to run test tools and ansible code.
2) Provide optional code coverage analysis of ansible code.
The injector is executed one of two ways:
1) On the... | gpl-3.0 |
DonHilborn/DataGenerator | faker/providers/internet.py | 1 | 4491 | # coding=utf-8
from __future__ import unicode_literals
from . import BaseProvider
import random
from faker.providers.lorem import Provider as Lorem
from faker.utils.decorators import slugify, slugify_domain
class Provider(BaseProvider):
safe_email_tlds = ('org', 'com', 'net')
free_email_domains = ('gmail.co... | mit |
drewmiller/tornado | docs/conf.py | 9 | 2900 | # Ensure we get the local copy of tornado instead of what's on the standard path
import os
import sys
sys.path.insert(0, os.path.abspath(".."))
import tornado
master_doc = "index"
project = "Tornado"
copyright = "2011, Facebook"
version = release = tornado.version
extensions = [
"sphinx.ext.autodoc",
"sphin... | apache-2.0 |
gfyoung/pandas | pandas/tests/indexes/datetimes/test_scalar_compat.py | 2 | 12213 | """
Tests for DatetimeIndex methods behaving like their Timestamp counterparts
"""
from datetime import datetime
import numpy as np
import pytest
from pandas._libs.tslibs import OutOfBoundsDatetime, to_offset
from pandas._libs.tslibs.offsets import INVALID_FREQ_ERR_MSG
import pandas as pd
from pandas import Datetime... | bsd-3-clause |
meredith-digops/ansible | docs/bin/dump_keywords.py | 33 | 2403 | #!/usr/bin/env python
import optparse
import yaml
from jinja2 import Environment, FileSystemLoader
from ansible.playbook import Play
from ansible.playbook.block import Block
from ansible.playbook.role import Role
from ansible.playbook.task import Task
template_file = 'playbooks_keywords.rst.j2'
oblist = {}
clist = ... | gpl-3.0 |
xiaohaidao007/pandoraBox-SDK-mt7620 | staging_dir/host/lib/scons-2.5.0/SCons/Job.py | 3 | 16096 | """SCons.Job
This module defines the Serial and Parallel classes that execute tasks to
complete a build. The Jobs class provides a higher level interface to start,
stop, and wait on jobs.
"""
#
# Copyright (c) 2001 - 2016 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
... | gpl-2.0 |
SwainLi/TeamTalk | win-client/3rdParty/src/json/amalgamate.py | 127 | 6807 | """Amalgate json-cpp library sources into a single source and header file.
Requires Python 2.6
Example of invocation (must be invoked from json-cpp top directory):
python amalgate.py
"""
import os
import os.path
import sys
class AmalgamationFile:
def __init__( self, top_dir ):
self.top_dir = top_dir
... | apache-2.0 |
eesatfan/openpli-enigma2 | lib/python/Tools/NumericalTextInput.py | 16 | 3334 | # -*- coding: UTF-8 -*-
from enigma import eTimer
from Components.Language import language
# Dict languageCode -> array of strings
MAP_SEARCH = (
u"%_0",
u" 1",
u"abc2",
u"def3",
u"ghi4",
u"jkl5",
u"mno6",
u"pqrs7",
u"tuv8",
u"wxyz9",
)
MAP_SEARCH_UPCASE = (
U"0%_",
U"1 ",
U"ABC2",
U"DEF3",
U"GHI4",
U... | gpl-2.0 |
glove747/liberty-neutron | neutron/tests/unit/extensions/test_external_net.py | 6 | 7741 | # 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/licenses/LICENSE-2.0
#
# Unless... | apache-2.0 |
lgarren/spack | lib/spack/external/_pytest/recwarn.py | 10 | 7361 | """ recording warnings during test function execution. """
import inspect
import _pytest._code
import py
import sys
import warnings
import pytest
@pytest.yield_fixture
def recwarn(request):
"""Return a WarningsRecorder instance that provides these methods:
* ``pop(category=None)``: return last warning matc... | lgpl-2.1 |
jjanssen/django-cms-patches | cms/admin/useradmin.py | 2 | 2246 | from django.conf import settings
from cms.admin.forms import PageUserForm, PageUserGroupForm
from cms.admin.permissionadmin import GenericCmsPermissionAdmin
from cms.exceptions import NoPermissionsException
from cms.models import PageUser, PageUserGroup
from cms.utils.permissions import get_subordinate_users
from djang... | bsd-3-clause |
UniMOOC/AAClassroom | modules/dashboard/course_settings.py | 5 | 15703 | # Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | apache-2.0 |
rossburton/yocto-autobuilder | lib/python2.7/site-packages/Twisted-12.2.0-py2.7-linux-x86_64.egg/twisted/manhole/telnet.py | 37 | 3494 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""Telnet-based shell."""
# twisted imports
from twisted.protocols import telnet
from twisted.internet import protocol
from twisted.python import log, failure
# system imports
import string, copy, sys
from cStringIO import StringIO
class Shel... | gpl-2.0 |
TeamEOS/external_chromium_org | tools/cr/cr/commands/info.py | 44 | 1236 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""A module for the info implementation of Command."""
import cr
class InfoCommand(cr.Command):
"""The cr info command implementation."""
def __init_... | bsd-3-clause |
alexandregz/simian | src/simian/mac/admin/packages.py | 1 | 7391 | #!/usr/bin/env python
#
# Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | apache-2.0 |
DwangoMediaVillage/pqkmeans | test/encoder/test_pq_encoder.py | 2 | 1590 | import unittest
import pqkmeans
import numpy
import pipe
class TestPQEncoder(unittest.TestCase):
def data_source(self, n: int):
for i in range(n):
for _ in range(3):
yield [i * 100] * 6
def setUp(self):
self.encoder = pqkmeans.encoder.PQEncoder(num_subdim=2)
d... | mit |
rs2/pandas | pandas/tests/indexes/test_base.py | 1 | 93051 | from collections import defaultdict
from datetime import datetime, timedelta
from io import StringIO
import math
import operator
import re
import numpy as np
import pytest
import pandas._config.config as cf
from pandas._libs.tslib import Timestamp
from pandas.compat.numpy import np_datetime64_compat
from pandas.util... | bsd-3-clause |
kennethgillen/ansible | lib/ansible/modules/network/ldap_attr.py | 28 | 11014 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Peter Sagerson <psagers@ignorare.net>
# (c) 2016, Jiri Tyr <jiri.tyr@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 So... | gpl-3.0 |
cchurch/ansible-modules-core | network/junos/junos_config.py | 11 | 11221 | #!/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 |
projecthamster/hamster-gtk | hamster_gtk/overview/widgets/misc.py | 1 | 5056 | # -*- coding: utf-8 -*-
# This file is part of 'hamster-gtk'.
#
# 'hamster-gtk' 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.
#
# 'h... | gpl-3.0 |
healpy/healpy | healpy/newvisufunc.py | 1 | 17516 | __all__ = ["projview", "newprojplot"]
import numpy as np
from .pixelfunc import ang2pix, npix2nside
from .rotator import Rotator
import matplotlib.pyplot as plt
from matplotlib.projections.geo import GeoAxes
from matplotlib.ticker import MultipleLocator, FormatStrFormatter, AutoMinorLocator
import warnings
class The... | gpl-2.0 |
codenote/chromium-test | tools/diagnose-me.py | 50 | 3016 | #!/usr/bin/python
# Copyright (c) 2012 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.
"""Diagnose some common system configuration problems on Linux, and
suggest fixes."""
import os
import subprocess
import sys
all_chec... | bsd-3-clause |
indykish/heroku-buildpack-python | vendor/distribute-0.6.36/setuptools/command/setopt.py | 167 | 5053 | import distutils, os
from setuptools import Command
from distutils.util import convert_path
from distutils import log
from distutils.errors import *
__all__ = ['config_file', 'edit_config', 'option_base', 'setopt']
def config_file(kind="local"):
"""Get the filename of the distutils, local, global, or per-user co... | mit |
ntt-pf-lab/backup_openstackx | openstackx/auth/tokens.py | 1 | 1872 | from openstackx.api import base
class Tenant(base.Resource):
def __repr__(self):
return "<Tenant %s>" % self._info
@property
def id(self):
return self._info['id']
@property
def description(self):
return self._info['description']
@property
def enabled(self):
... | bsd-3-clause |
arnavd96/Cinemiezer | myvenv/lib/python3.4/site-packages/django/contrib/contenttypes/models.py | 49 | 6717 | from __future__ import unicode_literals
from django.apps import apps
from django.db import models
from django.utils.encoding import force_text, python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
class ContentTypeManager(models.Manager):
use_in_migrations = True
def __init__(... | mit |
Princeton-CDH/derrida-django | derrida/people/migrations/0001_initial.py | 1 | 3871 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-03-06 19:54
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('places', '0001_initial'),
]
op... | apache-2.0 |
lz1988/company-site | django/conf/locale/ru/formats.py | 107 | 1134 | # -*- 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 E Y г.'
TIME_FORMAT = 'G:i:s'
D... | bsd-3-clause |
earonesty/bitcoin | test/functional/p2p-segwit.py | 5 | 90114 | #!/usr/bin/env python3
# Copyright (c) 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 segwit transactions and blocks on P2P network."""
from test_framework.mininode import *
from test_fram... | mit |
kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/idlelib/Bindings.py | 7 | 2976 | """Define the menu contents, hotkeys, and event bindings.
There is additional configuration information in the EditorWindow class (and
subclasses): the menus are created there based on the menu_specs (class)
variable, and menus not created are silently skipped in the code here. This
makes it possible, for example, to... | gpl-3.0 |
johndpope/tensorflow | tensorflow/python/kernel_tests/shape_ops_test.py | 12 | 22678 | # 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 |
ideasman42/nirw-search | _misc/readme_update_helptext.py | 1 | 1880 | #!/usr/bin/env python3
# GPL License, Version 3.0 or later
import os
import subprocess
import textwrap
import re
BASE_DIR = os.path.join(os.path.dirname(__file__), "..")
COMMAND_NAME = 'nirw-search'
def patch_help_test(help_output):
help_output = help_output.replace(
'usage: ' + COMMAND_NAME,
'u... | gpl-3.0 |
andresgz/django | tests/migrations/test_graph.py | 99 | 11829 | import warnings
from django.db.migrations.exceptions import (
CircularDependencyError, NodeNotFoundError,
)
from django.db.migrations.graph import RECURSION_DEPTH_WARNING, MigrationGraph
from django.test import SimpleTestCase
from django.utils.encoding import force_text
class GraphTests(SimpleTestCase):
"""
... | bsd-3-clause |
ex1usive-m4d/TemplateDocx | controllers/phpdocx/lib/openoffice/openoffice.org/basis3.4/program/python-core-2.6.1/lib/encodings/unicode_internal.py | 827 | 1196 | """ Python 'unicode-internal' Codec
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
import codecs
### Codec APIs
class Codec(codecs.Codec):
# Note: Binding these as C functions will result in the class not
# converting them to methods. This is in... | bsd-3-clause |
galtys/odoo | addons/website/models/ir_actions.py | 363 | 3074 | # -*- coding: utf-8 -*-
import urlparse
from openerp.http import request
from openerp.osv import fields, osv
class actions_server(osv.Model):
""" Add website option in server actions. """
_name = 'ir.actions.server'
_inherit = ['ir.actions.server']
def _compute_website_url(self, cr, uid, id, websit... | agpl-3.0 |
schumi2004/NOT_UPDATED_Sick-Beard-Dutch | lib/requests/compat.py | 289 | 2433 | # -*- coding: utf-8 -*-
"""
pythoncompat
"""
from .packages import charade as chardet
import sys
# -------
# Pythons
# -------
# Syntax sugar.
_ver = sys.version_info
#: Python 2.x?
is_py2 = (_ver[0] == 2)
#: Python 3.x?
is_py3 = (_ver[0] == 3)
#: Python 3.0.x
is_py30 = (is_py3 and _ver[1] == 0)
#: Python 3.1.... | gpl-3.0 |
Distrotech/PyQt-x11 | examples/animation/stickman/stickman_rc3.py | 5 | 44472 | # -*- coding: utf-8 -*-
# Resource object code
#
# Created: Wed Mar 20 11:18:27 2013
# by: The Resource Compiler for PyQt (Qt v4.8.4)
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore
qt_resource_data = b"\
\x00\x00\x05\x1c\
\xff\
\xff\xff\xff\x00\x00\x00\x05\x00\x00\x00\x10\x00\... | gpl-2.0 |
ctsit/nacculator | nacc/uds3/np/forms.py | 1 | 32292 | ###############################################################################
# Copyright 2015-2020 University of Florida. All rights reserved.
# This file is part of UF CTS-IT's NACCulator project.
# Use of this source code is governed by the license found in the LICENSE file.
#######################################... | bsd-2-clause |
AICP/external_chromium_org | tools/cr/cr/commands/init.py | 59 | 5608 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""A module for the init command."""
import os
import cr
# The set of variables to store in the per output configuration.
OUT_CONFIG_VARS = [
'CR_VERS... | bsd-3-clause |
jve/rabbittop | rabbittop/terminal.py | 1 | 5872 | """
The MIT License (MIT)
Copyright (c) 2014 Jozef van Eenbergen
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,... | mit |
manasapte/pants | src/python/pants/java/nailgun_client.py | 7 | 6693 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import logging
impor... | apache-2.0 |
detrout/pykolab | pykolab/cli/cmd_remove_mailaddress.py | 1 | 3308 | # -*- coding: utf-8 -*-
# Copyright 2010-2012 Kolab Systems AG (http://www.kolabsys.com)
#
# Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen a kolabsys.com>
#
# 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-3.0 |
klonage/nlt-gcs | packages/IronPython.StdLib.2.7.4/content/Lib/pickle.py | 42 | 46516 | """Create portable serialized representations of Python objects.
See module cPickle for a (much) faster implementation.
See module copy_reg for a mechanism for registering custom picklers.
See module pickletools source for extensive comments.
Classes:
Pickler
Unpickler
Functions:
dump(obje... | gpl-3.0 |
jjmleiro/hue | desktop/core/ext-py/cffi-1.5.2/demo/pyobj.py | 13 | 3399 |
referents = [] # list "object descriptor -> python object"
freelist = None
def store(x):
"Store the object 'x' and returns a new object descriptor for it."
global freelist
p = freelist
if p is None:
p = len(referents)
referents.append(x)
else:
freelist = referents[p]
... | apache-2.0 |
ActiveState/code | recipes/Python/579037_How_execute_x86_64bit_assembly_code_directly/recipe-579037.py | 1 | 1537 | #!/usr/bin/env python
import subprocess, os, tempfile
from ctypes import *
PAGE_SIZE = 4096
class AssemblerFunction(object):
def __init__(self, code, ret_type, *arg_types):
# Run Nasm
fd, source = tempfile.mkstemp(".S", "assembly", os.getcwd())
os.write(fd, code)
os.close(fd)
target = os... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.