repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
ryfx/gyp | refs/heads/master | test/variables/commands/test.py | 337 | print "sample\\path\\foo.cpp"
|
bitcraft/pyglet | refs/heads/master | contrib/experimental/buffer/streamers.py | 1 | #!/usr/bin/python
# $Id:$
import random
import sys
from pyglet.gl import *
from pyglet import clock
from pyglet import font
from pyglet import graphics
from pyglet import window
MAX_STREAMERS = 1000
if len(sys.argv) > 1:
MAX_STREAMERS = int(sys.argv[1])
MAX_ADD_STREAMERS = MAX_STREAMERS // 10
MIN_STREAMER_LENGTH... |
tgoyne/xy-vsfilter | refs/heads/master | src/thirdparty/gtest/test/gtest_list_tests_unittest.py | 1898 | #!/usr/bin/env python
#
# Copyright 2006, 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... |
oneminot/audacity | refs/heads/master | lib-src/lv2/lilv/waflib/Tools/irixcc.py | 330 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import os
from waflib import Utils
from waflib.Tools import ccroot,ar
from waflib.Configure import conf
@conf
def find_irixcc(conf):
v=conf.env
cc=None
if v['CC']:cc=v['CC'... |
saopicc/killMS | refs/heads/master | Predict/ClassImageSM.py | 1 | #!/usr/bin/env python
"""
killMS, a package for calibration in radio interferometry.
Copyright (C) 2013-2017 Cyril Tasse, l'Observatoire de Paris,
SKA South Africa, Rhodes University
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published ... |
jscn/django | refs/heads/master | tests/gis_tests/layermap/models.py | 34 | from django.utils.encoding import python_2_unicode_compatible
from ..models import models
@python_2_unicode_compatible
class NamedModel(models.Model):
name = models.CharField(max_length=25)
class Meta:
abstract = True
required_db_features = ['gis_enabled']
def __str__(self):
ret... |
hurricup/intellij-community | refs/heads/master | python/testData/resolve/Tuple.py | 83 | aa = 1
bb = 2
c = aa, b<ref>b |
ListFranz/torngas | refs/heads/master | demo/run_gunicorn.py | 3 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from torngas.webserver import Server
"""
run at gunicorn.
gunicorn -c gunicorn.py.conf run_gunicorn:app
torngas settings 写在gunicorn.conf.py中:
os.environ.setdefault('TORNGAS_APP_SETTINGS', 'settings.setting')
"""
server = Server()
server.parse_logger()
server.load_urls()
... |
LaoZhongGu/kbengine | refs/heads/master | kbe/src/lib/python/Lib/test/double_const.py | 203 | from test.support import TestFailed
# A test for SF bug 422177: manifest float constants varied way too much in
# precision depending on whether Python was loading a module for the first
# time, or reloading it from a precompiled .pyc. The "expected" failure
# mode is that when test_import imports this after all .py... |
jelugbo/ddi | refs/heads/master | lms/djangoapps/instructor_task/migrations/0001_initial.py | 73 | # -*- coding: 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 'InstructorTask'
db.create_table('instructor_task_instructortask', (
('id', self.... |
crcresearch/osf.io | refs/heads/develop | api/institutions/serializers.py | 4 | from rest_framework import serializers as ser
from rest_framework import exceptions
from osf.models import Node, Registration
from website.util import permissions as osf_permissions
from api.base.serializers import JSONAPISerializer, RelationshipField, LinksField, JSONAPIRelationshipSerializer, \
BaseAPISerialize... |
flypy/flypy | refs/heads/master | flypy/runtime/primitives.py | 1 | # -*- coding: utf-8 -*-
"""
Primitive operations, like 'a is b'.
"""
from __future__ import print_function, division, absolute_import
import operator
from .obj.core import NoneType
from .. import jit, ijit, cjit, typeof, overlay
jit = cjit
#===------------------------------------------------------------------===
... |
allmightyspiff/softlayer-python | refs/heads/master | SoftLayer/fixtures/SoftLayer_Virtual_DedicatedHost.py | 3 | getObject = {
'id': 37401,
'memoryCapacity': 242,
'modifyDate': '',
'name': 'test-dedicated',
'diskCapacity': 1200,
'createDate': '2017-10-16T12:50:23-05:00',
'cpuCount': 56,
'accountId': 1199911
}
getAvailableRouters = [
{'hostname': 'bcr01a.dal05', 'id': 12345},
{'hostname': ... |
tiwillia/openshift-tools | refs/heads/stg | ansible/roles/lib_openshift_3.2/build/ansible/oadm_policy_user.py | 13 | # pylint: skip-file
#Manage policy
#
#Usage:
# oadm policy [options]
#
#Available Commands:
# add-role-to-user Add users to a role in the current project
# remove-role-from-user Remove user from role in the current project
# remove-user Remove user from the current proje... |
nacl-webkit/chrome_deps | refs/heads/master | build/android/pylib/instrumentation/__init__.py | 998 | # 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.
|
camillemonchicourt/Geotrek | refs/heads/master | geotrek/trekking/migrations/0002_auto__add_field_difficultylevel_pictogram.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
from django.conf import settings
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'DifficultyLevel.pictogram'
... |
anistark/mozillians | refs/heads/master | vendor-local/lib/python/tablib/packages/odf/meta.py | 98 | # -*- 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... |
praveen-pal/edx-platform | refs/heads/master | lms/djangoapps/certificates/management/commands/ungenerated_certs.py | 11 | from django.core.management.base import BaseCommand
from certificates.models import certificate_status_for_student
from certificates.queue import XQueueCertInterface
from django.contrib.auth.models import User
from optparse import make_option
from django.conf import settings
from xmodule.course_module import CourseDesc... |
skydark/nstools | refs/heads/master | zhtools/xpinyin.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Translate chinese hanzi to pinyin by python
Created by Eric Lo on 2010-05-20.
Copyright (c) 2010 [email protected]__. http://lxneng.com All rights reserved.
"""
"""
Forked by skydarkchen <skydark2 at gmail>
"""
import os.path
try:
chr = unichr
except NameError:
... |
sbalde/edx-platform | refs/heads/master | lms/lib/courseware_search/test/test_lms_result_processor.py | 151 | """
Tests for the lms_result_processor
"""
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from courseware.tests.factories import UserFactory
from lms.lib.courseware_search.lms_result_processor import LmsSearchResultProc... |
mlorbetske/PTVS | refs/heads/master | Python/Tests/TestData/DjangoDebugProject/DjangoDebugProject/settings.py | 18 | # Django settings for DjangoDebugProject project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', '[email protected]'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
... |
PeterLValve/apitrace | refs/heads/master | scripts/convert.py | 1 | #!/usr/bin/env python
##########################################################################
#
# Copyright 2012 VMware Inc.
# All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the 'Software'), to deal
# in the... |
santoshkumarsingh/Data-Wrangling-with-MongoDB | refs/heads/master | Lesson_1_Data_Extraction_Fundamentals/07-Parsing_CSV_Files/simple.py | 2 | # Your task is to read the input DATAFILE line by line, and for the first 10 lines (not including the header)
# split each line on "," and then for each line, create a dictionary
# where the key is the header title of the field, and the value is the value of that field in the row.
# The function parse_file should retur... |
mapr/hue | refs/heads/hue-3.9.0-mapr | desktop/core/ext-py/Django-1.6.10/django/dispatch/__init__.py | 571 | """Multi-consumer multi-producer dispatching mechanism
Originally based on pydispatch (BSD) http://pypi.python.org/pypi/PyDispatcher/2.0.1
See license.txt for original license.
Heavily modified for Django's purposes.
"""
from django.dispatch.dispatcher import Signal, receiver |
fo0nikens/CapTipper | refs/heads/master | CTMagic.py | 11 | #
# CapTipper is a malicious HTTP traffic explorer tool
# By Omri Herscovici <omriher AT gmail.com>
# http://omriher.com
# @omriher
#
#
# This file is part of CapTipper, and part of the Whatype library
# Whatype is an independent file type identification pyt... |
p0psicles/SickRage | refs/heads/master | lib/stevedore/__init__.py | 77 | # flake8: noqa
__all__ = [
'ExtensionManager',
'EnabledExtensionManager',
'NamedExtensionManager',
'HookManager',
'DriverManager',
]
from .extension import ExtensionManager
from .enabled import EnabledExtensionManager
from .named import NamedExtensionManager
from .hook import HookManager
from .dri... |
honnibal/spaCy | refs/heads/master | spacy/pipeline/hooks.py | 1 | # coding: utf8
from __future__ import unicode_literals
from thinc.t2v import Pooling, max_pool, mean_pool
from thinc.neural._classes.difference import Siamese, CauchySimilarity
from .pipes import Pipe
from ..language import component
from .._ml import link_vectors_to_models
@component("sentencizer_hook", assigns=["... |
wiki-ai/editquality | refs/heads/master | editquality/feature_lists/cawiki.py | 1 | from revscoring.languages import catalan
from . import enwiki, mediawiki, wikipedia, wikitext
badwords = [
catalan.badwords.revision.diff.match_delta_sum,
catalan.badwords.revision.diff.match_delta_increase,
catalan.badwords.revision.diff.match_delta_decrease,
catalan.badwords.revision.diff.match_prop... |
MalmoUniversity-DA366A/calvin-base | refs/heads/master | calvin/Tools/cscompiler.py | 2 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Ericsson AB
#
# 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... |
FHannes/intellij-community | refs/heads/master | python/testData/highlighting/unsupportedFeaturesInPython3.py | 58 | print(<error descr="Python version 3.0 does not support <>, use != instead.">a <> 3</error>)
<error descr="Python version 3.0 does not support backquotes, use repr() instead">`foo()`</error>
a = <error descr="Python version 3.0 does not support a trailing 'l' or 'L'.">123l</error>
a = <error descr="Python version 3.0 d... |
zahanm/foodpedia | refs/heads/master | django/db/models/fields/related.py | 82 | from django.conf import settings
from django.db import connection, router, transaction, connections
from django.db.backends import util
from django.db.models import signals, get_model
from django.db.models.fields import (AutoField, Field, IntegerField,
PositiveIntegerField, PositiveSmallIntegerField, FieldDoesNotEx... |
Scorpio92/linux_kernel_3.16.1 | refs/heads/master | tools/perf/util/setup.py | 989 | #!/usr/bin/python2
from distutils.core import setup, Extension
from os import getenv
from distutils.command.build_ext import build_ext as _build_ext
from distutils.command.install_lib import install_lib as _install_lib
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_optio... |
jolevq/odoopub | refs/heads/master | addons/portal_project/tests/test_access_rights.py | 65 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2013-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... |
rue89-tech/edx-platform | refs/heads/master | cms/djangoapps/contentstore/features/textbooks.py | 116 | # pylint: disable=missing-docstring
# pylint: disable=redefined-outer-name
from lettuce import world, step
from django.conf import settings
from common import upload_file
from nose.tools import assert_equal
TEST_ROOT = settings.COMMON_TEST_DATA_ROOT
@step(u'I go to the textbooks page')
def go_to_uploads(_step):
... |
google-code-export/pyglet | refs/heads/master | pyglet/libs/darwin/constants.py | 46 | # ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistribu... |
leekchan/djangae | refs/heads/master | djangae/contrib/gauth/datastore/backends.py | 14 | # STANDARD LIB
from itertools import chain
# DJANGAE
from djangae.db import transaction
from djangae.contrib.gauth.common.backends import BaseAppEngineUserAPIBackend
from djangae.contrib.gauth.datastore.permissions import get_permission_choices
class AppEngineUserAPIBackend(BaseAppEngineUserAPIBackend):
atomic =... |
evansd/django | refs/heads/master | tests/flatpages_tests/test_middleware.py | 130 | from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.flatpages.models import FlatPage
from django.contrib.sites.models import Site
from django.test import TestCase, modify_settings, override_settings
from .settings import FLATPAGES_TEMPLATES
class TestDataMixin:
@clas... |
simonwydooghe/ansible | refs/heads/devel | test/units/module_utils/facts/system/distribution/test_parse_distribution_file_ClearLinux.py | 44 | # -*- coding: utf-8 -*-
# Copyright (c) 2019 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
from units.compat.mock import Mock
from ansible.module_utils.facts.system.dis... |
c0710204/mirrorsBistu | refs/heads/master | pypi/bandersnatch/lib/python2.7/site-packages/pip/download.py | 78 | import cgi
import getpass
import hashlib
import mimetypes
import os
import platform
import re
import shutil
import socket
import ssl
import sys
import tempfile
import pip
from pip.backwardcompat import (urllib, urllib2, httplib,
urlparse, string_types, get_http_message_param,
... |
robovm/robovm-studio | refs/heads/master | python/testData/formatter/wrapDefinitionWithLongLine_after.py | 79 | def my_function_name_which_is_rather_long:
pass
|
ryfeus/lambda-packs | refs/heads/master | Tensorflow_LightGBM_Scipy_nightly/source/tensorflow/contrib/learn/python/learn/datasets/text_datasets.py | 124 | # 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... |
legorovers/legoflask | refs/heads/master | app/rules.py | 1 |
class Rule(object):
def __init__(self, trigger, actions):
self.trigger = trigger
print "trigger: %s" % trigger
self.code = []
time = 0
for a in actions:
print "action: %s" % a
if a == 'back':
action = ('reverse', 40)
elif... |
Endika/commission | refs/heads/8.0 | sale_commission/models/sale_order.py | 8 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 Pexego Sistemas Informáticos (<http://www.pexego.es>).
# Copyright (C) 2015 Avanzosc (<http://www.avanzosc.es>)
# Copyright (C) 2015 Pedro ... |
hellerve/hawkweed | refs/heads/master | hawkweed/functional/__init__.py | 1 | """A collection of useful functions"""
from hawkweed.functional.primitives import *
from hawkweed.functional.logical import *
from hawkweed.functional.mathematical import *
from hawkweed.functional.list_prims import *
|
yamahata/neutron | refs/heads/master | neutron/tests/unit/cisco/test_network_plugin.py | 1 | # Copyright (c) 2012 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 law or agreed to... |
hadronproject/lpms | refs/heads/master | lpms/operations/remove.py | 1 | # Copyright 2009 - 2011 Burak Sezer <[email protected]>
#
# This file is part of lpms
#
# lpms is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... |
MenZil/kuma | refs/heads/master | scripts/pth_pydev.py | 31 | #!/usr/bin/env python
import sys
import os
from shutil import copyfile
from xml.etree.ElementTree import Element, ElementTree, tostring
pth_file = sys.argv[1]
pydevproject_file = sys.argv[2]
prefix = sys.argv[3]
copyfile(pydevproject_file, pydevproject_file+'.bak')
tree = ElementTree()
tree.parse(pydevproject_file)... |
DanielAttia/namebench | refs/heads/master | nb_third_party/dns/rdtypes/ANY/NS.py | 248 | # Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... |
ffu/DSA-3.2.2 | refs/heads/master | gnuradio-core/src/python/gnuradio/gruimpl/__init__.py | 140 | # make this a package
|
caorun0728/shadowsocks | refs/heads/master | shadowsocks/asyncdns.py | 2 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2014-2015 clowwindy
#
# 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... |
beezee/GAE-Django-base-app | refs/heads/master | django/contrib/messages/models.py | 634 | # Models module required so tests are discovered.
|
midgetspy/Sick-Beard | refs/heads/development | sickbeard/nzbSplitter.py | 8 | # Author: Nic Wolfe <[email protected]>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard 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 t... |
volatilityfoundation/volatility | refs/heads/master | volatility/plugins/mac/machine_info.py | 58 | # Volatility
# Copyright (C) 2007-2013 Volatility Foundation
#
# This file is part of Volatility.
#
# Volatility 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 o... |
nickpack/django-oscar | refs/heads/master | src/oscar/apps/dashboard/catalogue/views.py | 22 | from django.views import generic
from django.db.models import Q
from django.http import HttpResponseRedirect
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _
from django.shortcuts import get_object_or_404, redirect
from django.templ... |
vatsala/python_koans | refs/heads/master | python2/libs/colorama/ansi.py | 134 | '''
This module generates ANSI character codes to printing colors to terminals.
See: http://en.wikipedia.org/wiki/ANSI_escape_code
'''
CSI = '\033['
def code_to_chars(code):
return CSI + str(code) + 'm'
class AnsiCodes(object):
def __init__(self, codes):
for name in dir(codes):
if not nam... |
manderson23/NewsBlur | refs/heads/master | apps/rss_feeds/migrations/0010_stories_per_month.py | 18 | # 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 'StoriesPerMonth'
db.create_table('rss_feeds_storiespermonth', (
('id', self.gf... |
kionetworks/openstack-dashboard-havana | refs/heads/master | openstack_dashboard/dashboards/project/networks/subnets/tabs.py | 6 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 NEC 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 License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#... |
bitcrystal/p2pool-bitcrystal | refs/heads/master | wstools/__init__.py | 293 | #! /usr/bin/env python
"""WSDL parsing services package for Web Services for Python."""
ident = "$Id$"
import WSDLTools
import XMLname
import logging
|
OneAPI/GSMA-OneAPI | refs/heads/master | Python/response/location/ErrorInformation.py | 2 | from response.ServiceException import ServiceException
from response.PolicyException import PolicyException
class ErrorInformation:
"""dedicated error response for the location API"""
def __init__(self):
"""Default class constructor"""
self.serviceException=None
self.policyException=None
def __init__(self... |
LouisPlisso/pytomo | refs/heads/master | pytomo/dns/rdtypes/ANY/TXT.py | 2 | # Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... |
EE/bestja | refs/heads/master | addons/bestja_project_files/__init__.py | 2355 | # -*- coding: utf-8 -*-
import models
|
idiap/rgbd | refs/heads/master | Streaming/videoStreamer.py | 1 | """
Copyright (c) 2014 Idiap Research Institute, http://www.idiap.ch/
Written by Kenneth Funes <[email protected]>
This file contains the definition of a class able of loading and recording
video files. It is mostly based on opencv and ffmpeg.
This program is free software: you can redistribute it and/or modify... |
sivaprakashniet/push_pull | refs/heads/master | p2p/lib/python2.7/site-packages/celery/worker/autoscale.py | 4 | # -*- coding: utf-8 -*-
"""
celery.worker.autoscale
~~~~~~~~~~~~~~~~~~~~~~~
This module implements the internal thread responsible
for growing and shrinking the pool according to the
current autoscale settings.
The autoscale thread is only enabled if :option:`--autoscale`
has been enabled ... |
nghia-huynh/gem5-stable | refs/heads/master | ext/ply/test/yacc_badrule.py | 174 | # -----------------------------------------------------------------------------
# yacc_badrule.py
#
# Syntax problems in the rule strings
# -----------------------------------------------------------------------------
import sys
if ".." not in sys.path: sys.path.insert(0,"..")
import ply.yacc as yacc
from calclex imp... |
wreckoner/PyEuler | refs/heads/master | src/problem012.py | 1 | # -*- coding:utf-8 -*-
"""
Problem 12: Highly divisible triangular number
The sequence of triangle numbers is generated by adding the natural numbers. So the 7th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28. The first ten terms would be:
1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ...
Let us list the factors of ... |
djnugent/mavlink | refs/heads/master | pymavlink/tools/mavtogpx.py | 33 | #!/usr/bin/env python
'''
example program to extract GPS data from a mavlink log, and create a GPX
file, for loading into google earth
'''
import sys, struct, time, os
from argparse import ArgumentParser
parser = ArgumentParser(description=__doc__)
parser.add_argument("--condition", default=None, help="select packet... |
jxtech/wechatpy | refs/heads/master | wechatpy/client/api/media.py | 2 | # -*- coding: utf-8 -*-
from wechatpy.client.api.base import BaseWeChatAPI
class WeChatMedia(BaseWeChatAPI):
"""素材管理
https://developers.weixin.qq.com/doc/offiaccount/Asset_Management/New_temporary_materials.html
"""
def upload(self, media_type, media_file):
"""
新增临时素材
详情请参考... |
PaddlePaddle/Paddle | refs/heads/develop | python/paddle/vision/datasets/voc2012.py | 1 | # Copyright (c) 2020 PaddlePaddle 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 app... |
bernardokyotoku/skillplant | refs/heads/master | django/contrib/admindocs/models.py | 12 | # Empty models.py to allow for specifying admindocs as a test label.
|
yashodhank/erpnext | refs/heads/develop | erpnext/setup/setup_wizard/test_setup_wizard.py | 30 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from erpnext.setup.setup_wizard.test_setup_data import args
from frappe.desk.page.setup_wizard.setup_wizard import setup_complete
import ... |
BCLab-UNM/SwarmBaseCode-ROS | refs/heads/master | arduino/libraries/ros_lib/examples/ServiceClient/client.py | 61 | #!/usr/bin/env python
"""
Sample code to use with ServiceClient.pde
"""
import roslib; roslib.load_manifest("rosserial_arduino")
import rospy
from rosserial_arduino.srv import *
def callback(req):
print "The arduino is calling! Please send it a message:"
t = TestResponse()
t.output = raw_input()
re... |
dpgeorge/micropython | refs/heads/master | tests/micropython/extreme_exc.py | 9 | # test some extreme cases of allocating exceptions and tracebacks
import micropython
# Check for stackless build, which can't call functions without
# allocating a frame on the heap.
try:
def stackless():
pass
micropython.heap_lock()
stackless()
micropython.heap_unlock()
except RuntimeError:... |
yashu-seth/networkx | refs/heads/master | networkx/linalg/__init__.py | 61 | from networkx.linalg.attrmatrix import *
import networkx.linalg.attrmatrix
from networkx.linalg.spectrum import *
import networkx.linalg.spectrum
from networkx.linalg.graphmatrix import *
import networkx.linalg.graphmatrix
from networkx.linalg.laplacianmatrix import *
import networkx.linalg.laplacianmatrix
from network... |
MattCrystal/Haunted-X-series | refs/heads/master | scripts/build-all.py | 1182 | #! /usr/bin/env python
# Copyright (c) 2009-2011, The Linux Foundation. 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
# ... |
Bystroushaak/pyDHTMLParser | refs/heads/master | setup.py | 1 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Interpreter version: python 2.7
#
# Imports =====================================================================
from setuptools import setup
from setuptools import find_packages
from docs import get_version
# Variables =============================================... |
lseyesl/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/layout_tests/lint_test_expectations_unittest.py | 122 | # Copyright (C) 2012 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 ... |
vuteam/BlackHole-New | refs/heads/master | lib/python/Tools/Notifications.py | 3 |
notifications = [ ]
notificationAdded = [ ]
# notifications which are currently on screen (and might be closed by similiar notifications)
current_notifications = [ ]
def __AddNotification(fnc, screen, id, *args, **kwargs):
if ".MessageBox'>" in `screen`:
kwargs["simple"] = True
if ".Standby'>" in `screen`:
r... |
lucafavatella/intellij-community | refs/heads/cli-wip | python/lib/Lib/socket.py | 73 | """
This is an updated socket module for use on JVMs > 1.5; it is derived from the old jython socket module.
It is documented, along with known issues and workarounds, on the jython wiki.
http://wiki.python.org/jython/NewSocketModule
"""
_defaulttimeout = None
import errno
import jarray
import string
import struct
im... |
tseaver/google-cloud-python | refs/heads/master | core/tests/unit/test_client.py | 2 | # Copyright 2015 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 agreed to in writing, s... |
leppa/home-assistant | refs/heads/dev | homeassistant/components/caldav/__init__.py | 36 | """The caldav component."""
|
jcshen007/cloudstack | refs/heads/master | systemvm/test/python/TestCsRoute.py | 3 | # 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... |
Onager/l2tdevtools | refs/heads/master | l2tdevtools/py2to3.py | 2 | # -*- coding: utf-8 -*-
"""The Python 2 and 3 compatible type definitions."""
import sys
# pylint: disable=invalid-name,undefined-variable
if sys.version_info[0] < 3:
BYTES_TYPE = str
INTEGER_TYPES = (int, long)
STRING_TYPES = (basestring, )
UNICODE_TYPE = unicode
else:
BYTES_TYPE = bytes
INTEGER_TYPES ... |
defionscode/ansible-modules-extras | refs/heads/devel | cloud/cloudstack/cs_instance.py | 11 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, René Moser <[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 Lice... |
ahmetdaglarbas/e-commerce | refs/heads/tez | tests/integration/customer/test_custom_user_model.py | 39 | from django.test import TestCase
from oscar.apps.customer.forms import ProfileForm
from oscar.core.compat import get_user_model, existing_user_fields
class TestACustomUserModel(TestCase):
def setUp(self):
self.user_klass = get_user_model()
def test_can_be_created_without_error(self):
try:
... |
WafaaT/spark-tk | refs/heads/master | python/sparktk/graph/ops/__init__.py | 137 | # vim: set encoding=utf-8
# Copyright (c) 2016 Intel 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 License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... |
ashutrix03/inteygrate_flaskapp-master | refs/heads/master | yowsup/layers/logger/layer.py | 67 | from yowsup.layers import YowLayer
import logging
logger = logging.getLogger(__name__)
class YowLoggerLayer(YowLayer):
def send(self, data):
ldata = list(data) if type(data) is bytearray else data
logger.debug("tx:\n%s" % ldata)
self.toLower(data)
def receive(self, data):
ldata... |
tuxfux-hlp-notes/python-batches | refs/heads/master | archieves/batch-62/files/myenv/lib/python2.7/site-packages/pip/_vendor/html5lib/_trie/__init__.py | 456 | from __future__ import absolute_import, division, unicode_literals
from .py import Trie as PyTrie
Trie = PyTrie
# pylint:disable=wrong-import-position
try:
from .datrie import Trie as DATrie
except ImportError:
pass
else:
Trie = DATrie
# pylint:enable=wrong-import-position
|
strands-project/strands_social | refs/heads/hydro-devel | strands_tweets/scripts/tweet_test.py | 3 | #!/usr/bin/env python
import roslib; roslib.load_manifest('strands_tweets')
import sys
import rospy
from strands_tweets.srv import *
def tweet_client(text):
rospy.wait_for_service('/strands_tweets/Tweet')
try:
tweet = rospy.ServiceProxy('/strands_tweets/Tweet', Tweet)
resp1 = tweet(text,True)... |
andrewcbennett/iris | refs/heads/placeholder | lib/iris/fileformats/cf.py | 3 | # (C) British Crown Copyright 2010 - 2015, Met Office
#
# This file is part of Iris.
#
# Iris 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 3 of the License, or
# (at your option) any l... |
orekyuu/intellij-community | refs/heads/master | python/testData/resolve/pyToJava/FieldType.py | 83 | from java.lang import System as javasystem
javasystem.out.p<ref>rintln("Hello") |
leopittelli/Django-on-App-Engine-Example | refs/heads/master | django_summernote/settings.py | 5 | import os
import uuid
from datetime import datetime
from django.conf import settings
def uploaded_filepath(instance, filename):
ext = filename.split('.')[-1]
filename = "%s.%s" % (uuid.uuid4(), ext)
today = datetime.now().strftime('%Y-%m-%d')
return os.path.join('django-summernote', today, filename)
... |
primiano/edison-kernel | refs/heads/master | tools/perf/scripts/python/sctop.py | 11180 | # system call top
# (c) 2010, Tom Zanussi <[email protected]>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... |
svn2github/audacity | refs/heads/master | lib-src/lv2/lv2/plugins/eg01-amp.lv2/waflib/Context.py | 70 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import os,imp,sys
from waflib import Utils,Errors,Logs
import waflib.Node
HEXVERSION=0x1070b00
WAFVERSION="1.7.11"
WAFREVISION="50f631bc5e00bdda966c68094229b99be9a21084"
ABI=9... |
almeidapaulopt/erpnext | refs/heads/develop | erpnext/patches/v4_2/update_project_milestones.py | 121 | from __future__ import unicode_literals
import frappe
def execute():
for project in frappe.db.sql_list("select name from tabProject"):
frappe.reload_doc("projects", "doctype", "project")
p = frappe.get_doc("Project", project)
p.update_milestones_completed()
p.db_set("percent_milestones_completed", p.percent_m... |
rm-hull/ssd1306 | refs/heads/master | luma/__init__.py | 1 | # -*- coding: utf-8 -*-
# Copyright (c) 2014-2019 Richard Hull and contributors
# See LICENSE.rst for details.
try:
__import__('pkg_resources').declare_namespace(__name__)
except ImportError:
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
|
scalable-networks/gnuradio-3.7.0.1 | refs/heads/master | gnuradio-runtime/examples/network/dial_tone_sink.py | 58 | #!/usr/bin/env python
#
# Copyright 2006,2007,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 ... |
mattvick/phantomjs | refs/heads/master | src/breakpad/src/tools/gyp/test/subdirectory/gyptest-subdir-default.py | 137 | #!/usr/bin/env python
# Copyright (c) 2009 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.
"""
Verifies building a subsidiary dependent target from a .gyp file in a
subdirectory, without specifying an explicit output build director... |
int0x19/android_kernel_xiaomi_msm8992 | refs/heads/libra_miui_v2 | 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 ... |
zombi-x/android_kernel_lge_mako | refs/heads/mm6.0 | 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 ... |
twitter-forks/bazel | refs/heads/master | third_party/py/abseil/absl/testing/absltest.py | 15 | # 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 ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.