repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
aohta/shell-doctest | refs/heads/develop | shelldoctest/shelldoctest.py | 1 | #!/usr/bin/env python
"""
Shell Doctest module.
:Copyright: (c) 2009, the Shell Doctest Team All rights reserved.
:license: BSD, see LICENSE for more details.
"""
import commands
import doctest
import inspect
import re
import subprocess
import sys
import os
master = None
_EXC_WRAPPER = 'system_command("%s")'
def sy... |
release-engineering/dockpulp | refs/heads/master | tests/test_imgutils.py | 2 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from dockpulp import imgutils
import pytest
import tarfile
import os
from io import BytesIO
class TarWriter(object):
def __init__(self, outfile, directory=None):
mode = "w|bz2"
if hasattr(outfile, "write"):
self.tarfile = tarfile.open(fileobj... |
bryceliu/ansible | refs/heads/devel | lib/ansible/vars/__init__.py | 16 | # (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... |
technogesic/govhack2017 | refs/heads/master | music-lab/10_penrith-central/subway.py | 5 | ##
# TRACK 1
# TWO TRAINS
# From Data-Driven DJ (datadrivendj.com) by Brian Foo (brianfoo.com)
# This file builds the sequence file for use with ChucK from the data supplied
##
# Library dependancies
import csv
import json
import math
import os
import random
import re
import time
# Config
BPM = 120 # Beats per minute... |
emercs/BeagleBone-linux | refs/heads/3.14 | 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,... |
yushu9/kosmosfs | refs/heads/master | src/python/flogger/flogger.py | 11 | #!/usr/bin/env python
#
# $Id$
#
# Copyright 2006 Kosmix Corp.
#
# Author: Blake Lewis (Kosmix Corp.)
#
# This file is part of Kosmos File System (KFS).
#
# 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 ... |
surgebiswas/poker | refs/heads/master | PokerBots_2017/Johnny/wheel/tool/__init__.py | 232 | """
Wheel command-line utility.
"""
import os
import hashlib
import sys
import json
import wheel.paths
from glob import iglob
from .. import signatures
from ..util import (urlsafe_b64decode, urlsafe_b64encode, native, binary,
matches_requirement)
from ..install import WheelFile
def require_pkgres... |
PolicyStat/django | refs/heads/master | tests/staticfiles_tests/test_liveserver.py | 34 | """
A subset of the tests in tests/servers/tests exercicing
django.contrib.staticfiles.testing.StaticLiveServerTestCase instead of
django.test.LiveServerTestCase.
"""
import os
from django.core.exceptions import ImproperlyConfigured
from django.test import modify_settings, override_settings
from django.utils.six.move... |
josenavas/labman | refs/heads/master | labman/gui/test/test_plate.py | 1 | # ----------------------------------------------------------------------------
# Copyright (c) 2017-, labman development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# -----------------------------------------------------... |
crosswalk-project/chromium-crosswalk-efl | refs/heads/efl/crosswalk-10/39.0.2171.19 | tools/telemetry/telemetry/core/browser_credentials.py | 25 | # Copyright 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 json
import logging
import os
from telemetry.core import util
from telemetry.core.backends import codepen_credentials_backend
from telemetry.core.bac... |
rsjohnco/rez | refs/heads/resources2 | src/rez/utils/colorize.py | 3 | import sys
import logging
from rez.vendor import colorama
from rez.config import config
from rez.utils.platform_ import platform_
_initialised = False
def _init_colorama():
global _initialised
if not _initialised:
colorama.init()
_initialised = True
def stream_is_tty(stream):
"""Return... |
charbeljc/OCB | refs/heads/8.0 | addons/account/project/wizard/account_analytic_cost_ledger_report.py | 378 | # -*- 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... |
q1ang/scikit-learn | refs/heads/master | sklearn/linear_model/perceptron.py | 245 | # Author: Mathieu Blondel
# License: BSD 3 clause
from .stochastic_gradient import BaseSGDClassifier
from ..feature_selection.from_model import _LearntSelectorMixin
class Perceptron(BaseSGDClassifier, _LearntSelectorMixin):
"""Perceptron
Read more in the :ref:`User Guide <perceptron>`.
Parameters
-... |
mindbody/API-Examples | refs/heads/master | SDKs/Python/test/test_get_client_referral_types_response.py | 1 | # coding: utf-8
"""
MINDBODY Public API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: v6
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
impo... |
GeraldLoeffler/nupic | refs/heads/master | nupic/encoders/multi.py | 7 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... |
AKToronto/Bubba-Zombie | refs/heads/kk-4.4.x | scripts/tracing/draw_functrace.py | 14679 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... |
Statoil/SegyIO | refs/heads/master | python/examples/about.py | 1 | import sys
from segyio import TraceField
import segyio
def list_byte_offset_names():
print("Available offsets and their corresponding byte value:")
for x in TraceField.enums():
print(" {}: {}".format(str(x), x))
if __name__ == '__main__':
if len(sys.argv) < 4:
list_byte_offset_names()
... |
fly19890211/edx-platform | refs/heads/master | lms/djangoapps/courseware/migrations/0013_auto__add_field_studentfieldoverride_created__add_field_studentfieldov.py | 94 | # -*- coding: utf-8 -*-
# pylint: disable=invalid-name, missing-docstring, unused-argument, unused-import, line-too-long
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 'St... |
CameronLonsdale/sec-tools | refs/heads/master | python2/lib/python2.7/site-packages/setuptools/depends.py | 336 | import sys
import imp
import marshal
from distutils.version import StrictVersion
from imp import PKG_DIRECTORY, PY_COMPILED, PY_SOURCE, PY_FROZEN
from .py33compat import Bytecode
__all__ = [
'Require', 'find_module', 'get_module_constant', 'extract_constant'
]
class Require:
"""A prerequisite to building o... |
tempbottle/Nuitka | refs/heads/develop | nuitka/codegen/ConstantCodes.py | 1 | # Copyright 2015, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... |
diego-d5000/MisValesMd | refs/heads/master | env/lib/python2.7/site-packages/django/contrib/gis/geos/prototypes/errcheck.py | 1 | """
Error checking functions for GEOS ctypes prototype functions.
"""
from ctypes import c_void_p, string_at
from django.contrib.gis.geos.error import GEOSException
from django.contrib.gis.geos.prototypes.threadsafe import GEOSFunc
# Getting the `free` routine used to free the memory allocated for
# string ... |
cristiana214/cristianachavez214-cristianachavez | refs/heads/master | python/src/Lib/lib2to3/fixes/fix_idioms.py | 53 | """Adjust some old Python 2 idioms to their modern counterparts.
* Change some type comparisons to isinstance() calls:
type(x) == T -> isinstance(x, T)
type(x) is T -> isinstance(x, T)
type(x) != T -> not isinstance(x, T)
type(x) is not T -> not isinstance(x, T)
* Change "while 1:" into "while True:".... |
higgsd/euler | refs/heads/master | py/34.py | 1 | # 40730
import euler
f = [1]
f += [euler.product(range(1, i + 1)) for i in range(1, 10)]
s = 0
for n in xrange(11, 7 * f[9]):
if n == sum([f[int(c)] for c in str(n)]):
s += n
print s
|
onecrayon/PopClip-Extensions | refs/heads/master | source/OneNote/rauth/utils.py | 25 | # -*- coding: utf-8 -*-
'''
rauth.utils
-----------
General utilities.
'''
from rauth.compat import quote, parse_qsl, is_basestring
from requests.structures import CaseInsensitiveDict as cidict
from requests.auth import AuthBase
FORM_URLENCODED = 'application/x-www-form-urlencoded'
ENTITY_METHODS = ('PO... |
turbokongen/home-assistant | refs/heads/dev | homeassistant/util/location.py | 16 | """
Module with location helpers.
detect_location_info and elevation are mocked by default during tests.
"""
import asyncio
import collections
import math
from typing import Any, Dict, Optional, Tuple
import aiohttp
ELEVATION_URL = "https://api.open-elevation.com/api/v1/lookup"
IP_API = "http://ip-api.com/json"
IPAP... |
c-kuhlman/vision | refs/heads/master | software/builder/switchWindowsBuild.py | 5 | import os, sys, argparse, stat, traceback, shutil, subprocess, logging, json
import glob
logging.basicConfig(level=logging.WARNING)
log = logging.getLogger(os.path.basename(__file__))
mapping = [
[ "backend/*.cpp" , None ],
[ "backend/*.d" , None ],... |
raybuhr/grab | refs/heads/master | grab/spider/__init__.py | 12 | from grab.spider.base import Spider # noqa
from grab.spider.data import Data # noqa
from grab.spider.task import Task, inline_task # noqa
from grab.spider.error import * # noqa
|
EvgeneOskin/termius-cli | refs/heads/master | termius/account/__init__.py | 4 | # -*- coding: utf-8 -*-
"""Package with account command set."""
|
songmonit/CTTMSONLINE_V8 | refs/heads/master | addons/email_template/wizard/mail_compose_message.py | 197 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... |
radzhome/AWS-ElasticBeanstalk-CLI | refs/heads/master | eb/macosx/python2.7/lib/iam/servicecall.py | 4 | #!/usr/bin/env python
# ==============================================================================
# Copyright 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Amazon Software License (the "License"). You may not use
# this file except in compliance with the License. A copy of th... |
lidavidm/mathics-heroku | refs/heads/master | venv/lib/python2.7/site-packages/django/contrib/admin/options.py | 47 | import copy
import operator
from functools import partial, reduce, update_wrapper
from django import forms
from django.conf import settings
from django.contrib import messages
from django.contrib.admin import widgets, helpers
from django.contrib.admin.util import (unquote, flatten_fieldsets, get_deleted_objects,
m... |
wswld/python-notes | refs/heads/master | patterns/descriptors/descriptor_as_validator.py | 1 | # Descriptors could be used as validators
import re
class DescriptorValidator(object):
def __get__(self, obj, obj_cls):
return self.x
def __set__(self, obj, value):
self.validate(value)
self.x = value
def validate(self, value):
# raise some exception if not validated
... |
nilnvoid/wagtail | refs/heads/master | wagtail/contrib/settings/registry.py | 4 | from __future__ import absolute_import, unicode_literals
from django.apps import apps
from django.contrib.auth.models import Permission
from django.core.urlresolvers import reverse
from django.utils.text import capfirst
from wagtail.wagtailadmin.menu import MenuItem
from wagtail.wagtailcore import hooks
from .permis... |
eerwitt/tensorflow | refs/heads/master | tensorflow/contrib/ffmpeg/decode_audio_op_test.py | 75 | # 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... |
ryfeus/lambda-packs | refs/heads/master | HDF4_H5_NETCDF/source2.7/setuptools/command/py36compat.py | 286 | import os
from glob import glob
from distutils.util import convert_path
from distutils.command import sdist
from setuptools.extern.six.moves import filter
class sdist_add_defaults:
"""
Mix-in providing forward-compatibility for functionality as found in
distutils on Python 3.7.
Do not edit the code ... |
igormarfin/trading-with-python | refs/heads/master | cookbook/cython/setup.py | 77 | from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
import numpy
ext = Extension("mean_c", ["mean_c.pyx"],
include_dirs = [numpy.get_include()])
setup(ext_modules=[ext],
cmdclass = {'build_ext': build_ext}) |
gvangool/django-extensions | refs/heads/master | django_extensions/management/commands/set_fake_emails.py | 27 | """
set_fake_emails.py
Give all users a new email account. Useful for testing in a
development environment. As such, this command is only available when
setting.DEBUG is True.
"""
from optparse import make_option
from django.conf import settings
from django.core.management.base import CommandError, NoArg... |
israeleriston/scientific-week | refs/heads/master | backend/app/person/models.py | 1 | from app import db
class Person(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(60))
cpf = db.Column(db.String(14))
def __init__(self, name, cpf):
self.name = name
self.cpf = cpf
def __repr__(self):
return '<Product %d>' % self.id
|
rahulunair/nova | refs/heads/master | nova/tests/functional/notification_sample_tests/test_metrics.py | 2 | # Copyright 2018 NTT Corporation
#
# 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... |
eblot/miscripts | refs/heads/master | Python/jtag/state.py | 1 | #!/usr/bin/env python
# Experiment with a JTAG TAP controller state machine
class State(object):
"""
"""
def __init__(self, name):
self.name = name
def __repr__(self):
return self.name
def setx(self, fstate, tstate):
self.exits = [fstate, tstate]
class StateMach... |
rexfrommars/havefun | refs/heads/master | python/RawEdoc/_permutations_x.py | 1 | #!/usr/bin/env python3
# TODO a non-recursive implement
def _p(x, left):
for index in range(len(x)):
if x[index][1] and left > 1:
x[index][1] -= 1
for item in _p(x, left - 1):
yield [x[index][0]] + item
x[index][1] += 1
elif x[index][1]:
... |
zordsdavini/qtile | refs/heads/develop | test/layouts/test_verticaltile.py | 2 | # Copyright (c) 2011 Florian Mounier
# Copyright (c) 2012, 2014-2015 Tycho Andersen
# Copyright (c) 2013 Mattias Svala
# Copyright (c) 2013 Craig Barnes
# Copyright (c) 2014 ramnes
# Copyright (c) 2014 Sean Vig
# Copyright (c) 2014 Adi Sieker
# Copyright (c) 2014 Chris Wesseling
#
# Permission is hereby granted, free o... |
ecliptik/ansible-modules-core | refs/heads/devel | cloud/rackspace/rax_cbs_attachments.py | 157 | #!/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... |
broferek/ansible | refs/heads/devel | test/units/modules/network/check_point/test_checkpoint_host.py | 40 | # Copyright (c) 2018 Red Hat
#
# 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 i... |
nbborlongan/geonode | refs/heads/master | geonode/people/utils.py | 33 | #########################################################################
#
# Copyright (C) 2012 OpenPlans
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
#... |
awkspace/ansible | refs/heads/devel | lib/ansible/modules/storage/netapp/na_ontap_export_policy.py | 59 | #!/usr/bin/python
# (c) 2018, 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'],
... |
Yannig/ansible | refs/heads/devel | lib/ansible/module_utils/crypto.py | 19 | # -*- coding: utf-8 -*-
#
# (c) 2016, Yanis Guenane <yanis+ansible@guenane.org>
#
# 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 vers... |
bbmt-bbmt/MosaicoUtil | refs/heads/master | util.py | 1 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
from bs4 import BeautifulSoup
from bs4 import NavigableString
import json
import re
import sys
from tkinter import messagebox
import urllib
import psutil
import os
def modif_text(text):
# à mettre avant le traitement des espaces sinon le -e : peut devenir -e :
# o... |
ForgottenKahz/CloudOPC | refs/heads/master | venv/Lib/encodings/iso8859_1.py | 266 | """ Python Character Mapping Codec iso8859_1 generated from 'MAPPINGS/ISO8859/8859-1.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 decode(self,input,errors='... |
Godiyos/python-for-android | refs/heads/master | python-modules/twisted/twisted/conch/insults/colors.py | 146 | """
You don't really want to use this module. Try helper.py instead.
"""
CLEAR = 0
BOLD = 1
DIM = 2
ITALIC = 3
UNDERSCORE = 4
BLINK_SLOW = 5
BLINK_FAST = 6
REVERSE = 7
CONCEALED = 8
FG_BLACK = 30
FG_RED = 31
FG_GREEN = 32
FG_YELLOW = 33
FG_BLUE = 34
FG_MAGENTA = 35
FG_CYAN = 36
FG_WHITE = 37
BG_BLACK = 40
BG_RED = 41
... |
googleapis/python-bigquery | refs/heads/master | tests/unit/test_dbapi__helpers.py | 1 | # Copyright 2017 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
xapharius/HadoopML | refs/heads/master | Engine/src/tests/protocol/n_images_input_protocol_test.py | 2 | '''
Created on Apr 8, 2014
@author: Simon
'''
import unittest
from protocol.n_image_input_protocol import NImageInputProtocol
from skimage import io as skio
import struct
from numpy.testing.utils import assert_array_equal
from numpy.ma.testutils import assert_equal
import io
from encodings.base64_codec import base64_e... |
eugeneponomarenko/qualitybots | refs/heads/master | src/appengine/models/test_suite.py | 26 | #!/usr/bin/python2.4
#
# Copyright 2011 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... |
ravindrapanda/tensorflow | refs/heads/master | tensorflow/python/platform/tf_logging.py | 9 | # 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... |
sephii/django | refs/heads/master | tests/m2m_and_m2o/tests.py | 6 | from django.db.models import Q
from django.test import TestCase
from .models import Issue, User, UnicodeReferenceModel
class RelatedObjectTests(TestCase):
def test_related_objects_have_name_attribute(self):
for field_name in ('test_issue_client', 'test_issue_cc'):
obj = User._meta.get_field(... |
TAJaroszewski/lma_contrail_monitoring | refs/heads/master | deployment_scripts/puppet/modules/lma_contrail_monitoring/files/scripts/vrouter-flows-drop.py | 1 | #!/usr/bin/python
import signal
import sys
import urllib2
import xml.dom.minidom
plugin_name = "vrouter-flows-drop"
plugin_instance = "lma-contrail-extension"
plugin_interval = 60
plugin_type = 'gauge'
plugin_request = 'flow_action_drop'
def restore_sigchld():
signal.signal(signal.SIGCHLD, signal.SIG_DFL)
def... |
OCA/purchase-workflow | refs/heads/12.0 | purchase_allowed_product/models/__init__.py | 1 | from . import res_partner
from . import supplied_product_mixin
from . import account_invoice
from . import product
from . import purchase_order
from . import product_supplierinfo
|
foursquare/pants | refs/heads/master | src/python/pants/backend/jvm/tasks/jvm_compile/execution_graph.py | 1 | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
import queue
import sys
import threading
import traceback
from builtins import map, objec... |
pwoodworth/intellij-community | refs/heads/master | python/testData/inspections/PyUnresolvedReferencesInspection/staticMethodParameter.py | 83 | class A:
@staticmethod
def foo(q):
q.bar()
|
ThreatConnect-Inc/tcex | refs/heads/master | tcex/sessions/tc_session.py | 2 | """ThreatConnect Requests Session"""
# standard library
import base64
import hashlib
import hmac
import logging
import time
# third-party
import urllib3
from requests import Session, adapters, auth
from urllib3.util.retry import Retry
from ..utils import Utils
# disable ssl warning message
urllib3.disable_warnings(u... |
gquirozbogner/contentbox-master | refs/heads/master | third_party/django/conf/locale/nn/formats.py | 118 | # -*- 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... |
wainersm/buildbot | refs/heads/master | master/buildbot/steps/package/rpm/rpmspec.py | 11 | # This file is part of Buildbot. Buildbot is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... |
drptbl/splinter | refs/heads/master | tests/test_element_list.py | 7 | # -*- coding: utf-8 -*-
# Copyright 2013 splinter 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 unittest
from splinter.element_list import ElementList
from splinter.exceptions import ElementDoesNotExist
class Person(object... |
sauloal/cnidaria | refs/heads/master | scripts/venv/lib/python2.7/site-packages/matplotlib/tri/trifinder.py | 11 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
from matplotlib.tri import Triangulation
import matplotlib._tri as _tri
class TriFinder(object):
"""
Abstract base class for classes used to find the triangles of a
Triangulation in wh... |
canwe/NewsBlur | refs/heads/master | utils/backups/s3.py | 14 | from boto.s3.connection import S3Connection
from boto.s3.key import Key
import os
import sys
if '/srv/newsblur' not in ' '.join(sys.path):
sys.path.append("/srv/newsblur")
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
from django.conf import settings
ACCESS_KEY = settings.S3_ACCESS_KEY
SECRET = setting... |
cychenyin/windmill | refs/heads/master | apscheduler/jobstores/memory.py | 1 | # coding: utf-8
from __future__ import absolute_import
from apscheduler.jobstores.base import BaseJobStore, JobLookupError, ConflictingIdError
from apscheduler.util import datetime_to_utc_timestamp
class MemoryJobStore(BaseJobStore):
"""
Stores jobs in an array in RAM. Provides no persistence support.
P... |
redhat-openstack/python-openstackclient | refs/heads/master-patches | functional/tests/compute/v2/test_server.py | 1 | # 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... |
IvanGavran/scrapy | refs/heads/master | scrapy/logformatter.py | 52 | import os
import logging
from twisted.python.failure import Failure
SCRAPEDMSG = u"Scraped from %(src)s" + os.linesep + "%(item)s"
DROPPEDMSG = u"Dropped: %(exception)s" + os.linesep + "%(item)s"
CRAWLEDMSG = u"Crawled (%(status)s) %(request)s (referer: %(referer)s)%(flags)s"
class LogFormatter(object):
"""Cla... |
yukoba/sympy | refs/heads/master | sympy/utilities/codegen.py | 30 | """
module for generating C, C++, Fortran77, Fortran90 and Octave/Matlab routines
that evaluate sympy expressions. This module is work in progress. Only the
milestones with a '+' character in the list below have been completed.
--- How is sympy.utilities.codegen different from sympy.printing.ccode? ---
We considere... |
orion1024/Sick-Beard | refs/heads/master | sickbeard/clients/requests/packages/urllib3/filepost.py | 240 | # urllib3/filepost.py
# Copyright 2008-2012 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import codecs
import mimetypes
from uuid import uuid4
from io import BytesIO
from .packages ... |
seeminglee/pyglet64 | refs/heads/master | pyglet/media/procedural.py | 41 | # ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistribu... |
mancoast/CPythonPyc_test | refs/heads/master | cpython/152_test_new.py | 8 | from test_support import verbose
import sys
import new
class Eggs:
def get_yolks(self):
return self.yolks
print 'new.module()'
m = new.module('Spam')
if verbose:
print m
m.Eggs = Eggs
sys.modules['Spam'] = m
import Spam
def get_more_yolks(self):
return self.yolks + 3
print 'new.classobj()'
C = n... |
tuxfux-hlp-notes/python-batches | refs/heads/master | archieves/batch-64/09-modules/myenv/lib/python2.7/site-packages/django/conf/locale/uk/formats.py | 565 | # -*- 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 = 'H:i'
DA... |
clovett/MissionPlanner | refs/heads/master | Lib/urllib.py | 52 | """Open an arbitrary URL.
See the following document for more info on URLs:
"Names and Addresses, URIs, URLs, URNs, URCs", at
http://www.w3.org/pub/WWW/Addressing/Overview.html
See also the HTTP spec (from which the error codes are derived):
"HTTP - Hypertext Transfer Protocol", at
http://www.w3.org/pub/WWW/P... |
metashell/metashell | refs/heads/master | 3rd/templight/clang/utils/CIndex/completion_logger_server.py | 35 | #!/usr/bin/env python
from __future__ import absolute_import, division, print_function
import sys
from socket import *
from time import strftime
import datetime
def main():
if len(sys.argv) < 4:
print("completion_logger_server.py <listen address> <listen port> <log file>")
exit(1)
host = sys.argv[1]
por... |
kejbaly2/invoke | refs/heads/master | tests/_support/configs/runtime.py | 12 | from spec import eq_
from invoke import ctask
@ctask
def mytask(c):
eq_(c.hooray, 'yaml')
|
geoffret/litmus-rt | refs/heads/master | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py | 4653 | # EventClass.py
#
# This is a library defining some events types classes, which could
# be used by other scripts to analyzing the perf samples.
#
# Currently there are just a few classes defined for examples,
# PerfEvent is the base class for all perf event sample, PebsEvent
# is a HW base Intel x86 PEBS event, and use... |
the-c0d3r/jcu-api | refs/heads/master | lib/website.py | 1 | import urllib
import re
# import requests
from classes import Classes
class Website:
def __init__(self):
self.url = "http://afm.jcu.edu.sg/JCU/InfoDisplay/DailyCourseInformation.aspx"
self.page = self.getPage()
self.classes = []
self.parse()
def getPage(self):
try:
... |
2014c2g19/2014c2g19 | refs/heads/master | exts/wsgi/static/Brython2.1.0-20140419-113919/Lib/importlib/machinery.py | 106 | """The machinery of importlib: finders, loaders, hooks, etc."""
import _imp
from ._bootstrap import (SOURCE_SUFFIXES, DEBUG_BYTECODE_SUFFIXES,
OPTIMIZED_BYTECODE_SUFFIXES, BYTECODE_SUFFIXES,
EXTENSION_SUFFIXES)
from ._bootstrap import BuiltinImporter
from ._bootstrap ... |
gcodetogit/depot_tools | refs/heads/master | third_party/pylint/config.py | 67 | # Copyright (c) 2003-2013 LOGILAB S.A. (Paris, FRANCE).
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
#
# This program... |
1013553207/django | refs/heads/master | tests/admin_filters/tests.py | 86 | from __future__ import unicode_literals
import datetime
from django.contrib.admin import (
AllValuesFieldListFilter, BooleanFieldListFilter, ModelAdmin,
RelatedOnlyFieldListFilter, SimpleListFilter, site,
)
from django.contrib.admin.views.main import ChangeList
from django.contrib.auth.admin import UserAdmin
... |
sbarton272/AcousticBarcodes-Explorations | refs/heads/master | barcodes/dxfwrite/tests/test_engine.py | 1 | #!/usr/bin/env python
#coding:utf-8
# Created: 15.11.2010
# Copyright (C) 2010, Manfred Moitzi
# License: MIT License
__author__ = "mozman <mozman@gmx.at>"
import unittest
from dxfwrite.engine import DXFEngine
class TestDXFEngine(unittest.TestCase):
def test_drawing(self):
self.assertTrue(DXFEngine.draw... |
auready/django | refs/heads/master | tests/null_fk_ordering/tests.py | 133 | from django.test import TestCase
from .models import Article, Author, Comment, Forum, Post, SystemInfo
class NullFkOrderingTests(TestCase):
def test_ordering_across_null_fk(self):
"""
Regression test for #7512
ordering across nullable Foreign Keys shouldn't exclude results
"""
... |
endlessm/chromium-browser | refs/heads/master | third_party/grpc/src/examples/python/auth/test/_auth_example_test.py | 1 | # Copyright 2019 The gRPC Authors
#
# 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 writ... |
sam-tsai/django | refs/heads/master | django/contrib/gis/geos/prototypes/topology.py | 338 | """
This module houses the GEOS ctypes prototype functions for the
topological operations on geometries.
"""
from ctypes import c_double, c_int
from django.contrib.gis.geos.libgeos import GEOM_PTR, GEOSFuncFactory
from django.contrib.gis.geos.prototypes.errcheck import (
check_geom, check_minus_one, check_string... |
gnuhub/intellij-community | refs/heads/master | python/testData/inspections/PyBroadExceptionInspection/test.py | 83 | class ExceptionKlass(Exception):
pass
try:
function_throws_exception()
except <weak_warning descr="Too broad exception clause">Exception</weak_warning>:
pass
try:
function_throws_exception()
except <weak_warning descr="Too broad exception clause">BaseException</weak_warning>:
pass
try:
functi... |
splotz90/urh | refs/heads/master | src/urh/signalprocessing/Spectrogram.py | 1 | import math
import numpy as np
from PyQt5.QtGui import QImage
from urh import colormaps
from urh.cythonext import util
from urh.util.Logger import logger
class Spectrogram(object):
MAX_LINES_PER_VIEW = 1000
DEFAULT_FFT_WINDOW_SIZE = 1024
def __init__(self, samples: np.ndarray, window_size=DEFAULT_FFT_W... |
elventear/ansible | refs/heads/devel | lib/ansible/galaxy/login.py | 12 | #!/usr/bin/env python
########################################################################
#
# (C) 2015, Chris Houseknecht <chouse@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... |
Baha/z3 | refs/heads/master | src/api/python/z3types.py | 22 | import ctypes, z3core
class Z3Exception(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return str(self.value)
class ContextObj(ctypes.c_void_p):
def __init__(self, context): self._as_parameter_ = context
def from_param(obj): return obj
class Config(ctypes.c_v... |
EDUlib/edx-platform | refs/heads/master | cms/djangoapps/contentstore/views/tests/test_library.py | 4 | """
Unit tests for contentstore.views.library
More important high-level tests are in contentstore/tests/test_libraries.py
"""
from unittest import mock
from unittest.mock import patch
import ddt
from django.conf import settings
from django.test.utils import override_settings
from django.urls import reverse
from opa... |
Soya93/Extract-Refactoring | refs/heads/master | python/testData/completion/globalName.py | 83 | global foo<caret> |
scorpionis/docklet | refs/heads/master | client/venv/lib/python3.5/site-packages/setuptools/command/upload.py | 210 | import getpass
from distutils.command import upload as orig
class upload(orig.upload):
"""
Override default upload behavior to obtain password
in a variety of different ways.
"""
def finalize_options(self):
orig.upload.finalize_options(self)
# Attempt to obtain password. Short cir... |
mandliya/algorithms_and_ds_playground | refs/heads/master | tree_problems/closest_bst_value.py | 1 | '''
Given a non-empty binary search tree and a target value,
find the value in the BST that is closest to the target.
Also, to note that the target value is a floating point.
There will be only one unique value which is closest to the target.
'''
import sys
class TreeNode:
'''
A tree's node representation
... |
willusher/ansible-modules-core | refs/heads/devel | cloud/linode/linode.py | 37 | #!/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... |
common-workflow-language/cwltool | refs/heads/main | tests/test_environment.py | 1 | """Test passing of environment variables to tools."""
import os
from abc import ABC, abstractmethod
from pathlib import Path
from typing import Any, Callable, Dict, List, Mapping, Union
import pytest
from cwltool.singularity import get_version
from .util import env_accepts_null, get_tool_env, needs_docker, needs_sin... |
wlamond/scikit-learn | refs/heads/master | examples/feature_selection/plot_feature_selection_pipeline.py | 58 | """
==================
Pipeline Anova SVM
==================
Simple usage of Pipeline that runs successively a univariate
feature selection with anova and then a C-SVM of the selected features.
"""
from sklearn import svm
from sklearn.datasets import samples_generator
from sklearn.feature_selection import SelectKBest,... |
google/tf-quant-finance | refs/heads/master | tf_quant_finance/__init__.py | 1 | # Lint as: python3
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... |
mastizada/kuma | refs/heads/master | vendor/packages/translate-toolkit/translate/storage/__init__.py | 6 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2002-2005 Zuza Software Foundation
#
# This file is part of translate.
#
# translate is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version... |
sdlBasic/sdlbrt | refs/heads/master | win32/mingw/opt/lib/python2.7/distutils/command/install_egg_info.py | 438 | """distutils.command.install_egg_info
Implements the Distutils 'install_egg_info' command, for installing
a package's PKG-INFO metadata."""
from distutils.cmd import Command
from distutils import log, dir_util
import os, sys, re
class install_egg_info(Command):
"""Install an .egg-info file for the package"""
... |
argilo/nrsc-5 | refs/heads/master | hd_tx_hackrf.py | 1 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
##################################################
# GNU Radio Python Flow Graph
# Title: Hd Tx Hackrf
# Generated: Wed Aug 9 22:01:16 2017
##################################################
from gnuradio import analog
from gnuradio import blocks
from gnuradio import dig... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.