repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
mattvonrocketstein/smash | refs/heads/master | smashlib/ipy3x/parallel/engine/__main__.py | 9 | if __name__ == '__main__':
from IPython.parallel.apps import ipengineapp as app
app.launch_new_instance()
|
pandeyadarsh/sympy | refs/heads/master | sympy/stats/rv_interface.py | 88 | from __future__ import print_function, division
from .rv import (probability, expectation, density, where, given, pspace, cdf,
sample, sample_iter, random_symbols, independent, dependent,
sampling_density)
from sympy import sqrt
__all__ = ['P', 'E', 'density', 'where', 'given', 'sample', 'cdf', 'pspac... |
hmoco/osf.io | refs/heads/develop | tests/test_views.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Views tests for the OSF."""
from __future__ import absolute_import
import datetime as dt
import httplib as http
import json
import time
import pytz
import unittest
from flask import request
import mock
import pytest
from nose.tools import * # noqa PEP8 asserts
from d... |
kenshay/ImageScript | refs/heads/master | ProgramData/SystemFiles/Python/share/doc/networkx-2.2/examples/drawing/plot_knuth_miles.py | 4 | #!/usr/bin/env python
"""
===========
Knuth Miles
===========
`miles_graph()` returns an undirected graph over the 128 US cities from
the datafile `miles_dat.txt`. The cities each have location and population
data. The edges are labeled with the distance between the two cities.
This example is described in Section 1... |
pierluigiferrari/fcn8s_tensorflow | refs/heads/master | cityscapesscripts/helpers/__init__.py | 12133432 | |
nesdis/djongo | refs/heads/master | tests/django_tests/tests/v22/tests/swappable_models/__init__.py | 12133432 | |
michael-hartmann/snippets | refs/heads/master | euler/03.py | 1 | from math import sqrt
def isprime(n):
for m in range(2,int(sqrt(n))+1):
if n % m == 0:
return False
return True
if __name__ == "__main__":
factor = 600851475143
primes = []
for n in range(2,int(sqrt(factor))+1):
if (factor % n) == 0 and isprime(n):
primes.a... |
rajsadho/django | refs/heads/master | django/forms/models.py | 46 | """
Helper functions for creating Form classes from Django models
and database field objects.
"""
from __future__ import unicode_literals
from collections import OrderedDict
from itertools import chain
from django.core.exceptions import (
NON_FIELD_ERRORS, FieldError, ImproperlyConfigured, ValidationError,
)
fro... |
snehasi/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/pytest/testing/test_skipping.py | 165 | import pytest
import sys
from _pytest.skipping import MarkEvaluator, folded_skips, pytest_runtest_setup
from _pytest.runner import runtestprotocol
class TestEvaluator:
def test_no_marker(self, testdir):
item = testdir.getitem("def test_func(): pass")
evalskipif = MarkEvaluator(item, 'skipif')
... |
laperry1/android_external_chromium_org | refs/heads/cm-12.1 | tools/telemetry/telemetry/core/system_info.py | 58 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.core import gpu_info
class SystemInfo(object):
"""Provides low-level system information."""
def __init__(self, model_name, gpu_dict):
... |
ghdk/networkx | refs/heads/master | networkx/classes/tests/test_graph.py | 31 | #!/usr/bin/env python
from nose.tools import *
import networkx
class BaseGraphTester(object):
""" Tests for data-structure independent graph class features."""
def test_contains(self):
G=self.K3
assert(1 in G )
assert(4 not in G )
assert('b' not in G )
assert([] not in G... |
zfil/ansible-modules-core | refs/heads/devel | files/unarchive.py | 49 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2013, Dylan Martin <dmartin@seattlecentral.edu>
# (c) 2015, Toshio Kuratomi <tkuratomi@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the t... |
dcowden/cadquery-freecad-module | refs/heads/master | CadQuery/Libs/pyqode/core/modes/backspace.py | 7 | """
This module contains the smart backspace mode
"""
from pyqode.qt import QtCore, QtGui
from pyqode.core.api import Mode
class SmartBackSpaceMode(Mode):
""" Improves backspace behaviour.
When you press backspace and there are spaces on the left of the cursor,
those spaces will be deleted (at most tab_l... |
ClementLancien/convertToEntrezGeneID | refs/heads/master | script/conversion/trembl.py | 1 | # -*- coding: utf-8 -*-
"""
Created on Thu Aug 24 17:51:26 2017
@author: clancien
"""
try:
import ConfigParser
except ImportError:
import configparser as ConfigParser
import os
import logging
from logging.handlers import RotatingFileHandler
import sys
class TREMBL():
def __init__(self):
... |
wwbcoop/wwb.cc | refs/heads/master | apps/models/migrations/0004_remove_project_published_date.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-10-27 15:37
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('models', '0003_auto_20171027_1526'),
]
operations = [
migrations.RemoveField(
... |
dancingdan/tensorflow | refs/heads/master | tensorflow/contrib/distributions/python/kernel_tests/bijectors/weibull_test.py | 25 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
nooone/libgdx | refs/heads/master | extensions/gdx-freetype/jni/freetype-2.4.10/src/tools/docmaker/docmaker.py | 463 | #!/usr/bin/env python
#
# DocMaker (c) 2002, 2004, 2008 David Turner <david@freetype.org>
#
# This program is a re-write of the original DocMaker took used
# to generate the API Reference of the FreeType font engine
# by converting in-source comments into structured HTML.
#
# This new version is capable of outputting ... |
jkstrick/samba | refs/heads/master | source4/dsdb/tests/python/token_group.py | 26 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# test tokengroups attribute against internal token calculation
import optparse
import sys
import os
sys.path.insert(0, "bin/python")
import samba
from samba.tests.subunitrun import SubunitOptions, TestProgram
import samba.getopt as options
from samba.auth import syste... |
abhattad4/Digi-Menu | refs/heads/master | tests/mail/tests.py | 11 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import asyncore
import os
import shutil
import smtpd
import sys
import tempfile
import threading
from email.mime.text import MIMEText
from smtplib import SMTP, SMTPException
from ssl import SSLError
from django.core import mail
from django.core.mail impo... |
hcsturix74/django | refs/heads/master | tests/cache/liberal_backend.py | 446 | from django.core.cache.backends.locmem import LocMemCache
class LiberalKeyValidationMixin(object):
def validate_key(self, key):
pass
class CacheClass(LiberalKeyValidationMixin, LocMemCache):
pass
|
anthraxx/jenkins.debian.net | refs/heads/master | job-cfg/chroot-installation.yaml.py | 1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import os
from string import join
from yaml import load, dump
try:
from yaml import CLoader as Loader, CDumper as Dumper
except ImportError:
from yaml import Loader, Dumper
base_distros = [
'jessie',
'stretch',
'buster',
'sid',
]
distr... |
pculka/SkyDrop | refs/heads/master | skydrop/utils/etc/test.py | 5 | #!/usr/bin/python
file = open("TEST.CSV", "r")
lines = file.read().split("\n")
file.close()
def print_bites(val):
s = ""
for i in range(8):
if (val & 1 << (7-i)):
s += "1"
else:
s += "."
return s
def print_bites2(val):
s = ""
for i in range(8):
if (... |
sorenk/ansible | refs/heads/devel | lib/ansible/modules/network/avi/avi_virtualservice.py | 23 | #!/usr/bin/python
#
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
# Avi Version: 17.1.1
#
# Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses... |
rouge8/regex2dfa | refs/heads/master | regex2dfa_build.py | 3 | from os.path import abspath, dirname, join
from cffi import FFI
regex2dfa_header = abspath(join(dirname(__file__), 'src', 'regex2dfa.h'))
ffi = FFI()
ffi.cdef(
"""
const char * cffi_regex2dfa(char *regex, uint32_t len);
void free(void *ptr);
"""
)
ffi.set_source(
'_regex2dfa',
"""
#inc... |
deathslocus/jor1k-sysroot | refs/heads/master | fs/usr/lib/python2.7/UserDict.py | 358 | """A more or less complete user-defined wrapper around dictionary objects."""
class UserDict:
def __init__(self, dict=None, **kwargs):
self.data = {}
if dict is not None:
self.update(dict)
if len(kwargs):
self.update(kwargs)
def __repr__(self): return repr(self.d... |
pqftgs/bge-netplay | refs/heads/master | netplay/builtin_tables.py | 1 | from . import packer
def define():
tabledef = packer.TableDef('_permission')
tabledef.define('uint16', 'id')
tabledef.define('uint8', 'state')
tabledef = packer.TableDef('_destroy')
tabledef.define('uint16', 'id')
tabledef = packer.TableDef('_GameObject')
tabledef.define('uint16', 'id')
... |
unnikrishnankgs/va | refs/heads/master | venv/lib/python3.5/site-packages/IPython/utils/ulinecache.py | 5 | """
This module has been deprecated since IPython 6.0.
Wrapper around linecache which decodes files to unicode according to PEP 263.
"""
import functools
import linecache
from warnings import warn
getline = linecache.getline
# getlines has to be looked up at runtime, because doctests monkeypatch it.
@functools.wraps... |
Alberto-Beralix/Beralix | refs/heads/master | i386-squashfs-root/usr/lib/python2.7/dist-packages/aptdaemon/client.py | 1 | ../../../../share/pyshared/aptdaemon/client.py |
jburger424/MediaQueueHCI | refs/heads/dev | m-q-env/lib/python3.4/site-packages/setuptools/command/build_py.py | 207 | import os
import sys
import fnmatch
import textwrap
from distutils.command.build_py import build_py as _build_py
from distutils.util import convert_path
from glob import glob
try:
from setuptools.lib2to3_ex import Mixin2to3
except ImportError:
class Mixin2to3:
def run_2to3(self, files, doctests=True):
... |
denzow/ipymessenger | refs/heads/master | ipymessenger/consts.py | 1 | # -*- coding: utf-8 -*-
# coding:utf-8
# status
STAT_TABLE = range(4)
(STAT_ON, STAT_AFK, STAT_INVISIBLE, STAT_OFF) = STAT_TABLE
STAT_NAME = { STAT_ON : 'online', \
STAT_AFK : 'afk', \
STAT_INVISIBLE : 'invisible', \
STAT_OFF : 'offline', }
# misc
TCP_D... |
fergalmoran/Chrome2Kindle | refs/heads/master | server/model/Hits.py | 1 | from google.appengine.ext import db
class SiteStats(db.Model):
source = db.StringProperty(required = True)
action = db.StringProperty(required = True)
headers = db.StringProperty(required = True)
timestamp = db.DateTimeProperty(auto_now_add = True)
|
dzbarsky/servo | refs/heads/master | tests/wpt/web-platform-tests/webdriver/navigation/get_from_http_test.py | 142 | import os
import sys
import unittest
sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../..")))
import base_test
class GetFromHttpTest(base_test.WebDriverBaseTest):
def testGetUrlWithNoRedirectionOverHttp(self):
page = self.webserver.where_is('navigation/res/empty.html')
self.driver.get... |
cs591B1-Project/Social-Media-Impact-on-Stock-Market-and-Price | refs/heads/master | data/22 starbucks/sbGrapher.py | 14 | from ast import literal_eval
import matplotlib.pyplot as plt
p = [line.rstrip('\n') for line in open("positive.txt")]
n = [line.rstrip('\n') for line in open("negative.txt")]
a = [line.rstrip('\n') for line in open("all.txt")]
# stock closing prices from Nov 3 to Dec 3 (weedends/holidays given same price as ... |
pbrunet/pythran | refs/heads/master | pythran/analyses/is_assigned.py | 4 | """ Gathers variables that have value modification in the given node. """
from pythran.passmanager import NodeAnalysis
from collections import defaultdict
import ast
class IsAssigned(NodeAnalysis):
"""
Gather variable that change in given node.
It doesn't check constness as it is use for integer so we... |
Matt-Stammers/Python-Foundations | refs/heads/master | Simple Functions/Number_List_Power.py | 1 |
def powers_of_two(n):
result_list = []
i = 0
for i in range(n+1):
result = 2**i
result_list.append(result)
i+=1
return result_list
# or a much nicer way to do it:
def powers_of_two(n):
return [2**x for x in range(n+1)]
# powers of two:
def powers_of_two(n):
... |
fae92/TSML | refs/heads/master | __init__.py | 3 | __author__ = 'tianqilei'
|
pignacio/pignacio_scripts | refs/heads/develop | pignacio_scripts/pylint_extra/transforms/__init__.py | 12133432 | |
gkawamoto/yowsup | refs/heads/master | yowsup/layers/protocol_ib/protocolentities/clean_iq.py | 70 | from yowsup.structs import ProtocolEntity, ProtocolTreeNode
from yowsup.layers.protocol_iq.protocolentities import IqProtocolEntity
class CleanIqProtocolEntity(IqProtocolEntity):
'''
<iq id="" type="set" to="self.domain" xmlns="urn:xmpp:whatsapp:dirty">
<clean type="{{dirty_type}}"></clean>
</iq>
... |
Kamik423/uni_plan | refs/heads/master | plan/plan/lib/python3.4/site-packages/pip/_vendor/cachecontrol/filewrapper.py | 346 | from io import BytesIO
class CallbackFileWrapper(object):
"""
Small wrapper around a fp object which will tee everything read into a
buffer, and when that file is closed it will execute a callback with the
contents of that buffer.
All attributes are proxied to the underlying file object.
Thi... |
txm/make-good | refs/heads/master | django/contrib/localflavor/it/it_province.py | 406 | # -*- coding: utf-8 -*
PROVINCE_CHOICES = (
('AG', 'Agrigento'),
('AL', 'Alessandria'),
('AN', 'Ancona'),
('AO', 'Aosta'),
('AR', 'Arezzo'),
('AP', 'Ascoli Piceno'),
('AT', 'Asti'),
('AV', 'Avellino'),
('BA', 'Bari'),
('BT', 'Barletta-Andria-Trani'), # active starting from 2009
... |
lundjordan/releasewarrior-2.0 | refs/heads/master | releasewarrior/test/test_helpers.py | 1 | import pytest
from releasewarrior.helpers import validate_graphid
@pytest.mark.parametrize("graphid,expected", [
('UZ1SzyoKQuCQWNw5DD3Wew', True),
('H8sEEXySSqSQdAcbaM8VjA', True),
('', False), # Empty
('H8sEEXySSqS$dAcbaM8VjA', False), # Invalid characters
('H8sEEXySSqSQdAcbaM8Vj', False), # ... |
NelleV/pyconfr-test | refs/heads/master | symposion/cms/models.py | 7 | import datetime
import os
import re
from django.conf import settings
from django.core.urlresolvers import reverse
from django.core.exceptions import ValidationError
from django.db import models
from django.utils.translation import ugettext_lazy as _
from markitup.fields import MarkupField
from taggit.managers import... |
drexly/tonginBlobStore | refs/heads/master | lib/django/core/cache/backends/locmem.py | 586 | "Thread-safe in-memory cache backend."
import time
from contextlib import contextmanager
from django.core.cache.backends.base import DEFAULT_TIMEOUT, BaseCache
from django.utils.synch import RWLock
try:
from django.utils.six.moves import cPickle as pickle
except ImportError:
import pickle
# Global in-memor... |
AyoubZahid/odoo | refs/heads/9.0 | addons/utm/models/__init__.py | 78 | # -*- coding: utf-8 -*-
import utm
import ir_http
|
piyush82/icclab-rcb-web | refs/heads/master | virtualenv/lib/python2.7/site-packages/django/conf/locale/vi/formats.py | 237 | # -*- 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 = r'\N\gà\y d \t\há\n\g n \nă\m Y'
T... |
MrSurly/micropython | refs/heads/master | tests/basics/int_big_xor2.py | 61 | # test + +
print( 97989513389222316022151446562729620153292831887555425160965597396
^ 23716683549865351578586448630079789776107310103486834795830390982)
print( 53817081128841898634258263553430908085326601592682411889506742059
^ 37042558948907407488299113387826240429667200950043601129661240876)
print( 2616... |
oinopion/django | refs/heads/master | django/contrib/staticfiles/utils.py | 248 | import fnmatch
import os
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
def matches_patterns(path, patterns=None):
"""
Return True or False depending on whether the ``path`` should be
ignored (if it matches any pattern in ``ignore_patterns``).
"""
if patt... |
vladikr/nova_drafts | refs/heads/master | nova/api/metadata/__init__.py | 116 | # Copyright 2011 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... |
vipulroxx/sympy | refs/heads/master | sympy/functions/special/tests/test_bsplines.py | 83 | from sympy.functions import bspline_basis_set
from sympy.core.compatibility import range
from sympy import Piecewise, Interval
from sympy import symbols, Rational
x, y = symbols('x,y')
def test_basic_degree_0():
d = 0
knots = range(5)
splines = bspline_basis_set(d, knots, x)
for i in range(len(spline... |
jiahaoliang/group-based-policy | refs/heads/lbaasv2-mitaka-pull-request | gbpservice/tests/contrib/nfp_service/reference_configurator/api/config.py | 2 | # 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, software
# d... |
shantanugoel/email-actions | refs/heads/master | email_actions/plugins/email.py | 1 | import logging
from smtplib import SMTP, SMTPHeloError, SMTPAuthenticationError, \
SMTPNotSupportedError, SMTPException, SMTPRecipientsRefused,\
SMTPSenderRefused, SMTPDataError
from email_actions.config import read_config_plugin
PLUGIN_NAME = 'email'
def email_notify(filter_name, msg_from, msg_to, msg_subject... |
lyndsysimon/pywik | refs/heads/primary | tests/__init__.py | 1 | import json
import unittest
import responses
class PywikTestCase(unittest.TestCase):
def add_fake_response(self, module, method, value, http_method='get', status=200):
responses.add(
getattr(responses, http_method.upper()),
'http://example.test/?'
'module={module}... |
pa-siirja/shopcode | refs/heads/master | shopcode/core/tests.py | 24123 | from django.test import TestCase
# Create your tests here.
|
chris-wood/SCoNet | refs/heads/master | ns-3-dev/doc/tutorial-pt-br/pickle-to-xml.py | 392 | #!/usr/bin/python
# output xml format:
# <pages>
# <page url="xx"><prev url="yyy">zzz</prev><next url="hhh">lll</next><fragment>file.frag</fragment></page>
# ...
# </pages>
import pickle
import os
import codecs
def dump_pickles(out, dirname, filename, path):
f = open(os.path.join(dirname, filename), 'r')
da... |
flomotlik/formica | refs/heads/master | formica/stack_waiter.py | 1 | import sys
import time
from datetime import datetime
import boto3
import logging
from texttable import Texttable
EVENT_TABLE_HEADERS = ["Timestamp", "Status", "Type", "Logical ID", "Status reason"]
TABLE_COLUMN_SIZE = [28, 24, 30, 30, 50]
SUCCESSFUL_STATES = ["CREATE_COMPLETE", "UPDATE_COMPLETE", "DELETE_COMPLETE"]... |
cherez/youtube-dl | refs/heads/master | youtube_dl/extractor/orf.py | 111 | # coding: utf-8
from __future__ import unicode_literals
import json
import re
import calendar
import datetime
from .common import InfoExtractor
from ..utils import (
HEADRequest,
unified_strdate,
ExtractorError,
strip_jsonp,
int_or_none,
float_or_none,
determine_ext,
remove_end,
)
cl... |
adlius/osf.io | refs/heads/develop | osf_tests/conftest.py | 6 | import pytest
from framework.celery_tasks.handlers import handlers as celery_handlers
from framework.django.handlers import handlers as django_handlers
from framework.flask import rm_handlers
from website.app import init_app
from website.project.signals import contributor_added
from website.project.views.contributor i... |
ukanga/SickRage | refs/heads/master | lib/twilio/rest/resources/trunking/trunks.py | 24 | from .. import NextGenInstanceResource, NextGenListResource
class Trunk(NextGenInstanceResource):
"""
A Trunk resource.
See the `TaskRouter API reference
<https://www.twilio.com/docs/sip-trunking/rest/trunks>_`
for more information.
.. attribute:: sid
The unique ID for this Trunk.
... |
wilvk/ansible | refs/heads/devel | lib/ansible/modules/network/eos/eos_eapi.py | 10 | #!/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... |
jfburkhart/shyft | refs/heads/master | shyft/tests/test_concat_data_repository.py | 1 | from __future__ import print_function
import unittest
from os import path
from shyft import shyftdata_dir
from shyft import api
from shyft.repository.netcdf.concat_data_repository import ConcatDataRepository
#from shyft.repository.netcdf.concant_data_repository import ConcatDataRepositoryError
from shapely.geometry im... |
DiamondLightSource/auto_tomo_calibration-experimental | refs/heads/master | measure_resolution/find_resolution.py | 1 | import numpy as np
import pylab as pl
from scipy.ndimage.filters import median_filter
from skimage.filter import threshold_otsu
from skimage import io, exposure
import os
import fit_data
from scipy import misc
from math import ceil
def save_data(filename, data):
import cPickle
print("Saving data")
f = ope... |
suncycheng/intellij-community | refs/heads/master | python/testData/completion/heavyStarPropagation/lib/_pkg0/_pkg0_1/_pkg0_1_1/_pkg0_1_1_0/_pkg0_1_1_0_0/_mod0_1_1_0_0_1.py | 30 | name0_1_1_0_0_1_0 = None
name0_1_1_0_0_1_1 = None
name0_1_1_0_0_1_2 = None
name0_1_1_0_0_1_3 = None
name0_1_1_0_0_1_4 = None |
kidmaple/CoolWall | refs/heads/nios2 | user/python/Tools/i18n/pygettext.py | 3 | #! /usr/bin/env python
# Originally written by Barry Warsaw <bwarsaw@python.org>
#
# minimally patched to make it even more xgettext compatible
# by Peter Funk <pf@artcom-gmbh.de>
# for selftesting
try:
import fintl
_ = fintl.gettext
except ImportError:
def _(s): return s
__doc__ = _("""pygettext -- Pyt... |
santazhang/simple-rpc | refs/heads/master | pylib/simplerpc/server.py | 1 | import traceback
from simplerpc import _pyrpc
from simplerpc.marshal import Marshal
class MarshalWrap(object):
def __init__(self, f, input_types, output_types):
# f input: input_marshal (id only), f output: output_marshal (id only)
self.f = f
self.input_types = input_types
self.out... |
myRisk/dynamicDNA | refs/heads/master | setuptools-15.2/setuptools/tests/test_build_ext.py | 151 | import distutils.command.build_ext as orig
from setuptools.command.build_ext import build_ext
from setuptools.dist import Distribution
class TestBuildExt:
def test_get_ext_filename(self):
"""
Setuptools needs to give back the same
result as distutils, even if the fullname
is not in... |
conan-io/conan | refs/heads/develop | conans/test/integration/conan_v2/conanfile/test_package_method.py | 1 | import textwrap
from conans.test.utils.conan_v2_tests import ConanV2ModeTestCase
class ConanfileSourceTestCase(ConanV2ModeTestCase):
""" Conan v2: 'self.info' is not available in 'package()' """
def test_info_not_in_package(self):
# self.info is not available in 'package'
t = self.get_client... |
Dandandan/wikiprogramming | refs/heads/master | jsrepl/build/extern/python/closured/lib/python2.7/encodings/iso8859_10.py | 593 | """ Python Character Mapping Codec iso8859_10 generated from 'MAPPINGS/ISO8859/8859-10.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input,errors... |
silviuapostu/project-euler-solutions | refs/heads/master | 25.py | 1 | # first Fibonacci number with n digits. Don't waste memory by storing the whole
# Fibonacci sequence, but only the last two members since we're only testing
# their sum
def n_digit_fibo(n=1000):
last_fibs = [1, 1, 2]
ix = 3 # index of Fibo number we're about to test
while last_fibs[-1] / 10**(n-1) <... |
yogiben/Sublime-AdvancedNewFile | refs/heads/master | advanced_new_file/commands/helper_commands.py | 4 | import sublime
import sublime_plugin
class AnfReplaceCommand(sublime_plugin.TextCommand):
def run(self, edit, content):
self.view.replace(edit, sublime.Region(0, self.view.size()), content)
class AdvancedNewFileCommand(sublime_plugin.WindowCommand):
def run(self, is_python=False, initial_path=None,
... |
theju/f1oracle | refs/heads/master | race/context_processors.py | 1 | from .models import Driver, Constructor, Race, \
OverallDriverPredictionHistory, OverallConstructorPredictionHistory, \
OverallDriverPrediction, OverallConstructorPrediction, \
RaceDriverPrediction, RaceConstructorPrediction
import datetime
def race_context_processor(request):
if not request.user.is_au... |
MarvinBertin/Theano-Lights | refs/heads/master | models/draw_at_lstm1.py | 6 | import theano
import theano.tensor as T
from theano.sandbox.rng_mrg import MRG_RandomStreams
from theano.tensor.nnet.conv import conv2d
from theano.tensor.signal.downsample import max_pool_2d
from theano.tensor.shared_randomstreams import RandomStreams
import numpy as np
import scipy.io
import time
import sys
import l... |
melaniebeck/GZExpress | refs/heads/master | analysis/GZX_paper_figures.py | 1 | #!/usr/bin/env python -W ignore::DeprecationWarning
from __future__ import division
from simulation import Simulation
from astropy.table import Table, join, vstack
from argparse import ArgumentParser
import numpy as np
import pdb, sys
from datetime import *
import cPickle, glob
import swap
from GZX_SWAP_evaluation ... |
wtanaka/beam | refs/heads/master | sdks/python/apache_beam/io/gcp/internal/clients/bigquery/__init__.py | 25 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
mdaniel/intellij-community | refs/heads/master | python/testData/folding/collapseExpandDocCommentsTokenType.py | 11 | class Class:
"""Class doc
string"""
def __init__(self):
"""Docstring in init method
Addition information
"""
pass
def params(a, v):
"""
:param a:
:param v:
"""
pass
def empty():
"""this is doc string
this is the second line of it
"""
... |
leiferikb/bitpop | refs/heads/master | src/tools/cr/cr/actions/gdb.py | 103 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import cr
class GdbDebugger(cr.Debugger):
"""An implementation of cr.Debugger that launches gdb."""
DETECTED = cr.Config('DETECTED')
@pr... |
uranusjr/django | refs/heads/master | django/db/backends/base/__init__.py | 12133432 | |
obi1kenobi/pyre | refs/heads/master | RemoteControlCollection/__init__.py | 12133432 | |
mattmccarthy11/vidly-development | refs/heads/master | mediadrop/bk/templates/__init__.py | 12133432 | |
caphrim007/ansible-modules-extras | refs/heads/devel | packaging/os/layman.py | 61 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Jakub Jirutka <jakub@jirutka.cz>
#
# 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... |
peacekeeper/indy-sdk | refs/heads/master | wrappers/python/tests/pool/test_open_pool_ledger.py | 2 | import pytest
from indy import pool, error
@pytest.mark.parametrize(
"pool_genesis_txn_count, pool_config",
[(2, None), (3, None), (4, None), (4, '{"timeout": 20}')])
@pytest.mark.asyncio
async def test_open_pool_ledger_works(pool_handle):
pass
@pytest.mark.asyncio
async def test_open_pool_ledger_works... |
BJDev95/ardupilot | refs/heads/master | mk/PX4/Tools/genmsg/test/test_genmsg_command_line.py | 216 | # Software License Agreement (BSD License)
#
# Copyright (c) 2011, Willow Garage, 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... |
Hipo/django-sloop | refs/heads/master | test_app/urls.py | 1 | """test_app URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-b... |
vitan/django | refs/heads/master | django/contrib/auth/forms.py | 3 | from __future__ import unicode_literals
from django import forms
from django.contrib.auth import authenticate, get_user_model
from django.contrib.auth.hashers import (
UNUSABLE_PASSWORD_PREFIX, identify_hasher,
)
from django.contrib.auth.models import User
from django.contrib.auth.tokens import default_token_gener... |
jjs0sbw/CSPLN | refs/heads/master | apps/scaffolding/win/web2py/gluon/streamer.py | 15 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
| This file is part of the web2py Web Framework
| Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu>
| License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
Facilities to handle file streaming
------------------------------------
"""
import os
import stat
i... |
epheo/shaddock | refs/heads/master | setup.py | 1 | #!/usr/bin/env python
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
#
# 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
#
# Unle... |
javierTerry/odoo | refs/heads/8.0 | addons/website_mail_group/models/mail_group.py | 321 | # -*- coding: utf-8 -*-
from openerp.osv import osv
from openerp import tools
from openerp.tools.translate import _
from openerp.tools.safe_eval import safe_eval as eval
from openerp.addons.website.models.website import slug
class MailGroup(osv.Model):
_inherit = 'mail.group'
def message_get_email_values(sel... |
arpheno/django-rest-framework | refs/heads/master | rest_framework/serializers.py | 30 | """
Serializers and ModelSerializers are similar to Forms and ModelForms.
Unlike forms, they are not constrained to dealing with HTML output, and
form encoded input.
Serialization in REST framework is a two-phase process:
1. Serializers marshal between complex types like model instances, and
python primitives.
2. The... |
unicef/un-partner-portal | refs/heads/develop | backend/unpp_api/apps/partner/migrations/0034_auto_20171114_0917.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-11-14 09:17
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('partner', '0033_partnerotherinfo_org_logo_thumbnail'),
]
operations = [
mig... |
bright-sparks/chromium-spacewalk | refs/heads/master | tools/idl_parser/idl_node.py | 125 | #!/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 sys
#
# IDL Node
#
# IDL Node defines the IDLAttribute and IDLNode objects which are constructed
# by the parser as it proc... |
draperjames/bokeh | refs/heads/master | bokeh/sampledata/autompg.py | 13 | """
"""
from __future__ import absolute_import
from bokeh.util.dependencies import import_required
pd = import_required('pandas',
'autompg sample data requires Pandas (http://pandas.pydata.org) to be installed')
from os.path import dirname, join
autompg = pd.read_csv(join(dirname(__file__), 'auto-mpg.... |
simshadows/discord-mentionbot | refs/heads/master | mentionbot/servermodules/dynamicchannels.py | 1 | import sys
import asyncio
import threading
from copy import deepcopy
import re
import traceback
import concurrent
import textwrap
import collections
import discord
from .. import utils, errors, cmd
from ..servermodule import ServerModule, registered
from ..enums import PrivilegeLevel
from ..attributedictwrapper impo... |
GRArmstrong/invenio-inspire-ops | refs/heads/prod | modules/bibdocfile/lib/bibdocfile_webinterface.py | 1 | ## This file is part of Invenio.
## Copyright (C) 2012, 2013 CERN.
##
## Invenio 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 option) any later version.
##
... |
kimimj/scrapy | refs/heads/master | scrapy/core/downloader/__init__.py | 85 | from __future__ import absolute_import
import random
import warnings
from time import time
from datetime import datetime
from collections import deque
import six
from twisted.internet import reactor, defer, task
from scrapy.utils.defer import mustbe_deferred
from scrapy.utils.httpobj import urlparse_cached
from scrap... |
bottompawn/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/test/test_plistlib.py | 78 | # Copyright (C) 2003-2013 Python Software Foundation
import unittest
import plistlib
import os
import datetime
import codecs
import binascii
import collections
import struct
from test import support
from io import BytesIO
ALL_FORMATS=(plistlib.FMT_XML, plistlib.FMT_BINARY)
# The testdata is generated using Mac/Tools... |
cloudera/hue | refs/heads/master | apps/spark/setup.py | 31 | # Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file ex... |
johncollins/metric-learn | refs/heads/master | examples/wine_comparison.py | 1 | import numpy as np
import os
# Read the csv file wherein the class is the first column and transform to data
# Everything is numeric so we can just use a numpy array right off the bat
data = np.genfromtxt(os.path.join('data', 'wine', 'wine.csv'), skip_header=True, delimiter=',')
y, X = data[:,0], data[:,1:]
#X = (X - ... |
BeATz-UnKNoWN/python-for-android | refs/heads/master | python3-alpha/python3-src/Doc/includes/mp_newtype.py | 48 | #
# This module shows how to use arbitrary callables with a subclass of
# `BaseManager`.
#
# Copyright (c) 2006-2008, R Oudkerk
# All rights reserved.
#
from multiprocessing import freeze_support
from multiprocessing.managers import BaseManager, BaseProxy
import operator
##
class Foo:
def f(self):
print(... |
entropy1337/infernal-twin | refs/heads/master | Modules/build/pip/build/lib.linux-i686-2.7/pip/_vendor/progress/__init__.py | 916 | # Copyright (c) 2012 Giorgos Verigakis <verigak@gmail.com>
#
# Permission to use, copy, modify, and distribute this software 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 "AS IS" AND THE A... |
cyberden/CouchPotatoServer | refs/heads/develop | libs/rsa/_version133.py | 177 | """RSA module
pri = k[1] //Private part of keys d,p,q
Module for calculating large primes, and RSA encryption, decryption,
signing and verification. Includes generating public and private keys.
WARNING: this code implements the mathematics of RSA. It is not suitable for
real-world secur... |
vipulkanade/EventbriteDjango | refs/heads/master | lib/python2.7/encodings/iso2022_jp_2.py | 816 | #
# iso2022_jp_2.py: Python Unicode Codec for ISO2022_JP_2
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_iso2022, codecs
import _multibytecodec as mbc
codec = _codecs_iso2022.getcodec('iso2022_jp_2')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class Incrementa... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.