repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
puuu/micropython | refs/heads/master | tests/pyb/servo.py | 117 | from pyb import Servo
servo = Servo(1)
print(servo)
servo.angle(0)
servo.angle(10, 100)
servo.speed(-10)
servo.speed(10, 100)
servo.pulse_width(1500)
print(servo.pulse_width())
servo.calibration(630, 2410, 1490, 2460, 2190)
print(servo.calibration())
|
hroncok/freeipa | refs/heads/master | ipaplatform/rhel/services.py | 5 | # Authors:
# Jan Cholasta <[email protected]>
#
# Copyright (C) 2014 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, either v... |
redapple/scrapy | refs/heads/master | scrapy/exporters.py | 18 | """
Item Exporters are used to export/serialize items into different formats.
"""
import csv
import io
import sys
import pprint
import marshal
import six
from six.moves import cPickle as pickle
from xml.sax.saxutils import XMLGenerator
from scrapy.utils.serialize import ScrapyJSONEncoder
from scrapy.utils.python impo... |
zblz/naima | refs/heads/master | src/naima/extern/interruptible_pool.py | 1 | # -*- coding: utf-8 -*-
"""
Python's multiprocessing.Pool class doesn't interact well with
``KeyboardInterrupt`` signals, as documented in places such as:
* `<http://stackoverflow.com/questions/1408356/>`_
* `<http://stackoverflow.com/questions/11312525/>`_
* `<http://noswap.com/blog/python-multiprocessing-keyboardin... |
noirbizarre/django.js | refs/heads/master | djangojs/__init__.py | 3 | # -*- coding: utf-8 -*-
'''
Django.js provide better integration of javascript into Django.
'''
__version__ = '0.8.2.dev'
__description__ = "Django JS Tools"
#: Packaged jQuery version
JQUERY_DEFAULT_VERSION = '2.0.3'
JQUERY_MIGRATE_VERSION = '1.2.1'
|
ChromiumWebApps/chromium | refs/heads/master | native_client_sdk/src/tools/tests/fix_deps_test.py | 104 | #!/usr/bin/env python
# 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 sys
import tempfile
import unittest
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PARENT_DIR = os.path.d... |
HesselTjeerdsma/Cyber-Physical-Pacman-Game | refs/heads/master | Algor/flask/lib/python2.7/site-packages/pip/exceptions.py | 344 | """Exceptions used throughout package"""
from __future__ import absolute_import
from itertools import chain, groupby, repeat
from pip._vendor.six import iteritems
class PipError(Exception):
"""Base pip exception"""
class InstallationError(PipError):
"""General exception during installation"""
class Unin... |
jrjhealey/bioinfo-tools | refs/heads/master | fastafetcher.py | 1 | #!/usr/bin/env python
# Extract fasta files by their descriptors stored in a separate file.
# Requires biopython
# TODO:
# - Create more sophisticated logic for matching IDs/Descriptions/Partial matches etc.
# - Create a mode variable to encapsulate invert/partial/description/id etc?
from Bio import SeqIO
import s... |
bpshetty/erpnext | refs/heads/master | erpnext/crm/report/minutes_to_first_response_for_opportunity/minutes_to_first_response_for_opportunity.py | 54 | # Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
def execute(filters=None):
columns = [
{
'fieldname': 'creation_date',
'label': 'Date',
'fieldtype': 'Date'
},
{
'fieldname': ... |
kalahbrown/HueBigSQL | refs/heads/master | desktop/core/ext-py/Django-1.6.10/tests/m2m_through/__init__.py | 45382 | |
jacob2588m/twitter_with_python_search_api_basics | refs/heads/master | twitter_retweeters_of_last_retweeted_tweet.py | 1 | # Import the necessary package to process data in JSON format
try:
import json
except ImportError:
import simplejson as json
# Import the necessary methods from "twitter" library
from twitter import Twitter, OAuth, TwitterHTTPError, TwitterStream
# Variables that contains the user credentials to access Twitte... |
crosswalk-project/chromium-crosswalk-efl | refs/heads/efl/crosswalk-10/39.0.2171.19 | build/android/asan_symbolize.py | 96 | #!/usr/bin/env python
#
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import collections
import optparse
import os
import re
import sys
from pylib import constants
# Uses symbol.py from third_party/an... |
vvv1559/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/utils/dateformat.py | 234 | """
PHP date() style date formatting
See http://www.php.net/date for format strings
Usage:
>>> import datetime
>>> d = datetime.datetime.now()
>>> df = DateFormat(d)
>>> print df.format('jS F Y H:i')
7th October 2003 11:39
>>>
"""
import re
import time
import calendar
from django.utils.dates import MONTHS, MONTHS_3, ... |
Tehsmash/nova | refs/heads/master | nova/version.py | 61 | # Copyright 2011 OpenStack Foundation
#
# 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 l... |
firerszd/kbengine | refs/heads/master | kbe/src/lib/python/Lib/test/_test_multiprocessing.py | 67 | #
# Unit tests for the multiprocessing package
#
import unittest
import queue as pyqueue
import time
import io
import itertools
import sys
import os
import gc
import errno
import signal
import array
import socket
import random
import logging
import struct
import operator
import test.support
import test.script_helper
... |
mcornella/gnank | refs/heads/main | src/domini.py | 1 | # -*- coding: utf-8 -*-
# Gnank - cercador d'horaris de la FIB
# Copyright (C) 2006 - 2007 Albert Gasset Romo
# 2011 - 2019 Marc Cornellà
#
# 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 F... |
chdecultot/erpnext | refs/heads/develop | erpnext/agriculture/doctype/detected_disease/detected_disease.py | 23 | # -*- coding: utf-8 -*-
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class DetectedDisease(Document):
pass
|
cpburnz/python-path-specification | refs/heads/master | pathspec/tests/test_gitwildmatch.py | 1 | # encoding: utf-8
"""
This script tests ``GitWildMatchPattern``.
"""
from __future__ import unicode_literals
import re
import sys
import unittest
import pathspec.patterns.gitwildmatch
import pathspec.util
from pathspec.patterns.gitwildmatch import GitWildMatchPattern
if sys.version_info[0] >= 3:
unichr = chr
clas... |
motion2015/a3 | refs/heads/a3 | common/lib/xmodule/xmodule/tests/test_bulk_assertions.py | 173 | import ddt
import itertools
from xmodule.tests import BulkAssertionTest, BulkAssertionError
STATIC_PASSING_ASSERTIONS = (
('assertTrue', True),
('assertFalse', False),
('assertIs', 1, 1),
('assertEqual', 1, 1),
('assertEquals', 1, 1),
('assertIsNot', 1, 2),
('assertIsNone', None),
('as... |
hantonov/ansible-modules-core | refs/heads/devel | system/seboolean.py | 15 | #!/usr/bin/python
# (c) 2012, Stephen Fromm <[email protected]>
#
# 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 optio... |
Byron/pgit-distro | refs/heads/master | bin/.pgit.py | 1 | ../lib/bcore/src/python/bprocess/bootstrap.py
|
shadyueh/pyranking | refs/heads/master | env/lib/python2.7/site-packages/wheel/signatures/ed25519py.py | 565 | # -*- coding: utf-8 -*-
import warnings
import os
from collections import namedtuple
from . import djbec
__all__ = ['crypto_sign', 'crypto_sign_open', 'crypto_sign_keypair', 'Keypair',
'PUBLICKEYBYTES', 'SECRETKEYBYTES', 'SIGNATUREBYTES']
PUBLICKEYBYTES=32
SECRETKEYBYTES=64
SIGNATUREBYTES=64
Keypair = n... |
apple/llvm-project | refs/heads/llvm.org/main | lldb/test/API/commands/expression/call-function/TestCallUserDefinedFunction.py | 4 | """
Test calling user defined functions using expression evaluation.
Note:
LLDBs current first choice of evaluating functions is using the IR interpreter,
which is only supported on Hexagon. Otherwise JIT is used for the evaluation.
"""
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldb... |
bryceweiner/amkoin | refs/heads/master | share/qt/clean_mac_info_plist.py | 2 | #!/usr/bin/env python
# Jonas Schnelli, 2013
# make sure the Bitcoin-Qt.app contains the right plist (including the right version)
# fix made because of serval bugs in Qt mac deployment (https://bugreports.qt-project.org/browse/QTBUG-21267)
from string import Template
from datetime import date
bitcoinDir = "./";
inF... |
cruzegoodin/TSC-ShippingDetails | refs/heads/master | venv/lib/python2.7/site-packages/pip/_vendor/cachecontrol/compat.py | 317 | try:
from urllib.parse import urljoin
except ImportError:
from urlparse import urljoin
try:
import cPickle as pickle
except ImportError:
import pickle
from pip._vendor.requests.packages.urllib3.response import HTTPResponse
from pip._vendor.requests.packages.urllib3.util import is_fp_closed
|
FrankBian/kuma | refs/heads/master | vendor/packages/Babel/babel/messages/catalog.py | 9 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2007 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://babel.edgewall.org/wiki/License.
#
# This software consists of v... |
slackhq/python-slackclient | refs/heads/main | tests/web/classes/test_objects.py | 1 | import copy
import unittest
from typing import Optional, List, Union
from slack.errors import SlackObjectFormationError
from slack.web.classes import JsonObject, JsonValidator
from slack.web.classes.objects import (
ChannelLink,
ConfirmObject,
DateLink,
EveryoneLink,
HereLink,
Link,
Markdow... |
mancoast/CPythonPyc_test | refs/heads/master | cpython/276_test_itertools.py | 46 | import unittest
from test import test_support
from itertools import *
from weakref import proxy
from decimal import Decimal
from fractions import Fraction
import sys
import operator
import random
import copy
import pickle
from functools import reduce
maxsize = test_support.MAX_Py_ssize_t
minsize = -maxsize-1
def onear... |
vovojh/gem5 | refs/heads/master | tests/configs/realview64-switcheroo-o3.py | 33 | # Copyright (c) 2012 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functionality ... |
samthor/intellij-community | refs/heads/master | python/testData/refactoring/unwrap/ifInWhileUnwrap_before.py | 80 | while False:
if True:
# comment
x = 1<caret>
y = 2
|
stephenjoe1/gaap-roadmaps | refs/heads/master | node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py | 1509 | # Copyright (c) 2013 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.
"""Handle version information related to Visual Stuio."""
import errno
import os
import re
import subprocess
import sys
import gyp
import glob
class VisualStudi... |
josircg/raizcidadanista | refs/heads/master | raizcidadanista/cadastro/migrations/0011_auto__add_field_membro_contrib_tipo__add_field_membro_contrib_valor.py | 1 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Membro.contrib_tipo'
db.add_column('cadastro_membro', 'co... |
BoltzmannBrain/nupic | refs/heads/master | tests/unit/nupic/regions/regions_spec_test.py | 35 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... |
justinlulejian/fah-gae | refs/heads/master | libs/flask/_compat.py | 783 | # -*- coding: utf-8 -*-
"""
flask._compat
~~~~~~~~~~~~~
Some py2/py3 compatibility support based on a stripped down
version of six so we don't have to depend on a specific version
of it.
:copyright: (c) 2013 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import sys
PY... |
thebarbershopper/Empire | refs/heads/master | lib/modules/situational_awareness/network/sharefinder.py | 10 | from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'Invoke-ShareFinder',
'Author': ['@harmj0y'],
'Description': ('Finds shares on machines in the domain.'),
'Background' : True,
'Outpu... |
cybercarnage/mongo-web-shell | refs/heads/master | mongows/mws/util.py | 7 | # Copyright 2013 10gen 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 required by applicable law or agreed to... |
murphy-wang/aws-ec2 | refs/heads/master | deploy_templates.py | 35 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import with_statement
import os
import sys
# Deploy the configuration file templates in the spark-ec2/templates directory
# to the root filesystem, substituting variables such as the master hostname,
# ZooKeeper URL, etc as read from the environment.
# F... |
vatsala/python_koans | refs/heads/master | python2/runner/sensei.py | 43 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
import re
import sys
import os
import glob
import helper
from mockable_test_result import MockableTestResult
from runner import path_to_enlightenment
from libs.colorama import init, Fore, Style
init() # init colorama
class Sensei(MockableTestResult):
... |
alvaralmstedt/pdf_create | refs/heads/master | create-pdf.py | 1 | from reportlab.lib.styles import ParagraphStyle as PS
from reportlab.platypus import PageBreak
from reportlab.platypus.paragraph import Paragraph
from reportlab.platypus.doctemplate import PageTemplate, BaseDocTemplate
from reportlab.platypus.tableofcontents import TableOfContents
from reportlab.lib.styles import getSa... |
amcgee/pymomo | refs/heads/master | pymomo/hex8/instructions/retlw.py | 2 | from utils import *
class RetlwInstruction:
def __init__(self, args):
self.args = parse_args("i", args)
def __str__(self):
return "retlw 0x%x" % self.args[0]
def encode(self):
return (0b110100 << 8) | self.args[0] |
kevingu1003/python-pptx | refs/heads/master | pptx/oxml/chart/shared.py | 6 | # encoding: utf-8
"""
Shared oxml objects for charts.
"""
from __future__ import absolute_import, print_function, unicode_literals
from ..simpletypes import (
ST_LayoutMode, XsdBoolean, XsdDouble, XsdString, XsdUnsignedInt
)
from ..xmlchemy import (
BaseOxmlElement, OptionalAttribute, RequiredAttribute, Zero... |
Laknot/libvpx | refs/heads/master | tools/diff.py | 83 | #!/usr/bin/env python
## Copyright (c) 2012 The WebM project authors. All Rights Reserved.
##
## Use of this source code is governed by a BSD-style license
## that can be found in the LICENSE file in the root of the source
## tree. An additional intellectual property rights grant can be found
## in the file PATENT... |
spaam/svtplay-dl | refs/heads/master | lib/svtplay_dl/__main__.py | 3 | #!/usr/bin/env python
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
import sys
if __package__ is None and not hasattr(sys, "frozen"):
# direct call of __main__.py
import os.path
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import ... |
gsnbng/erpnext | refs/heads/develop | erpnext/agriculture/doctype/agriculture_analysis_criteria/agriculture_analysis_criteria.py | 24 | # -*- coding: utf-8 -*-
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class AgricultureAnalysisCriteria(Document):
pass
|
asimshankar/tensorflow | refs/heads/master | tensorflow/contrib/distributions/python/ops/bijectors/reshape.py | 18 | # Copyright 2017 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... |
mlk/thefuck | refs/heads/master | tests/rules/test_javac.py | 17 | import pytest
from thefuck.rules.javac import match, get_new_command
from tests.utils import Command
@pytest.mark.parametrize('command', [
Command(script='javac foo'),
Command(script='javac bar')])
def test_match(command):
assert match(command)
@pytest.mark.parametrize('command, new_command', [
(Com... |
becloudready/devopstraining | refs/heads/master | python/mock.py | 1 | # This is a Mock project for DevOps class
# Python-Paramiko (Module)
# SSH client online
# Python-OS (Module) - create directory
#
import paramiko
import requests
url = 'http://www.google.com'
loc='/home/index.html'
def google(url,loc):
r=requests.get(url)
return r.content
#print r.status_code
file=open(l... |
jk1/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/contrib/comments/templatetags/comments.py | 309 | from django import template
from django.template.loader import render_to_string
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.contrib import comments
from django.utils.encoding import smart_unicode
register = template.Library()
class BaseCommentNode(template.N... |
ryfeus/lambda-packs | refs/heads/master | Keras_tensorflow_nightly/source2.7/absl/flags/_helpers.py | 2 | # Copyright 2017 The Abseil Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... |
rouault/Quantum-GIS | refs/heads/master | python/plugins/processing/tools/postgis.py | 1 | # -*- coding: utf-8 -*-
"""
***************************************************************************
postgis.py
---------------------
Date : November 2012
Copyright : (C) 2012 by Martin Dobias
Email : volayaf at gmail dot com
****************************... |
gpagliuca/pyfas | refs/heads/master | build/lib/pyfas/test/test_tpl.py | 2 | import os
import sys
import pytest
import xlrd
import tempfile
from pyfas import Tpl
TEST_FLD = os.getcwd() + os.sep + "test_files" + os.sep
def test_not_a_tpl():
with pytest.raises(ValueError) as exeinfo:
tpl = Tpl(TEST_FLD+"/FC1_rev01.ppl")
assert exinfo.value.message == "not a tpl f... |
liamgh/liamgreenhughes-sl4a-tf101 | refs/heads/master | python/gdata/src/gdata/youtube/service.py | 141 | #!/usr/bin/python
#
# Copyright (C) 2008 Google 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 required by applicable law ... |
cosmicAsymmetry/zulip | refs/heads/master | zerver/lib/test_fixtures.py | 11 | # -*- coding: utf-8 -*-
import os
import re
import hashlib
from typing import Any, Optional
from importlib import import_module
from typing import Text
from six.moves import cStringIO as StringIO
from django.db import connections, DEFAULT_DB_ALIAS
from django.db.utils import OperationalError
from django.apps import ap... |
sorz/isi | refs/heads/master | store/product/migrations/0001_initial.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.core.validators
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('category', ... |
Storj/dataserv-client | refs/heads/master | tests/__init__.py | 1 | from . test_builder import * # NOQA
from . test_client import * # NOQA
from . test_deserialize import * # NOQA
from . test_bandwidth_test import * # NOQA
|
lecaoquochung/ddnb.django | refs/heads/master | tests/get_or_create/models.py | 90 | from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Person(models.Model):
first_name = models.CharField(max_length=100)
last_name = models.CharField(max_length=100)
birthday = models.DateFiel... |
NaturalGIS/QGIS | refs/heads/master | tests/src/python/test_qgsserver_wms.py | 4 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsServer WMS.
From build dir, run: ctest -R PyQgsServerWMS -V
.. 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 Licen... |
mbauskar/omnitech-erpnext | refs/heads/master | erpnext/patches/v6_0/fix_outstanding_amount.py | 87 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from erpnext.accounts.doctype.gl_entry.gl_entry import update_outstanding_amt
def execute():
for dt, party_field, account_field in ((... |
bblfsh/python-driver | refs/heads/master | fixtures/comments.py | 2 | # comment above
# second comment above
a = 1 # line trailing comment
# file trailing comment
# second file trailing comment
|
vigzmv/AB-Split-Tester | refs/heads/master | Tester/wsgi.py | 1 | """
WSGI config for Tester project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTIN... |
javipalanca/Django-facebook | refs/heads/master | docs/docs_env/Lib/site-packages/pip-1.0-py2.5.egg/pip/commands/install.py | 34 | import os, sys
from pip.req import InstallRequirement, RequirementSet
from pip.req import parse_requirements
from pip.log import logger
from pip.locations import build_prefix, src_prefix
from pip.basecommand import Command
from pip.index import PackageFinder
from pip.exceptions import InstallationError
class InstallC... |
indevgr/django | refs/heads/master | tests/forms_tests/tests/test_widgets.py | 6 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.admin.tests import AdminSeleniumTestCase
from django.forms import (
CheckboxSelectMultiple, ClearableFileInput, RadioSelect, TextInput,
)
from django.forms.widgets import (
ChoiceFieldRenderer, ChoiceInput, RadioFieldRenderer,
... |
diox/olympia | refs/heads/master | src/olympia/git/migrations/0001_initial.py | 6 | # Generated by Django 2.2.12 on 2020-04-22 11:50
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import olympia.amo.models
class Migration(migrations.Migration):
initial = True
dependencies = [('addons', '0004_auto_20191126_1712')]
operations = [
... |
hbrunn/OCB | refs/heads/8.0 | addons/sale/report/sale_report.py | 71 | # -*- 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... |
nirbheek/cerbero-old | refs/heads/master | cerbero/utils/__init__.py | 3 | # cerbero - a multi-platform build system for Open Source software
# Copyright (C) 2012 Andoni Morales Alastruey <[email protected]>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; eit... |
flar2/m7-bulletproof | refs/heads/master | scripts/tracing/draw_functrace.py | 14679 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <[email protected]>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... |
Endika/edx-platform | refs/heads/master | lms/lib/courseware_search/test/test_lms_filter_generator.py | 43 | """
Tests for the lms_filter_generator
"""
from mock import patch, Mock
from xmodule.modulestore.tests.factories import ItemFactory, CourseFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from student.tests.factories import UserFactory
from student.models import CourseEnrollment
from lms.... |
xy-VSFilter/xy-VSFilter | refs/heads/master | src/thirdparty/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... |
EDUlib/edx-platform | refs/heads/master | openedx/core/djangoapps/discussions/migrations/0003_alter_provider_filter_list.py | 4 | # Generated by Django 2.2.19 on 2021-03-23 14:46
from django.db import migrations, models
import django_mysql.models
class Migration(migrations.Migration):
dependencies = [
('discussions', '0002_add_provider_filter'),
]
operations = [
migrations.AlterField(
model_name='provi... |
Asurada2015/TFAPI_translation | refs/heads/master | math_ops_basicoperation/tf_pow.py | 1 | import tensorflow as tf
"""tf.pow(x,y,name=None)
功能:计算x各元素的y次方。
输入:x,y为张量,可以为`float32`, `float64`, `int32`, `int64`,`complex64`,`complex128`类型。"""
x = tf.constant([[2, 3, 5], [2, 3, 5]], tf.float64)
y = tf.constant([[2, 3, 4]], tf.float64)
z = tf.pow(x, y)
sess = tf.Session()
print(sess.run(z))
sess.close()
"""[[ ... |
marcreyesph/scancode-toolkit | refs/heads/develop | src/scancode/pool.py | 4 |
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
"""
Utilities and patches to create multiprocessing Process pools.
Apply proper monkeypatch to work around some bugs or limitations.
"""
"""
Monkeypatch Pool iterators... |
Integral-Technology-Solutions/ConfigNOW-4.3 | refs/heads/master | Lib/xml/sax/sax2exts.py | 2 | """
Various extensions to the core SAX 2.0 API.
$Id: sax2exts.py,v 1.4 2001/03/03 07:30:06 loewis Exp $
"""
import saxexts,saxlib
# In SAX2, validation is turned-on through a property. Make sure
# that all parsers returned from this factory are validating
class ValidatingReaderFactory(saxexts.ParserFactory):
def... |
ishay2b/tensorflow | refs/heads/segnet | tensorflow/python/ops/distributions/identity_bijector.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... |
laurenbarker/SHARE | refs/heads/master | share/migrations/0010_auto_20161212_1418_d.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-12-12 14:18
from __future__ import unicode_literals
import db.deletion
from django.conf import settings
from django.db import migrations, models
import share.models.fields
class Migration(migrations.Migration):
dependencies = [
('share', '0010_... |
Titulacion-Sistemas/PythonTitulacion-EV | refs/heads/master | Lib/encodings/tis_620.py | 593 | """ Python Character Mapping Codec tis_620 generated from 'python-mappings/TIS-620.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='st... |
andres-root/AIND | refs/heads/master | Therm2/rnn/my_answers.py | 1 | import numpy as np
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import LSTM
import keras
# TODO: fill out the function below that transforms the input series
# and window-size into a set of input/output pairs for use with our RNN model
def window_transform_series(series, wind... |
onelab-eu/sfa | refs/heads/geni-v3 | clientbin/sfiAddLinks.py | 2 | #! /usr/bin/env python
import sys
from sfa.util.sfalogging import logger
from sfa.client.sfi_commands import Commands
from sfa.rspecs.rspec import RSpec
from sfa.rspecs.version_manager import VersionManager
logger.enable_console()
command = Commands(usage="%prog [options] node1 node2...",
descript... |
Num98801/Linphone_lib | refs/heads/master | tools/python/unittests/test_call.py | 26 | from nose.tools import assert_equals
import linphone
from linphonetester import *
import os
import time
class TestCall:
def test_early_declined_call(self):
marie = CoreManager('marie_rc')
pauline = CoreManager('pauline_rc')
marie.lc.max_calls = 0
out_call = pauline.lc.invite_addre... |
jmolloy/pedigree | refs/heads/master | images/install/disk-contents/libraries/python2.6/getopt.py | 167 | # -*- coding: iso-8859-1 -*-
"""Parser for command line options.
This module helps scripts to parse the command line arguments in
sys.argv. It supports the same conventions as the Unix getopt()
function (including the special meanings of arguments of the form `-'
and `--'). Long options similar to those supported by... |
GinnyN/Team-Fortress-RPG-Generators | refs/heads/master | tests/regressiontests/admin_util/models.py | 40 | from django.db import models
class Article(models.Model):
"""
A simple Article model for testing
"""
site = models.ForeignKey('sites.Site', related_name="admin_articles")
title = models.CharField(max_length=100)
title2 = models.CharField(max_length=100, verbose_name="another name")
created... |
d0ugal-archive/python-rfxcom | refs/heads/master | tests/protocol/test_status.py | 4 | from unittest import TestCase
from rfxcom.protocol.status import Status
from rfxcom.exceptions import (InvalidPacketLength, UnknownPacketSubtype,
UnknownPacketType)
class StatusTestCase(TestCase):
def setUp(self):
self.data = bytearray(b'\x0D\x01\x00\x01\x02\x53\x45\x00\... |
CiscoSystems/vespa | refs/heads/master | neutron/tests/unit/openvswitch/test_ovs_tunnel.py | 4 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Nicira Networks, 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.apach... |
amenonsen/ansible | refs/heads/devel | lib/ansible/modules/source_control/github_key.py | 44 | #!/usr/bin/python
# Copyright: 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',
'status': ['preview'],
... |
westial/restfulcomm | refs/heads/master | restfulcomm/http/jsonresponse.py | 1 | # -*- coding: utf-8 -*-
"""Value object product of a json format response got from a server as plain
text.
"""
import base64
import json
from restfulcomm.http.superjson import BaseJson
from restfulcomm.core.helpers import HttpHelper
from requests.models import Response
class JsonResponse(BaseJson):
def to_dict(... |
aperigault/ansible | refs/heads/devel | lib/ansible/modules/storage/infinidat/infini_fs.py | 44 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2016, Gregory Shulov ([email protected])
# 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_... |
shakamunyi/tensorflow | refs/heads/master | tensorflow/contrib/distributions/python/kernel_tests/gaussian_conjugate_posteriors_test.py | 5 | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
ayushin78/coala | refs/heads/master | tests/processes/BearRunningTest.py | 21 | import multiprocessing
import queue
import unittest
from coalib.bears.GlobalBear import GlobalBear
from coalib.bears.LocalBear import LocalBear
from coalib.processes.BearRunning import (
LOG_LEVEL, LogMessage, run, send_msg, task_done)
from coalib.processes.CONTROL_ELEMENT import CONTROL_ELEMENT
from coalib.result... |
cloudxaas/cloudauth | refs/heads/master | idp/__init__.py | 1 | #
__all__ =[]
|
telwertowski/Books-Mac-OS-X | refs/heads/master | Versions/Books_3.0b3/Amazon (DE).plugin/Contents/Resources/amazon.py | 126 | """Python wrapper
for Amazon web APIs
This module allows you to access Amazon's web APIs,
to do things like search Amazon and get the results programmatically.
Described here:
http://www.amazon.com/webservices
You need a Amazon-provided license key to use these services.
Follow the link above to get one. These f... |
yeyanchao/calibre | refs/heads/master | src/calibre/ebooks/pdf/outline_writer.py | 9 | #!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:fdm=marker:ai
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
... |
hguemar/cinder | refs/heads/master | cinder/brick/remotefs/remotefs.py | 5 | # Copyright (c) 2013 OpenStack Foundation
# 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 r... |
gacarrillor/QGIS | refs/heads/master | python/plugins/grassprovider/ext/i_in_spotvgt.py | 45 | # -*- coding: utf-8 -*-
"""
***************************************************************************
i_in_spotvgt.py
---------------
Date : April 2016
Copyright : (C) 2016 by Médéric Ribreux
Email : medspx at medspx dot fr
*******************************... |
ahotam/micropython | refs/heads/master | tests/basics/dict_construct.py | 117 | # dict constructor
d = dict()
print(d)
d = dict({1:2})
print(d)
d = dict(a=1)
print(d)
d = dict({1:2}, a=3)
print(d[1], d['a'])
d = dict([(1, 2)], a=3, b=4)
print(d[1], d['a'], d['b'])
|
kellinm/anaconda | refs/heads/master | pyanaconda/anaconda_log.py | 3 | #
# anaconda_log.py: Support for logging to multiple destinations with log
# levels.
#
# Copyright (C) 2000, 2001, 2002, 2005 Red Hat, Inc. All rights reserved.
#
# 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 So... |
carlcarl/PyGithub | refs/heads/master | github/tests/Issue140.py | 39 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2013 Vincent Jacques <[email protected]> #
# ... |
kived/kivy | refs/heads/master | examples/widgets/popup_with_kv.py | 4 | '''
Example to show a Popup usage with the content from kv lang.
'''
from kivy.uix.popup import Popup
from kivy.uix.button import Button
from kivy.app import App
from kivy.lang import Builder
Builder.load_string('''
<CustomPopup>:
size_hint: .5, .5
auto_dismiss: False
title: 'Hello world'
Button:
... |
jonathanstowe/XDG | refs/heads/master | lib/XDG/IconTheme.py | 1 | """
Complete implementation of the XDG Icon Spec Version 0.8
http://standards.freedesktop.org/icon-theme-spec/
"""
import os, sys, time
from xdg.IniFile import *
from xdg.BaseDirectory import *
from xdg.Exceptions import *
import xdg.Config
class IconTheme(IniFile):
"Class to parse and validate IconThemes"
... |
aodarc/tennis_club | refs/heads/master | news/apps.py | 45 | from django.apps import AppConfig
class NewsConfig(AppConfig):
name = 'news'
|
ashemedai/ansible | refs/heads/devel | lib/ansible/plugins/callback/timer.py | 168 | # Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from datetime import datetime
from ansible.plugins.callback import CallbackBase
class CallbackModule(CallbackBase):
"""
This callback module tells you how long your plays ran for.
"""
... |
scottp-dpaw/django-preserialize | refs/heads/master | test_suite.py | 2 | import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings'
import django # noqa
if django.VERSION >= (1, 7):
django.setup()
from django.core import management # noqa
management.call_command('test', 'tests')
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.