repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
tobbad/micropython | refs/heads/master | tests/thread/mutate_dict.py | 14 | # test concurrent mutating access to a shared dict object
#
# MIT license; Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd
import _thread
# the shared dict
di = {"a": "A", "b": "B", "c": "C", "d": "D"}
# main thread function
def th(n, lo, hi):
for repeat in range(n):
for i in range(lo, hi):
... |
staranjeet/fjord | refs/heads/master | vendor/packages/translate-toolkit/translate/storage/aresource.py | 3 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2012 Michal Čihař
#
# This file is part of the Translate Toolkit.
#
# 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 o... |
chyeh727/django | refs/heads/master | tests/check_framework/test_templates.py | 288 | from copy import deepcopy
from django.core.checks.templates import E001
from django.test import SimpleTestCase
from django.test.utils import override_settings
class CheckTemplateSettingsAppDirsTest(SimpleTestCase):
TEMPLATES_APP_DIRS_AND_LOADERS = [
{
'BACKEND': 'django.template.backends.djan... |
UniversalMasterEgg8679/ansible | refs/heads/devel | lib/ansible/modules/network/cumulus/_cl_ports.py | 70 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Cumulus Networks <ce-ceng@cumulusnetworks.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... |
anryko/ansible | refs/heads/devel | lib/ansible/plugins/shell/sh.py | 63 | # Copyright (c) 2014, Chris Church <chris@ninemoreminutes.com>
# Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
name: sh
plugin_ty... |
FedericoCeratto/debian-pymongo | refs/heads/master | pymongo/monitor.py | 19 | # Copyright 2014-2015 MongoDB, 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 in writi... |
HydrelioxGitHub/home-assistant | refs/heads/dev | tests/util/test_package.py | 13 | """Test Home Assistant package util methods."""
import asyncio
import logging
import os
import sys
from subprocess import PIPE
from unittest.mock import MagicMock, call, patch
import pytest
import homeassistant.util.package as package
TEST_NEW_REQ = 'pyhelloworld3==1.0.0'
@pytest.fixture
def mock_sys():
"""Mo... |
ScatterHQ/eliot | refs/heads/master | eliot/_action.py | 2 | """
Support for actions and tasks.
Actions have a beginning and an eventual end, and can be nested. Tasks are
top-level actions.
"""
from __future__ import unicode_literals, absolute_import
import threading
from uuid import uuid4
from contextlib import contextmanager
from functools import partial
from inspect import... |
jsgf/xen | refs/heads/master | tools/xm-test/tests/console/02_console_baddom_neg.py | 42 | #!/usr/bin/python
# Copyright (C) International Business Machines Corp., 2005
# Author: Li Ge <lge@us.ibm.com>
# Test Description:
# Negative Tests:
# Test for attempting to connect to non existent domname, domid. Verify fail.
import re
from XmTestLib import *
status, output = traceCommand("xm console 5000")
eyecat... |
lmazuel/azure-sdk-for-python | refs/heads/master | azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/network_profile.py | 1 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
svebk/DeepSentiBank_memex | refs/heads/master | scripts/precompute_similar_images_parallel.py | 1 | import os
import sys
import time
import datetime
import happybase
# parallel
#from multiprocessing import JoinableQueue as Queue
from multiprocessing import Queue
from multiprocessing import Process
sys.path.append('..')
import cu_image_search
from cu_image_search.search import searcher_hbaseremote
nb_workers = 20
t... |
atosorigin/ansible | refs/heads/devel | lib/ansible/plugins/lookup/__init__.py | 89 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@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 of the License, or
# (at your option) an... |
openhatch/oh-mainline | refs/heads/master | vendor/packages/Django/tests/regressiontests/urlpatterns_reverse/tests.py | 17 | # -*- coding: utf-8 -*-
"""
Unit tests for reverse URL lookups.
"""
from __future__ import absolute_import, unicode_literals
import sys
from django.conf import settings
from django.contrib.auth.models import User
from django.core.exceptions import ImproperlyConfigured, ViewDoesNotExist
from django.core.urlresolvers i... |
ravindrapanda/tensorflow | refs/heads/master | tensorflow/python/summary/summary_test.py | 75 | # 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... |
KingOfBanana/SocialNetworkAI | refs/heads/master | page_get/basic.py | 1 | # coding:utf-8
import os
import time
import signal
import requests
from headers import headers
from db.redis_db import Urls
from db.redis_db import Cookies
from logger.log import crawler, other
from db.login_info import freeze_account
from utils.email_warning import send_email
from page_parse.basic import is_403, is_40... |
fjruizruano/ngs-protocols | refs/heads/master | massive_phylogeny_raxml_support.py | 1 | #! /usr/bin/python
from subprocess import call
from Bio import AlignIO
import sys
print "massive_phylogeny_raxml_support.py FastaFile NumberSearches NumberBootstrap NumberThreads Name"
try:
file = sys.argv[1]
except:
file = raw_input("FASTA file name: ")
try:
trees = sys.argv[2]
except:
trees = raw_... |
ntucllab/striatum | refs/heads/master | setup.py | 1 | #!/usr/bin/env python
import os
from setuptools import setup
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
# read the docs could not compile numpy and c extensions
if on_rtd:
setup_requires = []
install_requires = []
else:
setup_requires = [
'nose',
'coverage',
]
install_r... |
3dfxsoftware/cbss-addons | refs/heads/master | base_iban/__openerp__.py | 125 | # -*- 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... |
bazz-erp/erpnext | refs/heads/master | erpnext/schools/doctype/academic_year/test_academic_year.py | 54 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
# test_records = frappe.get_test_records('Academic Year')
class TestAcademicYear(unittest.TestCase):
pass
|
JoeLaMartina/aima-python | refs/heads/master | submissions/McLean/runPuzzles.py | 18 | import search
import submissions.McLean.puzzles as pz
def compare_searchers(problems, header, searchers=[]):
def do(searcher, problem):
p = search.InstrumentedProblem(problem)
goalNode = searcher(p)
return p, goalNode.path_cost
table = [[search.name(s)] + [do(s, p) for p in problems] fo... |
jbassen/edx-platform | refs/heads/master | lms/djangoapps/branding/__init__.py | 1 | from xmodule.modulestore.django import modulestore
from xmodule.course_module import CourseDescriptor
from django.conf import settings
from branding_stanford.models import TileConfiguration
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from microsite_configuration import microsite
from staticfiles.stor... |
samdmarshall/xcparse | refs/heads/develop | xcparse/Helpers/path_helper.py | 1 | import os
class path_helper(object):
"""
This is a path object to allow for root, base, and full path storage to create relative paths
"""
# base_path = '';
# obj_path = '';
# root_path = '';
def __init__(self, path, root):
self.obj_path = os.path.normpath(path);
self.b... |
dmitry-sobolev/ansible | refs/heads/devel | test/units/playbook/test_playbook.py | 290 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@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 of the License, or
# (at your option) an... |
40223134/w16b_test | refs/heads/master | static/Brython3.1.3-20150514-095342/Lib/unittest/test/test_discovery.py | 785 | import os
import re
import sys
import unittest
class TestableTestProgram(unittest.TestProgram):
module = '__main__'
exit = True
defaultTest = failfast = catchbreak = buffer = None
verbosity = 1
progName = ''
testRunner = testLoader = None
def __init__(self):
pass
class TestDisc... |
IEMLdev/ieml-api | refs/heads/master | ieml/usl/distance/sort.py | 2 | import numpy as np
def square_order_matrix(usl_list):
"""
Compute the ordering of a list of usls from each usl and return the matrix m s.t.
for each u in usl_list at index i, [usl_list[j] for j in m[i, :]] is the list sorted
by proximity from u.
of the result
:param usl_list: a list of usls
... |
niavlys/kivy | refs/heads/master | kivy/base.py | 4 | # pylint: disable=W0611
'''
Kivy Base
=========
This module contains core Kivy functionality and is not intended for end users.
Feel free to look though it, but calling any of these methods directly may well
result in unpredicatable behavior.
Event loop management
---------------------
'''
__all__ = (
'EventLoo... |
SHA2017-badge/micropython-esp32 | refs/heads/master | tests/basics/int_divmod_intbig.py | 45 | # test integer floor division and modulo
# this tests bignum modulo
a = 987654321987987987987987987987
b = 19
print(a % b)
print(a % -b)
print(-a % b)
print(-a % -b)
|
nayanshah/python | refs/heads/master | ml.py | 1 | import json
import nltk
import operator as op
import numpy as np
from sys import stdin
from sklearn.ensemble import RandomForestRegressor
from sklearn.cross_validation import train_test_split
from sklearn.grid_search import GridSearchCV
class ML:
"""Toolkit for simplifying machine learning tasks"""
X = y ... |
SpaceKatt/CSPLN | refs/heads/master | apps/scaffolding/mac/web2py/web2py.app/Contents/Resources/lib/python2.7/numpy/core/tests/test_regression.py | 5 | from StringIO import StringIO
import pickle
import sys
import platform
import gc
import copy
from os import path
from numpy.testing import *
from numpy.testing.utils import _assert_valid_refcount, WarningManager
from numpy.compat import asbytes, asunicode, asbytes_nested
import warnings
import tempfile
import numpy as ... |
ASinanSaglam/westpa | refs/heads/master | lib/examples/wca-dimer_openmm/we_custom/sampling.py | 4 | import simtk
import simtk.unit as units
import simtk.openmm as openmm
def minimize(platform, system, positions):
# Create a Context.
timestep = 1.0 * units.femtoseconds
integrator = openmm.VerletIntegrator(timestep)
context = openmm.Context(system, integrator, platform)
# Set coordinates.
cont... |
rubyinhell/brython | refs/heads/master | www/src/Lib/test/test_importlib/source/test_file_loader.py | 28 | from importlib import machinery
import importlib
import importlib.abc
from .. import abc
from .. import util
from . import util as source_util
import errno
import imp
import marshal
import os
import py_compile
import shutil
import stat
import sys
import unittest
from test.support import make_legacy_pyc
class Simple... |
ojii/sandlib | refs/heads/master | lib/lib-python/2.7/encodings/utf_16_le.py | 860 | """ Python 'utf-16-le' Codec
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
import codecs
### Codec APIs
encode = codecs.utf_16_le_encode
def decode(input, errors='strict'):
return codecs.utf_16_le_decode(input, errors, True)
class IncrementalEncod... |
romain-dartigues/ansible | refs/heads/devel | test/units/modules/network/ovs/test_openvswitch_port.py | 68 | #
# (c) 2016 Red Hat Inc.
#
# 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 d... |
sjfloat/youtube-dl | refs/heads/master | devscripts/gh-pages/update-feed.py | 159 | #!/usr/bin/env python3
from __future__ import unicode_literals
import datetime
import io
import json
import textwrap
atom_template = textwrap.dedent("""\
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<link rel="self" href="http://rg3.github.io/youtube-dl/update/rel... |
xubayer786/namebench | refs/heads/master | nb_third_party/dns/name.py | 228 | # Copyright (C) 2001-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 ... |
dinhkhanh/trac | refs/heads/master | sample-plugins/workflow/MilestoneOperation.py | 2 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012 Franz Mayer <franz.mayer@gefasoft.de>
#
# "THE BEER-WARE LICENSE" (Revision 42):
# <franz.mayer@gefasoft.de> wrote this file. As long as you retain this
# notice you can do whatever you want with this stuff. If we meet some day,
# and you think this stuff is worth it, y... |
endlessm/chromium-browser | refs/heads/master | third_party/catapult/dashboard/dashboard/pinpoint/models/change/change.py | 1 | # Copyright 2016 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.
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import collections
try:
from itertools impor... |
imply/chuu | refs/heads/master | chrome/common/extensions/docs/server2/fake_url_fetcher.py | 31 | # 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
from future import Future
class _Response(object):
def __init__(self):
self.content = ''
self.headers = { 'content-type': 'none' }
... |
ice3/track_a_parcel | refs/heads/reboot | db_create.py | 1 | #!/usr/bin/env python
"""Script to create the database."""
import os.path
from migrate.versioning import api
from config import SQLALCHEMY_DATABASE_URI
from config import SQLALCHEMY_MIGRATE_REPO
from app import db, app
with app.app_context():
db.create_all()
if not os.path.exists(SQLALCHEMY_MIGRATE_REPO):
... |
noemis-fr/old-custom | refs/heads/7.0 | l10n_fr_siret/company.py | 11 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 Numérigraphe SARL.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General ... |
vaygr/ansible | refs/heads/devel | lib/ansible/utils/module_docs_fragments/docker.py | 6 | # 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 in the hope that ... |
Tagar/incubator-airflow | refs/heads/master | airflow/contrib/operators/bigquery_table_delete_operator.py | 3 | # -*- coding: utf-8 -*-
#
# 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
#... |
Pluto-tv/chromium-crosswalk | refs/heads/master | tools/telemetry/third_party/webpagereplay/third_party/dns/tsigkeyring.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 ... |
alkyl1978/gnuradio | refs/heads/master | docs/sphinx/hieroglyph/__init__.py | 72 | # We only need to expose the setup function to Sphinx
from .hieroglyph import setup
from .version import __version__
__author__ = 'Robert Smallshire' |
CeltonMcGrath/TACTIC | refs/heads/master | src/pyasm/widget/statistic_wdg.py | 6 | ###########################################################
#
# Copyright (c) 2005, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without written permi... |
yselkowitz/pluma-plugins | refs/heads/master | plugins/commander/modules/format.py | 2 | import commander.commands as commands
__commander_module__ = True
def remove_trailing_spaces(view, all=False):
"""Remove trailing spaces: format.remove-trailing-spaces [<all>]
Remove trailing spaces in the selection. If there is no selection, trailing
spaces are removed from the whole document. When the optio... |
GunoH/intellij-community | refs/heads/master | python/testData/refactoring/pushdown/simple.after.py | 79 | class Foo:
pass
class Boo(Foo):
def boo(self):
print "rrrrr"
def foo(self):
print("a") |
angr/angr | refs/heads/master | angr/procedures/libc/memcmp.py | 2 | import angr
import logging
l = logging.getLogger(name=__name__)
class memcmp(angr.SimProcedure):
#pylint:disable=arguments-differ
def run(self, s1_addr, s2_addr, n):
max_memcmp_size = self.state.libc.max_buffer_size
definite_size = self.state.solver.min_int(n)
conditional_s1_start = ... |
oscar6echo/ezhc | refs/heads/master | ezhc/samples/build_samples.py | 2 |
import numpy as np
import pandas as pd
import json
def df_one_idx_several_col():
dic = {'John': [5, 3, 4, 7, 2],
'Jane': [2, 2, 3, 2, 1],
'Joe': [3, 4, 4, 2, 5]}
df = pd.DataFrame.from_dict(dic)
df.index = ['Apples', 'Oranges', 'Pears', 'Grapes', 'Bananas']
df.index.name = 'F... |
Tangcuyu/perfectinfo | refs/heads/master | lib/socksd/node_modules/node-gyp/gyp/pylib/gyp/input.py | 713 | # 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.
from compiler.ast import Const
from compiler.ast import Dict
from compiler.ast import Discard
from compiler.ast import List
from compiler.ast import Module
from co... |
willingc/oh-mainline | refs/heads/master | vendor/packages/scrapy/scrapy/contrib/downloadermiddleware/httpcache.py | 16 | from __future__ import with_statement
import os
from os.path import join, exists
from time import time
import cPickle as pickle
from w3lib.http import headers_dict_to_raw, headers_raw_to_dict
from scrapy.xlib.pydispatch import dispatcher
from scrapy import signals
from scrapy.http import Headers
from scrapy.exceptio... |
nep0muck/cavita-bremen | refs/heads/master | node_modules/node-gyp/gyp/pylib/gyp/MSVSToolFile.py | 2736 | # 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.
"""Visual Studio project reader/writer."""
import gyp.common
import gyp.easy_xml as easy_xml
class Writer(object):
"""Visual Studio XML tool file writer."""
... |
litchfield/django | refs/heads/master | django/conf/locale/sk/formats.py | 504 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. F Y'
TIME_FORMAT = 'G:i'
DATET... |
PoundPay/wtforms | refs/heads/master | tests/ext_appengine/tests.py | 3 | #!/usr/bin/env python
"""
Unittests for wtforms.ext.appengine
To run the tests, use NoseGAE:
easy_install nose
easy_install nosegae
nosetests --with-gae --without-sandbox
"""
import sys, os
WTFORMS_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..'))
sys.path.insert(0, WTFORMS_DIR)
from unitte... |
d-grossman/magichour | refs/heads/master | magichour/validate/templategen.py | 2 | import collections
import distance
import itertools
import numpy as np
import random
from magichour.api.local.util.log import get_logger
from collections import defaultdict
logger = get_logger(__name__)
def sample(objs, ratio, seed=None):
if seed:
random.seed(seed)
return random.sample(objs, max(1, ... |
wenxer/peewee | refs/heads/master | playhouse/tests/test_migrate.py | 12 | import datetime
import os
from peewee import *
from peewee import print_
from playhouse.migrate import *
from playhouse.test_utils import count_queries
from playhouse.tests.base import database_initializer
from playhouse.tests.base import PeeweeTestCase
from playhouse.tests.base import skip_if
try:
from psycopg2c... |
klebercode/canaa | refs/heads/master | canaa/catalog/views.py | 1 | # coding: utf-8
from django.shortcuts import render
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.db.models import Q
from django.template import RequestContext
from django.utils import translation
from slim.helpers import get_language_from_request
from canaa.context_processors i... |
SatelliteQE/automation-tools | refs/heads/master | automation_tools/bz.py | 9 | # -*- encoding: utf-8 -*-
"""
Collection of functions to work with Bugzilla and Redmine.
copied from robottelo's robotello/decorators/__init__.py
"""
import bugzilla
import logging
import requests
from six.moves.xmlrpc_client import Fault
from xml.parsers.expat import ExpatError, ErrorString
BZ_OPEN_STATUSES = [
... |
SeanHeuer/Rachael | refs/heads/master | bots/rachael.py | 2 | import re
import bot
class Rachael(bot.bot):
hello = re.compile(r'^Hello.*')
test = re.compile(r'^Test.*')
test2 = re.compile(r'^Hi.*')
def parse(self, sender, channel, message):
print "Sender: " + sender
print "Message: " + message
if self.hello.search(message) is not None:
... |
dostavro/dotfiles | refs/heads/master | sublime2/Packages/SublimeCodeIntel/libs/zope/cachedescriptors/__init__.py | 9480 | #
|
jtrag/namebench | refs/heads/master | libnamebench/addr_util.py | 173 | # Copyright 2009 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 ... |
NatTuck/teg | refs/heads/master | python/client/tegclient.py | 2 | ## $Id: tegclient.py,v 1.6 2003/09/14 04:31:39 riq Exp $
##
## Tenes Empanadas Graciela
##
## Copyright (C) 2000,2003 Ricardo Quesada
##
## Author: Ricardo Calixto Quesada <riq@coresecurity.com>
# python modules
import pygame
# teg modules
import gui
from gui import twidget_manager
from gui import ttest
import theme... |
zhukaixy/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/test/test_faulthandler.py | 60 | from contextlib import contextmanager
import datetime
import faulthandler
import os
import re
import signal
import subprocess
import sys
from test import support, script_helper
from test.script_helper import assert_python_ok
import tempfile
import unittest
from textwrap import dedent
try:
import threading
HAVE... |
Tomtomgo/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/BuildSlaveSupport/build.webkit.org-config/htdigestparser_unittest.py | 117 | # Copyright (C) 2011 Apple 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:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... |
undoware/neutron-drive | refs/heads/master | google_appengine/lib/django_1_3/django/contrib/webdesign/__init__.py | 12133432 | |
eduNEXT/edx-platform | refs/heads/master | openedx/core/lib/x_forwarded_for/__init__.py | 12133432 | |
gannetson/django | refs/heads/master | tests/gis_tests/geoapp/__init__.py | 12133432 | |
emijrp/pywikibot-core | refs/heads/master | pywikibot/families/battlestarwiki_family.py | 5 | # -*- coding: utf-8 -*-
"""Family module for Battlestar Wiki."""
from __future__ import unicode_literals
__version__ = '$Id$'
from pywikibot import family
# The Battlestar Wiki family, a set of Battlestar wikis.
# http://battlestarwiki.org/
class Family(family.Family):
"""Family class for Battlestar Wiki."""
... |
handroissuazo/tensorflow | refs/heads/master | tensorflow/contrib/tfprof/python/tools/tfprof/model_analyzer_test.py | 7 | # 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... |
lepistone/odoo | refs/heads/master | addons/analytic_user_function/__openerp__.py | 119 | # -*- 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... |
yojota/volatility | refs/heads/master | volatility/plugins/linux/vma_cache.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... |
derDavidT/sympy | refs/heads/master | sympy/matrices/expressions/determinant.py | 92 | from __future__ import print_function, division
from sympy import Basic, Expr, S, sympify
from .matexpr import ShapeError
class Determinant(Expr):
"""Matrix Determinant
Represents the determinant of a matrix expression.
>>> from sympy import MatrixSymbol, Determinant, eye
>>> A = MatrixSymbol('A', ... |
wwj718/murp-edx | refs/heads/master | common/djangoapps/external_auth/djangostore.py | 224 | """A openid store using django cache"""
from openid.store.interface import OpenIDStore
from openid.store import nonce
from django.core.cache import cache
import logging
import time
DEFAULT_ASSOCIATIONS_TIMEOUT = 60
DEFAULT_NONCE_TIMEOUT = 600
ASSOCIATIONS_KEY_PREFIX = 'openid.provider.associations.'
NONCE_KEY_PREF... |
zahodi/ansible | refs/heads/devel | lib/ansible/modules/cloud/ovirt/ovirt_datacenters.py | 18 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, Inc.
#
# 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
#... |
wilsonmar/md-to-toc | refs/heads/master | md-to-toc.py | 1 | # Author: Antonio Maiorano (amaiorano@gmail.com)
import os
import sys
import re
TOC_LIST_PREFIX = "-"
# TOC_LIST_PREFIX = "*"
HEADER_LINE_RE = re.compile("^(#+)\s*(.*?)\s*(#+$|$)", re.IGNORECASE)
# Dictionary of anchor name to number of instances found so far
anchors = {}
def print_usage():
print("\nUsage: md-to... |
Vvucinic/Wander | refs/heads/master | venv_2_7/lib/python2.7/site-packages/Django-1.9-py2.7.egg/django/contrib/gis/db/backends/spatialite/models.py | 510 | """
The GeometryColumns and SpatialRefSys models for the SpatiaLite backend.
"""
from django.contrib.gis.db.backends.base.models import SpatialRefSysMixin
from django.contrib.gis.db.backends.spatialite.base import DatabaseWrapper
from django.db import connection, models
from django.db.backends.signals import connectio... |
jamtot/DailyChallenge | refs/heads/master | hyperbinary (04mar2015)/hype.py | 1 | import re
def dec2bin(dec):
bn = ''
count,n=1,1
while n*2 < dec:
n*=2
count+=1
while n >= 1:
if dec/n > 0:
dec%=n
bn+='1'
else: bn+='0'
n/=2
return bn
# using 10 = 02 and 20 = 12
def dec2hyp(dec):
hyperbinarys = [dec2bin(dec)]
... |
danmcp/origin | refs/heads/master | vendor/github.com/google/certificate-transparency/python/ct/crypto/asn1/print_util.py | 35 | # Utilities for printing ASN.1 values
def bits_to_hex(bit_array, delimiter=":"):
"""Convert a bit array to a prettily formated hex string. If the array
length is not a multiple of 8, it is padded with 0-bits from the left.
For example, [1,0,0,1,1,0,1,0,0,1,0] becomes 04:d2.
Args:
bit_array: the... |
michelts/aloe_django | refs/heads/master | tests/integration/django/alfaces/__init__.py | 9480 | #
|
pombredanne/teamwork | refs/heads/master | w2/static/Brython2.0.0-20140209-164925/Lib/xml/dom/minicompat.py | 781 | """Python version compatibility support for minidom."""
# This module should only be imported using "import *".
#
# The following names are defined:
#
# NodeList -- lightest possible NodeList implementation
#
# EmptyNodeList -- lightest possible NodeList that is guaranteed to
# remain empty... |
valgur/numpyson | refs/heads/master | test_numpyson.py | 1 | import datetime as dt
from functools import partial
import inspect
from multiprocessing import Process, Queue
import pytest
import numpy as np
import pandas as pd
from pandas.util.testing import assert_index_equal, assert_series_equal, assert_frame_equal
from numpy.testing import assert_equal
assert_series_equal_stri... |
almeidapaulopt/erpnext | refs/heads/develop | erpnext/hr/doctype/training_program/__init__.py | 12133432 | |
bregydoc/detechAlgorithm | refs/heads/master | core/registrationOfImages.py | 1 | import argparse
from os import listdir
import registro1 as reg
import images_operations as ops
from PIL import Image
import cv2
parser = argparse.ArgumentParser()
parser.add_argument('-i', '--input', help='Input folder', required=True)
parser.add_argument('-o', '--output', help='output folder', required=True)
args = ... |
keedio/hue | refs/heads/master | desktop/core/ext-py/lxml/ez_setup.py | 358 | #!python
"""Bootstrap setuptools installation
If you want to use setuptools in your package's setup.py, just include this
file in the same directory with it, and add this to the top of your setup.py::
from ez_setup import use_setuptools
use_setuptools()
If you want to require a specific version of setuptools... |
ujjwalwahi/odoo | refs/heads/8.0 | addons/base_action_rule/tests/base_action_rule_test.py | 395 | from openerp import SUPERUSER_ID
from openerp.tests import common
from .. import test_models
class base_action_rule_test(common.TransactionCase):
def setUp(self):
"""*****setUp*****"""
super(base_action_rule_test, self).setUp()
cr, uid = self.cr, self.uid
self.demo = self.registry(... |
gamechanger/docker-py | refs/heads/master | docker/utils/__init__.py | 21 | from .utils import (
compare_version, convert_port_bindings, convert_volume_binds,
mkbuildcontext, tar, parse_repository_tag, parse_host,
kwargs_from_env, convert_filters, create_host_config,
create_container_config, parse_bytes, ping_registry
) # flake8: noqa
from .types import Ulimit, LogConfig # fla... |
dreamsxin/ubuntu-tweak | refs/heads/master | ubuntutweak/common/inifile.py | 5 | """
Base Class for DesktopEntry, IconTheme and IconData
"""
import os.path
import codecs
class IniFile:
filename = ''
def __init__(self, filename=None):
self.content = dict()
if filename:
self.parse(filename)
def parse(self, filename):
# for performance reasons
... |
JoeyDeRosa/TrollPy | refs/heads/master | trollpy/models/meta.py | 1 | """Meta."""
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.schema import MetaData
# Recommended naming convention used by Alembic, as various different database
# providers will autogenerate vastly different names making migrations more
# difficult. See: http://alembic.zzzcomputing.com/en/la... |
brain-tec/account-financial-reporting | refs/heads/8.0 | account_financial_report_webkit_xls/tests/test_trial_balance_xls.py | 3 | # -*- coding: utf-8 -*-
# Copyright 2009-2017 Noviat.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from .test_common_xls import TestCommonXls
class TestTrialBalanceXls(TestCommonXls):
def _getReportModel(self):
return 'trial.balance.webkit'
def _getXlsReportName(self):
ret... |
ComplexNetTSP/CooperativeNetworking | refs/heads/master | complex_systems/mobility/stabrnd.py | 1 | #-------------------------------------------------------------------------------
# Copyright (c) 2012 Vincent Gauthier.
#
# 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,... |
michaelgallacher/intellij-community | refs/heads/master | python/testData/copyPaste/SelectionOneLine.dst.py | 83 | class MyClass(object):
member1 = 1
<selection> member2 = 2
<caret></selection> member3 = 3 |
leuschel/logen | refs/heads/master | old_logen/pylogen/Pmw/Pmw_1_2/lib/PmwBalloon.py | 6 | import os
import string
import Tkinter
import Pmw
class Balloon(Pmw.MegaToplevel):
def __init__(self, parent = None, **kw):
# Define the megawidget options.
optiondefs = (
('initwait', 500, None), # milliseconds
('label_background', 'lightyellow', None... |
gojira/tensorflow | refs/heads/master | tensorflow/python/keras/datasets/boston_housing.py | 23 | # Copyright 2015 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... |
lukasjapan/bt-speaker | refs/heads/master | bt_manager/__init__.py | 1 | from distutils.version import StrictVersion
import cffi
import os
__version__ = '0.3.1'
if StrictVersion(cffi.__version__) < StrictVersion('0.7'):
raise RuntimeError(
'bt_manager requires cffi >= 0.7, but found %s' % cffi.__version__)
ffi = cffi.FFI()
cwd = os.path.dirname(__file__)
header_file =... |
spblightadv/rethinkdb | refs/heads/next | test/rql_test/connections/http_support/werkzeug/_compat.py | 448 | import sys
import operator
import functools
try:
import builtins
except ImportError:
import __builtin__ as builtins
PY2 = sys.version_info[0] == 2
_identity = lambda x: x
if PY2:
unichr = unichr
text_type = unicode
string_types = (str, unicode)
integer_types = (int, long)
int_to_byte = c... |
kxliugang/edx-platform | refs/heads/master | lms/djangoapps/teams/tests/__init__.py | 12133432 | |
benjamin-jones/pupy | refs/heads/master | pupy/packages/windows/x86/psutil/_pssunos.py | 80 | #!/usr/bin/env python
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Sun OS Solaris platform implementation."""
import errno
import os
import socket
import subprocess
import sys
from collections im... |
sl2017/campos | refs/heads/8.0 | campos_event/models/camp_area.py | 1 | # -*- coding: utf-8 -*-
from openerp import api, fields, models, _
from openerp.addons.base_geoengine import geo_model
from openerp.addons.base_geoengine import fields as geo_fields
import logging
_logger = logging.getLogger(__name__)
class CamposCampArea(geo_model.GeoModel):
_description = 'Camp Area'
_name... |
renzon/appengine-search-api-test | refs/heads/master | backend/apps/course_app/course_model.py | 1 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from google.appengine.ext import ndb
from gaegraph.model import Node
from gaeforms.ndb import property
class Course(Node):
name = ndb.StringProperty(required=True)
price = property.SimpleCurrency(required=True)
start_date = n... |
scotthartbti/android_external_chromium_org | refs/heads/kk44 | tools/telemetry/telemetry/core/extension_page.py | 23 | # 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.
from telemetry.core import web_contents
class ExtensionPage(web_contents.WebContents):
"""Represents a an extension page in the browser"""
def __init... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.