repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
jimwaldo/HarvardX-Tools | refs/heads/master | src/main/python/logs/__init__.py | 1 | """
A set of programs for dealing with and manipulating the log files recevied from edX.
Most of these programs are used to convert the log files, received from edX as logs from
each server organized by day, into a form that is more conducive to the research work
being done; the organization is to have the log entrie... |
darmaa/odoo | refs/heads/master | openerp/addons/base/ir/ir_config_parameter.py | 33 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... |
audetto/andsoft | refs/heads/master | python/radio/PS3Remote.py | 1 | import pyudev
import re
from asi import Config
from asi import Joystick
def init_state(state):
state["ps3"] = None
state["joystick"] = None
state["mac"] = None
state["hidraw"] = None
def gone(state):
init_state(state)
print("PS3 detached")
# logic copied from https://github.com/chrippa/ds... |
JamesNickerson/py-junos-eznc | refs/heads/master | lib/jnpr/junos/factory/to_json.py | 2 | import json
from lxml import etree
class TableJSONEncoder(json.JSONEncoder):
"""
Used to encode Table/View instances into JSON. See :meth:`Table.to_json`.
"""
def default(self, obj):
from jnpr.junos.factory.view import View
from jnpr.junos.factory.table import Table
if isinst... |
ucam-smt/sgnmt | refs/heads/master | cam/sgnmt/misc/trie.py | 1 | # -*- coding: utf-8 -*-
# coding=utf-8
# Copyright 2019 The SGNMT 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 requir... |
Tejal011089/Medsyn2_app | refs/heads/master | support/doctype/customer_issue/__init__.py | 37694 | from __future__ import unicode_literals
|
cyrixhero/powerline | refs/heads/develop | tests/test_cmdline.py | 23 | # vim:fileencoding=utf-8:noet
'''Tests for shell.py parser'''
from __future__ import (unicode_literals, division, absolute_import, print_function)
import sys
if sys.version_info < (3,):
from io import BytesIO as StrIO
else:
from io import StringIO as StrIO
from powerline.commands.main import get_argparser, finis... |
cxgbit/cxgbit | refs/heads/master | tools/perf/scripts/python/futex-contention.py | 1997 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... |
sammerry/ansible | refs/heads/devel | lib/ansible/plugins/action/async.py | 89 | # (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... |
ordinary-developer/book_python_cookbook_3_ed_d_beazley_b_k_jones | refs/heads/master | code/ch_2-STRINGS_AND_TEXT/05-searching_and_replacing_text/main.py | 3 | def example_1():
text = 'yeah, but no, but yeah, but no, but yeah'
print(text.replace('yeah', 'yep'))
def example_2():
text = 'Today is 11/27/2012. PyCon starts 3/13/2013'
import re
print(re.sub(r'(\d+)/(\d+)/(\d+)', r'\3-\1-\2', text))
def example_3():
text = 'Today is 11/27/2012. PyCon s... |
dudonwai/dudonsblog | refs/heads/master | Lib/distutils/__init__.py | 1211 | import os
import sys
import warnings
import imp
import opcode # opcode is not a virtualenv module, so we can use it to find the stdlib
# Important! To work on pypy, this must be a module that resides in the
# lib-python/modified-x.y.z directory
dirname = os.path.dirname
distutils_path = o... |
vishwaprakashmishra/xmatrix | refs/heads/master | vumi/transports/telnet/tests/test_telnet.py | 4 | # coding: utf-8
"""Tests for vumi.transports.telnet.transport."""
from twisted.internet.defer import (
inlineCallbacks, DeferredQueue, returnValue, Deferred)
from twisted.protocols.basic import LineReceiver
from twisted.internet import reactor, protocol
from vumi.message import TransportUserMessage
from vumi.tes... |
burdell/CS4464-Final-Project | refs/heads/master | django/contrib/sitemaps/management/commands/ping_google.py | 591 | from django.core.management.base import BaseCommand
from django.contrib.sitemaps import ping_google
class Command(BaseCommand):
help = "Ping Google with an updated sitemap, pass optional url of sitemap"
def execute(self, *args, **options):
if len(args) == 1:
sitemap_url = args[0]
... |
tinloaf/home-assistant | refs/heads/dev | tests/components/sensor/test_transport_nsw.py | 12 | """The tests for the Transport NSW (AU) sensor platform."""
import unittest
from unittest.mock import patch
from homeassistant.setup import setup_component
from tests.common import get_test_home_assistant
VALID_CONFIG = {'sensor': {
'platform': 'transport_nsw',
'stop_id': '209516',
'route': '199',
'... |
gvb/odoo | refs/heads/8.0 | openerp/report/render/html2html/html2html.py | 443 | # -*- 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... |
jjmiranda/edx-platform | refs/heads/master | common/test/acceptance/pages/lms/teams.py | 6 | # -*- coding: utf-8 -*-
"""
Teams pages.
"""
from common.test.acceptance.pages.lms.course_page import CoursePage
from common.test.acceptance.pages.lms.discussion import InlineDiscussionPage
from common.test.acceptance.pages.common.paging import PaginatedUIMixin
from common.test.acceptance.pages.common.utils import con... |
edisonlz/fruit | refs/heads/master | web_project/base/site-packages/docutils/parsers/rst/languages/nl.py | 57 | # $Id: nl.py 4564 2006-05-21 20:44:42Z wiemann $
# Author: Martijn Pieters <mjpieters@users.sourceforge.net>
# Copyright: This module has been placed in the public domain.
# New language mappings are welcome. Before doing a new translation, please
# read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must ... |
openrtc/OpenHRIVoice | refs/heads/master | openhrivoice/RecaiusSpeechRecogRTC/recaius.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys, os
import time,wave
import math
import json
import urllib
import urllib.request, urllib.error
import cookielib
import base64
class RecaiusAsr():
def __init__(self, service_id="", passwd=""):
self._baseAuthUrl="https://api.recaius.jp/auth/v2/"
sel... |
pskrz/httpbin | refs/heads/master | httpbin/core.py | 7 | # -*- coding: utf-8 -*-
"""
httpbin.core
~~~~~~~~~~~~
This module provides the core HttpBin experience.
"""
import base64
import json
import os
import random
import time
import uuid
from flask import Flask, Response, request, render_template, redirect, jsonify as flask_jsonify, make_response, url_for
from werkzeug.... |
TimYi/django | refs/heads/master | django/core/cache/backends/db.py | 480 | "Database cache backend."
import base64
from datetime import datetime
from django.conf import settings
from django.core.cache.backends.base import DEFAULT_TIMEOUT, BaseCache
from django.db import DatabaseError, connections, models, router, transaction
from django.utils import six, timezone
from django.utils.encoding i... |
rversteegen/commandergenius | refs/heads/sdl_android | project/jni/python/src/Lib/plat-mac/Carbon/CarbonEvents.py | 81 | # Generated from 'CarbonEvents.h'
def FOUR_CHAR_CODE(x): return x
def FOUR_CHAR_CODE(x): return x
false = 0
true = 1
keyAEEventClass = FOUR_CHAR_CODE('evcl')
keyAEEventID = FOUR_CHAR_CODE('evti')
eventAlreadyPostedErr = -9860
eventTargetBusyErr = -9861
eventClassInvalidErr = -9862
eventClassIncorrectErr = -9864
eventH... |
sysalexis/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/site-packages/pip/_vendor/requests/utils.py | 303 | # -*- coding: utf-8 -*-
"""
requests.utils
~~~~~~~~~~~~~~
This module provides utility functions that are used within Requests
that are also useful for external consumption.
"""
import cgi
import codecs
import collections
import io
import os
import platform
import re
import sys
import socket
import struct
from . i... |
thopiekar/Cura | refs/heads/master | plugins/UM3NetworkPrinting/src/Network/SendMaterialJob.py | 1 | # Copyright (c) 2019 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
import os
from typing import Dict, TYPE_CHECKING, Set, List
from PyQt5.QtNetwork import QNetworkReply, QNetworkRequest
from UM.Job import Job
from UM.Logger import Logger
from UM.Settings import ContainerRegistry
from cura.... |
hasgeek/hasjob | refs/heads/master | migrations/versions/465e724941d3_userblocked.py | 1 | """userblocked
Revision ID: 465e724941d3
Revises: 95eacca1a9d
Create Date: 2013-09-12 22:13:57.647552
"""
# revision identifiers, used by Alembic.
revision = '465e724941d3'
down_revision = '95eacca1a9d'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.add_column(
'user',
sa.Col... |
anaran/kuma | refs/heads/master | vendor/packages/pygments/lexers/_php_builtins.py | 43 | # -*- coding: utf-8 -*-
"""
pygments.lexers._php_builtins
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This file loads the function names and their modules from the
php webpage and generates itself.
Do not alter the MODULES dict by hand!
WARNING: the generation transfers quite much data over your
... |
RevelSystems/django | refs/heads/master | django/db/backends/dummy/features.py | 555 | from django.db.backends.base.features import BaseDatabaseFeatures
class DummyDatabaseFeatures(BaseDatabaseFeatures):
supports_transactions = False
|
WhireCrow/openwrt-mt7620 | refs/heads/master | staging_dir/host/lib/python2.7/encodings/cp437.py | 593 | """ Python Character Mapping Codec cp437 generated from 'VENDORS/MICSFT/PC/CP437.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_map)
def decode(self,input,errors='strict... |
lumig242/Hue-Integration-with-CDAP | refs/heads/pull3 | desktop/core/ext-py/Django-1.6.10/django/core/files/uploadedfile.py | 223 | """
Classes representing uploaded files.
"""
import os
from io import BytesIO
from django.conf import settings
from django.core.files.base import File
from django.core.files import temp as tempfile
from django.utils.encoding import force_str
__all__ = ('UploadedFile', 'TemporaryUploadedFile', 'InMemoryUploadedFile',... |
Lacrymology/django-guardian | refs/heads/devel | benchmarks/run_benchmarks.py | 69 | #!/usr/bin/env python
"""
This benchmark package should be treated as work-in-progress, not a production
ready benchmarking solution for django-guardian.
"""
import datetime
import os
import random
import string
import sys
abspath = lambda *p: os.path.abspath(os.path.join(*p))
THIS_DIR = abspath(os.path.dirname(__fil... |
isaac-s/cloudify-manager-blueprints | refs/heads/master | components/manager/scripts/creation_validation.py | 2 | #!/usr/bin/env python
from os.path import join, dirname
from cloudify import ctx
ctx.download_resource(
join('components', 'utils.py'),
join(dirname(__file__), 'utils.py'))
import utils # NOQA
IMMUTABLE_PROPERTIES = [
'security',
'ssh_user'
]
if utils.is_upgrade:
utils.verify_immutable_propert... |
schleichdi2/OPENNFR-6.3-CORE | refs/heads/nextp3-ssl111 | bitbake/lib/bb/fetch2/repo.py | 1 | """
BitBake "Fetch" repo (git) implementation
"""
# Copyright (C) 2009 Tom Rini <trini@embeddedalley.com>
#
# Based on git.py which is:
# Copyright (C) 2005 Richard Purdie
#
# SPDX-License-Identifier: GPL-2.0-only
#
import os
import bb
from bb.fetch2 import FetchMethod
from bb.fetch2 import runfetchcmd
from bb... |
menzenski/django-year-end-site | refs/heads/master | recipes/admin.py | 13848 | from django.contrib import admin
# Register your models here.
|
coursemdetw/2014cda | refs/heads/master | wsgi/programs/cdag30/gear.py | 9 |
import cherrypy
import os
import sys
# 確定程式檔案所在目錄, 在 Windows 有最後的反斜線
_curdir = os.path.join(os.getcwd(), os.path.dirname(__file__))
# 將所在目錄設為系統搜尋目錄
sys.path.append(_curdir)
# 這是 Gear 設計類別的定義
'''
# 在 application 中導入子模組
import programs.cdag30.gear as cdag30_gear
# 加入 cdag30 模組下的 gear.py 且以子模組 gear 對應其 MAIN() 類別
root.... |
kiyoto/statsmodels | refs/heads/master | examples/incomplete/arima.py | 34 | from __future__ import print_function
from statsmodels.datasets.macrodata import load_pandas
from statsmodels.tsa.base.datetools import dates_from_range
from statsmodels.tsa.arima_model import ARIMA
import matplotlib.pyplot as plt
import numpy as np
import statsmodels.api as sm
plt.interactive(False)
# let's examine a... |
amirrpp/django-oscar | refs/heads/master | tests/integration/offer/availability_tests.py | 40 | from django.test import TestCase
from oscar.apps.offer import models
from oscar.test.factories import (
create_order, OrderDiscountFactory, UserFactory)
class TestAPerUserConditionalOffer(TestCase):
def setUp(self):
self.offer = models.ConditionalOffer(max_user_applications=1)
self.user = Us... |
teltek/edx-platform | refs/heads/master | lms/envs/acceptance_docker.py | 20 | """
This config file extends the test environment configuration
so that we can run the lettuce acceptance tests.
"""
# We intentionally define lots of variables that aren't used, and
# want to import all variables from base settings files
# pylint: disable=wildcard-import, unused-wildcard-import
import os
os.environ... |
openshift/openshift-tools | refs/heads/prod | ansible/roles/lib_oa_utils/filter_plugins/openshift_hosted_filters.py | 44 | #!/usr/bin/python
# -*- coding: utf-8 -*-
'''
Custom filters for use in openshift_hosted
'''
class FilterModule(object):
''' Custom ansible filters for use by openshift_hosted role'''
@staticmethod
def get_router_replicas(replicas=None, router_nodes=None):
''' This function will return the number... |
axbaretto/beam | refs/heads/master | sdks/python/.tox/py27/lib/python2.7/encodings/uu_codec.py | 57 | """ Python 'uu_codec' Codec - UU content transfer encoding
Unlike most of the other codecs which target Unicode, this codec
will return Python string objects for both encode and decode.
Written by Marc-Andre Lemburg (mal@lemburg.com). Some details were
adapted from uu.py which was written by Lance Ell... |
BorisJeremic/Real-ESSI-Examples | refs/heads/master | analytic_solution/test_cases/8NodeBrick/circular_plate_simply_support/4layer/side_length_05/extract_numerical_solution.py | 441 | #!/usr/bin/python
import h5py
import sys
import numpy as np
import os
import re
import random
# find the path to my own python function:
cur_dir=os.getcwd()
sep='test_cases'
test_DIR=cur_dir.split(sep,1)[0]
scriptDIR=test_DIR+'compare_function'
sys.path.append(scriptDIR)
# import my own function for color and comparat... |
jamesliu/mxnet | refs/heads/master | python/mxnet/model.py | 5 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
lidiamcfreitas/FenixScheduleMaker | refs/heads/master | ScheduleMaker/brython/www/src/Lib/unittest/runner.py | 637 | """Running tests"""
import sys
import time
import warnings
from . import result
from .signals import registerResult
__unittest = True
class _WritelnDecorator(object):
"""Used to decorate file-like objects with a handy 'writeln' method"""
def __init__(self,stream):
self.stream = stream
def __ge... |
ultmaster/eoj3 | refs/heads/master | contest/tasks.py | 1 | from threading import Thread
from django.db import transaction
from problem.tasks import judge_submission_on_problem
from submission.models import Submission
from submission.util import SubmissionStatus
from .models import Contest, ContestParticipant
from .statistics import invalidate_contest, invalidate_contest_part... |
xq262144/hue | refs/heads/master | desktop/core/ext-py/thriftpy-0.3.9/thriftpy/transport/sslsocket.py | 11 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
import socket
import ssl
import struct
from ._ssl import (
create_thriftpy_context,
RESTRICTED_SERVER_CIPHERS,
DEFAULT_CIPHERS
)
from .socket import TSocket, TServerSocket
class TSSLSocket(TSocket):
"""SSL socket implementatio... |
saradbowman/osf.io | refs/heads/develop | addons/dropbox/migrations/0003_auto_20170713_1125.py | 22 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-07-13 16:25
from __future__ import unicode_literals
import pytz
import datetime
from django.db import migrations
import django_extensions.db.fields
class Migration(migrations.Migration):
dependencies = [
('addons_dropbox', '0002_auto_20170323_... |
uberamd/NGECore2 | refs/heads/master | scripts/object/resource_container/simple.py | 85615 | import sys
def setup(core, object):
return |
ProjectSWGCore/NGECore2 | refs/heads/master | scripts/object/static/worldbuilding/camping/eqp_camping_chair_s2.py | 85615 | import sys
def setup(core, object):
return |
ShinyROM/android_external_chromium_org | refs/heads/master | tools/site_compare/operators/equals_with_mask.py | 189 | # 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.
"""Compare two images for equality, subject to a mask."""
from PIL import Image
from PIL import ImageChops
import os.path
def Compare(file1, file2, *... |
posquit0/dotfiles | refs/heads/master | weechat/.weechat/python/autoload/colorize_nicks.py | 1 | ../colorize_nicks.py |
mozilla/mozillians | refs/heads/master | mozillians/phonebook/tests/test_identities.py | 2 | import json
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test.utils import override_settings, override_script_prefix
from mock import ANY, Mock, patch
from nose.tools import eq_
from mozillians.common.tests import TestCase
from mozillians.users.models import Idp... |
alexpark07/ARMSCGen | refs/heads/master | shellcodes/thumb/setregid.py | 1 |
def generate(gid=0):
"""setregid(gid, gid) to get egid's privilige
argument:
gid (int/str/reg) - effective gid number
"""
try:
xgid = '#%s' % int(gid)
except:
xgid = '%s' % gid
sc = """
movs r0, %s
movs r1, %s
movs r7, #71
svc 1
""" ... |
meduz/scikit-learn | refs/heads/master | sklearn/linear_model/tests/test_coordinate_descent.py | 25 | # Authors: Olivier Grisel <olivier.grisel@ensta.org>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# License: BSD 3 clause
from sys import version_info
import numpy as np
from scipy import interpolate, sparse
from copy import deepcopy
from sklearn.datasets import load_boston
from sklearn.exceptions imp... |
TobiasLohner/mapgen | refs/heads/master | lib/xcsoar/mapgen/topology/shapefiles.py | 5 | import os
import subprocess
from xcsoar.mapgen.georect import GeoRect
from xcsoar.mapgen.filelist import FileList
__cmd_ogr2ogr = 'ogr2ogr'
__cmd_shptree = 'shptree'
def __filter_datasets(bounds, datasets):
filtered = []
for dataset in datasets:
if bounds.intersects(GeoRect(*dataset['bounds'])):
... |
djkonro/client-python | refs/heads/master | examples/exec.py | 3 | import time
from kubernetes import config
from kubernetes.client import configuration
from kubernetes.client.apis import core_v1_api
from kubernetes.client.rest import ApiException
config.load_kube_config()
configuration.assert_hostname = False
api = core_v1_api.CoreV1Api()
name = 'busybox-test'
resp = None
try:
... |
apache/qpid-proton | refs/heads/main | python/proton/handlers.py | 9 | #
# 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... |
hmit/livestreamer | refs/heads/develop | src/livestreamer/exceptions.py | 34 | class LivestreamerError(Exception):
"""Any error caused by Livestreamer will be caught
with this exception."""
class PluginError(LivestreamerError):
"""Plugin related error."""
class NoStreamsError(LivestreamerError):
def __init__(self, url):
self.url = url
err = "No streams found... |
vmthunder/nova | refs/heads/master | nova/db/api.py | 1 | # Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# 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... |
Sofcom/treeio | refs/heads/2.0 | treeio/core/api/auth/__init__.py | 3 | # encoding: utf-8
# Copyright 2011 Tree.io Limited
# This file is part of Treeio.
# License www.tree.io/license
import oauth2 as oauth
from django.conf import settings
from django.http import HttpResponse
from treeio.core.api.auth.store import store, InvalidConsumerError, InvalidTokenError
from treeio.core.api.auth.u... |
HalcyonChimera/osf.io | refs/heads/develop | addons/osfstorage/__init__.py | 32 | default_app_config = 'addons.osfstorage.apps.OSFStorageAddonAppConfig'
|
chrippa/ds4drv | refs/heads/master | ds4drv/actions/battery.py | 5 | from ..action import ReportAction
BATTERY_WARNING = 2
ReportAction.add_option("--battery-flash", action="store_true",
help="Flashes the LED once a minute if the "
"battery is low")
class ReportActionBattery(ReportAction):
"""Flashes the LED when battery is lo... |
procangroup/edx-platform | refs/heads/master | lms/djangoapps/support/views/manage_user.py | 3 | """
Support tool for disabling user accounts.
"""
from django.contrib.auth import get_user_model
from django.core.urlresolvers import reverse
from django.db.models import Q
from django.utils.decorators import method_decorator
from django.utils.translation import ugettext as _
from django.views.generic import View
from ... |
phoerious/massengeschmack-xbmc | refs/heads/master | default.py | 2 | # -*- coding: utf-8 -*-
#
# Massengeschmack Kodi add-on
# Copyright (C) 2013-2016 by Janek Bevendorff
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at... |
fusionbox/django-filer | refs/heads/develop | filer/utils/zip.py | 47 | #-*- coding: utf-8 -*-
#import zipfile
# zipfile.open() is only available in Python 2.6, so we use the future version
from django.core.files.uploadedfile import SimpleUploadedFile
from zipfile import ZipFile
def unzip(file_obj):
"""
Take a path to a zipfile and checks if it is a valid zip file
and returns... |
spilgames/novacek | refs/heads/master | novacek/novacek.py | 1 | #!/usr/bin/env python
#
# vim: set expandtab:ts=4:sw=4
#
# Authors: Jasper Capel
# Robert van Leeuwen
#
# About: This is a toolset around OpenStack to easy the daily operations
#
# This software is released under the terms of the Apache License.
#
import socket
import sys
import argparse
import logging
imp... |
ovilab/atomify-lammps | refs/heads/dev | libs/lammps/tools/i-pi/ipi/inputs/barostats.py | 41 | """Deals with creating the barostat class.
Copyright (C) 2013, Joshua More and Michele Ceriotti
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) a... |
realsaiko/odoo | refs/heads/8.0 | addons/pad/pad.py | 84 | # -*- coding: utf-8 -*-
from openerp.osv import fields, osv
import random
import re
import string
import urllib2
import logging
from openerp import SUPERUSER_ID
from openerp.tools.translate import _
from openerp.tools import html2plaintext
from py_etherpad import EtherpadLiteClient
_logger = logging.getLogger(__name__... |
Lektorium-LLC/edx-platform | refs/heads/master | lms/djangoapps/bulk_email/admin.py | 10 | """
Django admin page for bulk email models
"""
from config_models.admin import ConfigurationModelAdmin
from django.contrib import admin
from bulk_email.forms import CourseAuthorizationAdminForm, CourseEmailTemplateForm
from bulk_email.models import BulkEmailFlag, CourseAuthorization, CourseEmail, CourseEmailTemplate,... |
gnuhub/intellij-community | refs/heads/master | python/testData/MockSdk3.4/Lib/numbers.py | 883 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Abstract Base Classes (ABCs) for numbers, according to PEP 3141.
TODO: Fill out more detailed documentation on the operators."""
from abc import ABCMeta, abstractmethod
__all__ = ["Number", "Complex", "Real", "Rat... |
dragly/conan | refs/heads/develop | conans/server/service/authorize.py | 4 | '''
This module handles user authentication and permissions
for read or write a conans or package.
This only reads from file the users and permissions.
Replace this module with other that keeps the interface or super class.
'''
from abc import ABCMeta, abstractmethod
from conans.errors import ForbiddenException, ... |
mlperf/training_results_v0.5 | refs/heads/master | v0.5.0/google/research_v3.32/gnmt-tpuv3-32/code/gnmt/model/t2t/tensor2tensor/utils/metrics_hook.py | 3 | # coding=utf-8
# Copyright 2018 The Tensor2Tensor 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... |
CPFDSoftware-Tony/gmv | refs/heads/master | utils/Mesa/Mesa-7.8.2/src/mesa/glapi/gen/mesadef.py | 46 | #!/usr/bin/env python
# Mesa 3-D graphics library
# Version: 4.1
#
# Copyright (C) 1999-2001 Brian Paul 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 ... |
CristianBB/SickRage | refs/heads/develop | lib/tornado/locale.py | 40 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2009 Facebook
#
# 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 ... |
apporc/cinder | refs/heads/master | cinder/tests/unit/targets/test_scst_driver.py | 35 | # 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... |
ChristosChristofidis/h2o-3 | refs/heads/master | h2o-py/tests/testdir_munging/pyunit_in.py | 1 | import sys
sys.path.insert(1, "../../")
import h2o
def test_in(ip,port):
#TODO PUBDEV-
iris = h2o.import_frame(h2o.locate("smalldata/iris/iris.csv"))
assert 5.1 in iris[0], "expected 5.1 to be in the first column, but it wasn't"
assert 1.7 in iris, "expected 1.7 to be in the dataset, but it wasn't"
... |
makermade/arm_android-21_arm-linux-androideabi-4.8 | refs/heads/master | lib/python2.7/sha.py | 260 | # $Id$
#
# Copyright (C) 2005 Gregory P. Smith (greg@krypto.org)
# Licensed to PSF under a Contributor Agreement.
import warnings
warnings.warn("the sha module is deprecated; use the hashlib module instead",
DeprecationWarning, 2)
from hashlib import sha1 as sha
new = sha
blocksize = 1 # l... |
rwbogl/gbg | refs/heads/master | pycparser/tests/test_general.py | 21 | import sys, os
import unittest
sys.path.insert(0, '..')
from pycparser import parse_file, c_ast
CPPPATH = 'cpp'
# Test successful parsing
#
class TestParsing(unittest.TestCase):
def _find_file(self, name):
""" Find a c file by name, taking into account the current dir can be
in a couple of t... |
henrytao-me/openerp.positionq | refs/heads/master | openerp/addons/idea/__openerp__.py | 52 | # -*- 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... |
ProfessionalIT/professionalit-webiste | refs/heads/master | sdk/google_appengine/google/appengine/_internal/antlr3/dottreegen.py | 23 | """ @package antlr3.dottreegenerator
@brief ANTLR3 runtime package, tree module
This module contains all support classes for AST construction and tree parsers.
"""
# begin[licence]
#
# [The "BSD licence"]
# Copyright (c) 2005-2008 Terence Parr
# All rights reserved.
#
# Redistribution and use in source and binary fo... |
prutseltje/ansible | refs/heads/devel | test/units/module_utils/facts/test_ansible_collector.py | 35 | # -*- coding: utf-8 -*-
#
#
# 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 in the hope that it wi... |
dancingdan/tensorflow | refs/heads/master | tensorflow/python/kernel_tests/dynamic_partition_op_test.py | 5 | # 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... |
AcalephStorage/ansible-modules-extras | refs/heads/ceph | cloud/ceph/ceph_osd_pool.py | 1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, Alistair Israel <aisrael@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 ... |
rajpurkar/heroku-buildpack-python-sklearn | refs/heads/master | vendor/pip-1.3.1/pip/commands/install.py | 63 | import os
import sys
import tempfile
import shutil
from pip.req import InstallRequirement, RequirementSet, parse_requirements
from pip.log import logger
from pip.locations import build_prefix, src_prefix, virtualenv_no_global
from pip.basecommand import Command
from pip.index import PackageFinder
from pip.exceptions im... |
gonboy/sl4a | refs/heads/master | python/gdata/src/gdata/finance/service.py | 261 | #!/usr/bin/python
#
# Copyright (C) 2009 Tan Swee Heng
#
# 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 la... |
partofthething/home-assistant | refs/heads/dev | homeassistant/components/homekit/accessories.py | 1 | """Extend the basic Accessory and Bridge functions."""
import logging
from pyhap.accessory import Accessory, Bridge
from pyhap.accessory_driver import AccessoryDriver
from pyhap.const import CATEGORY_OTHER
from homeassistant.components import cover
from homeassistant.components.cover import (
DEVICE_CLASS_GARAGE,... |
BelgianBiodiversityPlatform/meuh | refs/heads/master | test/sample_config_files/missing_meuhconfig_var.py | 1 | # The point here is that we miss the mandatory MeuhConfig dict.
Blabla = [] |
jreiberkyle/Kaggle_Data-Science-London | refs/heads/master | main.py | 1 | '''
Created on May 9, 2014
@author: Jennifer Reiber Kyle
'''
from kaggle import Submitter, DataReader
from prediction import Preprocessor, Classifier
def runPrediction(sourceDirectory,submitDirectory):
reader = DataReader(dataDir)
p = Preprocessor(*reader.getData())
submitter = Submitter(submitDir)
... |
geminy/aidear | refs/heads/master | oss/qt/qt-everywhere-opensource-src-5.9.0/qtwebengine/src/3rdparty/chromium/third_party/mesa/src/src/mapi/glapi/gen/gl_gentable.py | 12 | #!/usr/bin/env python
# (C) Copyright IBM Corporation 2004, 2005
# (C) Copyright Apple Inc. 2011
# All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction,... |
Tejal011089/paypal_erpnext | refs/heads/develop | erpnext/accounts/doctype/budget_detail/__init__.py | 37694 | from __future__ import unicode_literals
|
digwanderlust/pants | refs/heads/master | src/python/pants/backend/project_info/tasks/ide_gen.py | 2 | # 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... |
bartekjagiello/inteygrate_flaskapp | refs/heads/master | yowsup/layers/protocol_groups/protocolentities/test_iq_result_groups.py | 63 | from yowsup.layers.protocol_iq.protocolentities.test_iq_result import ResultIqProtocolEntityTest
class GroupsResultIqProtocolEntityTest(ResultIqProtocolEntityTest):
pass |
OneBitSoftware/jwtSample | refs/heads/master | src/Spa/env1/Lib/site-packages/pip/_vendor/distlib/manifest.py | 559 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2013 Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
"""
Class representing the list of files in a distribution.
Equivalent to distutils.filelist, but fixes some problems.
"""
import fnmatch
import logging
import os
import re
from . import DistlibEx... |
ChromiumWebApps/chromium | refs/heads/master | build/android/pylib/utils/host_path_finder.py | 74 | # 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.
import os
from pylib import constants
def GetMostRecentHostPath(file_name):
"""Returns the most recent existing full path for the given file name.
Re... |
cedk/odoo | refs/heads/8.0 | addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/logreport.py | 386 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... |
TheTypoMaster/chromium-crosswalk | refs/heads/master | content/test/gpu/gpu_tests/hardware_accelerated_feature.py | 5 | # 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.
import hardware_accelerated_feature_expectations as expectations
from telemetry import benchmark
from telemetry.page import page as page_module
from telemetr... |
40223201/w16b_test | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/encodings/__init__.py | 764 | """ Standard "encodings" Package
Standard Python encoding modules are stored in this package
directory.
Codec modules must have names corresponding to normalized encoding
names as defined in the normalize_encoding() function below, e.g.
'utf-8' must be implemented by the module 'utf_8.py'.
Ea... |
uberamd/NGECore2 | refs/heads/master | scripts/object/tangible/lair/base/poi_all_lair_mound_small_evil_fire_green.py | 85615 | import sys
def setup(core, object):
return |
agry/NGECore2 | refs/heads/master | scripts/object/tangible/loot/collectible/collectible_parts/sculpture_structure_04.py | 85615 | import sys
def setup(core, object):
return |
agry/NGECore2 | refs/heads/master | scripts/object/mobile/dressed_imperial_colonel_m.py | 85615 | import sys
def setup(core, object):
return |
sysalexis/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/json/encoder.py | 88 | """Implementation of JSONEncoder
"""
import re
try:
from _json import encode_basestring_ascii as c_encode_basestring_ascii
except ImportError:
c_encode_basestring_ascii = None
try:
from _json import make_encoder as c_make_encoder
except ImportError:
c_make_encoder = None
ESCAPE = re.compile(r'[\x00-\x... |
WillieMaddox/numpy | refs/heads/master | numpy/f2py/tests/test_array_from_pyobj.py | 63 | from __future__ import division, absolute_import, print_function
import unittest
import os
import sys
import copy
import nose
from numpy import (
array, alltrue, ndarray, zeros, dtype, intp, clongdouble
)
from numpy.testing import (
run_module_suite, assert_, assert_equal
)
from numpy.core.multiarray import ... |
mitar/django | refs/heads/master | django/conf/locale/en/formats.py | 318 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'N j, Y'
TIME_FORMAT = 'P'
DATETIME_FORMAT = 'N j, Y, P'
YEAR_MONTH_FORMAT... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.