repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
unixbhaskar/Linux-kernel | refs/heads/master | Documentation/networking/cxacru-cf.py | 14668 | #!/usr/bin/env python
# Copyright 2009 Simon Arlott
#
# 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 i... |
splav/servo | refs/heads/master | tests/wpt/web-platform-tests/webdriver/tests/find_elements_from_element/user_prompts.py | 24 | # META: timeout=long
import pytest
from tests.support.asserts import (
assert_error,
assert_same_element,
assert_success,
assert_dialog_handled,
)
from tests.support.inline import inline
def find_elements(session, element_id, using, value):
return session.transport.send(
"POST", "session... |
thisispuneet/potato-blog | refs/heads/master | django/db/backends/sqlite3/client.py | 635 | import os
import sys
from django.db.backends import BaseDatabaseClient
class DatabaseClient(BaseDatabaseClient):
executable_name = 'sqlite3'
def runshell(self):
args = [self.executable_name,
self.connection.settings_dict['NAME']]
if os.name == 'nt':
sys.exit(os.sys... |
normtown/SickRage | refs/heads/master | lib/sqlalchemy/sql/annotation.py | 79 | # sql/annotation.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""The :class:`.Annotated` class and related routines; creates hash-equivalent
copie... |
thresholdsoftware/asylum | refs/heads/master | openerp/addons/crm_partner_assign/report/crm_partner_report.py | 53 | # -*- 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... |
kaffeebrauer/Lean | refs/heads/master | Algorithm.Python/MaximumPortfolioDrawdownFrameworkAlgorithm.py | 1 | # QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect 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 Lice... |
svenstaro/ansible | refs/heads/devel | test/integration/targets/module_utils/module_utils/foo0.py | 298 | data = 'foo0'
|
qsnake/gpaw | refs/heads/master | oldtest/transport_stm.py | 3 | from ase import *
from gpaw import *
from gpaw.transport.stm import STM
a = 7.0
d = 3.31
tip = Atoms('Na5', pbc=1, cell=(a, a, a / 2 + 4 * d))
tip.positions[:, 2] = np.arange(5) * d + a / 2
tip.positions[:, :2] = a / 2
calc = GPAW(mode='lcao', basis='sz', width=0.1)
tip.set_calculator(calc)
tip.get_potential_energy()
... |
argaen/django_zoneblog | refs/heads/master | setup.py | 1 | from setuptools import setup
packages = ['Django']
setup(
name="django_zoneblog",
version="0.1",
url="http://github.com/argaen/django_zoneblog",
description="Lightweight blog app",
author="argaen",
author_email="manu.mirandad@gmail.com",
packages=['zone_blog'],
include_package_data=Tru... |
bohlian/erpnext | refs/heads/develop | erpnext/healthcare/doctype/patient_appointment/patient_appointment.py | 5 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, ESS LLP and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
import json
from frappe.utils import getdate
from frappe import _
import datetime
from frappe.core.do... |
robertnishihara/ray | refs/heads/master | rllib/examples/env/correlated_actions_env.py | 3 | import gym
from gym.spaces import Discrete, Tuple
import random
class CorrelatedActionsEnv(gym.Env):
"""Simple env in which the policy has to emit a tuple of equal actions.
The best score would be ~200 reward."""
def __init__(self, _):
self.observation_space = Discrete(2)
self.action_spa... |
ChristopherOlson/ArduHeli | refs/heads/ArduHeli-3.5.7 | mk/PX4/Tools/genmsg/src/genmsg/deps.py | 216 | # Software License Agreement (BSD License)
#
# Copyright (c) 2011, Willow Garage, 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 ... |
gangadhar-kadam/adb-erp | refs/heads/master | hr/doctype/earning_type/__init__.py | 37694 | from __future__ import unicode_literals
|
d-e-s-o/btrfs-backup | refs/heads/devel | btrfs-backup/src/deso/btrfs/repository.py | 1 | # repository.py
#/***************************************************************************
# * Copyright (C) 2015-2017 Daniel Mueller (deso@posteo.net) *
# * *
# * This program is free software: you can redistribute it and/or m... |
christianurich/DynaMind-ToolBox | refs/heads/master | DynaMind-Extensions/unit-tests/gtest-1.6.0/test/gtest_throw_on_failure_test.py | 2917 | #!/usr/bin/env python
#
# Copyright 2009, 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... |
benhowell/pycsw | refs/heads/master | pycsw/ogc/fes/__init__.py | 63 | # -*- coding: ISO-8859-15 -*-
# =================================================================
#
# Authors: Tom Kralidis <tomkralidis@gmail.com>
#
# Copyright (c) 2015 Tom Kralidis
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files... |
DEVSENSE/PTVS | refs/heads/master | Python/Tests/TestData/WFastCgi/DjangoTestApp/manage.py | 963 | #!/usr/bin/env python
from django.core.management import execute_manager
import imp
try:
imp.find_module('settings') # Assumed to be in the same directory.
except ImportError:
import sys
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized t... |
ParkJinSang/SIMONFramework | refs/heads/master | src/SIMON_Py/__init__.py | 1 | __author__ = 'PARKJINSANG'
'''
SIMON Framework is made for implementing AI Learning.
agents - There are implementations of AI agents.
algorithms - For now, genetic algorithm has been implemented.
objects - There are basic object files of the framework.
test - Test modules.
utils - Utility... |
qqzwc/XX-Net | refs/heads/master | code/default/python27/1.0/lib/win32/cryptography/hazmat/backends/openssl/ec.py | 19 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
from cryptography import utils
from cryptography.exceptions import (
... |
JayVora-SerpentCS/e-commerce | refs/heads/9.0 | setup/website_sale_default_country/odoo_addons/__init__.py | 13048 | __import__('pkg_resources').declare_namespace(__name__)
|
shopmium/titanium_mobile | refs/heads/master | support/common/simplejson/tests/test_encode_basestring_ascii.py | 135 | from unittest import TestCase
import simplejson.encoder
CASES = [
(u'/\\"\ucafe\ubabe\uab98\ufcde\ubcda\uef4a\x08\x0c\n\r\t`1~!@#$%^&*()_+-=[]{}|;:\',./<>?', '"/\\\\\\"\\ucafe\\ubabe\\uab98\\ufcde\\ubcda\\uef4a\\b\\f\\n\\r\\t`1~!@#$%^&*()_+-=[]{}|;:\',./<>?"'),
(u'\u0123\u4567\u89ab\ucdef\uabcd\uef4a', '"\\u0... |
indictranstech/focal-erpnext | refs/heads/develop | stock/doctype/landed_cost_purchase_receipt/__init__.py | 37694 | from __future__ import unicode_literals
|
ralphbean/moksha | refs/heads/dev | moksha/apps/__init__.py | 13048 | __import__('pkg_resources').declare_namespace(__name__)
|
gVallverdu/pymatgen | refs/heads/master | pymatgen/ext/tests/test_cod.py | 4 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
import unittest
from monty.os.path import which
import warnings
from pymatgen.ext.cod import COD
class CODTest(unittest.TestCase):
_multiprocess_shared_ = True
def setUp(self):
warnings.sim... |
andrewpaulreeves/soapy | refs/heads/master | soapy/pyqtgraph/units.py | 55 | # -*- coding: utf-8 -*-
## Very simple unit support:
## - creates variable names like 'mV' and 'kHz'
## - the value assigned to the variable corresponds to the scale prefix
## (mV = 0.001)
## - the actual units are purely cosmetic for making code clearer:
##
## x = 20*pA is identical to x = 20*1e-12
#... |
googleads/google-ads-python | refs/heads/master | google/ads/googleads/v8/services/services/invoice_service/__init__.py | 2 | # -*- coding: utf-8 -*-
# Copyright 2020 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... |
Serulab/Py4Bio | refs/heads/master | code/ch18/toexcel.py | 1 | from Bio.SeqUtils import MeltingTemp as MT
import xlwt
PRIMER_FILE = '../../samples/primers.txt'
# w is the name of a newly created workbook.
w = xlwt.Workbook()
# ws is the name of a new sheet in this workbook.
ws = w.add_sheet('Result')
# These two lines writes the titles of the columns.
ws.write(0, 0, 'Primer Seque... |
remilap/Raspberry_dev | refs/heads/master | Camera/cam01.py | 1 | #!/usr/bin/python
import picamera
from time import sleep, localtime, strftime
camera = picamera.PiCamera()
camera.hflip = False
camera.vflip = False
name = 'image' + strftime("%Y_%m_%d_%H_%M_%S", localtime())
camera.capture(name + '_1.jpg')
sleep(2)
camera.capture(name + '_1.jpg')
|
maxive/erp | refs/heads/master | addons/account/wizard/__init__.py | 12 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import account_reconcile
from . import account_unreconcile
from . import account_invoice_refund
from . import account_invoice_state
from . import account_validate_account_move
from . import pos_box
from . import ... |
Dm47021/CAF-MSM-34 | refs/heads/msm-3.4 | tools/perf/scripts/python/syscall-counts.py | 11181 | # system call counts
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.path.append(os.envir... |
smart-make/zxing | refs/heads/master | cpp/scons/scons-local-2.0.0.final.0/SCons/Tool/ilink32.py | 34 | """SCons.Tool.ilink32
XXX
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
# 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 re... |
msmolens/girder | refs/heads/master | scripts/InstallPythonRequirements.py | 6 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright Kitware 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 ... |
ZeusWPI/Haldis | refs/heads/master | app/hlds/parser.py | 1 | #!/usr/bin/env python3
from glob import glob
from os import path
import itertools
from copy import deepcopy
from typing import Iterable, List, Union, Tuple
from tatsu import parse as tatsu_parse
from tatsu.ast import AST
from tatsu.exceptions import SemanticError
from .models import Location, Choice, Option, Dish
from... |
cpennington/edx-platform | refs/heads/master | common/lib/xmodule/xmodule/modulestore/modulestore_settings.py | 4 | """
This file contains helper functions for configuring module_store_setting settings and support for backward compatibility with older formats.
"""
import copy
import warnings
import six
def convert_module_store_setting_if_needed(module_store_setting):
"""
Converts old-style module_store_setting configura... |
herilalaina/scikit-learn | refs/heads/master | examples/svm/plot_separating_hyperplane_unbalanced.py | 9 | """
=================================================
SVM: Separating hyperplane for unbalanced classes
=================================================
Find the optimal separating hyperplane using an SVC for classes that
are unbalanced.
We first find the separating plane with a plain SVC and then plot
(dashed) the ... |
Astrak/three.js | refs/heads/dev | utils/exporters/blender/addons/io_three/exceptions.py | 174 | class ThreeError(Exception): pass
class UnimplementedFeatureError(ThreeError): pass
class ThreeValueError(ThreeError): pass
class UnsupportedObjectType(ThreeError): pass
class GeometryError(ThreeError): pass
class MaterialError(ThreeError): pass
class SelectionError(ThreeError): pass
class NGonError(ThreeError): pass
c... |
dulems/hue | refs/heads/master | desktop/core/ext-py/lxml/benchmark/bench_xpath.py | 29 | import sys, copy
from itertools import *
from StringIO import StringIO
import benchbase
from benchbase import with_attributes, with_text, onlylib, serialized, children, nochange
############################################################
# Benchmarks
############################################################
clas... |
ambikeshwar1991/sandhi-2 | refs/heads/master | module/gr36/gr-howto-write-a-block/docs/doxygen/doxyxml/base.py | 333 | #
# Copyright 2010 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# any later version.
#
#... |
mdaniel/intellij-community | refs/heads/master | python/testData/inspections/PyUnresolvedReferencesInspection/undeclaredAttrAssign.py | 83 | x = object()
x.y = 5
|
vighneshbirodkar/scikit-image | refs/heads/master | skimage/measure/_marching_cubes_lewiner.py | 3 | import sys
import base64
import dis
import inspect
import numpy as np
if sys.version_info >= (3, ):
base64decode = base64.decodebytes
ordornot = lambda x:x
else:
base64decode = base64.decodestring
ordornot = ord
from . import _marching_cubes_lewiner_luts as mcluts
from . import _marching_cubes_lewine... |
Spacecraft-Code/SPELL | refs/heads/master | drivers/example/src/gcstime.py | 1 | ###################################################################################
## MODULE : gcstime
## DATE : Mar 18, 2011
## PROJECT : SPELL
## DESCRIPTION: Time service interface of the driver connection layer
## --------------------------------------------------------------------------------
##
## ... |
sbellem/django | refs/heads/master | django/contrib/gis/forms/widgets.py | 422 | from __future__ import unicode_literals
import logging
from django.conf import settings
from django.contrib.gis import gdal
from django.contrib.gis.geos import GEOSException, GEOSGeometry
from django.forms.widgets import Widget
from django.template import loader
from django.utils import six, translation
logger = log... |
mj10777/QGIS | refs/heads/master | tests/src/python/test_qgslayoutshape.py | 19 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsLayoutItemShape.
.. note:: 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.
""... |
Yarrick13/hwasp | refs/heads/master | tests/asp/AllAnswerSets/tight/graph.colouring.4.40.5_7.asp.test.py | 4 | input = """
1 2 0 0
1 3 0 0
1 4 0 0
1 5 0 0
1 6 0 0
1 7 0 0
1 8 0 0
1 9 0 0
1 10 0 0
1 11 0 0
1 12 0 0
1 13 0 0
1 14 0 0
1 15 0 0
1 16 0 0
1 17 0 0
1 18 0 0
1 19 0 0
1 20 0 0
1 21 0 0
1 22 0 0
1 23 0 0
1 24 0 0
1 25 0 0
1 26 0 0
1 27 0 0
1 28 0 0
1 29 0 0
1 30 0 0
1 31 0 0
1 32 0 0
1 33 0 0
1 34 0 0
1 35 0 0
1 36 0 0
1... |
tuxxy/CloudBot | refs/heads/master | plugins/minecraft_status.py | 24 | import json
import requests
from cloudbot import hook
@hook.command(autohelp=False)
def mcstatus():
"""- gets the status of various Mojang (Minecraft) servers"""
try:
request = requests.get("http://status.mojang.com/check")
request.raise_for_status()
except (requests.exceptions.HTTPError... |
dededong/goblin-core | refs/heads/master | riscv/llvm/3.5/llvm-3.5.0.src/test/CodeGen/SystemZ/Large/branch-range-11.py | 13 | # Test 32-bit COMPARE LOGICAL IMMEDIATE AND BRANCH in cases where the sheer
# number of instructions causes some branches to be out of range.
# RUN: python %s | llc -mtriple=s390x-linux-gnu | FileCheck %s
# Construct:
#
# before0:
# conditional branch to after0
# ...
# beforeN:
# conditional branch to after0
# m... |
ESOedX/edx-platform | refs/heads/master | openedx/core/djangoapps/programs/tasks/v1/tests/test_tasks.py | 1 | """
Tests for programs celery tasks.
"""
from __future__ import absolute_import
import json
import logging
from datetime import datetime, timedelta
import ddt
import httpretty
import mock
import pytz
from celery.exceptions import MaxRetriesExceededError
from django.conf import settings
from django.test import TestCas... |
dimagol/trex-core | refs/heads/master | scripts/astf/http_manual_cli_tunable.py | 2 | # Example for creating your program by specifying buffers to send, without relaying on pcap file
from trex_astf_lib.api import *
# we can send either Python bytes type as below:
http_req = b'GET /3384 HTTP/1.1\r\nHost: 22.0.0.3\r\nConnection: Keep-Alive\r\nUser-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.... |
dogancankilment/UnixTools | refs/heads/master | showcase/wsgi.py | 1 | """
WSGI config for showcase project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION``... |
valexandersaulys/airbnb_kaggle_contest | refs/heads/master | venv/lib/python3.4/site-packages/scipy/sparse/dia.py | 53 | """Sparse DIAgonal format"""
from __future__ import division, print_function, absolute_import
__docformat__ = "restructuredtext en"
__all__ = ['dia_matrix', 'isspmatrix_dia']
import numpy as np
from .base import isspmatrix, _formats
from .data import _data_matrix
from .sputils import isshape, upcast_char, getdtype... |
agry/NGECore2 | refs/heads/master | scripts/object/tangible/painting/painting_twilek_f_lg_s04.py | 85615 | import sys
def setup(core, object):
return |
NL66278/OCB | refs/heads/8.0 | openerp/addons/base/module/__init__.py | 462 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
gigitux/lollypop | refs/heads/master | src/player_bin.py | 1 | # Copyright (c) 2014-2015 Cedric Bellegarde <cedric.bellegarde@adishatz.org>
# 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... |
moijes12/oh-mainline | refs/heads/master | vendor/packages/Django/django/db/backends/postgresql_psycopg2/creation.py | 107 | import psycopg2.extensions
from django.db.backends.creation import BaseDatabaseCreation
from django.db.backends.util import truncate_name
class DatabaseCreation(BaseDatabaseCreation):
# This dictionary maps Field objects to their associated PostgreSQL column
# types, as strings. Column-type strings can conta... |
ClusterLabs/pcs | refs/heads/master | pcs_test/tier1/legacy/test_stonith.py | 3 | # pylint: disable=too-many-lines
import shutil
from textwrap import dedent
from threading import Lock
from unittest import TestCase
from pcs.common.str_tools import indent
from pcs_test.tier1.cib_resource.common import ResourceTest
from pcs_test.tools.assertions import AssertPcsMixin
from pcs_test.tools.bin_mock impor... |
wenhulove333/ScutServer | refs/heads/master | Sample/ClientSource/tools/xcode4_template_generator/template_generator.py | 1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# ----------------------------------------------------------------------------
# Xcode 4 template generator for cocos2d project
# (c) 2011 Ricardo Quesada
#
# LICENSE: Dual License: MIT & GNU GPL v2 Whatever suits you best.
#
# Given a directory, it generates the "Defin... |
lakshmi-kannan/st2 | refs/heads/master | st2common/st2common/persistence/keyvalue.py | 6 | # Licensed to the StackStorm, Inc ('StackStorm') 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 th... |
djmitche/moto | refs/heads/master | moto/dynamodb/urls.py | 6 | from __future__ import unicode_literals
from .responses import DynamoHandler
url_bases = [
"https?://dynamodb.(.+).amazonaws.com",
"https?://sts.amazonaws.com",
]
url_paths = {
"{0}/": DynamoHandler().dispatch,
}
|
sabi0/intellij-community | refs/heads/master | python/helpers/coveragepy/coverage/parser.py | 39 | # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt
"""Code parsing for coverage.py."""
import ast
import collections
import os
import re
import token
import tokenize
from coverage import env
from coverage.backward... |
jhakonen/setuptools-wotmod | refs/heads/master | tox/clean.py | 1 | import os
from common import *
print_header('Cleaning projects')
exec_command(['python', 'setup.py', '-q', 'clean'], PROJECT_DIR)
exec_command(['python', 'setup.py', '-q', 'clean', '--dist', '--eggs', '--pycache'], HELLOWORLD_DIR)
remove_dir(os.path.join(PYPIPACKAGE_DIR, 'pydash-4.2.1'))
remove_file(os.path.join(PYPI... |
xujun10110/golismero | refs/heads/master | tools/theHarvester/harvesteroutput.py | 8 | from lib import htmlExport
from lxml import etree
class HarvesterOutput:
def __init__(self, output_results = None):
self.output_results = output_results
self.output_formats = {'H':self.__process_html,
'X':self.__process_xml}
def get_output_formats (self):
return self.output_formats.keys()
def pro... |
reviewboard/reviewboard | refs/heads/master | reviewboard/accounts/evolutions/profile_settings.py | 5 | from __future__ import unicode_literals
from django_evolution.mutations import AddField
from djblets.db.fields import JSONField
MUTATIONS = [
AddField('Profile', 'settings', JSONField, null=True),
]
|
ecederstrand/django | refs/heads/master | django/contrib/messages/__init__.py | 741 | from django.contrib.messages.api import * # NOQA
from django.contrib.messages.constants import * # NOQA
default_app_config = 'django.contrib.messages.apps.MessagesConfig'
|
40223247/2015test2-1 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/markdown2.py | 669 | import browser.html
import re
class URL:
def __init__(self,src):
elts = src.split(maxsplit=1)
self.href = elts[0]
self.alt = ''
if len(elts)==2:
alt = elts[1]
if alt[0]=='"' and alt[-1]=='"':self.alt=alt[1:-1]
elif alt[0]=="'" and alt[-1]=="'":sel... |
izonder/intellij-community | refs/heads/master | python/lib/Lib/popen2.py | 110 | """Spawn a command with pipes to its stdin, stdout, and optionally stderr.
The normal os.popen(cmd, mode) call spawns a shell command and provides a
file interface to just the input or output of the process depending on
whether mode is 'r' or 'w'. This module provides the functions popen2(cmd)
and popen3(cmd) which r... |
gauravbose/digital-menu | refs/heads/master | django/contrib/flatpages/middleware.py | 478 | from django.conf import settings
from django.contrib.flatpages.views import flatpage
from django.http import Http404
class FlatpageFallbackMiddleware(object):
def process_response(self, request, response):
if response.status_code != 404:
return response # No need to check for a flatpage for n... |
net592/OneOps | refs/heads/master | groups/admin.py | 13848 | from django.contrib import admin
# Register your models here.
|
robbiet480/home-assistant | refs/heads/dev | homeassistant/components/somfy_mylink/__init__.py | 10 | """Component for the Somfy MyLink device supporting the Synergy API."""
import logging
from somfy_mylink_synergy import SomfyMyLinkSynergy
import voluptuous as vol
from homeassistant.const import CONF_HOST, CONF_PORT
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.discovery import... |
andreparrish/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/test/test_wait3.py | 63 | """This test checks for correct wait3() behavior.
"""
import os
import time
import unittest
from test.fork_wait import ForkWait
from test.support import run_unittest, reap_children
try:
os.fork
except AttributeError:
raise unittest.SkipTest("os.fork not defined -- skipping test_wait3")
try:
os.wait3
exce... |
op1ekun/shaka-player | refs/heads/master | third_party/closure/deps/treescan.py | 582 | #!/usr/bin/env python
#
# Copyright 2010 The Closure Library 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
... |
arenadata/ambari | refs/heads/branch-adh-1.6 | ambari-server/src/test/python/mpacks/mystack-ambari-mpack-1.0.0.1/hooks/before_install.py | 40 | #!/usr/bin/env python
'''
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")... |
stephane-martin/salt-debian-packaging | refs/heads/master | salt-2016.3.2/tests/unit/states/ddns_test.py | 2 | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Jayesh Kariya <jayeshk@saltstack.com>`
'''
# Import Python libs
from __future__ import absolute_import
# Import Salt Testing Libs
from salttesting import skipIf, TestCase
from salttesting.mock import (
NO_MOCK,
NO_MOCK_REASON,
MagicMock,
patch)
from... |
spark-test/spark | refs/heads/master | examples/src/main/python/mllib/logistic_regression.py | 51 | #
# 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... |
gminds/rapidnewsng | refs/heads/master | django/contrib/localflavor/ec/ec_provinces.py | 110 | # -*- coding: utf-8 -*-
"""
A list of Ecuador departaments as `choices` in a
formfield.
This exists in this standalone file so that it's only
imported into memory when explicitly needed.
"""
from __future__ import unicode_literals
PROVINCE_CHOICES = (
('A', 'Azuay'),
('B', 'Bolívar'),
('F', 'Cañar'),
... |
sebaxtian/raspberrypi3 | refs/heads/master | lighting_led/gpio_control_2.py | 1 | '''
Ejemplo de usar un boton para encender y apagar un LED.
Fuente: https://www.raspberrypi.org/learning/physical-computing-with-python/worksheet/
Fecha: mar dic 6 21:19:23 COT 2016
Version: 1.0
'''
from gpiozero import LED, Button
from time import sleep
# Usando el GP17 controlamos el LED
led = LED(17)
# Usando el... |
TeamSWAP/swap | refs/heads/master | external/pyinstaller/tests/import/relimp2/bar/baz.py | 7 | #-----------------------------------------------------------------------------
# Copyright (c) 2013, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this softwa... |
Nimoab/DQN-Deepmind-NIPS-2013 | refs/heads/master | QtDisplay.py | 1 | import time
import datetime
import threading as Thr
import PyQt4.QtCore as qtc
import PyQt4.QtGui as qtg
import Plotter as P
import EnvDisplay as ED
## The QDisplay class provides a way to integrate different window or Qt
# applications. This class is a QtCore.QObject that hold the QApplication
# and star... |
s40523121/2017springwcm_g5 | refs/heads/gh-pages | plugin/summary/test_summary.py | 31 | # -*- coding: utf-8 -*-
import unittest
from jinja2.utils import generate_lorem_ipsum
# generate one paragraph, enclosed with <p>
TEST_CONTENT = str(generate_lorem_ipsum(n=1))
TEST_SUMMARY = generate_lorem_ipsum(n=1, html=False)
from pelican.contents import Page
import summary
class TestSummary(un... |
2014c2g2/2015cda | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/markdown2.py | 669 | import browser.html
import re
class URL:
def __init__(self,src):
elts = src.split(maxsplit=1)
self.href = elts[0]
self.alt = ''
if len(elts)==2:
alt = elts[1]
if alt[0]=='"' and alt[-1]=='"':self.alt=alt[1:-1]
elif alt[0]=="'" and alt[-1]=="'":sel... |
pymedusa/Medusa | refs/heads/master | ext/guessit/rules/markers/path.py | 7 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Path markers
"""
from rebulk import Rebulk
from rebulk.utils import find_all
def path(config): # pylint:disable=unused-argument
"""
Builder for rebulk object.
:param config: rule configuration
:type config: dict
:return: Created Rebulk object
... |
Antiun/sale-workflow | refs/heads/8.0 | sale_product_set/models/product_set_line.py | 15 | # -*- coding: utf-8 -*-
from openerp import fields, models
import openerp.addons.decimal_precision as dp
class ProductSetLine(models.Model):
_name = 'product.set.line'
_description = 'Product set line'
_rec_name = 'product_id'
_order = 'sequence'
product_id = fields.Many2one(
'product.pr... |
tamihiro/grpc | refs/heads/master | src/python/grpcio/tests/unit/_cython/cygrpc_test.py | 8 | # 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... |
52ai/django-ccsds | refs/heads/master | tests/utils_tests/test_timezone.py | 13 | import copy
import datetime
import pickle
import unittest
from django.test import override_settings
from django.utils import timezone
try:
import pytz
except ImportError:
pytz = None
if pytz is not None:
CET = pytz.timezone("Europe/Paris")
EAT = timezone.get_fixed_timezone(180) # Africa/Nairobi
ICT... |
arch1tect0r/root | refs/heads/master | interpreter/llvm/src/utils/lit/tests/shtest-format.py | 56 | # Check the various features of the ShTest format.
#
# RUN: not %{lit} -j 1 -v %{inputs}/shtest-format > %t.out
# RUN: FileCheck < %t.out %s
#
# END.
# CHECK: -- Testing:
# CHECK: PASS: shtest-format :: argv0.txt
# CHECK: FAIL: shtest-format :: external_shell/fail.txt
# CHECK-NEXT: *** TEST 'shtest-format :: external... |
rajuniit/udacity | refs/heads/master | tv-script/problem_unittests.py | 26 | import numpy as np
import tensorflow as tf
from tensorflow.contrib import rnn
def _print_success_message():
print('Tests Passed')
def test_create_lookup_tables(create_lookup_tables):
with tf.Graph().as_default():
test_text = '''
Moe_Szyslak Moe's Tavern Where the elite meet to drink
... |
uvNikita/appstats | refs/heads/master | appstats/anomaly.py | 1 | from flask import url_for
from collections import namedtuple
_Anomaly = namedtuple('Anomaly', ['app_id', 'name', 'field'])
class Anomaly(_Anomaly):
@property
def url(self):
return url_for('stats_frontend.apps_info',
app_id=self.app_id, name=self.name, _external=True)
|
lthurlow/Boolean-Constrained-Routing | refs/heads/master | networkx-1.8.1/build/lib.linux-i686-2.7/networkx/drawing/__init__.py | 41 | # graph drawing and interface to graphviz
import sys
from networkx.drawing.layout import *
from networkx.drawing.nx_pylab import *
# graphviz interface
# prefer pygraphviz/agraph (it's faster)
from networkx.drawing.nx_agraph import *
try:
import pydot
import networkx.drawing.nx_pydot
from networkx.drawing.... |
40223145c2g18/c2g18 | refs/heads/master | .leo_shadow/xc2_w1_python1.py | 76 | #@+leo-ver=4-thin
#@+node:2014python.20140224210642.3167:@shadow c2_w1_python1.py
#@-node:2014python.20140224210642.3167:@shadow c2_w1_python1.py
#@-leo
|
schambers/civmarket | refs/heads/master | civmarket/lib/python2.7/site-packages/pip/commands/freeze.py | 345 | import re
import sys
import pip
from pip.req import InstallRequirement
from pip.log import logger
from pip.basecommand import Command
from pip.util import get_installed_distributions
from pip._vendor import pkg_resources
class FreezeCommand(Command):
"""Output installed packages in requirements format."""
na... |
zooba/PTVS | refs/heads/master | Python/Product/Miniconda/Miniconda3-x64/Lib/macpath.py | 11 | """Pathname and path-related operations for the Macintosh."""
# strings representing various path-related bits and pieces
# These are primarily for export; internally, they are hardcoded.
# Should be set before imports for resolving cyclic dependency.
curdir = ':'
pardir = '::'
extsep = '.'
sep = ':'
pathsep = '\n'
de... |
magicgoose/dr14_t.meter | refs/heads/master | dr14tmeter/dr14_tmeter.py | 1 | #!/usr/bin/python
# dr14_t.meter: compute the DR14 value of the given audiofiles
# Copyright (C) 2011 Simone Riva
#
# 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 Lic... |
XeryusTC/rotd | refs/heads/master | functional_tests/base.py | 1 | # -*- coding: utf-8 -*-
# ROTD suggest a recipe to cook for dinner, changing the recipe every day.
# Copyright © 2015 Xeryus Stokkel
# ROTD is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the
# Free Software Foundation, either versio... |
liangz0707/scikit-learn | refs/heads/master | examples/neighbors/plot_approximate_nearest_neighbors_hyperparameters.py | 227 | """
=================================================
Hyper-parameters of Approximate Nearest Neighbors
=================================================
This example demonstrates the behaviour of the
accuracy of the nearest neighbor queries of Locality Sensitive Hashing
Forest as the number of candidates and the numb... |
liang42hao/bokeh | refs/heads/master | sphinx/source/docs/user_guide/source_examples/styling_dimensions.py | 46 | from bokeh.plotting import figure, output_file, show
output_file("dimensions.html")
# create a new plot with a title
p = figure(plot_width=700)
p.plot_height = 300
p.circle([1, 2, 3, 4, 5], [2, 5, 8, 2, 7], size=10)
show(p)
|
ingokegel/intellij-community | refs/heads/master | python/helpers/pydev/pydev_tests_python/resources/_debugger_case_check_tracer.py | 15 | import threading, atexit, sys
from collections import namedtuple
import os.path
if sys.version_info[0] >= 3:
from _thread import start_new_thread
else:
from thread import start_new_thread
FrameInfo = namedtuple('FrameInfo', 'filename, name, f_trace')
def _atexit():
sys.stderr.flush()
sys.stdout.flus... |
OpenState-SDN/ryu | refs/heads/master | ryu/base/app_manager.py | 3 | # Copyright (C) 2011-2014 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2011 Isaku Yamahata <yamahata at valinux co jp>
#
# 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
#
# ht... |
valkjsaaa/sl4a | refs/heads/master | python/src/Lib/test/test_dummy_threading.py | 195 | from test import test_support
import unittest
import dummy_threading as _threading
import time
class DummyThreadingTestCase(unittest.TestCase):
class TestThread(_threading.Thread):
def run(self):
global running
global sema
global mutex
# Uncomment if testin... |
hosaka/micropython | refs/heads/master | tests/basics/int_big_and.py | 63 | print(0 & (1 << 80))
print(0 & (1 << 80) == 0)
print(bool(0 & (1 << 80)))
a = 0xfffffffffffffffffffffffffffff
print(a & (1 << 80))
print((a & (1 << 80)) >> 80)
print((a & (1 << 80)) >> 80 == 1)
# test negative on rhs
a = 123456789012345678901234567890
print(a & -1)
print(a & -2)
print(a & -234567890123456789012345678... |
precedenceguo/mxnet | refs/heads/master | python/mxnet/lr_scheduler.py | 12 | # 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... |
cubledesarrollo/cubledotes | refs/heads/master | cuble/quotes/__init__.py | 11 | # -*- coding: utf-8 -*-
"""
The MIT License (MIT)
Copyright (c) 2014 Cuble Desarrollo S.L.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the ri... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.