repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
simartin/servo | refs/heads/master | tests/wpt/webgl/tests/py/tex_image_test_generator.py | 24 | #!/usr/bin/env python
# Copyright (c) 2015 The Khronos Group Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and/or associated documentation files (the
# "Materials"), to deal in the Materials without restriction, including
# without limitation the rights to use... |
pombredanne/PythonJS | refs/heads/master | pythonjs/ministdlib.py | 4 | # Python to PythonJS Mini Standard Library
# by Brett Hartshorn - copyright 2013
# You may destribute this file using the "New BSD" or MIT license
REQUIRES = 1
LUA = {
'time': {
## requires socket module, install for luajit on ubuntu - `sudo-apt get install lua-socket`
## for lua interpreter on ubuntu - `sudo ap... |
kschwank/dcache-docker | refs/heads/master | dcache/deps/.vim/bundle/jedi-vim/jedi/test/completion/basic.py | 14 | # -----------------
# cursor position
# -----------------
#? 0 int
int()
#? 3 int
int()
#? 4 str
int(str)
# -----------------
# should not complete
# -----------------
#? []
.
#? []
str..
#? []
a(0):.
# -----------------
# if/else/elif
# -----------------
if (random.choice([0, 1])):
1
elif(random.choice([0, 1])... |
romain-dartigues/ansible | refs/heads/devel | lib/ansible/module_utils/common/dict_transformations.py | 27 | # -*- 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
import re
from copy import deepcopy
def camel_dict_to_snake_dict(camel_d... |
rpoleski/MulensModel | refs/heads/master | examples/example_04_einsteinring.py | 1 | """
Calculate the Einstein ring for a lens at a variety of distances with
a variety of masses and output the results to a file.
Output:
thetaE.tab - Angular Einstein ring radius in milliarcseconds
rE.tab - Physical Einstein ring radius in AU (Lens plane)
rEtilde.tab - Projection of Einstein ring radius i... |
futurulus/scipy | refs/heads/master | scipy/sparse/tests/test_base.py | 22 | #
# Authors: Travis Oliphant, Ed Schofield, Robert Cimrman, Nathan Bell, and others
""" Test functions for sparse matrices. Each class in the "Matrix class
based tests" section become subclasses of the classes in the "Generic
tests" section. This is done by the functions in the "Tailored base
class for generic tests" ... |
pyKun/rally | refs/heads/master | tests/unit/plugins/openstack/scenarios/authenticate/test_authenticate.py | 3 | # Copyright (C) 2014 Yahoo! Inc. All Rights Reserved.
# 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
#
... |
suyashphadtare/test | refs/heads/develop | erpnext/hr/doctype/leave_block_list_allow/leave_block_list_allow.py | 41 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class LeaveBlockListAllow(Document):
p... |
uni-peter-zheng/autotest | refs/heads/master | client/profilers/iostat/iostat.py | 4 | """
Run iostat with a default interval of 1 second.
"""
import time
import os
import subprocess
from autotest.client import profiler
from autotest.client.shared import utils, error
class iostat(profiler.profiler):
version = 2
def initialize(self, interval=1, options='', **dargs):
# Usage: iostat [ op... |
praveendath92/fitgoal | refs/heads/master | migrations/versions/ca17e014a0bf_float_for_distances.py | 1 | """float for distances
Revision ID: ca17e014a0bf
Revises: 4c085e7f2c9f
Create Date: 2017-06-02 16:23:18.943752
"""
# revision identifiers, used by Alembic.
revision = 'ca17e014a0bf'
down_revision = '4c085e7f2c9f'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
def upgrade... |
jitendra29/servo | refs/heads/master | tests/wpt/web-platform-tests/webdriver/element_state/method_test.py | 141 | import os
import sys
import unittest
sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../..")))
import base_test
class GetElementAttributeTest(base_test.WebDriverBaseTest):
def test_get_element_attribute(self):
self.driver.get(self.webserver.where_is("element_state/res/element-with-id-attribute... |
holvi/python-stdnum | refs/heads/holvi-master | stdnum/si/__init__.py | 5 | # __init__.py - collection of Slovenian numbers
# coding: utf-8
#
# Copyright (C) 2012 Arthur de Jong
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License... |
github-borat/cinder | refs/heads/master | cinder/volume/drivers/glusterfs.py | 1 | # Copyright (c) 2013 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... |
sudheerchintala/LearnEraPlatForm | refs/heads/master | common/lib/xmodule/xmodule/tests/test_lti_unit.py | 17 | # -*- coding: utf-8 -*-
"""Test for LTI Xmodule functional logic."""
from mock import Mock, patch, PropertyMock
import textwrap
from lxml import etree
from webob.request import Request
from copy import copy
import urllib
from xmodule.lti_module import LTIDescriptor
from xmodule.lti_2_util import LTIError
from . imp... |
gquirozbogner/contentbox-master | refs/heads/master | third_party/unidecode/x0b9.py | 4 | data = (
'ruk', # 0x00
'rut', # 0x01
'rup', # 0x02
'ruh', # 0x03
'rweo', # 0x04
'rweog', # 0x05
'rweogg', # 0x06
'rweogs', # 0x07
'rweon', # 0x08
'rweonj', # 0x09
'rweonh', # 0x0a
'rweod', # 0x0b
'rweol', # 0x0c
'rweolg', # 0x0d
'rweolm', # 0x0e
'rweolb', ... |
riccardomc/moto | refs/heads/master | tests/test_swf/models/test_timeout.py | 14 | from freezegun import freeze_time
from moto.swf.models import Timeout
from ..utils import make_workflow_execution
def test_timeout_creation():
wfe = make_workflow_execution()
# epoch 1420113600 == "2015-01-01 13:00:00"
timeout = Timeout(wfe, 1420117200, "START_TO_CLOSE")
with freeze_time("2015-01-... |
brokendata/vertica-python | refs/heads/master | vertica_python/vertica/messages/backend_messages/parameter_status.py | 2 | from __future__ import absolute_import
import string
from struct import unpack
from vertica_python.vertica.messages.message import BackendMessage
class ParameterStatus(BackendMessage):
def __init__(self, data):
null_byte = string.find(data, '\x00')
unpacked = unpack('{0}sx{1}sx'.format(null_by... |
etuna-SBF-kog/Stadsparken | refs/heads/master | env/lib/python2.7/site-packages/django/utils/copycompat.py | 90 | """
Fixes Python 2.4's failure to deepcopy unbound functions.
"""
import copy
import types
import warnings
warnings.warn("django.utils.copycompat is deprecated; use the native copy module instead",
PendingDeprecationWarning)
# Monkeypatch copy's deepcopy registry to handle functions correctly.
if (hasa... |
ryankanno/py-utilities | refs/heads/master | py_utilities/dev/command_line_utilities.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
def piped(input=sys.stdin):
"""
Returns input if input is not connected to a tty(-like) device
"""
return input if not input.isatty() else None
def prompt_yes_no(prompt_msg, default=None, num_retries=5, input=raw_input):
"""
Yes/no pr... |
leighpauls/k2cro4 | refs/heads/master | third_party/python_26/Lib/site-packages/pythonwin/pywin/scintilla/config.py | 17 | # config.py - deals with loading configuration information.
# Loads config data from a .cfg file. Also caches the compiled
# data back into a .cfc file.
# If you are wondering how to avoid needing .cfg files (eg,
# if you are freezing Pythonwin etc) I suggest you create a
# .py file, and put the config info in a doc... |
KitKatXperience/platform_external_chromium_org | refs/heads/kk | tools/telemetry/telemetry/page/page_set_unittest.py | 27 | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import tempfile
import unittest
from telemetry.page import page_set
simple_archive_info = """
{
"archives": {
"data_01.wpr": ["http://www.fo... |
cstavr/synnefo | refs/heads/develop | snf-astakos-app/astakos/quotaholder_app/migrations/0001_initial.py | 10 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Holder'
db.create_table('quotaholder_app_holder', (
('attribute', self.gf('dja... |
sbalde/edxplatform | refs/heads/master | lms/djangoapps/certificates/tests/test_api.py | 13 | """Tests for the certificates Python API. """
from contextlib import contextmanager
import ddt
from django.test import TestCase, RequestFactory
from django.test.utils import override_settings
from django.conf import settings
from mock import patch
from nose.plugins.attrib import attr
from opaque_keys.edx.locator impo... |
vmindru/ansible | refs/heads/devel | lib/ansible/module_utils/docker/swarm.py | 2 | # (c) 2019 Piotr Wojciechowski (@wojciechowskipiotr) <piotr@it-playground.pl>
# (c) Thierry Bouvet (@tbouvet)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
import json
try:
from docker.errors import APIError
except ImportError:
# missing docker-py handled in ansi... |
rlaboiss/pelican-plugins | refs/heads/master | liquid_tags/test_generation.py | 6 | # -*- coding: utf-8 -*-
from __future__ import print_function
import filecmp
import os
import unittest
from shutil import rmtree
from tempfile import mkdtemp
import pytest
from pelican import Pelican
from pelican.settings import read_settings
from .notebook import IPYTHON_VERSION
PLUGIN_DIR = os.path.dirname(__file... |
contracode/python-social-auth | refs/heads/master | social/backends/pocket.py | 65 | """
Pocket OAuth2 backend, docs at:
http://psa.matiasaguirre.net/docs/backends/pocket.html
"""
from social.backends.base import BaseAuth
from social.utils import handle_http_errors
class PocketAuth(BaseAuth):
name = 'pocket'
AUTHORIZATION_URL = 'https://getpocket.com/auth/authorize'
ACCESS_TOKEN_URL =... |
glwu/python-for-android | refs/heads/master | python-modules/twisted/twisted/test/test_fdesc.py | 60 | # Copyright (c) 2007-2009 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.internet.fdesc}.
"""
import os, sys
import errno
try:
import fcntl
except ImportError:
skip = "not supported on this platform"
else:
from twisted.internet import fdesc
from twisted.python.util impor... |
opencivicdata/python-opencivicdata-django | refs/heads/master | opencivicdata/elections/migrations/0006_auto_20171005_2029.py | 2 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-10-05 20:29
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [("elections", "0005_auto_20170823_1648")]
operations = [
... |
jmcorgan/gnuradio | refs/heads/master | gr-fec/python/fec/polar/common.py | 24 | #!/usr/bin/env python
#
# Copyright 2015 Free Software Foundation, Inc.
#
# 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.
#
# GNU Radio is... |
theheros/kbengine | refs/heads/master | kbe/src/lib/python/Lib/cgitb.py | 48 | """More comprehensive traceback formatting for Python scripts.
To enable this module, do:
import cgitb; cgitb.enable()
at the top of your script. The optional arguments to enable() are:
display - if true, tracebacks are displayed in the web browser
logdir - if set, tracebacks are written to fi... |
newemailjdm/scipy | refs/heads/master | scipy/sparse/csgraph/_laplacian.py | 38 | """
Laplacian of a compressed-sparse graph
"""
# Authors: Aric Hagberg <hagberg@lanl.gov>
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# Jake Vanderplas <vanderplas@astro.washington.edu>
# License: BSD
from __future__ import division, print_function, absolute_import
import numpy as np
from scip... |
tpsatish95/Python-Workshop | refs/heads/master | Python Environment Setup/Alternate/1. Python/1. Installer/Python-3.4.0(Linux)/Tools/freeze/hello.py | 100 | print('Hello world...')
|
williamroot/opps | refs/heads/master | opps/core/tags/models.py | 4 | # -*- coding: utf-8 -*-
import re
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.template.defaultfilters import slugify
from opps.utils.text import split_tags
from opps.core.models import Date, Slugged
class Tag(Date, Slugged):
name = models.CharField(_(u'Name')... |
kenshay/ImageScript | refs/heads/master | ProgramData/SystemFiles/Python/Lib/site-packages/spyderlib/tour.py | 2 | # -*- coding: utf-8 -*-
#
# Copyright © 2009-2013 Pierre Raybaut
# Licensed under the terms of the MIT License
# (see spyderlib/__init__.py for details)
"""Spyder interactive tours"""
# pylint: disable=C0103
# pylint: disable=R0903
# pylint: disable=R0911
# pylint: disable=R0201
from __future__ import division
impo... |
matmutant/sl4a | refs/heads/master | python-build/python-libs/gdata/samples/finance/test_finance.py | 128 | #!/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... |
plotly/python-api | refs/heads/master | packages/python/plotly/plotly/validators/cone/colorbar/_tick0.py | 1 | import _plotly_utils.basevalidators
class Tick0Validator(_plotly_utils.basevalidators.AnyValidator):
def __init__(self, plotly_name="tick0", parent_name="cone.colorbar", **kwargs):
super(Tick0Validator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
e... |
alikins/ansible | refs/heads/devel | contrib/inventory/rax.py | 46 | #!/usr/bin/env python
# (c) 2013, Jesse Keating <jesse.keating@rackspace.com,
# Paul Durivage <paul.durivage@rackspace.com>,
# Matt Martz <matt@sivel.net>
#
# This file is part of Ansible.
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Pu... |
miconof/headphones | refs/heads/master | lib/logutils/queue.py | 34 | #
# Copyright (C) 2010-2013 Vinay Sajip. See LICENSE.txt for details.
#
"""
This module contains classes which help you work with queues. A typical
application is when you want to log from performance-critical threads, but
where the handlers you want to use are slow (for example,
:class:`~logging.handlers.SMTPHandler`)... |
OCA/l10n-italy | refs/heads/12.0 | l10n_it_fatturapa_out_ddt/__manifest__.py | 1 | # Copyright 2018 Lorenzo Battistini
# Copyright 2018 Sergio Zanchetta (Associazione PNLUG - Gruppo Odoo)
# Copyright 2018 Ruben Tonetto (Associazione PNLUG - Gruppo Odoo)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
'name': 'ITA - Fattura elettronica - Integrazione DDT',
"summary": "Modul... |
rafaeltg/Deep-Learning-Algorithms | refs/heads/master | pydl/models/pipeline/unittests/test_preprocessing.py | 2 | import unittest
import numpy as np
from pydl.models.pipeline import StandardScaler
class StandardScalerTestCase(unittest.TestCase):
def test_get_config(self):
s = StandardScaler()
config = s.get_config()
expected_config = dict(
name='scaler',
mean=[],
... |
bottompawn/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/lib2to3/tests/data/false_encoding.py | 160 | #!/usr/bin/env python
print '#coding=0'
|
chili-epfl/minimalkb | refs/heads/master | src/minimalkb/kb.py | 1 | import logging; logger = logging.getLogger("minimalKB."+__name__);
from Queue import Queue, Empty
import json
import traceback
DEFAULT_MODEL = "default"
import shlex
from multiprocessing import Process
hasRDFlib = False
try:
import rdflib
import rdflib.namespace
hasRDFlib = True
except ImportError:
... |
KokareIITP/django | refs/heads/master | django/contrib/gis/maps/google/__init__.py | 287 | """
This module houses the GoogleMap object, used for generating
the needed javascript to embed Google Maps in a Web page.
Google(R) is a registered trademark of Google, Inc. of Mountain View, California.
Example:
* In the view:
return render_to_response('template.html', {'google' : GoogleMap(key="... |
unseenlaser/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/lib2to3/fixes/fix_sys_exc.py | 203 | """Fixer for sys.exc_{type, value, traceback}
sys.exc_type -> sys.exc_info()[0]
sys.exc_value -> sys.exc_info()[1]
sys.exc_traceback -> sys.exc_info()[2]
"""
# By Jeff Balogh and Benjamin Peterson
# Local imports
from .. import fixer_base
from ..fixer_util import Attr, Call, Name, Number, Subscript, Node, syms
clas... |
zyzyis/monetdb | refs/heads/master | sql/test/testdb-upgrade-hge/Tests/upgrade.SQL.py | 4 | import os, sys
try:
from MonetDBtesting import process
except ImportError:
import process
clt = process.client('sql', user = 'testuser', passwd = 'testpassword',
stdin = process.PIPE,
stdout = process.PIPE, stderr = process.PIPE)
out, err = clt.communicate('select coun... |
ganeshrn/ansible | refs/heads/devel | lib/ansible/plugins/connection/paramiko_ssh.py | 13 | # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2017 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
DOCUMENTATION = """
author: Ansible Core Team
nam... |
schleichdi2/OPENNFR-6.0-CORE | refs/heads/master | opennfr-openembedded-core/scripts/pybootchartgui/pybootchartgui/draw.py | 2 | # This file is part of pybootchartgui.
# pybootchartgui 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.
# pybootchartgui is dis... |
fangxingli/hue | refs/heads/master | desktop/core/ext-py/tablib-0.10.0/tablib/packages/odf3/office.py | 56 | # -*- coding: utf-8 -*-
# Copyright (C) 2006-2007 Søren Roug, European Environment Agency
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at you... |
markflyhigh/incubator-beam | refs/heads/master | sdks/python/apache_beam/typehints/decorators.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... |
vishdha/erpnext | refs/heads/develop | erpnext/stock/doctype/item_customer_detail/__init__.py | 37694 | from __future__ import unicode_literals
|
pavelchristof/gomoku-ai | refs/heads/master | tensorflow/contrib/compiler/jit.py | 129 | # 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... |
missilerider/minduino-editor | refs/heads/master | html/blocky/i18n/json_to_js.py | 206 | #!/usr/bin/python
# Converts .json files into .js files for use within Blockly apps.
#
# Copyright 2013 Google Inc.
# https://developers.google.com/blockly/
#
# 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 ... |
iamroot9C-arm/linux | refs/heads/master | tools/perf/scripts/python/futex-contention.py | 11261 | # 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... |
talnoah/Sprint-One-4.2.2-Sense | refs/heads/master | tools/perf/scripts/python/futex-contention.py | 11261 | # 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... |
antoinecarme/pyaf | refs/heads/master | tests/artificial/transf_BoxCox/trend_LinearTrend/cycle_12/ar_/test_artificial_1024_BoxCox_LinearTrend_12__100.py | 1 | import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 1024 , FREQ = 'D', seed = 0, trendtype = "LinearTrend", cycle_length = 12, transform = "BoxCox", sigma = 0.0, exog_count = 100, ar_order = 0); |
ptrendx/mxnet | refs/heads/master | example/kaggle-ndsb1/predict_dsb.py | 52 | # 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... |
dims/neutron | refs/heads/master | neutron/extensions/portsecurity.py | 2 | # Copyright 2013 VMware, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... |
sankar-mukherjee/DecMeg2014 | refs/heads/master | DecMeg2014-master/python/neuromag_vectorview_3d_layout.py | 1 | """DecMeg2014 example code.
Simple visualization of the Neuromag VectorView 3D layout.
Copyright Emanuele Olivetti 2014, BSD license, 3 clauses.
"""
import numpy as np
from scipy.io import loadmat
from mayavi import mlab
if __name__ == '__main__':
filename = '../additional_files/NeuroMagSensorsDeviceSpace.... |
Fl0rianFischer/sme_odoo | refs/heads/9.0 | addons/website_theme_install/models/__init__.py | 52 | import ir_module_module |
paurosello/frappe | refs/heads/develop | frappe/integrations/doctype/dropbox_settings/test_dropbox_settings.py | 17 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
# test_records = frappe.get_test_records('Dropbox Settings')
class TestDropboxSettings(unittest.TestCase):
pass
|
codekaki/odoo | refs/heads/7.0 | addons/decimal_precision/decimal_precision.py | 35 | # -*- encoding: 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 G... |
barche/k3d | refs/heads/master | tests/bitmap/bitmap.source.BitmapSourceScript.py | 2 | #python
import k3d
import testing
setup = testing.setup_bitmap_source_test("BitmapSourceScript")
testing.require_similar_bitmap(setup.document, setup.source.get_property("output_bitmap"), "BitmapSourceScript", 0)
|
jemekite/youtube-dl | refs/heads/master | youtube_dl/extractor/screencast.py | 147 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import (
compat_parse_qs,
compat_urllib_request,
)
from ..utils import (
ExtractorError,
)
class ScreencastIE(InfoExtractor):
_VALID_URL = r'https?://www\.screencast\.com/t/(?P<id>[a-zA-Z0-... |
matk86/pymatgen | refs/heads/master | pymatgen/analysis/pourbaix/tests/__init__.py | 37694 | from __future__ import unicode_literals
|
lpantano/bcbio-nextgen | refs/heads/master | bcbio/variation/scalpel.py | 1 | """InDel calling using Scalpel
https://sourceforge.net/p/scalpel/code/ci/master/tree/
"""
from __future__ import print_function
import os
try:
import vcf
except ImportError:
vcf = None
from bcbio import install, utils
from bcbio.distributed.transaction import file_transaction
from bcbio.pipeline import conf... |
gmm96/Txt2SpeechBot | refs/heads/master | models/logger.py | 1 | # !/usr/bin/python3
# -*- coding: utf-8 -*-
import logging
import os
import sys
from models.loggerFormatter import CustomFormatter
class Logger:
BASE_PATH: str = os.getcwd() + "/"
def __init__(self, name: str, file: str, level: int = logging.INFO):
self.filename: str = Logger.BASE_PATH + file
... |
EricNeedham/assignment-1 | refs/heads/master | venv/lib/python2.7/site-packages/wtforms/widgets/__init__.py | 316 | from wtforms.widgets.core import *
# Compatibility imports
from wtforms.widgets.core import html_params, Input, HTMLString
|
ESSS/ben10 | refs/heads/master | source/python/ben10/foundation/_tests/test_memoize.py | 2 | from __future__ import unicode_literals
from ben10.foundation.memoize import Memoize
from ben10.foundation.weak_ref import GetWeakRef
import pytest
#===================================================================================================
# Test
#============================================================... |
uranusjr/django | refs/heads/master | tests/template_tests/syntax_tests/test_include.py | 16 | from django.template import (
Context, Engine, TemplateDoesNotExist, TemplateSyntaxError, loader,
)
from django.test import SimpleTestCase
from ..utils import setup
from .test_basic import basic_templates
include_fail_templates = {
'include-fail1': '{% load bad_tag %}{% badtag %}',
'include-fail2': '{% lo... |
tdsymonds/codeeval | refs/heads/master | python/easy/(102) json-menu-ids.py | 1 | import json
import sys
def main(filepath):
with open(filepath, 'r') as f:
for line in f.readlines():
if line:
line = line.strip()
data = json.loads(line)
the_sum = 0
for item in data['menu']['items']:
... |
Sonicbids/django | refs/heads/master | tests/migrations/test_migrations_squashed_complex/3_auto.py | 385 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("migrations", "2_auto")]
operations = [
migrations.RunPython(migrations.RunPython.noop)
]
|
minrk/sympy | refs/heads/master | sympy/functions/elementary/benchmarks/bench_exp.py | 4 | from sympy import exp, symbols
x,y = symbols('x,y')
e = exp(2*x)
q = exp(3*x)
def timeit_exp_subs():
e.subs(q, y)
|
saurabh6790/med_app_rels | refs/heads/master | patches/october_2013/repost_planned_qty.py | 30 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
def execute():
import webnotes
from utilities.repost_stock import get_planned_qty, update_bin
for d in webnotes.conn.sql("select item_code, warehouse from tabBin"):
update_bin(d[0], ... |
cosenal/osf.io | refs/heads/develop | website/addons/figshare/routes.py | 54 | from framework.routing import Rule, json_renderer
from . import views
settings_routes = {
'rules': [
# OAuth: Node
Rule([
'/project/<pid>/figshare/oauth/',
'/project/<pid>/node/<nid>/figshare/oauth',
], 'get', views.auth.figshare_oauth_start, json_renderer),
... |
jlcarmic/producthunt_simulator | refs/heads/master | venv/lib/python2.7/site-packages/scipy/optimize/minpack.py | 3 | from __future__ import division, print_function, absolute_import
import warnings
from . import _minpack
import numpy as np
from numpy import (atleast_1d, dot, take, triu, shape, eye,
transpose, zeros, product, greater, array,
all, where, isscalar, asarray, inf, abs,
... |
Alan01252/docs | refs/heads/master | docs/conf.py | 1 | # -*- coding: utf-8 -*-
#
# DebOps documentation build configuration file, created by
# sphinx-quickstart on Tue Oct 21 10:34:56 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# Al... |
mccarrion/python-practice | refs/heads/master | crash_course/chapter11/names.py | 1 | from name_function import get_formatted_name
print("Enter 'q' at any time to quit.")
while True:
first = input("\nPlease give me a first name: ")
if first == 'q':
break
last = input("Please give me a last name: ")
if last == 'q':
break
formatted_name = get_formatted_name(first, las... |
vademo/j | refs/heads/master | node_modules/node-gyp/gyp/pylib/gyp/xcode_ninja.py | 1789 | # 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.
"""Xcode-ninja wrapper project file generator.
This updates the data structures passed to the Xcode gyp generator to build
with ninja instead. The Xcode project i... |
jspam/temci | refs/heads/master | temci/setup/setup.py | 1 | """
This module helps to build the C and C++ code in the scripts directory.
"""
import os, subprocess, logging
def script_relative(file: str) -> str:
"""
Returns the absolute version of the passed file name.
:param file: passed file name relative to the scripts directory
"""
return os.path.join(o... |
chr1sb/Sick-Beard | refs/heads/development | cherrypy/wsgiserver/__init__.py | 35 | """A high-speed, production ready, thread pooled, generic HTTP server.
Simplest example on how to use this module directly
(without using CherryPy's application machinery):
from cherrypy import wsgiserver
def my_crazy_app(environ, start_response):
status = '200 OK'
response_heade... |
mustafa-cosar/ceng445Project | refs/heads/master | src/website/toPickApp/apps.py | 1 | from django.apps import AppConfig
class TopickappConfig(AppConfig):
name = 'toPickApp'
|
Learningtribes/edx-platform | refs/heads/master | common/djangoapps/microsite_configuration/backends/__init__.py | 67 | """
Supported backends for microsites
1. filebased
This backend supports retrieval of microsite configurations/templates from filesystem.
2. database
This backend supports retrieval of microsite configurations/templates from database.
"""
|
google-research/google-research | refs/heads/master | task_set/tasks/fixed/fixed_image_conv_vae_test.py | 1 | # coding=utf-8
# Copyright 2021 The Google Research 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 applicab... |
rockyzhang/zhangyanhit-python-for-android-mips | refs/heads/master | python-modules/twisted/twisted/protocols/amp.py | 56 | # -*- test-case-name: twisted.test.test_amp -*-
# Copyright (c) 2005 Divmod, Inc.
# Copyright (c) 2007-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
This module implements AMP, the Asynchronous Messaging Protocol.
AMP is a protocol for sending multiple asynchronous request/response pairs over
the s... |
fitzgen/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/pytest/_pytest/monkeypatch.py | 177 | """ monkeypatching and mocking functionality. """
import os, sys
import re
from py.builtin import _basestring
RE_IMPORT_ERROR_NAME = re.compile("^No module named (.*)$")
def pytest_funcarg__monkeypatch(request):
"""The returned ``monkeypatch`` funcarg provides these
helper methods to modify objects, dicti... |
CalthorpeAnalytics/urbanfootprint | refs/heads/master | footprint/main/publishing/publishing.py | 1 |
# UrbanFootprint v1.5
# Copyright (C) 2017 Calthorpe Analytics
#
# This file is part of UrbanFootprint version 1.5
#
# UrbanFootprint is distributed under the terms of the GNU General
# Public License version 3, as published by the Free Software Foundation. This
# code is distributed WITHOUT ANY WARRANTY, without impl... |
greedo/DIY-FilingsResearch | refs/heads/master | threadedSearch.py | 1 | #! /usr/bin/env python
# encoding: utf-8
# Multithreading Searcher and Indexer.
# One Thread Indexes new documents in the background
# while thread in the foreground waits for new user queries
# This searcher and indexer works from the terminal, simply start it.
# It begins indexing files in the directory you point it... |
elkingtonmcb/shogun | refs/heads/develop | examples/undocumented/python_modular/classifier_multiclass_ecoc.py | 24 | #!/usr/bin/env python
import re
import time
from tools.multiclass_shared import prepare_data
# run with toy data
[traindat, label_traindat, testdat, label_testdat] = prepare_data()
# run with opt-digits if available
#[traindat, label_traindat, testdat, label_testdat] = prepare_data(False)
parameter_list = [[traindat,... |
janewangfb/spark | refs/heads/master | examples/src/main/python/sort.py | 77 | #
# 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... |
infogulch/pyspades | refs/heads/protocol075 | feature_server/scripts/strongblock.py | 7 | """
Blocks built by players are twice as hard to break.
* You can remove your own blocks as if they weren't strong.
* Dirt-colored or buried blocks (those that turn into dirt) become normal blocks.
Maintainer: hompy
"""
from collections import namedtuple
from pyspades.server import block_action, set_color
... |
nfcpy/ndeflib | refs/heads/master | tests/test_text.py | 1 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division
import ndef
import pytest
import _test_record_base
def pytest_generate_tests(metafunc):
_test_record_base.generate_tests(metafunc)
class TestTextRecord(_test_record_base._TestRecordBase):
RECORD = ndef.text.TextRecord
ATTRIB = "t... |
celarco/ardupilot | refs/heads/master | Tools/LogAnalyzer/tests/TestPerformance.py | 261 | from LogAnalyzer import Test,TestResult
import DataflashLog
class TestPerformance(Test):
'''check performance monitoring messages (PM) for issues with slow loops, etc'''
def __init__(self):
Test.__init__(self)
self.name = "PM"
def run(self, logdata, verbose):
self.result = TestRe... |
jmmauricio/pypstools | refs/heads/master | tests/test_psys_heatmap_raw_ieee118.py | 1 | # -*- coding: utf-8 -*-
"""
Example converting ds txt output to python dict and plotting results
Created on Sat Mar 21 12:13:25 2015
@author: jmmauricio
"""
# add pypstools to the path
import sys,os
import numpy as np
import matplotlib.pyplot as plt
from pypstools.tools import raw2pandas
sys.path.insert(0,os.path.ab... |
bikong2/django | refs/heads/master | tests/gis_tests/geoapp/tests.py | 189 | from __future__ import unicode_literals
import re
import tempfile
from django.contrib.gis import gdal
from django.contrib.gis.db.models import Extent, MakeLine, Union
from django.contrib.gis.geos import (
GeometryCollection, GEOSGeometry, LinearRing, LineString, Point, Polygon,
fromstr,
)
from django.core.man... |
perimosocordiae/scipy | refs/heads/master | scipy/sparse/linalg/isolve/tests/test_iterative.py | 12 | """ Test functions for the sparse.linalg.isolve module
"""
import itertools
import platform
import sys
import numpy as np
from numpy.testing import (assert_equal, assert_array_equal,
assert_, assert_allclose, suppress_warnings)
import pytest
from pytest import raises as assert_raises
from numpy import zeros, ar... |
m-ober/byceps | refs/heads/master | byceps/services/orga_presence/service.py | 1 | """
byceps.services.orga_presence.service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from datetime import date, datetime
from itertools import groupby
from typing import Iterator, List, Sequence, Tuple
import pendulum
from pen... |
kaixinjxq/crosswalk-test-suite | refs/heads/master | webapi/tct-csp-w3c-tests/csp-py/csp_frame-src_cross-origin_multi_blocked_int-manual.py | 30 | def main(request, response):
import simplejson as json
f = file('config.json')
source = f.read()
s = json.JSONDecoder().decode(source)
url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1])
url2 = "http://" + s['host'] + ":" + str(s['ports']['http'][0])
_CSP = "frame-src " + url1 + ... |
thaskell1/volatility | refs/heads/master | volatility/plugins/overlays/windows/win2003_sp0_x86_vtypes.py | 58 | ntkrnlmp_types = {
'LIST_ENTRY64' : [ 0x10, {
'Flink' : [ 0x0, ['unsigned long long']],
'Blink' : [ 0x8, ['unsigned long long']],
} ],
'LIST_ENTRY32' : [ 0x8, {
'Flink' : [ 0x0, ['unsigned long']],
'Blink' : [ 0x4, ['unsigned long']],
} ],
'__unnamed_100a' : [ 0x8, {
'LowPart' : [ 0x0, ['unsig... |
Proggie02/TestRepo | refs/heads/master | django/contrib/comments/managers.py | 113 | from django.db import models
from django.contrib.contenttypes.models import ContentType
from django.utils.encoding import force_text
class CommentManager(models.Manager):
def in_moderation(self):
"""
QuerySet for all comments currently in the moderation queue.
"""
return self.get_q... |
nolanliou/tensorflow | refs/heads/master | tensorflow/python/keras/optimizers/__init__.py | 73 | # 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.