repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
skg-net/ansible | refs/heads/devel | lib/ansible/modules/network/cloudengine/ce_command.py | 43 | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... |
kvar/ansible | refs/heads/seas_master_2.9.5 | lib/ansible/modules/windows/win_file_version.py | 52 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2015, Sam Liu <sam.liu@activenetwork.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by'... |
ThinkingBridge/platform_external_chromium_org | refs/heads/kitkat | chrome/test/functional/ap_lab/ap_configurator_test.py | 76 | # 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 unittest
import ap_configurator_factory
import dlink_ap_configurator
import linksys_ap_configurator
import pyauto_ap_configurator # must precee... |
JonathanSalwan/Triton | refs/heads/master | src/examples/pin/sym_only_on_tainted.py | 1 | #!/usr/bin/env python2
## -*- coding: utf-8 -*-
##
## $ ./build/triton ./src/examples/pin/sym_only_on_tainted.py ./src/samples/crackmes/crackme_xor a
##
from pintool import *
from triton import ARCH, MODE
def cb_ir(inst):
if inst.getAddress() == 0x400574:
rax = getCurrentRegisterValue(getTritonContext()... |
dol-sen/portage | refs/heads/master | pym/portage/tests/resolver/test_onlydeps_minimal.py | 2 | # Copyright 2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from portage.tests import TestCase
from portage.tests.resolver.ResolverPlayground import ResolverPlayground, ResolverPlaygroundTestCase
class OnlydepsMinimalTestCase(TestCase):
def testOnlydepsMinimal(self):
ebui... |
abaditsegay/arangodb | refs/heads/devel | 3rdParty/V8-4.3.61/build/gyp/test/msvs/external_builder/msbuild_rule.py | 260 | # 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.
import sys, os.path
sys.argv[1] = os.path.basename(sys.argv[1])
with open('msbuild_rule.out', 'w') as f:
f.write(' '.join(sys.argv))
|
smolix/incubator-mxnet | refs/heads/master | docs/conf.py | 20 | # 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... |
baour/goldocoin | refs/heads/master | contrib/pyminer/pyminer.py | 1257 | #!/usr/bin/python
#
# Copyright (c) 2011 The Bitcoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file license.txt or http://www.opensource.org/licenses/mit-license.php.
#
import time
import json
import pprint
import hashlib
import struct
import re
import base64
import httplib
im... |
blaze/dask | refs/heads/master | dask/bytes/utils.py | 3 | import io
import gzip
import bz2
import lzma
import zipfile
def zip_compress(data):
"""Write data into zipfile and return the bytes"""
out = io.BytesIO()
with zipfile.ZipFile(file=out, mode="w") as z:
with z.open("myfile", "w") as zf:
zf.write(data)
out.seek(0)
return out.read(... |
spaceninja/mltshp | refs/heads/master | models/subscription.py | 1 | from datetime import datetime
from lib.flyingcow import Model, Property
from tornado.options import options
import shake
import user
import post
class Subscription(Model):
user_id = Property()
shake_id = Property()
deleted = Property(default=0)
created_at = Property()
updated_at = P... |
ThiagoGarciaAlves/intellij-community | refs/heads/master | plugins/hg4idea/testData/bin/hgext/blackbox.py | 94 | # blackbox.py - log repository events to a file for post-mortem debugging
#
# Copyright 2010 Nicolas Dumazet
# Copyright 2013 Facebook, Inc.
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
"""log repository events to a blackbox fo... |
chubbymaggie/codereason | refs/heads/master | gtest-1.6.0/test/gtest_throw_on_failure_test.py | 2917 | #!/usr/bin/env python
#
# Copyright 2009, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... |
opensourcechipspark/platform_external_chromium_org | refs/heads/master | chrome/test/functional/chromeos_file_browser.py | 41 | #!/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 pyauto_functional
import pyauto
import chromeos.file_browser
import test_utils
class ChromeosFileBrowserTest(pyauto.PyUIT... |
Netuitive/netuitive-client-python | refs/heads/master | netuitive/util.py | 1 | # -*- coding: utf-8 -*-
from datetime import datetime
def to_ms_timestamp(dt, epoch=datetime(1970, 1, 1)):
td = dt - epoch
return ((td.microseconds + (td.seconds + td.days * 86400) * 10**6) / 10**3)
def to_ms_timestamp_int(dt, epoch=datetime(1970, 1, 1)):
ts = to_ms_timestamp(dt, epoch)
return in... |
RandyLowery/erpnext | refs/heads/develop | erpnext/setup/doctype/naming_series/__init__.py | 37694 | from __future__ import unicode_literals
|
MichaelNedzelsky/intellij-community | refs/heads/master | python/testData/psi/ClassDecorators.py | 83 | @foo
@bar
class A:
pass
|
sajeeshcs/nested_quota | refs/heads/master | nova/virt/xenapi/image/vdi_through_dev.py | 17 | # Copyright 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 requ... |
Ebag333/Pyfa | refs/heads/master | eos/effects/shipmodeshtdamagepostdiv.py | 2 | # shipModeSHTDamagePostDiv
#
# Used by:
# Module: Hecate Sharpshooter Mode
type = "passive"
def handler(fit, module, context):
fit.modules.filteredItemMultiply(
lambda mod: mod.item.requiresSkill("Small Hybrid Turret"),
"damageMultiplier",
1 / module.getModifiedItemAttr("modeDamageBonusPos... |
adoosii/edx-platform | refs/heads/master | lms/djangoapps/shoppingcart/decorators.py | 181 | """
This file defines any decorators used by the shopping cart app
"""
from django.http import Http404
from .utils import is_shopping_cart_enabled
def enforce_shopping_cart_enabled(func):
"""
Is a decorator that forces a wrapped method to be run in a runtime
which has the ENABLE_SHOPPING_CART flag set
... |
KingOfBanana/SocialNetworkAI | refs/heads/master | db/db_proxy.py | 1 | # coding:utf-8
from db.basic_db import proxy_db_session
from db.models import Proxys, ProxySource
from decorators.decorator import db_commit_decorator, proxy_db_commit_decorator
from sqlalchemy import func
@proxy_db_commit_decorator
def insert_proxy(proxies):
if proxies:
for proxy in proxies:
if ... |
jimcunderwood/MissionPlanner | refs/heads/master | Lib/site-packages/scipy/stats/tests/test_mstats_basic.py | 61 | """
Tests for the stats.mstats module (support for maskd arrays)
"""
import numpy as np
from numpy import nan
import numpy.ma as ma
from numpy.ma import masked, nomask
import scipy.stats.mstats as mstats
from numpy.testing import TestCase, run_module_suite
from numpy.ma.testutils import assert_equal, assert_almost_e... |
erwilan/ansible | refs/heads/devel | test/integration/targets/module_utils/module_utils/spam5/ham/eggs.py | 298 | data = 'spam5:eggs'
|
jason-weirather/Au-public | refs/heads/master | iron/pythonlib/BigFileBasics.py | 1 | import os, sys
# Read lines from a big file starting on the Nth chunk.
# Lets you work on a file as if you had split it, without splitting it.
#
# Pre: A file name of an Ascii file
# Needs to have either set_chunk_size_bytes or set_chunk_count run.
# Example:
#
# Methods:
# set_chunk_size_bytes(byte... |
mstriemer/olympia | refs/heads/master | src/olympia/migrations/597-theme-description.py | 31 | #!/usr/bin/env python
def run():
"""
Migrate summary to description field for a handful of themes after
getpersonas migration.
"""
# addons = Addon.objects.filter(type=amo.ADDON_PERSONA,
# description__isnull=True, summary__isnull=False)
# for addon in addons:
# addon.descripti... |
raphaelfruneaux/scrapy | refs/heads/master | scrapy/utils/http.py | 202 | """
Transitional module for moving to the w3lib library.
For new code, always import from w3lib.http instead of this module
"""
from w3lib.http import *
def decode_chunked_transfer(chunked_body):
"""Parsed body received with chunked transfer encoding, and return the
decoded body.
For more info see:
... |
phamelin/ardupilot | refs/heads/master | Tools/LogAnalyzer/DataflashLog.py | 17 | #
# Code to abstract the parsing of APM Dataflash log files, currently only used by the LogAnalyzer
#
# Initial code by Andrew Chapman (amchapman@gmail.com), 16th Jan 2014
#
from __future__ import print_function
import collections
import numpy
import bisect
import sys
import ctypes
from VehicleType import VehicleType... |
mgugino-upstream-stage/ansible-modules-core | refs/heads/devel | web_infrastructure/django_manage.py | 19 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Scott Anderson <scottanderson42@gmail.com>
#
# 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 o... |
ThePletch/ansible | refs/heads/devel | lib/ansible/modules/cloud/amazon/ecs_service_facts.py | 23 | #!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed... |
keedio/hue | refs/heads/master | desktop/core/ext-py/pycrypto-2.6.1/lib/Crypto/SelfTest/Random/OSRNG/__init__.py | 118 | # -*- coding: utf-8 -*-
#
# SelfTest/Random/OSRNG/__init__.py: Self-test for OSRNG modules
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedica... |
dsimic/ibproductlist | refs/heads/master | ibproduct/ibproduct/spiders/ibexchange_spider.py | 1 | import scrapy
from scrapy.selector import Selector
from ibproduct.items import IBExchangeItem
from urlparse import parse_qs, urlparse
base_url = 'https://www.interactivebrokers.com/en/index.php?f=products&p=%s'
product_cats = [
'stk',
'europe_stk',
'asia_stk',
'fut',
'europe_fut',
'asia_fut',
... |
gojira/tensorflow | refs/heads/master | tensorflow/python/framework/smart_cond.py | 17 | # Copyright 2018 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... |
miltonruelas/cursotecnico | refs/heads/7.0 | branch/l10n_pe_ple03/report/sunat_3_13.py | 4 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2011 NUMA Extreme Systems (www.numaes.com) for Cubic ERP - Teradata SAC. (http://cubicerp.com).
#
# WARNING: This program as such is intended to be use... |
hfutsuchao/Python2.6 | refs/heads/master | SEOKeywordsAnalysis/keywordsCityGroup.py | 1 | #coding:utf-8
import html,time
import BeautifulSoup
from urllib import quote
htmlHandle = html.Html()
loginUrl = 'http://www.aizhan.com/login.php?refer=http://ci.aizhan.com/'
params = {
'email':'hfutsuchao@gmail.com',
'password':'814155356',
'refer':'http%3A%2F%2Fci.ai... |
nikoonia/gem5v | refs/heads/master | src/arch/x86/isa/insts/simd64/floating_point/compare/compare_and_write_mask.py | 91 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# 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 implemen... |
vamanea/goldfish-trustzone | refs/heads/android-goldfish-3.4-tz | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... |
chuanchang/tp-libvirt | refs/heads/master | virttest/libvirt_xml/devices/lease.py | 30 | """
lease device support class(es)
http://libvirt.org/formatdomain.html#elementsLease
"""
from virttest.libvirt_xml.devices import base
class Lease(base.UntypedDeviceBase):
# TODO: Write this class
__metaclass__ = base.StubDeviceMeta
_device_tag = 'lease'
|
sekikn/incubator-airflow | refs/heads/master | airflow/providers/jira/hooks/jira.py | 5 | #
# 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... |
ndardenne/pymatgen | refs/heads/master | pymatgen/io/vasp/GWvaspinputsets.py | 4 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import division, unicode_literals, print_function
"""
Input sets for VASP GW calculations
Single vasp GW work: Creates input and jobscripts from the input sets for a specific job
"""
__author... |
DNFcode/edx-platform | refs/heads/master | common/djangoapps/enrollment/tests/test_data.py | 8 | """
Test the Data Aggregation Layer for Course Enrollments.
"""
import ddt
from nose.tools import raises
import unittest
from django.test.utils import override_settings
from django.conf import settings
from xmodule.modulestore.tests.django_utils import (
ModuleStoreTestCase, mixed_store_config
)
from xmodule.modu... |
jashank/rust | refs/heads/master | src/etc/htmldocck.py | 41 | # Copyright 2015 The Rust Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution and at
# http://rust-lang.org/COPYRIGHT.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://... |
devunt/ika | refs/heads/master | ika/services/ozinger/commands/transfer_channel.py | 1 | from ika.service import Command, Permission
from ika.models import Account, Channel, Flag
from ika.enums import Flags
class TransferChannel(Command):
name = '채널소유권이전'
aliases = (
'TRANSFERCHANNEL',
)
syntax = '<#채널명> <계정명> <YES>'
regex = r'(?P<cname>#\S+) (?P<target>\S+) (?P<confirmed>YES)... |
4eek/edx-platform | refs/heads/master | common/djangoapps/monitoring/signals.py | 172 | """
Add receivers for django signals, and feed data into the monitoring system.
If a model has a class attribute 'METRIC_TAGS' that is a list of strings,
those fields will be retrieved from the model instance, and added as tags to
the recorded metrics.
"""
from django.db.models.signals import post_save, post_delete,... |
wemanuel/smry | refs/heads/master | smry/server-auth/ls/google-cloud-sdk/platform/gsutil/third_party/boto/boto/gs/bucket.py | 130 | # Copyright 2010 Google Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish, dis-
# trib... |
ancafarcas/superdesk-core | refs/heads/superdesk-master | superdesk/commands/remove_exported_files.py | 5 | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014, 2015, 2016, 2017 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/lic... |
sudheerchintala/LearnEraPlatForm | refs/heads/master | common/djangoapps/course_action_state/migrations/0002_add_rerun_display_name.py | 129 | # -*- 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 field 'CourseRerunState.display_name'
db.add_column('course_action_state_coursererunstate', 'displa... |
x2Ident/x2Ident | refs/heads/master | mitmproxy/pathod/pathoc_cmdline.py | 2 | from __future__ import print_function
import sys
import argparse
import os
import os.path
from netlib import tcp
from netlib import version
from netlib.http import user_agents
from . import pathoc, language
def args_pathoc(argv, stdout=sys.stdout, stderr=sys.stderr):
preparser = argparse.ArgumentPar... |
Maccimo/intellij-community | refs/heads/master | python/testData/formatter/continuationIndentForCollectionsAndComprehensionsHangingIndentOfClosingBrace.py | 30 | l = [
1,
2,
3
]
lc = [
x
for x
in range(42)
if x
]
s = {
1,
2,
3
}
sc = {
x
for x
in range(42)
if x
}
t = (
1,
2,
3
)
g = (
x
for x
in range(42)
if x
)
d = {
1: True,
2: False,
3: None
}
dc = {
x: None
for x
... |
sdarji/lpthw | refs/heads/master | Lib/site-packages/pip/_vendor/requests/packages/urllib3/fields.py | 294 | # urllib3/fields.py
# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import email.utils
import mimetypes
from .packages import six
def guess_content_type(filename... |
OpenMOOC/moocng | refs/heads/master | moocng/api/resources.py | 1 | # -*- coding: utf-8 -*-
# Copyright 2012-2013 UNED
#
# 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... |
ksmit799/Toontown-Source | refs/heads/master | toontown/estate/DistributedPlantBase.py | 1 | import DistributedLawnDecor
from direct.interval.IntervalGlobal import *
from direct.directnotify import DirectNotifyGlobal
from direct.showbase.ShowBase import *
import GardenGlobals
from toontown.toonbase import TTLocalizer
class DistributedPlantBase(DistributedLawnDecor.DistributedLawnDecor):
notify = DirectNot... |
keenondrums/sovrin-node | refs/heads/master | sovrin_common/constants.py | 1 | from typing import NamedTuple
from plenum.common.constants import TXN_TYPE, TARGET_NYM, ORIGIN, DATA, RAW, \
ENC, HASH, NAME, VERSION, TYPE, POOL_TXN_TYPES, ALIAS, VERKEY, FORCE
from sovrin_common.roles import Roles
from sovrin_common.transactions import SovrinTransactions
Environment = NamedTuple("Environment", ... |
bertucho/epic-movie-quotes-quiz | refs/heads/master | dialogos/build/scrapy/scrapy/statscol.py | 144 | import warnings
from scrapy.exceptions import ScrapyDeprecationWarning
warnings.warn("Module `scrapy.statscol` is deprecated, "
"use `scrapy.statscollectors` instead",
ScrapyDeprecationWarning, stacklevel=2)
from scrapy.statscollectors import *
|
jawilson/pmxbot | refs/heads/master | tests/functional/test_exceptions.py | 2 | import time
from tests.functional import PmxbotHarness
class TestPmxbotExceptions(PmxbotHarness):
def test_no_op(self):
"""
Test that the harness is working.
"""
def test_exception(self):
"""
pmxbot should still be running after running a crashing command
"""
self.client.send_message('#inane', '!cras... |
savoirfairelinux/django | refs/heads/master | django/db/backends/postgresql/introspection.py | 16 | import warnings
from django.db.backends.base.introspection import (
BaseDatabaseIntrospection, FieldInfo, TableInfo,
)
from django.db.models.indexes import Index
from django.utils.deprecation import RemovedInDjango21Warning
class DatabaseIntrospection(BaseDatabaseIntrospection):
# Maps type codes to Django F... |
mikedh/trimesh | refs/heads/master | examples/scan_register.py | 2 | """
scan_register.py
-------------
Create some simulated 3D scan data and register
it to a "truth" mesh.
"""
import trimesh
import numpy as np
def simulated_brick(face_count, extents, noise, max_iter=10):
"""
Produce a mesh that is a rectangular solid with noise
with a random transform.
Parameters
... |
skidzo/sympy | refs/heads/master | sympy/polys/tests/test_galoistools.py | 98 |
from sympy.polys.galoistools import (
gf_crt, gf_crt1, gf_crt2, gf_int,
gf_degree, gf_strip, gf_trunc, gf_normal,
gf_from_dict, gf_to_dict,
gf_from_int_poly, gf_to_int_poly,
gf_neg, gf_add_ground, gf_sub_ground, gf_mul_ground,
gf_add, gf_sub, gf_add_mul, gf_sub_mul, gf_mul, gf_sqr,
gf_div, ... |
darkryder/django | refs/heads/master | tests/indexes/models.py | 9 | from django.db import connection, models
class CurrentTranslation(models.ForeignObject):
"""
Creates virtual relation to the translation with model cache enabled.
"""
# Avoid validation
requires_unique_target = False
def __init__(self, to, on_delete, from_fields, to_fields, **kwargs):
... |
amitsaha/pelican-plugins | refs/heads/master | creole_reader/creole_reader.py | 71 | #-*- conding: utf-8 -*-
'''
Creole Reader
-------------
This plugins allows you to write your posts using the wikicreole syntax. Give to
these files the creole extension.
For the syntax, look at: http://www.wikicreole.org/
'''
from pelican import readers
from pelican import signals
from pelican import settings
from... |
marcoantoniooliveira/labweb | refs/heads/master | oscar/lib/python2.7/site-packages/django/forms/extras/__init__.py | 324 | from __future__ import absolute_import
from django.forms.extras.widgets import *
|
jcherqui/searx | refs/heads/master | tests/unit/engines/test_google_videos.py | 1 | from collections import defaultdict
import mock
from searx.engines import google_videos
from searx.testing import SearxTestCase
class TestGoogleVideosEngine(SearxTestCase):
def test_request(self):
query = 'test_query'
dicto = defaultdict(dict)
dicto['pageno'] = 1
dicto['safesearch... |
msurkovsky/kaira | refs/heads/master | tests/alltests.py | 11 | import unittest
from tests import *
from tests_mpi import *
from tests_octave import *
from tests_verification import *
unittest.main()
|
diofeher/django-nfa | refs/heads/master | tests/regressiontests/forms/localflavor/ar.py | 19 | # -*- coding: utf-8 -*-
# Tests for the contrib/localflavor/ AR form fields.
tests = r"""
# ARProvinceField #############################################################
>>> from django.contrib.localflavor.ar.forms import ARProvinceSelect
>>> f = ARProvinceSelect()
>>> f.render('provincias', 'A')
u'<select name="prov... |
violasox/tellurium | refs/heads/master | setup.py | 1 | from distutils.core import setup
import os
with open(os.path.join(os.path.dirname(__file__), 'VERSION.txt'), 'r') as f:
version = f.read().rstrip()
setup(name='tellurium',
version=version,
description='Tellurium',
url='https://github.com/sys-bio/tellurium',
packages=[
'tellurium'... |
heracek/django-nonrel | refs/heads/master | django/core/management/commands/inspectdb.py | 110 | import keyword
from optparse import make_option
from django.core.management.base import NoArgsCommand, CommandError
from django.db import connections, DEFAULT_DB_ALIAS
class Command(NoArgsCommand):
help = "Introspects the database tables in the given database and outputs a Django model module."
option_list =... |
x303597316/hue | refs/heads/master | desktop/core/ext-py/Django-1.6.10/django/core/management/commands/cleanup.py | 116 | import warnings
from django.contrib.sessions.management.commands import clearsessions
class Command(clearsessions.Command):
def handle_noargs(self, **options):
warnings.warn(
"The `cleanup` command has been deprecated in favor of `clearsessions`.",
DeprecationWarning)
supe... |
littlecodersh/itchatmp | refs/heads/master | itchatmp/controllers/mpapi/mp/users.py | 1 | ''' This package is for user managing in wechat mp
1. What can we do?
- set tags and everything around them
- get all your users (of course not at a time) or get detailed information of one
- set blacklist and everything around it
3. I alse listed API list for you:
- TAGS
create_tag
... |
wolfprogrammer/zotserver | refs/heads/master | zotserver/zoterolib.py | 1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Module to extract data from Zotero database
This module allows to export and extract Zotero's
data to external applications.
@TODO: Add a better module docstring
@TODO: Make database (Sqlite) thread safe
@TODO: Create an object to handle the database and close it each re... |
oliverhr/odoo | refs/heads/8.0-pos-pademobile-payment | addons/account/wizard/account_tax_chart.py | 385 | # -*- 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... |
marcoantoniooliveira/labweb | refs/heads/master | oscar/lib/python2.7/site-packages/IPython/qt/console/history_console_widget.py | 2 | # System library imports
from IPython.external.qt import QtGui
# Local imports
from IPython.utils.traitlets import Bool
from console_widget import ConsoleWidget
class HistoryConsoleWidget(ConsoleWidget):
""" A ConsoleWidget that keeps a history of the commands that have been
executed and provides a readl... |
NirBenTalLab/proorigami-cde-package | refs/heads/master | cde-root/local/munk/data/phd/phd/ptgraph/pttableau.py | 1 | #!/usr/bin/env python
###############################################################################
#
# pttableau.py - Object to represent protein tableaux and functions to
# parse output of TableauCreator program into tableau object.
#
#
# File: pttableau.py
# Author: Alex Stivala
# Created: Octob... |
ProjectSWGCore/NGECore2 | refs/heads/master | scripts/object/weapon/melee/polearm/lance_staff_janta.py | 85615 | import sys
def setup(core, object):
return |
jonyroda97/redbot-amigosprovaveis | refs/heads/develop | lib/youtube_dl/extractor/popcorntv.py | 13 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
extract_attributes,
int_or_none,
unified_timestamp,
)
class PopcornTVIE(InfoExtractor):
_VALID_URL = r'https?://[^/]+\.popcorntv\.it/guarda/(?P<display_id>[^/]+)/(?P<id>\d+)'
_TESTS = [{
... |
maxive/erp | refs/heads/master | addons/account_bank_statement_import/wizard/__init__.py | 16 | from . import journal_creation
|
CJ8664/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/pytest/_pytest/assertion/reinterpret.py | 176 | """
Find intermediate evalutation results in assert statements through builtin AST.
"""
import ast
import sys
import _pytest._code
import py
from _pytest.assertion import util
u = py.builtin._totext
class AssertionError(util.BuiltinAssertionError):
def __init__(self, *args):
util.BuiltinAssertionError.__... |
akiss77/servo | refs/heads/master | tests/wpt/web-platform-tests/mathml/tools/stacks.py | 92 | #!/usr/bin/python
from utils import mathfont
import fontforge
v = 7 * mathfont.em
f = mathfont.create("stack-axisheight%d" % v)
f.math.AxisHeight = v
f.math.StackBottomDisplayStyleShiftDown = 0
f.math.StackBottomShiftDown = 0
f.math.StackDisplayStyleGapMin = 0
f.math.StackGapMin = 0
f.math.StackTopDisplayStyleShiftUp... |
vmax-feihu/hue | refs/heads/master | desktop/core/ext-py/Mako-0.8.1/mako/_ast_util.py | 57 | # mako/_ast_util.py
# Copyright (C) 2006-2012 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
ast
~~~
The `ast` module helps Python applications to process trees of the Pyth... |
mosaic-cloud/mosaic-distribution-dependencies | refs/heads/development | dependencies/nodejs/0.8.22/deps/npm/node_modules/node-gyp/gyp/test/compiler-override/my_cc.py | 980 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
print sys.argv
|
wooga/airflow | refs/heads/master | tests/providers/http/operators/__init__.py | 5130 | #
# 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... |
abhinavjain241/acousticbrainz-server | refs/heads/master | db/dump_manage.py | 1 | from __future__ import print_function
from db import dump
import db
import config
import shutil
import click
import re
import os
cli = click.Group()
@cli.command()
@click.option("--location", "-l", default=os.path.join(os.getcwd(), 'export'), show_default=True,
help="Directory where dumps need to be cr... |
40223108/-2015cd_midterm | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/_io.py | 629 | """
Python implementation of the io module.
"""
import os
import abc
import codecs
import errno
# Import _thread instead of threading to reduce startup cost
try:
from _thread import allocate_lock as Lock
except ImportError:
from _dummy_thread import allocate_lock as Lock
import io
#brython fix me
#from io imp... |
jbbrokaw/piktio | refs/heads/master | piktio/__init__.py | 1 | from pyramid.config import Configurator
import configure
import os
from piktio.models import (
DBSession,
PiktioProfile
)
def expandvars_dict(settings):
"""Expands all environment variables in a settings dictionary."""
return dict((key, os.path.expandvars(value)) for
key, value in set... |
nurmd2/nurmd | refs/heads/master | addons/website_crm_partner_assign/controllers/main.py | 23 | # -*- coding: utf-8 -*-
import werkzeug
from openerp import SUPERUSER_ID
from openerp.addons.web import http
from openerp.addons.web.http import request
from openerp.addons.website.models.website import slug, unslug
from openerp.addons.website_partner.controllers.main import WebsitePartnerPage
from openerp.tools.transl... |
dennis-sheil/commandergenius | refs/heads/sdl_android | project/jni/python/src/Lib/test/test_ossaudiodev.py | 56 | from test import test_support
test_support.requires('audio')
from test.test_support import findfile, TestSkipped
import errno
import ossaudiodev
import sys
import sunau
import time
import audioop
import unittest
# Arggh, AFMT_S16_NE not defined on all platforms -- seems to be a
# fairly recent addition to OSS.
try:
... |
edeposit/edeposit.amqp.ftp | refs/heads/master | src/edeposit/amqp/ftp/decoders/parser_yaml.py | 1 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Interpreter version: python 2.7
#
"""
This submodule is used to parse metadata from YAML_ (``.yaml``) files.
.. _YAML: https://en.wikipedia.org/wiki/YAML
Example of the valid data::
ISBN knihy: 80-86056-31-7
Vazba knihy: brož.
Nazev knihy: 80-86056-31-7.... |
shujunqiao/cocos2d-python | refs/heads/master | samples/presentation/presentacion.py | 3 | from __future__ import division, print_function, unicode_literals
# This code is so you can run the samples without installing the package
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../..'))
import cocos
from cocos.director import director
import pyglet
from pyglet import font,... |
doganaltunbay/odoo | refs/heads/8.0 | addons/account/wizard/account_report_partner_balance.py | 364 | # -*- 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... |
mjocean/PyProcGameHD-SkeletonGame | refs/heads/master | procgame/keyboard.py | 3 | import sys
import procgame
import pinproc
from threading import Thread
import random
import string
import time
import locale
import math
import copy
import pygame
from pygame.locals import *
import dmd
pygame.init()
screen_multiplier = 2
screen = pygame.display.set_mode((128*screen_multiplier, 32*screen_multiplier))
p... |
junmin-zhu/chromium-rivertrail | refs/heads/v8-binding | chrome/tools/build/win/make_policy_zip.py | 159 | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""Creates a zip archive with policy template files. The list of input files is
extracted from a grd file with grit. This is to kee... |
lindiyer/pxe | refs/heads/master | webpy/pxe-menu-tpl/config/settings.py | 1 | #!/usr/bin/env python
# coding: utf-8
import web
web.config.debug = True
render = web.template.render('templates')
config = web.storage(
server='192.168.11.9',
ks_path = 'pxe/linux/ks',
)
web.template.Template.globals['config'] = config
web.template.Template.globals['render'] = render
|
nubark/odoo | refs/heads/9.0 | addons/report_webkit/ir_report.py | 47 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
# Copyright (c) 2010 Camptocamp SA (http://www.camptocamp.com)
# Author : Nicolas Bessi (Camptocamp)
import openerp
from openerp.osv import fields, orm
from webkit_report import WebKitParser
class ir_actions_report_xm... |
Stanford-Online/edx-platform | refs/heads/master | openedx/stanford/lms/envs/devstack.py | 1 | from lms.envs.devstack import *
from openedx.core.lib.logsettings import get_logger_config
FEATURES.update({
'ENABLE_COURSEWARE_SEARCH': False,
'USE_DJANGO_PIPELINE': False,
})
LOGGING = get_logger_config(
LOG_DIR,
logging_env=ENV_TOKENS['LOGGING_ENV'],
local_loglevel=local_loglevel,
service_v... |
mpyatishev/djfeedback | refs/heads/master | example/wsgi.py | 1 | """
WSGI config for djfeedback 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.7/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "example.settings")
from django.cor... |
zploskey/servo | refs/heads/master | tests/wpt/css-tests/tools/pywebsocket/src/example/internal_error_wsh.py | 465 | # Copyright 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 f... |
vladmm/intellij-community | refs/heads/master | python/testData/quickFixes/PyMakePublicQuickFixTest/positive_after.py | 80 | class A:
def __init__(self):
self.x = 1
def _foo(self):
print(self.x)
a = A()
a._foo()
print(a.x) |
Sony-Kitakami/android_kernel_sony | refs/heads/cm-13.0 | 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... |
franga2000/django-machina | refs/heads/master | machina/apps/forum_search/__init__.py | 2 | # -*- coding: utf-8 -*-
default_app_config = 'machina.apps.forum_search.registry_config.SearchRegistryConfig'
|
ilpianista/ansible | refs/heads/devel | test/integration/targets/module_utils/module_utils/spam5/ham/eggs.py | 298 | data = 'spam5:eggs'
|
gangadharkadam/tailorfrappe | refs/heads/master | frappe/tests/test_fmt_money.py | 37 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
import frappe
from frappe import _
from frappe.utils import flt, cstr
def fmt_money(amount, precision=None):
"""
Convert to string with commas for thousands, millions etc
"""
number_format = frappe.db.get_defa... |
pstratem/bitcoin | refs/heads/master | test/functional/mempool_reorg.py | 25 | #!/usr/bin/env python3
# Copyright (c) 2014-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test mempool re-org scenarios.
Test re-org scenarios with a mempool that contains transactions
that sp... |
BTCTaras/bitcoin | refs/heads/master | contrib/zmq/zmq_sub.py | 92 | #!/usr/bin/env python2
import array
import binascii
import zmq
port = 28332
zmqContext = zmq.Context()
zmqSubSocket = zmqContext.socket(zmq.SUB)
zmqSubSocket.setsockopt(zmq.SUBSCRIBE, "hashblock")
zmqSubSocket.setsockopt(zmq.SUBSCRIBE, "hashtx")
zmqSubSocket.setsockopt(zmq.SUBSCRIBE, "rawblock")
zmqSubSocket.setsock... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.