repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
qrkourier/ansible | refs/heads/devel | lib/ansible/plugins/cliconf/aruba.py | 43 | #
# (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
# (at your option) any later version.
#
# Ansible is d... |
MakMukhi/grpc | refs/heads/master | src/python/grpcio_tests/tests/unit/framework/interfaces/face/_future_invocation_asynchronous_event_service.py | 23 | # Copyright 2015, 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 f... |
platux/vlc | refs/heads/master | extras/misc/stackhandler.py | 99 | #!/usr/bin/python
#####################################################################
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
# Version 2, December 2004
#
# Copyright (C) 2011-2012 Ludovic Fauvet <etix@videolan.org>
# Jean-Baptiste Kempf <jb@videolan.org>
#... |
zero-ui/miniblink49 | refs/heads/master | v8_5_7/testing/gtest/test/gtest_output_test.py | 363 | #!/usr/bin/env python
#
# Copyright 2008, 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... |
KurtDeGreeff/infernal-twin | refs/heads/master | build/reportlab/src/rl_addons/rl_accel/tests/t1.py | 14 | import time
from reportlab.pdfbase.pdfmetrics import _fonts, findFontAndRegister, _py_getFont
from _rl_accel import getFontU
from getrc import getrc, checkrc
import sys
#fn0 = 'Times-Bold'
#fn1 = 'Times-Roman'
N = 1000000
def tim(N,msg,func,*args):
t0 = time.time()
for i in range(N):
x = func(*args)
... |
openstenoproject/plover | refs/heads/master | plover/oslayer/osxkeyboardlayout.py | 4 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Author: @abarnert, @willwade, and @morinted
# Code taken and modified from
# <https://github.com/willwade/PyUserInput/blob/master/pykeyboard/mac_keycode.py>
# <https://stackoverflow.com/questions/1918841/how-to-convert-ascii-character-to-cgkeycode>
from threading import... |
RGreinacher/bachelor-thesis | refs/heads/master | Apps/Vorverarbeitung/create_annotated_corpus.py | 1 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# import python libs
import re
import json
import argparse
import json
import random
import math
import os
import copy
import sys
from os import listdir
from os.path import isfile, join
from pprint import pprint as pp
# import project libs
sys.path.append('../Auswertun... |
moijes12/oh-mainline | refs/heads/master | vendor/packages/distribute/setuptools/tests/server.py | 62 | """Basic http server for tests to simulate PyPI or custom indexes
"""
import urllib2
import sys
from threading import Thread
from BaseHTTPServer import HTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler
class IndexServer(HTTPServer):
"""Basic single-threaded http server simulating a package index
... |
edmundgentle/schoolscript | refs/heads/master | SchoolScript/bin/Debug/pythonlib/Lib/urllib/response.py | 3 | """Response classes used by urllib.
The base class, addbase, defines a minimal file-like interface,
including read() and readline(). The typical response object is an
addinfourl instance, which defines an info() method that returns
headers and a geturl() method that returns the url.
"""
class addbase(object)... |
MjAbuz/watchdog | refs/heads/master | vendor/rdflib-2.4.0/test/sparql/testSPARQL.py | 4 | #!/d/Bin/Python/python.exe
# -*- coding: utf-8 -*-
#
#
# $Date: 2005/04/02 07:29:30 $, by $Author: ivan $, $Revision: 1.1 $
#
"""
"""
import sys, os, time, datetime
from rdflib.constants import RDFNS as ns_rdf
from rdflib.constants import RDFSNS as ns_rdfs
#from rdflib.sparql import ns_dc as ns_dc
#from rdflib... |
xdatravelbug/N909D_Kernel_JB_4.1.2 | refs/heads/master | tools/perf/util/setup.py | 4998 | #!/usr/bin/python2
from distutils.core import setup, Extension
from os import getenv
from distutils.command.build_ext import build_ext as _build_ext
from distutils.command.install_lib import install_lib as _install_lib
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_optio... |
sgraham/nope | refs/heads/master | tools/gyp/test/win/gyptest-system-include.py | 120 | #!/usr/bin/env python
# Copyright (c) 2014 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Checks that msvs_system_include_dirs works.
"""
import TestGyp
import sys
if sys.platform == 'win32':
test = TestGyp.TestGyp(format... |
vCentre/vFRP-6233 | refs/heads/master | frappe/workflow/doctype/workflow_document_state/workflow_document_state.py | 73 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class WorkflowDocumentState(Document):
pass |
dezynetechnologies/odoo | refs/heads/8.0 | addons/hr_recruitment/report/hr_recruitment_report.py | 325 | # -*- 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... |
zspotter/dream-link | refs/heads/master | src/app/models.py | 1 | from google.appengine.ext import ndb
class Dream( ndb.Model ):
tags = ndb.StringProperty(repeated=True)
def to_dict( self ):
return { 'key' : self.key.urlsafe(),
'tags' : self.tags }
|
luzi82/HiSocial | refs/heads/master | core/user/Permission.py | 1 | from user.GroupPermission import GroupPermission
from user.UserGroup import UserGroup
from sqlalchemy.sql.expression import desc
def get_user_permission(session,user_id,permission_name):
'''
Get permission of a user
:type session: sqlalchemy.orm.session.Session
:param session: sqlalchemy DB Sessio... |
0x0all/scikit-learn | refs/heads/master | sklearn/decomposition/tests/test_pca.py | 25 | import numpy as np
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_greater
from sklearn.utils.testing import assert_rai... |
UTSA-ICS/python-keystoneclient-SID | refs/heads/master | keystoneclient/v3/credentials.py | 3 | # Copyright 2011 OpenStack Foundation
# Copyright 2011 Nebula, 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/... |
stewartpark/django | refs/heads/master | django/db/backends/mysql/features.py | 1 | from django.db.backends.base.features import BaseDatabaseFeatures
from django.utils.functional import cached_property
from .base import Database
try:
import pytz
except ImportError:
pytz = None
class DatabaseFeatures(BaseDatabaseFeatures):
empty_fetchmany_value = ()
update_can_self_select = False
... |
takis/django | refs/heads/master | tests/validation/test_custom_messages.py | 519 | from . import ValidationTestCase
from .models import CustomMessagesModel
class CustomMessagesTest(ValidationTestCase):
def test_custom_simple_validator_message(self):
cmm = CustomMessagesModel(number=12)
self.assertFieldFailsValidationWithMessage(cmm.full_clean, 'number', ['AAARGH'])
def test... |
valrus/mingus3 | refs/heads/python3 | unittest/test_Instrument.py | 3 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
sys.path += ['../']
from mingus.containers.Instrument import Instrument, Piano, Guitar
from mingus.containers.NoteContainer import NoteContainer
import unittest
class test_Instrument(unittest.TestCase):
def setUp(self):
self.i = Instrument()
se... |
jimberlage/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/third_party/pytest/src/_pytest/python.py | 32 | """ Python test discovery, setup and run of test functions. """
from __future__ import absolute_import, division, print_function
import fnmatch
import inspect
import sys
import os
import collections
import warnings
from textwrap import dedent
from itertools import count
import py
import six
from _pytest.mark import ... |
yangkf1985/tornado | refs/heads/master | tornado/test/testing_test.py | 144 | #!/usr/bin/env python
from __future__ import absolute_import, division, print_function, with_statement
from tornado import gen, ioloop
from tornado.log import app_log
from tornado.testing import AsyncTestCase, gen_test, ExpectLog
from tornado.test.util import unittest
import contextlib
import os
import traceback
@... |
jesramirez/odoo | refs/heads/8.0 | addons/website_hr_recruitment/__openerp__.py | 370 | {
'name': 'Jobs',
'category': 'Website',
'version': '1.0',
'summary': 'Job Descriptions And Application Forms',
'description': """
OpenERP Contact Form
====================
""",
'author': 'OpenERP SA',
'depends': ['website_partner', 'hr_recruitment', 'website_mail'],
'data': [
... |
zubron/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/pywebsocket/src/example/cookie_wsh.py | 451 | # Copyright 2014 Google Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-style
# license that can be found in the COPYING file or at
# https://developers.google.com/open-source/licenses/bsd
import urlparse
def _add_set_cookie(request, value):
request.extra_headers.append(('Set-Cookie',... |
praneethkumarpidugu/matchmaking | refs/heads/master | lib/python2.7/site-packages/requests/packages/chardet/sjisprober.py | 1776 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... |
gilsondev/balin | refs/heads/master | balin/auth_balin/forms.py | 1 | # -*- coding: utf-8 -*-
from django import forms
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext as _
from django.contrib.auth.forms import UserCreationForm, UserChangeForm
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Div, Submit, HTML, ... |
davidam/python-examples | refs/heads/master | pandas/jsonpandas.py | 1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2018 David Arroyo Menéndez
# Author: David Arroyo Menéndez <davidam@gnu.org>
# Maintainer: David Arroyo Menéndez <davidam@gnu.org>
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as p... |
vllab/TSMC_DL | refs/heads/master | DCGAN/image_utils.py | 2 | from scipy import misc
import numpy as np
# inverse_transform: transform image value from [-1, 1] to [0, 1]
def inverse_transform(images):
return (images + 1.) / 2.
# Do inverse_transform before saving the grid image
def save_images(image_path, images, grid_size):
return imsave(image_path, inverse_transform(i... |
ajbc/lda-svi | refs/heads/master | process_to_tmv_db.py | 1 | #!/usr/bin/python
# Copyright (C) 2014 Allison Chaney
import cPickle, sys
from os.path import join
import onlineldavb
import generalrandom
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser(description = \
'Fit LDA to a set of documents with online VB.')
parser.add_ar... |
Lh4cKg/sl4a | refs/heads/master | python/src/Lib/test/test_asynchat.py | 58 | # test asynchat -- requires threading
import thread # If this fails, we can't test this module
import asyncore, asynchat, socket, threading, time
import unittest
import sys
from test import test_support
HOST = test_support.HOST
SERVER_QUIT = 'QUIT\n'
class echo_server(threading.Thread):
# parameter to determine ... |
shakalaca/ASUS_ZenFone_A400CG | refs/heads/android-5.0 | prebuilts/gcc/darwin-x86/x86/x86_64-linux-android-4.8/share/gdb/python/gdb/command/prompt.py | 137 | # Extended prompt.
# Copyright (C) 2011-2013 Free Software Foundation, Inc.
# 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) any later vers... |
erinspace/osf.io | refs/heads/develop | api/addons/views.py | 5 | import re
from django.apps import apps
from rest_framework.exceptions import NotFound, PermissionDenied
from rest_framework import generics, permissions as drf_permissions
from framework.auth.oauth_scopes import CoreScopes
from api.addons.serializers import AddonSerializer
from api.base.filters import ListFilterMixi... |
possoumous/Watchers | refs/heads/master | seleniumbase/plugins/page_source.py | 4 | """
The plugin for capturing and storing the page source on errors and failures.
"""
import os
import codecs
from nose.plugins import Plugin
from seleniumbase.config import settings
from seleniumbase.core import log_helper
class PageSource(Plugin):
"""
This plugin will capture the page source when a test fai... |
jolevq/odoopub | refs/heads/master | openerp/report/render/simple.py | 324 | # -*- 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... |
RafiKueng/SteMM | refs/heads/master | controller.py | 1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
PHOTOMETRYDEMO - controller.py
basically the interface to galfit and fits files
Created on Tue Sep 23 12:09:45 2014
@author: rafik
"""
import time
import subprocess
templates = {
'header' : '''
=======================================================================... |
sk364/chat-api | refs/heads/master | chat/backend/main/utils/constants.py | 1 | IMAGE_EXTENSIONS = ['jpg', 'jpeg', 'png', 'gif'] |
jfpla/odoo | refs/heads/8.0 | addons/hr_gamification/__openerp__.py | 320 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
wfxiang08/django190 | refs/heads/master | tests/template_tests/filter_tests/test_slugify.py | 324 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.template.defaultfilters import slugify
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class SlugifyTests(SimpleTestCase):
"""
Running slugify on a pre-escaped string le... |
SirAnthony/marvin-xmpp | refs/heads/master | plugins/fortune.py | 1 | import random
class Fortune:
_marvinModule = True
public = ['fortune', 'testm']
def fortune(self, message):
fortunes = ['The gene pool could use a little chlorine.',
'Make it idiot proof and someone will make a better idiot.',
'He who laughs last thinks slowes... |
faribas/RMG-Py | refs/heads/master | rmgpy/kinetics/arrheniusTest.py | 4 | #!/usr/bin/env python
# encoding: utf-8
################################################################################
#
# RMG - Reaction Mechanism Generator
#
# Copyright (c) 2002-2009 Prof. William H. Green (whgreen@mit.edu) and the
# RMG Team (rmg_dev@mit.edu)
#
# Permission is hereby granted, free of cha... |
jacklee0810/QMarkdowner | refs/heads/master | tftpy/TftpServer.py | 17 | """This module implements the TFTP Server functionality. Instantiate an
instance of the server, and then run the listen() method to listen for client
requests. Logging is performed via a standard logging object set in
TftpShared."""
import socket, os, time
import select
from TftpShared import *
from TftpPacketTypes im... |
ingokegel/intellij-community | refs/heads/master | python/testData/inspections/PyUnboundLocalVariableInspection/UnboundAugmentedAssignment.py | 83 | def f(c):
if c:
x = 1
<warning descr="Local variable 'x' might be referenced before assignment">x</warning> += 1 #fail
return x
|
cursesun/zhihu-python | refs/heads/master | auth.py | 10 | #!/usr/bin/env python
#-*- coding:utf-8 -*-
# Build-in / Std
import os, sys, time, platform, random
import re, json, cookielib
# requirements
import requests, termcolor
requests = requests.Session()
requests.cookies = cookielib.LWPCookieJar('cookies')
try:
requests.cookies.load(ignore_discard=True)
except:
... |
dulems/hue | refs/heads/master | desktop/core/ext-py/Django-1.6.10/django/contrib/gis/db/backends/oracle/base.py | 623 | from django.db.backends.oracle.base import *
from django.db.backends.oracle.base import DatabaseWrapper as OracleDatabaseWrapper
from django.contrib.gis.db.backends.oracle.creation import OracleCreation
from django.contrib.gis.db.backends.oracle.introspection import OracleIntrospection
from django.contrib.gis.db.backen... |
prmtl/fuel-web | refs/heads/master | nailgun/nailgun/api/v1/validators/json_schema/node.py | 1 | # -*- coding: utf-8 -*-
# Copyright 2014 Mirantis, 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 requi... |
ArianaGashi/Techstitution | refs/heads/master | venv/lib/python2.7/site-packages/flask/testsuite/test_apps/config_module_app.py | 1257 | import os
import flask
here = os.path.abspath(os.path.dirname(__file__))
app = flask.Flask(__name__)
|
0x7678/nfi | refs/heads/master | DBHandler.py | 2 | '''
NFI -- Silensec's Nyuki Forensics Investigator
Copyright (C) 2014 George Nicolaou (george[at]silensec[dot]com)
Silensec Ltd.
This file is part of Nyuki Forensics Investigator (NFI).
NFI is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public Licen... |
meabsence/python-for-android | refs/heads/master | python3-alpha/python3-src/Tools/scripts/parseentities.py | 46 | #!/usr/bin/env python3
""" Utility for parsing HTML entity definitions available from:
http://www.w3.org/ as e.g.
http://www.w3.org/TR/REC-html40/HTMLlat1.ent
Input is read from stdin, output is written to stdout in form of a
Python snippet defining a dictionary "entitydefs" mapping literal
en... |
gregorlarson/loxodo | refs/heads/cmdline1 | src/__init__.py | 28 | #
# Loxodo -- Password Safe V3 compatible Password Vault
# Copyright (C) 2008 Christoph Sommer <mail@christoph-sommer.de>
#
# 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 ... |
asacamano/keyczar | refs/heads/master | cpp/src/tools/scons/scons-local-1.2.0.d20090223/SCons/Tool/tar.py | 19 | """SCons.Tool.tar
Tool-specific initialization for tar.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation
#
# Permiss... |
berndw1960/creategmap | refs/heads/master | mapdata.py | 1 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import configparser
import time
WORK_DIR = (os.environ['HOME'] + "/map_build/")
def info(msg):
print("II: " + msg)
def warn(msg):
print("WW: " + msg)
def error(msg):
print("EE: " + msg)
# configparser
def write_config():
with open('p... |
Taapat/enigma2-openpli-vuplus | refs/heads/master | lib/python/Components/EpgList.py | 5 | from HTMLComponent import HTMLComponent
from GUIComponent import GUIComponent
from enigma import eEPGCache, eListbox, eListboxPythonMultiContent, gFont, \
RT_HALIGN_LEFT, RT_HALIGN_RIGHT, RT_HALIGN_CENTER, RT_VALIGN_CENTER
from Tools.Alternatives import CompareWithAlternatives
from Tools.LoadPixmap import LoadPixmap... |
mogoweb/chromium-crosswalk | refs/heads/master | third_party/protobuf/python/google/protobuf/internal/service_reflection_test.py | 559 | #! /usr/bin/python
#
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# ... |
mtscampagnolo/sistema_login | refs/heads/master | app/__init__.py | 1 | from bottle import Bottle
from bottle.ext import sqlalchemy
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
import bottle_session
Base = declarative_base()
engine = create_engine('sqlite:///database.db', echo=True)
app = Bottle()
plugin = sqlalchemy.Plugin(
engine,
Bas... |
xbmc/xbmc-antiquated | refs/heads/master | xbmc/lib/libPython/Python/Lib/test/test_inspect.py | 13 | source = '''# line 1
'A module docstring.'
import sys, inspect
# line 5
# line 7
def spam(a, b, c, d=3, (e, (f,))=(4, (5,)), *g, **h):
eggs(b + d, c + f)
# line 11
def eggs(x, y):
"A docstring."
global fr, st
fr = inspect.currentframe()
st = inspect.stack()
p = x
q = y / 0
# line 20
clas... |
netease-youdao/hex | refs/heads/master | tools/make_hexium.py | 5 | # Copyright (c) 2012-2013 NetEase Youdao Inc. and other heX contributors. All
# rights reserved. Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file.
from date_util import *
from file_util import *
from gclient_util import *
from optparse import OptionParser
import os
imp... |
veyesys/opencvr | refs/heads/master | 3rdparty/protobuf/gmock/gtest/test/gtest_env_var_test.py | 2408 | #!/usr/bin/env python
#
# Copyright 2008, 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... |
realsobek/freeipa | refs/heads/master | ipalib/base.py | 7 | # Authors:
# Jason Gerard DeRose <jderose@redhat.com>
#
# Copyright (C) 2008 Red Hat
# see file 'COPYING' for use and warranty information
#
# 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, ei... |
wndhydrnt/airflow | refs/heads/master | airflow/utils/db.py | 2 | # -*- coding: 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 License, Version 2.0 (the
#... |
3upperm2n/DIGITS | refs/heads/master | digits/config/current_config.py | 15 | # Copyright (c) 2015, NVIDIA CORPORATION. All rights reserved.
from jobs_dir import JobsDirOption
from gpu_list import GpuListOption
from log_file import LogFileOption
from log_level import LogLevelOption
from server_name import ServerNameOption
from secret_key import SecretKeyOption
from caffe_option import CaffeOpt... |
lokirius/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/encodings/koi8_u.py | 272 | """ Python Character Mapping Codec koi8_u generated from 'python-mappings/KOI8-U.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='stri... |
TinyOS-Camp/DDEA-DEV | refs/heads/master | DDEA-DEMO/main.py | 1 | #!/usr/bin/python
# To force float point division
"""
Created on Mon Mar 24 19:24:11 2014
@author: NGO Quang Minh Khiem
@e-mail: khiem.ngo@adsc.com.sg
"""
from __future__ import division
from multiprocessing import Process, JoinableQueue, Event
from SimpleHTTPServer import SimpleHTTPRequestHandler
from SimpleWebSock... |
ConeyLiu/spark | refs/heads/master | python/pyspark/ml/tests/test_training_summary.py | 1 | #
# 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... |
vikeen/band-maker | refs/heads/master | songs/tests/test_songs.py | 1 | from django.contrib.auth.models import User
from django.test import TestCase
from django.core.urlresolvers import reverse
from django.core.exceptions import ObjectDoesNotExist
from ..models import Song, SongStats
class SongTestCase(TestCase):
def setUp(self):
self.user_creator = User.objects.create_user(... |
40223137/150601 | refs/heads/master | static/Brython3.1.3-20150514-095342/Lib/sre_compile.py | 630 | #
# Secret Labs' Regular Expression Engine
#
# convert template to internal format
#
# Copyright (c) 1997-2001 by Secret Labs AB. All rights reserved.
#
# See the sre.py file for information on usage and redistribution.
#
"""Internal support module for sre"""
import sys
import _sre
import sre_parse
from sre_constan... |
gnuhub/intellij-community | refs/heads/master | python/testData/refactoring/pushdown/multiple.before.py | 83 | class Foo:
def foo(self):
print("a")
class Zope(Foo):
def _mine(self):
print "zope"
class Boo(Foo):
def boo(self):
print "rrrrr"
|
DreamerKing/LightweightHtmlWidgets | refs/heads/master | publish-rc/v1.0/files/Ipy.Lib/distutils/extension.py | 250 | """distutils.extension
Provides the Extension class, used to describe C/C++ extension
modules in setup scripts."""
__revision__ = "$Id$"
import os, string, sys
from types import *
try:
import warnings
except ImportError:
warnings = None
# This class is really only used by the "build_ext" command, so it mig... |
saurbkumar/programming_question_python | refs/heads/master | my_question/binary-tree-all-path-to-given-sum.py | 1 | #First case
#http://www.geeksforgeeks.org/root-to-leaf-path-sum-equal-to-a-given-number/
'''Print all the paths from root, with a specified sum in Binary tree - For that Second If condition'''
'''Print all the paths from root, with a specified node in Binary tree - For that first If condition'''
class Node:
def ... |
boogiekodi/plugin.program.ump | refs/heads/master | lib/third/imsize.py | 2 | #-------------------------------------------------------------------------------
# Name: get_image_size
# Purpose: extract image dimensions given a file path using just
# core modules
#
# Author: Paulo Scardine (based on code from Emmanuel VAISSE)
# Ported to stream data by Huseyin BIYIK
#
# Created... |
dmordom/nipype | refs/heads/master | nipype/interfaces/camino/tests/test_auto_SFLUTGen.py | 5 | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from nipype.testing import assert_equal
from nipype.interfaces.camino.calib import SFLUTGen
def test_SFLUTGen_inputs():
input_map = dict(args=dict(argstr='%s',
),
binincsize=dict(argstr='-binincsize %d',
units='NA',
),
directmap=dict(argstr=... |
nharraud/invenio-oaiharvester | refs/heads/master | invenio_oaiharvester/views.py | 3 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015 CERN.
#
# Invenio 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... |
gameduell/duell | refs/heads/master | bin/win/python2.7.9/Lib/lib2to3/fixes/fix_isinstance.py | 326 | # Copyright 2008 Armin Ronacher.
# Licensed to PSF under a Contributor Agreement.
"""Fixer that cleans up a tuple argument to isinstance after the tokens
in it were fixed. This is mainly used to remove double occurrences of
tokens as a leftover of the long -> int / unicode -> str conversion.
eg. isinstance(x, (int,... |
shaon/eutester | refs/heads/master | testcases/cloud_admin/load/locust/locustfile.py | 6 | import time
from eucaops import Eucaops
from locust import Locust, events, web
import user_profiles
@web.app.route("/added_page")
def my_added_page():
return "Another page"
class EucaopsClient(Eucaops):
def __init__(self, *args, **kwargs):
"""
This class extends Eucaops in order to provide a ... |
jimbobhickville/libcloud | refs/heads/trunk | libcloud/test/common/test_openstack.py | 42 | # 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 use ... |
simon-pepin/scikit-learn | refs/heads/master | sklearn/linear_model/tests/test_base.py | 120 | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
#
# License: BSD 3 clause
import numpy as np
from scipy import sparse
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_equal
from sklearn.linear_model.... |
soldag/home-assistant | refs/heads/dev | homeassistant/components/yessssms/const.py | 18 | """Const for YesssSMS."""
CONF_PROVIDER = "provider"
|
hyperized/ansible | refs/heads/devel | lib/ansible/modules/cloud/openstack/_os_server_actions.py | 61 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Ansible Project
# 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',
... |
terkkila/scikit-learn | refs/heads/master | benchmarks/bench_20newsgroups.py | 377 | from __future__ import print_function, division
from time import time
import argparse
import numpy as np
from sklearn.dummy import DummyClassifier
from sklearn.datasets import fetch_20newsgroups_vectorized
from sklearn.metrics import accuracy_score
from sklearn.utils.validation import check_array
from sklearn.ensemb... |
mark-ignacio/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/test/runner_unittest.py | 124 | # Copyright (C) 2012 Google, Inc.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer... |
awkspace/ansible | refs/heads/devel | test/integration/targets/ansible-runner/files/adhoc_example1.py | 87 | import json
import os
import sys
import ansible_runner
# the first positional arg should be where the artifacts live
output_dir = sys.argv[1]
# this calls a single module directly, aka "adhoc" mode
r = ansible_runner.run(
private_data_dir=output_dir,
host_pattern='localhost',
module='shell',
module_ar... |
drexly/tonginBlobStore | refs/heads/master | lib/django/shortcuts.py | 135 | """
This module collects helper functions and classes that "span" multiple levels
of MVC. In other words, these functions/classes introduce controlled coupling
for convenience's sake.
"""
import warnings
from django.core import urlresolvers
from django.db.models.base import ModelBase
from django.db.models.manager imp... |
EliasTouil/simpleBlog | refs/heads/master | simpleBlog/Lib/encodings/iso2022_jp_3.py | 816 | #
# iso2022_jp_3.py: Python Unicode Codec for ISO2022_JP_3
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_iso2022, codecs
import _multibytecodec as mbc
codec = _codecs_iso2022.getcodec('iso2022_jp_3')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class Incrementa... |
joshmgrant/selenium | refs/heads/master | py/test/selenium/webdriver/common/repr_tests.py | 31 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
kharts/kastodi | refs/heads/master | resources/lib/google/protobuf/unittest_import_pb2.py | 8 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/protobuf/unittest_import.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.proto... |
goldeneye-source/ges-python | refs/heads/master | lib/multiprocessing/popen_fork.py | 83 | import os
import sys
import signal
import errno
from . import util
__all__ = ['Popen']
#
# Start child process using fork
#
class Popen(object):
method = 'fork'
def __init__(self, process_obj):
sys.stdout.flush()
sys.stderr.flush()
self.returncode = None
self._launch(process... |
kivy/plyer | refs/heads/master | examples/text2speech/main.py | 1 | import kivy
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.popup import Popup
from plyer import tts
kivy.require('1.8.0')
class Text2SpeechDemo(BoxLayout):
def do_read(self):
try:
tts.speak(self.ids.notification_text.text)
except NotImplementedError:
... |
InstigatorX/InstigatorX-V2-Kernel | refs/heads/master | scripts/build-all.py | 1250 | #! /usr/bin/env python
# Copyright (c) 2009-2011, Code Aurora Forum. 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
# n... |
fairdk/fair-ubuntu-centre | refs/heads/master | installscripts/postinstall/filesystem/opt/fair-apps/shutdown/deploy.py | 1 | import datetime
import os
import subprocess, shlex
import re
import sys
import time
REMOTE_SSH_EXEC = "ssh -o CheckHostIP=no -o StrictHostKeyChecking=no -o PasswordAuthentication=no root@%s \"%s\""
REMOTE_SCP = "scp -o CheckHostIP=no -o StrictHostKeyChecking=no %s root@%s:%s"
REMOTE_IPS = ["192.168.10.%d" % x for x i... |
arbrandes/edx-platform | refs/heads/master | lms/djangoapps/mobile_api/tests/test_middleware.py | 5 | """
Tests for Version Based App Upgrade Middleware
"""
from datetime import datetime
from unittest import mock
import ddt
from django.core.cache import caches
from django.http import HttpRequest, HttpResponse
from pytz import UTC
from lms.djangoapps.mobile_api.middleware import AppVersionUpgrade
from lms.djangoapps... |
s-hertel/ansible | refs/heads/devel | test/integration/targets/missing_required_lib/library/missing_required_lib.py | 28 | #!/usr/bin/python
# Copyright: (c) 2020, Matt Martz <matt@sivel.net>
# 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
from ansible.module_utils.basic import AnsibleModule, missing_required... |
glue-viz/bermuda | refs/heads/master | bermuda/demos/shape_options.py | 1 | import matplotlib.pyplt as plt
from bermuda import ellipse, polygon, rectangle
plt.plot([1,2,3], [2,3,4])
ax = plg.gca()
# default choices for everything
e = ellipse(ax)
# custom position, genric interface for all shapes
e = ellipse(ax, bbox = (x, y, w, h, theta))
e = ellipse(ax, cen=(x, y), width=w, height=h, the... |
kneeks/is210-week-03-synthesizing | refs/heads/master | inquisition.py | 25 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Nobody expects this module."""
SPANISH = '''Nobody expects the Spanish Inquisition!
Our chief weapon is surprise...surprise and fear...fear and surprise....
Our two weapons are fear and surprise...and ruthless efficiency....
Our three weapons are fear, surprise, and ru... |
themiken/mtasa-blue | refs/heads/master | vendor/google-breakpad/src/tools/gyp/test/win/vs-macros/as.py | 332 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from optparse import OptionParser
parser = OptionParser()
parser.add_option('-a', dest='platform')
parser.add_option('-o', dest='output')
p... |
yanigisawa/voting-tornado | refs/heads/master | server/seeddata.py | 1 | from pymongo import MongoClient
import urllib
from datetime import datetime
import json
import config
from models import Event, EventEncoder, Team, TeamMember
import requests
server = config.dbServer
user = urllib.parse.quote_plus(config.dbUser)
password = urllib.parse.quote_plus(config.dbPassword)
uri = 'mongodb://{0... |
fhaoquan/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/encodings/cp1250.py | 272 | """ Python Character Mapping Codec cp1250 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1250.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,in... |
ishay2b/tensorflow | refs/heads/segnet | tensorflow/contrib/linalg/python/__init__.py | 959 | # 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... |
czgu/metaHack | refs/heads/master | env/lib/python2.7/site-packages/django/conf/locale/fr/formats.py | 82 | # -*- 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:s'
DATE... |
syci/OCB | refs/heads/9.0 | addons/product_uos/models/product_uos.py | 11 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from openerp import api, fields, models
import openerp.addons.decimal_precision as dp
class ProductTemplate(models.Model):
_inherit = "product.template"
uos_id = fields.Many2one('product.uom', 'Unit of Sale',
... |
hassanabidpk/django | refs/heads/master | tests/sessions_tests/custom_db_backend.py | 159 | """
This custom Session model adds an extra column to store an account ID. In
real-world applications, it gives you the option of querying the database for
all active sessions for a particular account.
"""
from django.contrib.sessions.backends.db import SessionStore as DBStore
from django.contrib.sessions.base_session ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.