repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
camradal/ansible-modules-extras | refs/heads/devel | notification/sns.py | 44 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Michael J. Schultz <mjschultz@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 ... |
tpodowd/boto | refs/heads/master | boto/dynamodb/schema.py | 185 | # Copyright (c) 2011 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2011 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 ... |
ptisserand/ansible | refs/heads/devel | lib/ansible/modules/network/aireos/aireos_command.py | 73 | #!/usr/bin/python
#
# Copyright: Ansible Team
# 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'],
... |
fengbaicanhe/intellij-community | refs/heads/master | python/testData/resolve/multiFile/importSubmodule/ImportSubmodule.py | 83 | import p1.m1
p1.m1
# <ref> |
CamelBackNotation/CarnotKE | refs/heads/master | jyhton/lib-python/2.7/test/test_uu.py | 60 | """
Tests for uu module.
Nick Mathewson
"""
import unittest
from test import test_support
import sys, os, uu, cStringIO
import uu
plaintext = "The smooth-scaled python crept over the sleeping dog\n"
encodedtext = """\
M5&AE('-M;V]T:\"US8V%L960@<'ET:&]N(&-R97!T(&]V97(@=&AE('-L965P
(:6YG(&1O9PH """
encodedtextwrappe... |
ramineni/myironic | refs/heads/master | ironic/dhcp/neutron.py | 1 | #
# Copyright 2014 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 req... |
ict-felix/stack | refs/heads/master | ofam/src/src/foam/sfa/rspecs/elements/location.py | 3 | from foam.sfa.rspecs.elements.element import Element
class Location(Element):
fields = [
'country',
'longitude',
'latitude',
]
|
luckylavish/zamboni | refs/heads/master | mkt/constants/tests/test_platforms.py | 13 | from django.test.client import RequestFactory
from nose.tools import eq_
from tower import ugettext as _
import mkt.site.tests
from mkt.constants.platforms import FREE_PLATFORMS, PAID_PLATFORMS
class TestPlatforms(mkt.site.tests.TestCase):
def test_free_platforms(self):
platforms = FREE_PLATFORMS()
... |
matiasb/django | refs/heads/master | tests/migrations/migrations_test_apps/conflicting_app_with_dependencies/migrations/0002_conflicting_second.py | 241 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("conflicting_app_with_dependencies", "0001_initial"),
]
operations = [
migrations.CreateModel(
"Something",
... |
davharris/retriever | refs/heads/master | try_install_all.py | 2 | """Attempt to install all datasets into all database management systems
This module, when run, attempts to install datasets from all Retriever scripts
in the /scripts folder (except for those listed in IGNORE), for each engine in
ENGINE_LIST() from __init__.py. In other words, it runs trys to install using
all possibl... |
CloudServer/cinder | refs/heads/master | cinder/__init__.py | 43 | # 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 ... |
moijes12/oh-mainline | refs/heads/master | vendor/packages/gdata/src/gdata/tlslite/utils/PyCrypto_TripleDES.py | 359 | """PyCrypto 3DES implementation."""
from cryptomath import *
from TripleDES import *
if pycryptoLoaded:
import Crypto.Cipher.DES3
def new(key, mode, IV):
return PyCrypto_TripleDES(key, mode, IV)
class PyCrypto_TripleDES(TripleDES):
def __init__(self, key, mode, IV):
TripleDE... |
mubeta06/python | refs/heads/master | signal_processing/sp/mls.py | 1 | #!/usr/bin/env python
"""Module providing the functionality to generate Maximal Length Sequences.
Based on wiki's description and polynomial representation.
http://en.wikipedia.org/wiki/Maximum_length_sequence
"""
import numpy
bittaps = {2:[1], 3:[2], 4:[3], 5:[2], 6:[5], 7:[6], 8:[4,5,6], 9:[5],
... |
amaloz/obfuscation | refs/heads/master | pyobf/obfuscator.py | 1 | import pyobf.utils as utils
import os, time
MMAP_CLT = 0x00
MMAP_GGHLITE = 0x01
MMAP_DUMMY = 0x02
def get_mmap_flag(mmap):
if mmap == 'CLT':
return MMAP_CLT
elif mmap == 'GGH':
return MMAP_GGHLITE
else:
return MMAP_DUMMY
class Obfuscator(object):
def __init__(self, obf, mmap, ... |
pacificIT/mopidy | refs/heads/develop | mopidy/mpd/protocol/__init__.py | 15 | """
This is Mopidy's MPD protocol implementation.
This is partly based upon the `MPD protocol documentation
<http://www.musicpd.org/doc/protocol/>`_, which is a useful resource, but it is
rather incomplete with regards to data formats, both for requests and
responses. Thus, we have had to talk a great deal with the th... |
hyphyphyph/lascaux | refs/heads/master | tests/test_widget.py | 1 | if __name__ == "__main__": import sys; sys.path.append('.')
import unittest
from petrified.widget import Widget
class TestWidget(unittest.TestCase):
def setUp(self):
self.POST = dict(first_name=u'Derek',
last_name=u'Mounce')
def test_init(self):
widget = Widget()
... |
MQQiang/kbengine | refs/heads/master | kbe/src/lib/python/Lib/nntplib.py | 63 | """An NNTP client class based on:
- RFC 977: Network News Transfer Protocol
- RFC 2980: Common NNTP Extensions
- RFC 3977: Network News Transfer Protocol (version 2)
Example:
>>> from nntplib import NNTP
>>> s = NNTP('news')
>>> resp, count, first, last, name = s.group('comp.lang.python')
>>> print('Group', name, 'ha... |
BaesFr/Sick-Beard | refs/heads/development | lib/enzyme/asf.py | 180 | # -*- coding: utf-8 -*-
# enzyme - Video metadata parser
# Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com>
# Copyright 2003-2006 Thomas Schueppel <stain@acm.org>
# Copyright 2003-2006 Dirk Meyer <dischi@freevo.org>
#
# This file is part of enzyme.
#
# enzyme is free software; you can redistribute it and/or mod... |
VinceZK/phantomjs | refs/heads/decktape | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/system/urlfetcher.py | 165 | # Copyright (C) 2011 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... |
LinuxChristian/home-assistant | refs/heads/dev | homeassistant/components/alarm_control_panel/alarmdotcom.py | 8 | """
Interfaces with Alarm.com alarm control panels.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/alarm_control_panel.alarmdotcom/
"""
import logging
import asyncio
import voluptuous as vol
import homeassistant.components.alarm_control_panel as alarm
fr... |
multikatt/CouchPotatoServer | refs/heads/master | couchpotato/core/downloaders/putio/__init__.py | 34 | from .main import PutIO
def autoload():
return PutIO()
config = [{
'name': 'putio',
'groups': [
{
'tab': 'downloaders',
'list': 'download_providers',
'name': 'putio',
'label': 'put.io',
'description': 'This will start a torrent download... |
PaulMcMillan/shmoocon_2014_talk | refs/heads/master | caravan/caravan/dashboards/tasks/rdp/urls.py | 40 | from django.conf.urls.defaults import patterns # noqa
from django.conf.urls.defaults import url # noqa
from .views import IndexView
urlpatterns = patterns('',
url(r'^$', IndexView.as_view(), name='index'),
)
|
levilucio/SyVOLT | refs/heads/master | UMLRT2Kiltera_MM/MT_post__Capsule.py | 1 | """
__MT_post__Capsule.py_____________________________________________________
Automatically generated AToM3 syntactic object (DO NOT MODIFY DIRECTLY)
Author: gehan
Modified: Sun Feb 15 10:31:26 2015
__________________________________________________________________________
"""
from ASGNode import *
from ATOM3Type im... |
cetic/ansible | refs/heads/devel | lib/ansible/plugins/lookup/consul_kv.py | 63 | # (c) 2015, Steve Gargan <steve.gargan@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) any later v... |
ping/instagram_private_api | refs/heads/master | tests/web/upload.py | 1 | import unittest
import time
try:
# python 2.x
from urllib2 import urlopen
except ImportError:
# python 3.x
from urllib.request import urlopen
import json
from ..common import WebApiTestBase, MockResponse, compat_mock
class UploadTests(WebApiTestBase):
"""Tests for ClientCompatPatch."""
@stat... |
hackersql/sq1map | refs/heads/master | plugins/dbms/sqlite/__init__.py | 3 | #!/usr/bin/env python
"""
Copyright (c) 2006-2017 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
from lib.core.enums import DBMS
from lib.core.settings import SQLITE_SYSTEM_DBS
from lib.core.unescaper import unescaper
from plugins.dbms.sqlite.enumeration import Enumeratio... |
trankmichael/numpy | refs/heads/master | numpy/distutils/extension.py | 162 | """distutils.extension
Provides the Extension class, used to describe C/C++ extension
modules in setup scripts.
Overridden to support f2py.
"""
from __future__ import division, absolute_import, print_function
import sys
import re
from distutils.extension import Extension as old_Extension
if sys.version_info[0] >= ... |
BigBrother1984/android_external_chromium_org | refs/heads/kitkat | chrome/tools/build/win/scan_server_dlls.py | 79 | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""Script used to scan for server DLLs at build time and build a header
included by setup.exe. This header contains an array of ... |
lgarren/spack | refs/heads/develop | var/spack/repos/builtin/packages/ghostscript-fonts/package.py | 3 | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... |
makaaso/aws-lambda-tools | refs/heads/master | autoscaling-adjust-size/docutils/parsers/rst/languages/gl.py | 130 | # -*- coding: utf-8 -*-
# Author: David Goodger
# Contact: goodger@users.sourceforge.net
# Revision: $Revision: 4229 $
# Date: $Date: 2005-12-23 00:46:16 +0100 (Fri, 23 Dec 2005) $
# Copyright: This module has been placed in the public domain.
# New language mappings are welcome. Before doing a new translation, pleas... |
arthru/OpenUpgrade | refs/heads/master | openerp/addons/base/tests/test_ir_sequence.py | 136 | # -*- coding: utf-8 -*-
# Run with one of these commands:
# > OPENERP_ADDONS_PATH='../../addons/trunk' OPENERP_PORT=8069 \
# OPENERP_DATABASE=yy PYTHONPATH=. python tests/test_ir_sequence.py
# > OPENERP_ADDONS_PATH='../../addons/trunk' OPENERP_PORT=8069 \
# OPENERP_DATABASE=yy nosetests tests/test_ir_se... |
AstroTech/atlassian-python-api | refs/heads/master | examples/jira/jira_jql_query.py | 2 | # coding=utf-8
from atlassian import Jira
JQL = "project = DEMO AND status NOT IN (Closed, Resolved) ORDER BY issuekey"
jira = Jira(url="http://localhost:8080", username="admin", password="admin")
data = jira.jql(JQL)
print(data)
|
arnavgosain/msm8x27 | refs/heads/cm-11.0-next | tools/perf/scripts/python/sctop.py | 11180 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... |
charleswhchan/ansible | refs/heads/devel | lib/ansible/plugins/action/assert.py | 63 | # Copyright 2012, Dag Wieers <dag@wieers.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 versi... |
amaozhao/basecms | refs/heads/master | sekizai/tests.py | 6 | from __future__ import with_statement
from difflib import SequenceMatcher
from django import template
from django.conf import settings
from django.template.loader import render_to_string
from sekizai.context import SekizaiContext
from sekizai.helpers import validate_template, get_namespaces, Watcher, get_varname
from s... |
maheshraju-Huawei/actn | refs/heads/master | tools/test/topos/opticalUtils.py | 13 | #!/usr/bin/python
'''
Notes:
This file contains classes and methods useful for integrating LincOE with Mininet,
such as startOE, stopOE, LINCLink, and OpticalSwitch
- $ONOS_ROOT ust be set
- Need to run with sudo -E to preserve ONOS_ROOT env var
- We assume LINC-Config-Generator is named LINC-Config-Generator
- We a... |
4eek/edx-platform | refs/heads/master | lms/djangoapps/certificates/tests/test_webview_views.py | 5 | """Tests for certificates views. """
import json
from uuid import uuid4
from nose.plugins.attrib import attr
from mock import patch
from django.conf import settings
from django.core.urlresolvers import reverse
from django.test.client import Client
from django.test.utils import override_settings
from openedx.core.lib... |
TeamWin/android_device_htc_pico | refs/heads/android-4.4 | releasetools/edify_generator.py | 1 | # Copyright (C) 2009 The Android Open Source Project
#
# 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 ... |
anthonyfok/frescobaldi | refs/heads/master | frescobaldi_app/qpopplerview/kineticscrollarea.py | 1 | # This file is part of the qpopplerview package.
#
# Copyright (c) 2010 - 2014 by Wilbert Berendsen
#
# 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 yo... |
hivesolutions/appier | refs/heads/master | src/appier/validation.py | 1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Hive Appier Framework
# Copyright (c) 2008-2021 Hive Solutions Lda.
#
# This file is part of Hive Appier Framework.
#
# Hive Appier Framework is free software: you can redistribute it and/or modify
# it under the terms of the Apache License as published by the Apach... |
SteveHNH/ansible | refs/heads/devel | lib/ansible/modules/network/illumos/ipadm_prop.py | 33 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Adam Števko <adam.stevko@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... |
lsp84ch83/PyText | refs/heads/master | 公开课/爬虫/download.py | 1 | import urllib.request
import os
def url_open(url):
req = urllib.request.Request(url)
req.add_header('User-Agent', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.79 Safari/537.36')
response = urllib.request.urlopen(url)
html = response.read()
retur... |
Kozea/CSStyle | refs/heads/master | setup.py | 1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# This file is part of CSStyle
# Copyright © 2010 Kozea
#
# This library 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 yo... |
nkhare/rockstor-core | refs/heads/master | src/rockstor/storageadmin/migrations/0031_auto__add_configbackup.py | 8 | # -*- 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 'ConfigBackup'
db.create_table(u'storageadmin_configbackup... |
prutseltje/ansible | refs/heads/devel | lib/ansible/modules/cloud/ovirt/ovirt_scheduling_policies_facts.py | 73 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (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
#... |
nlu90/heron | refs/heads/master | heron/tools/common/src/python/access/tracker_access.py | 4 | #!/usr/bin/env python
# -*- encoding: 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... |
dayatz/taiga-back | refs/heads/stable | taiga/base/db/models/fields/json.py | 1 | # -*- coding: utf-8 -*-
# Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can r... |
michigraber/scikit-learn | refs/heads/master | examples/cluster/plot_lena_segmentation.py | 271 | """
=========================================
Segmenting the picture of Lena in regions
=========================================
This example uses :ref:`spectral_clustering` on a graph created from
voxel-to-voxel difference on an image to break this image into multiple
partly-homogeneous regions.
This procedure (spe... |
nzavagli/UnrealPy | refs/heads/master | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Twisted-15.2.1/twisted/test/test_stateful.py | 10 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test cases for twisted.protocols.stateful
"""
from twisted.trial.unittest import TestCase
from twisted.protocols.test import test_basic
from twisted.protocols.stateful import StatefulProtocol
from struct import pack, unpack, calcsize
clas... |
GDGND/evm | refs/heads/master | allauth/socialaccount/providers/angellist/urls.py | 80 | from allauth.socialaccount.providers.oauth2.urls import default_urlpatterns
from .provider import AngelListProvider
urlpatterns = default_urlpatterns(AngelListProvider)
|
lvming/linux | refs/heads/htnice-3.18 | scripts/analyze_suspend.py | 1540 | #!/usr/bin/python
#
# Tool for analyzing suspend/resume timing
# Copyright (c) 2013, Intel Corporation.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU General Public License,
# version 2, as published by the Free Software Foundation.
#
# This prog... |
agry/NGECore2 | refs/heads/master | scripts/object/tangible/ship/components/armor/armor_subpro_light_plasteel.py | 85615 | import sys
def setup(core, object):
return |
agry/NGECore2 | refs/heads/master | scripts/object/tangible/food/generic/dish_bivoli_tempari.py | 85615 | import sys
def setup(core, object):
return |
patrickm/chromium.src | refs/heads/nw | chrome/test/functional/nacl_sdk.py | 66 | #!/usr/bin/env 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.
import copy
import ctypes
from distutils import version
import fnmatch
import glob
import hashlib
import logging
import os
import p... |
arielalmendral/ert | refs/heads/master | python/python/ert/test/test_area.py | 2 | # Copyright (C) 2013 Statoil ASA, Norway.
#
# The file 'test_work_area.py' is part of ERT - Ensemble based Reservoir Tool.
#
# ERT 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... |
tinchoss/Python_Android | refs/heads/master | python/src/Tools/scripts/xxci.py | 94 | #! /usr/bin/env python
# xxci
#
# check in files for which rcsdiff returns nonzero exit status
import sys
import os
from stat import *
import fnmatch
EXECMAGIC = '\001\140\000\010'
MAXSIZE = 200*1024 # Files this big must be binaries and are skipped.
def getargs():
args = sys.argv[1:]
if args:
retu... |
mahendra-r/edx-platform | refs/heads/master | lms/djangoapps/licenses/views.py | 147 | import logging
import json
import re
from urlparse import urlparse
from collections import namedtuple, defaultdict
from edxmako.shortcuts import render_to_string
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models imp... |
aavanian/bokeh | refs/heads/master | sphinx/source/docs/user_guide/examples/plotting_legends.py | 62 | import numpy as np
from bokeh.plotting import output_file, show, figure
x = np.linspace(0, 4*np.pi, 100)
y = np.sin(x)
output_file("legend.html")
p = figure()
p.circle(x, y, legend="sin(x)")
p.line(x, y, legend="sin(x)")
p.line(x, 2*y, legend="2*sin(x)",
line_dash=[4, 4], line_color="orange", line_width=2)
... |
jessevig/bertviz | refs/heads/master | bertviz/head_view.py | 1 | import json
import os
import uuid
from IPython.core.display import display, HTML, Javascript
from .util import format_special_chars, format_attention
def head_view(
attention=None,
tokens=None,
sentence_b_start=None,
prettify_tokens=True,
layer=None,
heads=None,
... |
OrkoHunter/networkx | refs/heads/master | examples/drawing/ego_graph.py | 4 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Example using the NetworkX ego_graph() function to return the main egonet of
the largest hub in a Barabási-Albert network.
"""
__author__="""Drew Conway (drew.conway@nyu.edu)"""
from operator import itemgetter
import networkx as nx
import matplotlib.pyplot as plt
if... |
kallewoof/bitcoin | refs/heads/master | test/functional/test_framework/script.py | 19 | #!/usr/bin/env python3
# Copyright (c) 2015-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Functionality to build scripts, as well as signature hash functions.
This file is modified from python... |
Islandman93/reinforcepy | refs/heads/master | reinforcepy/learners/base_learner.py | 1 | from abc import ABCMeta
class BaseLearner(metaclass=ABCMeta):
"""
Base leaner abstract class.
"""
def run_episode(self, environment):
"""
Runs an episode. The learner can determine when the episode has stopped
Should return the total reward
"""
raise NotImplemen... |
TidyHuang/floodlight | refs/heads/master | src/main/python/PythonClient.py | 152 | #!/usr/bin/env python
import sys
sys.path.append('../../../target/gen-py')
from packetstreamer import PacketStreamer
from packetstreamer.ttypes import *
from thrift import Thrift
from thrift.transport import TSocket
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol
try:
# Make... |
gorjuce/odoo | refs/heads/8.0 | addons/resource/resource.py | 81 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-TODAY OpenERP SA (http://www.openerp.com)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... |
akretion/sale-workflow | refs/heads/8.0 | __unported__/product_special_type_invoice/__openerp__.py | 3 | # -*- coding: utf-8 -*-
#
#
# Author: Guewen Baconnier
# Copyright 2012 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License... |
omni5cience/django-inlineformfield | refs/heads/master | .tox/py27/lib/python2.7/site-packages/django/db/backends/oracle/schema.py | 56 | import copy
import datetime
import binascii
from django.utils import six
from django.utils.text import force_text
from django.db.backends.schema import BaseDatabaseSchemaEditor
from django.db.utils import DatabaseError
class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
sql_create_column = "ALTER TABLE %(tabl... |
CourseTalk/edx-platform | refs/heads/master | openedx/core/djangolib/markup.py | 5 | """
Utilities for use in Mako markup.
"""
import markupsafe
# Text() can be used to declare a string as plain text, as HTML() is used
# for HTML. It simply wraps markupsafe's escape, which will HTML-escape if
# it isn't already escaped.
Text = markupsafe.escape # pylint: disable=invalid-name
... |
yangdongsheng/autotest | refs/heads/master | client/kernel.py | 3 | import os, copy, pickle, re, glob, time, logging
from autotest.client import kernel_config, os_dep, kernelexpand
from autotest.client import utils
from autotest.client.shared import log, error
def tee_output_logdir_mark(fn):
def tee_logdir_mark_wrapper(self, *args, **dargs):
mark = self.__class__.__name__... |
bboreham/docker-py | refs/heads/master | docker/__init__.py | 64 | # Copyright 2013 dotCloud 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 t... |
CTSRD-CHERI/u-boot | refs/heads/master | test/py/tests/test_mmc_rd.py | 8 | # SPDX-License-Identifier: GPL-2.0
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
# Test U-Boot's "mmc read" command. The test reads data from the eMMC or SD
# card, and validates the no errors occurred, and that the expected data was
# read if the test configuration contains a CRC of the expected data... |
nopjmp/SickRage | refs/heads/master | lib/pyasn1/codec/__init__.py | 3653 | # This file is necessary to make this directory a package.
|
cg31/tensorflow | refs/heads/master | tensorflow/contrib/rnn/python/kernel_tests/fused_rnn_cell_test.py | 10 | # 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... |
gohin/django | refs/heads/master | django/conf/locale/he/formats.py | 619 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j בF Y'
TIME_FORMAT = 'H:i'
DATET... |
malaterre/ITK | refs/heads/master | Wrapping/Generators/Python/Tests/ModifiedTime.py | 2 | #==========================================================================
#
# Copyright NumFOCUS
#
# 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/l... |
Nepherhotep/django | refs/heads/master | tests/annotations/models.py | 238 | # coding: utf-8
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Author(models.Model):
name = models.CharField(max_length=100)
age = models.IntegerField()
friends = models.ManyToManyField('self', blank=True)
def __str__(self... |
unreal666/youtube-dl | refs/heads/master | youtube_dl/extractor/arkena.py | 41 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_urlparse
from ..utils import (
determine_ext,
ExtractorError,
float_or_none,
int_or_none,
mimetype2ext,
parse_iso8601,
strip_jsonp,
)
class ArkenaIE(InfoExtract... |
anisku11/sublimeku | refs/heads/master | Packages/pygments/all/pygments/lexers/esoteric.py | 22 | # -*- coding: utf-8 -*-
"""
pygments.lexers.esoteric
~~~~~~~~~~~~~~~~~~~~~~~~
Lexers for esoteric languages.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.lexer import RegexLexer, include
from pygments.token import Tex... |
iulian787/spack | refs/heads/develop | var/spack/repos/builtin/packages/librsb/package.py | 3 | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Librsb(AutotoolsPackage):
"""librsb : A shared memory parallel sparse matrix computations
... |
stacywsmith/ansible | refs/heads/devel | lib/ansible/modules/packaging/language/easy_install.py | 70 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Matt Wright <matt@nobien.net>
#
# 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... |
kartikeys98/coala | refs/heads/master | coalib/bearlib/languages/definitions/Ruby.py | 14 | from coalib.bearlib.languages.Language import Language
@Language
class Ruby:
pass
|
0111001101111010/open-health-inspection-api | refs/heads/master | venv/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/shutil.py | 1002 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
"""Utility functions for copying and archiving files and directory trees.
XXX The functions here don't copy the resource fork or other metadata on Mac.
"""
import os
import sys
import stat
from os... |
HarryRybacki/osf.io | refs/heads/develop | website/addons/wiki/routes.py | 6 | """
"""
import os
from framework.routing import Rule, json_renderer
from website.routes import OsfWebRenderer
from . import views
TEMPLATE_DIR = '../addons/wiki/templates/'
settings_routes = {
'rules': [],
'prefix': '/api/v1',
}
widget_routes = {
'rules': [
Rule([
'/project/<pid>/... |
daubers/ComponentStock | refs/heads/master | Components/tests.py | 1 | __author__ = 'Matt'
from django.test import TestCase
from django.test.client import Client
import json
class ComponentTestCase(TestCase):
def setUp(self):
self.client = Client()
def addSupplier(self):
"""
Add a supplier to the database
returns the response
"""
... |
zzcclp/spark | refs/heads/master | python/pyspark/ml/tests/test_stat.py | 23 | #
# 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... |
sharkspeed/dororis | refs/heads/dev | algorithm/psads/3-chapter/1-stack/stack_3_9.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Assume the infix expression is a string of tokens delimited by spaces. The operator tokens are *, /, +, and -, along with the left and right parentheses, ( and ). The operand tokens are the single-character identifiers A, B, C, and so on
from stack_3_3 import Stack
inf... |
boneyao/sentry | refs/heads/master | src/sentry/search/elastic_search/__init__.py | 108 | from __future__ import absolute_import, print_function
|
0jpq0/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/test/test_asyncio/test_windows_utils.py | 60 | """Tests for window_utils"""
import socket
import sys
import test.support
import unittest
from test.support import IPV6_ENABLED
from unittest import mock
if sys.platform != 'win32':
raise unittest.SkipTest('Windows only')
import _winapi
from asyncio import windows_utils
from asyncio import _overlapped
class W... |
DrDos0016/z2 | refs/heads/master | tools/one-offs/csv_audit.py | 1 | import csv
import os
import sys
import django
sys.path.append("/var/projects/museum/")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "z2.settings")
django.setup()
from z2_site.models import File
def main():
fh = open("/var/projects/museum/tools/archive.csv")
data = csv.reader(fh)
count = 0
for ... |
poppogbr/genropy | refs/heads/master | gnrpy/gnr/web/gnrwebpage.py | 1 | #-*- coding: UTF-8 -*-
#--------------------------------------------------------------------------
# package : GenroPy web - see LICENSE for details
# module gnrwebcore : core module for genropy web framework
# Copyright (c) : 2004 - 2007 Softwell sas - Milano
# Written by : Giovanni Porcari, Michele ... |
fmfn/UnbalancedDataset | refs/heads/master | imblearn/combine/_smote_tomek.py | 1 | """Class to perform over-sampling using SMOTE and cleaning using Tomek
links."""
# Authors: Guillaume Lemaitre <g.lemaitre58@gmail.com>
# Christos Aridas
# License: MIT
from __future__ import division
from sklearn.base import clone
from sklearn.utils import check_X_y
from ..base import BaseSampler
from ..o... |
mano3m/CouchPotatoServer | refs/heads/develop_mano3m | libs/suds/mx/literal.py | 179 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) 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.
#
# This program is distributed in the hope that it will ... |
pwong-mapr/private-hue | refs/heads/HUE-1096-abe | desktop/core/ext-py/Django-1.4.5/django/contrib/comments/views/moderation.py | 50 | from __future__ import absolute_import
from django import template
from django.conf import settings
from django.contrib import comments
from django.contrib.auth.decorators import login_required, permission_required
from django.contrib.comments import signals
from django.contrib.comments.views.utils import next_redirec... |
lepistone/vertical-ngo | refs/heads/8.0 | __unported__/logistic_requisition/wizard/transport_plan.py | 1 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Joël Grand-Guillaume
# Copyright 2013 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as pu... |
Mikkyo/heuristic_PRD | refs/heads/master | models/Task.py | 1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# --- Import Area
from enums.TaskStatus import TaskStatus
class Task:
"""Class to represent a container"""
# --- Attributes
# Private
_resource = None # The resource's task
_duration = None # The task duration
_parent_tasks = None # The parent task
... |
veltzer/pycmdtools | refs/heads/master | pycmdtools/static.py | 1 | """ version which can be consumed from within the module """
VERSION_STR = "0.0.73"
DESCRIPTION = "pycmdtools is set of useful command line tools written in python"
APP_NAME = "pycmdtools"
LOGGER_NAME = "pycmdtools"
|
cedk/odoo | refs/heads/8.0 | addons/account_check_writing/wizard/__init__.py | 437 | # -*- 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... |
foreni-packages/golismero | refs/heads/master | thirdparty_libs/nltk/draw/tree.py | 17 | # Natural Language Toolkit: Graphical Representations for Trees
#
# Copyright (C) 2001-2012 NLTK Project
# Author: Edward Loper <edloper@gradient.cis.upenn.edu>
# URL: <http://www.nltk.org/>
# For license information, see LICENSE.TXT
"""
Graphically display a Tree.
"""
import sys
from Tkinter import IntVar, Menu, Tk... |
neumerance/deploy | refs/heads/master | .venv/lib/python2.7/site-packages/babel/core.py | 79 | # -*- coding: utf-8 -*-
"""
babel.core
~~~~~~~~~~
Core locale representation and locale data access.
:copyright: (c) 2013 by the Babel Team.
:license: BSD, see LICENSE for more details.
"""
import os
from babel import localedata
from babel._compat import pickle, string_types
__all__ = ['Unknown... |
kawamon/hue | refs/heads/master | desktop/libs/notebook/src/notebook/connectors/flink_sql.py | 2 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... |
NeuralEnsemble/neuroConstruct | refs/heads/master | lib/jython/Lib/test/test_univnewlines2k.py | 137 | # Tests universal newline support for both reading and parsing files.
import unittest
import os
import sys
from test import test_support
if not hasattr(sys.stdin, 'newlines'):
raise unittest.SkipTest, \
"This Python does not have universal newline support"
FATX = 'x' * (2**14)
DATA_TEMPLATE = [
"line... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.