repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
woobe/h2o | refs/heads/master | py/testdir_0xdata_only/mnist_to_csv.py | 22 |
# from http://g.sweyla.com/blog/2012/mnist-numpy/
import os, struct
from array import array as pyarray
import numpy
from numpy import append, array, int8, uint8, zeros
DO_REALS=False
DO_IMAGES=False
# gzip infile to gzfile
def file_gzip(infile, gzfile):
import gzip
print "\nGzip-ing", infile, "to", gzfile
... |
erwilan/ansible | refs/heads/devel | lib/ansible/modules/network/avi/avi_poolgroup.py | 50 | #!/usr/bin/python
#
# Created on Aug 25, 2016
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
# Avi Version: 17.1.1
#
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the te... |
xubenben/scikit-learn | refs/heads/master | sklearn/cluster/tests/test_affinity_propagation.py | 341 | """
Testing for Clustering methods
"""
import numpy as np
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_raises
from sklearn.cluster.affinity_propagation_ import AffinityPropagation
from sklearn.cluster.affinity_propagatio... |
bcho/porn-image-detect | refs/heads/master | detect.py | 1 | #coding: utf-8
from PIL import Image
SIZE = 150, 150
THRESHOLD = 0.5
def prepare_image(image):
if not image.mode == 'RGB':
image = image.convert(mode='RGB')
image.thumbnail(SIZE, Image.ANTIALIAS)
return image
def get_ycbcr(image):
ret = []
def rgb2ycbcr(r, g, b):
return (
... |
Zord13appdesa/python-for-android | refs/heads/master | python-modules/twisted/twisted/plugins/twisted_news.py | 54 | # Copyright (c) 2001-2008 Twisted Matrix Laboratories.
# See LICENSE for details.
from twisted.application.service import ServiceMaker
TwistedNews = ServiceMaker(
"Twisted News",
"twisted.news.tap",
"A news server.",
"news")
|
apache/qpid-proton | refs/heads/main | tools/python/mllib/__init__.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... |
kidscancode/gamedev | refs/heads/master | shmup/shmup-17.py | 1 | # Shmup - Part 17
# explosions
# by KidsCanCode 2015
# A space shmup in multiple parts
# For educational purposes only
# Art from Kenney.nl
# Frozen Jam by tgfcoder <https://twitter.com/tgfcoder> licensed under CC-BY-3
import pygame
import random
from os import path
sound_dir = path.join(path.dirname(__file__), 'sn... |
EDUlib/edx-platform | refs/heads/master | import_shims/lms/third_party_auth/saml_configuration/tests/__init__.py | 4 | """Deprecated import support. Auto-generated by import_shims/generate_shims.sh."""
# pylint: disable=redefined-builtin,wrong-import-position,wildcard-import,useless-suppression,line-too-long
from import_shims.warn import warn_deprecated_import
warn_deprecated_import('third_party_auth.saml_configuration.tests', 'commo... |
mmatyas/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/pytest/testing/code/test_source.py | 171 | # flake8: noqa
# disable flake check on this file because some constructs are strange
# or redundant on purpose and can't be disable on a line-by-line basis
import sys
import _pytest._code
import py
import pytest
from _pytest._code import Source
from _pytest._code.source import _ast
if _ast is not None:
astonly =... |
efortuna/AndroidSDKClone | refs/heads/master | ndk_experimental/prebuilt/linux-x86_64/lib/python2.7/test/test_support.py | 28 | """Supporting definitions for the Python regression tests."""
if __name__ != 'test.test_support':
raise ImportError('test_support must be imported from the test package')
import contextlib
import errno
import functools
import gc
import socket
import sys
import os
import platform
import shutil
import warnings
impo... |
remyroy/uwsgi | refs/heads/master | plugins/rsyslog/uwsgiplugin.py | 21 | NAME = 'rsyslog'
CFLAGS = []
LDFLAGS = []
LIBS = []
GCC_LIST = ['rsyslog_plugin']
|
conates/my_site | refs/heads/master | backend/tests.py | 24123 | from django.test import TestCase
# Create your tests here.
|
minhphung171093/OpenERP_V8 | refs/heads/master | openerp/addons/sale_stock/res_config.py | 331 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... |
Eksmo/calibre | refs/heads/master | src/calibre/ebooks/markdown/extensions/abbr.py | 5 | '''
Abbreviation Extension for Python-Markdown
==========================================
This extension adds abbreviation handling to Python-Markdown.
Simple Usage:
>>> import markdown
>>> text = """
... Some text with an ABBR and a REF. Ignore REFERENCE and ref.
...
... *[ABBR]: Abbreviation
... |
munnerz/CouchPotatoServer | refs/heads/master | libs/html5lib/treewalkers/_base.py | 658 | from __future__ import absolute_import, division, unicode_literals
from six import text_type, string_types
import gettext
_ = gettext.gettext
from xml.dom import Node
DOCUMENT = Node.DOCUMENT_NODE
DOCTYPE = Node.DOCUMENT_TYPE_NODE
TEXT = Node.TEXT_NODE
ELEMENT = Node.ELEMENT_NODE
COMMENT = Node.COMMENT_NODE
ENTITY =... |
lagopus/ryu-lagopus-ext | refs/heads/master | ryu/lib/packet/afi.py | 10 | # Copyright (C) 2013 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2013 YAMAMOTO Takashi <yamamoto at valinux co jp>
#
# 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:... |
nijel/weblate | refs/heads/main | weblate/utils/data.py | 2 | #
# Copyright © 2012 - 2021 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.org/>
#
# 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 3 of the Lice... |
christophlsa/odoo | refs/heads/8.0 | addons/sale/report/sale_report.py | 37 | # -*- 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... |
grap/OCB | refs/heads/7.0 | openerp/addons/base/ir/ir_config_parameter.py | 72 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... |
potato/searx | refs/heads/master | searx/engines/deviantart.py | 3 | """
Deviantart (Images)
@website https://www.deviantart.com/
@provide-api yes (https://www.deviantart.com/developers/) (RSS)
@using-api no (TODO, rewrite to api)
@results HTML
@stable no (HTML can change)
@parse url, title, thumbnail_src, img_src
@todo rewrite to api
"""
from lxm... |
yannickcr/CouchPotatoServer | refs/heads/develop | libs/rtorrent/common.py | 88 | # Copyright (c) 2013 Chris Lucas, <chris@chrisjlucas.com>
# 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, ... |
cetic/ansible | refs/heads/devel | lib/ansible/modules/network/cloudengine/ce_vxlan_gateway.py | 46 | #!/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... |
realsaiko/odoo | refs/heads/8.0 | addons/website_sale/__openerp__.py | 299 | {
'name': 'eCommerce',
'category': 'Website',
'summary': 'Sell Your Products Online',
'website': 'https://www.odoo.com/page/e-commerce',
'version': '1.0',
'description': """
OpenERP E-Commerce
==================
""",
'author': 'OpenERP SA',
'depends': ['website', 'sale', 'paymen... |
cprov/snapcraft | refs/heads/master | snapcraft/project/errors.py | 2 | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2018 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in the h... |
leighpauls/k2cro4 | refs/heads/master | third_party/mesa/MesaLib/src/mapi/glapi/gen/glX_proto_common.py | 46 | #!/usr/bin/env python
# (C) Copyright IBM Corporation 2004, 2005
# All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# ... |
guillermooo/dart-sublime-bundle-releases | refs/heads/master | polymer.py | 3 | # Copyright (c) 2014, Guillermo López-Anglada. Please see the AUTHORS file for details.
# All rights reserved. Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.)
import sublime
import sublime_plugin
import os
from Dart.lib.pub_package import PubPackage
from Dart.lib.... |
nashve/mythbox | refs/heads/master | resources/lib/twisted/twisted/internet/test/test_gtkreactor.py | 56 | # Copyright (c) 2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests to ensure all attributes of L{twisted.internet.gtkreactor} are
deprecated.
"""
import sys
from twisted.trial.unittest import TestCase
class GtkReactorDeprecation(TestCase):
"""
Tests to ensure all attributes of L{twiste... |
vvv1559/intellij-community | refs/heads/master | python/testData/refactoring/introduceVariable/substringFromFormatDict.py | 83 | print("<selection>Hello</selection> %(name)s" % {"name": "World"}) |
HarborYuan/cashier | refs/heads/master | env/Lib/_dummy_thread.py | 63 | """Drop-in replacement for the thread module.
Meant to be used as a brain-dead substitute so that threaded code does
not need to be rewritten for when the thread module is not present.
Suggested usage is::
try:
import _thread
except ImportError:
import _dummy_thread as _thread
"""
# Exports ... |
kaushik94/sympy | refs/heads/master | sympy/liealgebras/tests/test_type_B.py | 125 | from sympy.liealgebras.cartan_type import CartanType
from sympy.matrices import Matrix
def test_type_B():
c = CartanType("B3")
m = Matrix(3, 3, [2, -1, 0, -1, 2, -2, 0, -1, 2])
assert m == c.cartan_matrix()
assert c.dimension() == 3
assert c.roots() == 18
assert c.simple_root(3) == [0, 0, 1]
... |
yousafsyed/casperjs | refs/heads/master | bin/Lib/chunk.py | 83 | """Simple class to read IFF chunks.
An IFF chunk (used in formats such as AIFF, TIFF, RMFF (RealMedia File
Format)) has the following structure:
+----------------+
| ID (4 bytes) |
+----------------+
| size (4 bytes) |
+----------------+
| data |
| ... |
+----------------+
The ID is a 4-byte s... |
lukasheinrich/hepmcanalysis | refs/heads/master | tests/readwrite.py | 1 | from hepmcanalysis.events import events,dumps,fromfile, fromstring
print 'single event'
print dumps([fromfile('test.hepmc').next()])
eventstring = dumps([fromfile('test.hepmc').next()])
print dumps([e for e in fromstring(eventstring)]) == eventstring
print 'many events'
print dumps([e for e in fromfile('test.hepmc')... |
CVML/pybrain | refs/heads/master | pybrain/rl/environments/simple/__init__.py | 26 | from pybrain.rl.environments.simple.environment import SimpleEnvironment
from pybrain.rl.environments.simple.tasks import MinimizeTask |
o5k/openerp-oemedical-v0.1 | refs/heads/master | openerp/addons/oemedical/oemedical_hospital_unit/oemedical_hospital_unit.py | 3 | # -*- coding: utf-8 -*-
#/#############################################################################
#
# Tech-Receptives Solutions Pvt. Ltd.
# Copyright (C) 2004-TODAY Tech-Receptives(<http://www.techreceptives.com>)
# Special Credit and Thanks to Thymbra Latinoamericana S.A.
#
# This program is free sof... |
gregcaporaso/qiime | refs/heads/master | qiime/denoiser/make_cluster_jobs.py | 15 | #!/usr/bin/env python
"""A simple qsub based cluster submission script."""
__author__ = "Jens Reeder"
__copyright__ = "Copyright 2011, The QIIME Project"
# remember to add yourself if you make changes
__credits__ = ["Jens Reeder", "Rob Knight", "Jai Ram Rideout"]
__license__ = "GPL"
__version__ = "1.9.1-dev"
__mainta... |
bak1an/django | refs/heads/master | tests/datetimes/models.py | 133 | from django.db import models
class Article(models.Model):
title = models.CharField(max_length=100)
pub_date = models.DateTimeField()
published_on = models.DateField(null=True)
categories = models.ManyToManyField("Category", related_name="articles")
def __str__(self):
return self.title
... |
swarna-k/MyDiary | refs/heads/master | flask/lib/python2.7/site-packages/sqlalchemy/orm/evaluator.py | 60 | # orm/evaluator.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import operator
from ..sql import operators
class UnevaluatableError(Exception):
... |
MJuddBooth/pandas | refs/heads/master | pandas/tests/indexes/test_numeric.py | 1 | # -*- coding: utf-8 -*-
from datetime import datetime
import re
import numpy as np
import pytest
from pandas._libs.tslibs import Timestamp
from pandas.compat import PY2, range
import pandas as pd
from pandas import Float64Index, Index, Int64Index, Series, UInt64Index
from pandas.api.types import pandas_dtype
from p... |
mdanielwork/intellij-community | refs/heads/master | python/testData/refactoring/extractsuperclass/presenter/file.py | 80 | from datetime import date
class Child(object, date):
CLASS_VAR = "spam"
def eggs(self): # May be abstract
pass
def __init__(self):
super(Child, self).__init__()
self.artur = "king"
class StaticOnly(object):
@staticmethod
def static_method(): # May be abstract in case of P... |
sensysnetworks/uClinux | refs/heads/master | user/python/Tools/faqwiz/faqconf.py | 5 | """FAQ Wizard customization module.
Edit this file to customize the FAQ Wizard. For normal purposes, you
should only have to change the FAQ section titles and the small group
of parameters below it.
"""
# Titles of FAQ sections
SECTION_TITLES = {
# SectionNumber : SectionTitle; need at least one entry
1: "... |
taganaka/daf-metabase-cacher | refs/heads/master | superset-data-test/superset_config.py | 1 | import os
MAPBOX_API_KEY = os.getenv('MAPBOX_API_KEY', '')
CACHE_CONFIG = {
'CACHE_TYPE': 'redis',
'CACHE_DEFAULT_TIMEOUT': 300,
'CACHE_KEY_PREFIX': 'superset_',
'CACHE_REDIS_HOST': 'redis',
'CACHE_REDIS_PORT': 6379,
'CACHE_REDIS_DB': 1,
'CACHE_REDIS_URL': 'redis://redis-junit:6379/1'}
SQLA... |
Baralabite/Tandapy | refs/heads/master | auth/token.py | 1 | """
The MIT License (MIT)
Copyright (c) 2016 John Board
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, ... |
edouard-lopez/ansible-modules-core | refs/heads/devel | commands/shell.py | 95 | # There is actually no actual shell module source, when you use 'shell' in ansible,
# it runs the 'command' module with special arguments and it behaves differently.
# See the command source and the comment "#USE_SHELL".
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify... |
sekikn/incubator-airflow | refs/heads/master | airflow/providers/cncf/kubernetes/backcompat/backwards_compat_converters.py | 7 | # 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... |
pysb/pysb | refs/heads/master | pysb/export/sbml.py | 5 | """
Module containing a class for exporting a PySB model to SBML using libSBML
For information on how to use the model exporters, see the documentation
for :py:mod:`pysb.export`.
"""
import pysb
import pysb.bng
from pysb.export import Exporter
from sympy.printing.mathml import MathMLPrinter
from sympy import Symbol
fr... |
eayunstack/nova | refs/heads/develop | nova/tests/integrated/v3/test_server_external_events.py | 28 | # Copyright 2014 Red Hat, 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 agre... |
mancoast/CPythonPyc_test | refs/heads/master | fail/331_test_codeop.py | 118 | """
Test cases for codeop.py
Nick Mathewson
"""
import unittest
from test.support import run_unittest, is_jython
from codeop import compile_command, PyCF_DONT_IMPLY_DEDENT
import io
if is_jython:
import sys
def unify_callables(d):
for n,v in d.items():
if hasattr(v, '__call__'):
... |
scarcry/snm-mezzanine | refs/heads/master | mezzanine/accounts/forms.py | 2 |
from django.contrib.auth import authenticate
from django.db.models import Q
from django import forms
from django.utils.translation import ugettext as _
from mezzanine.accounts import get_profile_model, get_profile_user_fieldname
from mezzanine.conf import settings
from mezzanine.core.forms import Html5Mixin
from mezz... |
CallaJun/hackprince | refs/heads/master | indico/networkx/algorithms/tree/tests/test_recognition.py | 54 |
from nose.tools import *
import networkx as nx
class TestTreeRecognition(object):
graph = nx.Graph
multigraph = nx.MultiGraph
def setUp(self):
self.T1 = self.graph()
self.T2 = self.graph()
self.T2.add_node(1)
self.T3 = self.graph()
self.T3.add_nodes_from(range... |
2franix/homewatcher | refs/heads/master | homewatcher/ensurepyknx.py | 1 | #!/usr/bin/python3
# Copyright (C) 2012-2017 Cyrille Defranoux
#
# This file is part of Homewatcher.
#
# Homewatcher 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 y... |
zchenpds/ee631_final | refs/heads/master | visualization/spencer_tracking_rviz_plugin/scripts/send_test_msgs.py | 2 | #!/usr/bin/env python
import roslib; roslib.load_manifest( 'spencer_tracking_rviz_plugin' )
from spencer_tracking_msgs.msg import TrackedPersons, TrackedPerson, DetectedPersons, DetectedPerson
import rospy
from math import cos, sin, tan, pi
import tf
import random
import copy
def setPoseAndTwistFromAngle( pose, twist... |
firebitsbr/memex-explorer | refs/heads/master | source/apps/crawl_space/utils.py | 5 | import os
import errno
def touch(fname, times=None):
with open(fname, 'a'):
os.utime(fname, times)
def ensure_exists(path):
try:
os.makedirs(path)
except OSError as e:
if e.errno == errno.EEXIST: # (path exists)
pass
if not os.path.isdir(path):
rai... |
mandeepdhami/horizon | refs/heads/master | openstack_dashboard/dashboards/project/routers/ports/forms.py | 35 | # Copyright 2012, Nachi Ueno, NTT MCL, 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 applic... |
rahushen/ansible | refs/heads/devel | lib/ansible/modules/network/iosxr/__init__.py | 12133432 | |
a-bioinformatician/BreaKmer | refs/heads/master | breakmer/processor/__init__.py | 12133432 | |
fkie-cad/FACT_core | refs/heads/master | src/plugins/analysis/software_components/test/__init__.py | 12133432 | |
cymplecy/python-gpioone | refs/heads/master | gpioone/input_devices.py | 1 | from __future__ import division
import inspect
import warnings
from functools import wraps
from time import sleep, time
from threading import Event
from RPi import GPIO
from w1thermsensor import W1ThermSensor
from spidev import SpiDev
from .devices import GPIODeviceError, GPIODeviceClosed, GPIODevice, GPIOQueue
de... |
WillisXChen/django-oscar | refs/heads/master | oscar/lib/python2.7/site-packages/phonenumbers/data/region_PL.py | 1 | """Auto-generated file, do not edit by hand. PL metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_PL = PhoneMetadata(id='PL', country_code=48, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='[12]\\d{6,8}|[3-57-9]\\d{8}|6\\d{5,8}', p... |
bobisme/odoo | refs/heads/sp-8.0 | openerp/addons/test_new_api/tests/test_attributes.py | 394 | # -*- coding: utf-8 -*-
from openerp.tests import common
ANSWER_TO_ULTIMATE_QUESTION = 42
class TestAttributes(common.TransactionCase):
def test_we_can_add_attributes(self):
Model = self.env['test_new_api.category']
instance = Model.create({'name': 'Foo'})
# assign an unknown attribute
... |
google/rekall | refs/heads/master | rekall-agent/rekall_agent/locations/cloud_test.py | 3 | # -*- coding: utf-8 -*-
"""Test the cloud locations for contacting Google Cloud Storage."""
import argparse
import os
import StringIO
import time
from rekall import testlib
from rekall_agent.locations import cloud
# Note that this test requires a valid connection to the cloud.
parser = argparse.ArgumentParser(descrip... |
Guilhermeslucas/jarbas | refs/heads/master | jarbas/core/tests/test_receipts_command.py | 2 | from unittest.mock import Mock, call, patch
from django.test import TestCase
from django.db.models import QuerySet
from requests.exceptions import ConnectionError
from jarbas.core.management.commands.receipts import Command
class TestCommandHandler(TestCase):
@patch('jarbas.core.management.commands.receipts.Co... |
edmorley/django | refs/heads/master | django/contrib/postgres/forms/__init__.py | 1015 | from .array import * # NOQA
from .hstore import * # NOQA
from .jsonb import * # NOQA
from .ranges import * # NOQA
|
neerajvashistha/pa-dude | refs/heads/master | lib/python2.7/site-packages/django/conf/locale/fr/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 = 'H:i'
DATETI... |
evensonbryan/yocto-autobuilder | refs/heads/master | lib/python2.7/site-packages/buildbot-0.8.8-py2.7.egg/buildbot/test/unit/test_steps_package_deb_pbuilder.py | 4 | # This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... |
gchp/django | refs/heads/master | django/conf/locale/cy/__init__.py | 12133432 | |
gcarq/freqtrade | refs/heads/develop | freqtrade/plugins/pairlist/AgeFilter.py | 1 | """
Minimum age (days listed) pair list filter
"""
import logging
from copy import deepcopy
from typing import Any, Dict, List, Optional
import arrow
from pandas import DataFrame
from freqtrade.exceptions import OperationalException
from freqtrade.misc import plural
from freqtrade.plugins.pairlist.IPairList import IP... |
hujiajie/chromium-crosswalk | refs/heads/master | components/cronet/tools/extract_from_jars.py | 10 | #!/usr/bin/env python
#
# Copyright 2014 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 fnmatch
import optparse
import os
import sys
REPOSITORY_ROOT = os.path.abspath(os.path.join(
os.path.dirname(__file__), '... |
fengbaicanhe/intellij-community | refs/heads/master | python/testData/refactoring/extractmethod/StaticMethod.after.py | 71 | class C:
@staticmethod
def foo():
C.baz()
@staticmethod
def baz():
print "hello world" |
Anylytics/dash | refs/heads/master | db_migrate.py | 27 | #!flask/bin/python
import imp
from migrate.versioning import api
from app import db
from config import SQLALCHEMY_DATABASE_URI
from config import SQLALCHEMY_MIGRATE_REPO
v = api.db_version(SQLALCHEMY_DATABASE_URI, SQLALCHEMY_MIGRATE_REPO)
migration = SQLALCHEMY_MIGRATE_REPO + ('/versions/%03d_migration.py' % (v+1))
tmp... |
qmarlats/pyquizz | refs/heads/master | env-3/lib/python3.5/site-packages/pygments/lexers/roboconf.py | 25 | # -*- coding: utf-8 -*-
"""
pygments.lexers.roboconf
~~~~~~~~~~~~~~~~~~~~~~~~
Lexers for Roboconf DSL.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.lexer import RegexLexer, words, re
from pygments.token import Text, O... |
aristanetworks/neutron | refs/heads/master | neutron/db/l3_attrs_db.py | 63 | # Copyright (c) 2014 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 ... |
g8os/grid | refs/heads/master | pyclient/zeroos/orchestrator/client/EnumNodeStatus.py | 2 | from enum import Enum
class EnumNodeStatus(Enum):
running = "running"
halted = "halted"
|
varesa/shopify_python_api | refs/heads/master | shopify/resources/country.py | 8 | from ..base import ShopifyResource
class Country(ShopifyResource):
pass
|
auferack08/edx-platform | refs/heads/master | lms/djangoapps/certificates/migrations/0010_auto__del_field_generatedcertificate_enabled__add_field_generatedcerti.py | 188 | # -*- 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):
# Deleting field 'GeneratedCertificate.enabled'
db.delete_column('certificates_generatedcertificate', 'enabl... |
sve-odoo/odoo | refs/heads/master | addons/hr_timesheet/report/__init__.py | 395 | import hr_timesheet_report
|
ahotam/micropython | refs/heads/master | tests/float/float2int.py | 43 | # check cases converting float to int, relying only on single precision float
try:
import ustruct as struct
except:
import struct
# work out configuration values
is_64bit = struct.calcsize("P") == 8
# 0 = none, 1 = long long, 2 = mpz
try:
dummy = 0x7fffffffffffffff
try:
if (0xffffffffffffffff ... |
tsuibin/linux-loongson-all | refs/heads/master | tools/perf/scripts/python/check-perf-trace.py | 948 | # perf trace event handlers, generated by perf trace -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. Ba... |
nitzmahone/ansible | refs/heads/devel | lib/ansible/plugins/lookup/sequence.py | 46 | # (c) 2013, Jayson Vantuyl <jayson@aggressive.ly>
# (c) 2012-17 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 = """
lookup: sequence
author: Jayso... |
ArmstrongYang/StudyShare | refs/heads/master | Spark-Python/examples/status_api_demo.py | 30 | #
# 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... |
sajuptpm/neutron-ipam | refs/heads/stable/icehouse | neutron/plugins/hyperv/model.py | 21 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Cloudbase Solutions SRL
# 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.ap... |
raghavs1108/DataPlotter | refs/heads/master | pyqtgraph/opengl/items/GLVolumeItem.py | 48 | from OpenGL.GL import *
from .. GLGraphicsItem import GLGraphicsItem
from ...Qt import QtGui
import numpy as np
from ... import debug
__all__ = ['GLVolumeItem']
class GLVolumeItem(GLGraphicsItem):
"""
**Bases:** :class:`GLGraphicsItem <pyqtgraph.opengl.GLGraphicsItem>`
Displays volumetric data.
... |
AICP/external_chromium_org | refs/heads/lp5.0 | tools/perf/benchmarks/polymer_load.py | 8 | # Copyright 2014 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 page_sets
from measurements import polymer_load
from telemetry import test
class PolymerLoadPica(test.Test):
"""Measures time to polymer-ready for... |
mvpoland/django-smsgateway | refs/heads/master | smsgateway/smpplib/command.py | 1 | #
# smpplib -- SMPP Library for Python
# Copyright (c) 2005 Martynas Jocius <mjoc@akl.lt>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at you... |
vipul-sharma20/oh-mainline | refs/heads/master | vendor/packages/scrapy/scrapy/tests/test_downloadermiddleware_defaultheaders.py | 19 | from unittest import TestCase
from scrapy.conf import settings
from scrapy.contrib.downloadermiddleware.defaultheaders import DefaultHeadersMiddleware
from scrapy.http import Request
from scrapy.spider import BaseSpider
from scrapy.utils.test import get_crawler
class TestDefaultHeadersMiddleware(TestCase):
def ... |
marckuz/django | refs/heads/master | tests/model_inheritance_regress/__init__.py | 12133432 | |
diorcety/intellij-community | refs/heads/master | python/testData/inspections/PyUnresolvedReferencesInspection/NullReferenceInIncompleteImport/foo/__init__.py | 12133432 | |
takeshineshiro/glance | refs/heads/master | glance/common/__init__.py | 12133432 | |
Kongsea/tensorflow | refs/heads/master | tensorflow/examples/get_started/regression/imports85.py | 24 | # 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... |
dmt4/pssh | refs/heads/master | psshlib/cli.py | 58 | # Copyright (c) 2009-2012, Andrew McNabb
# Copyright (c) 2003-2008, Brent N. Chun
import optparse
import os
import shlex
import sys
import textwrap
from psshlib import version
_DEFAULT_PARALLELISM = 32
_DEFAULT_TIMEOUT = 0 # "infinity" by default
def common_parser():
"""
Create a basic OptionParser wit... |
papedaniel/oioioi | refs/heads/master | oioioi/notifications/processors.py | 1 | import string
import random
from django.utils.functional import lazy
from oioioi.contests.utils import can_enter_contest
from django.conf import settings
from django.template.loader import render_to_string
from oioioi.notifications.models import NotificationsSession
from django.contrib.sessions.models import Session
... |
ameisner/content | refs/heads/master | labs/lab8/generate_friends.py | 41 | #!/usr/bin/python
"""
generate_friends.py
Generates data file "baseball_friends.csv" to be used for lab8 MapReduce
example.
Reads list of names from "names.txt", randomly assigns team alligiences,
then assigns friendships based on super simple algorithm, and finally
writes out the file in the following csv format:
... |
gangadharkadam/vlinkfrappe | refs/heads/master | frappe/patches/v4_0/fix_attach_field_file_url.py | 32 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
attach_fields = (frappe.db.sql("""select parent, fieldname from `tabDocField` where fieldtype='Attach'""") +
frappe.db.sql("""select dt, fieldname... |
revdotcom/babelsubs | refs/heads/master | babelsubs/parsers/dfxp.py | 2 | from babelsubs.storage import SubtitleSet
from base import BaseTextParser, SubtitleParserError, register
from xml.parsers.expat import ExpatError
from lxml.etree import XMLSyntaxError
MAX_SUB_TIME = (60 * 60 * 100) - 1
class DFXPParser(BaseTextParser):
"""
The DFXPParser is in reality just a shim around the b... |
Elbagoury/odoo | refs/heads/8.0 | addons/crm_partner_assign/__init__.py | 17 | # -*- 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... |
rogerhu/django | refs/heads/master | tests/admin_inlines/tests.py | 5 | from __future__ import unicode_literals
from django.contrib.admin.tests import AdminSeleniumWebDriverTestCase
from django.contrib.admin.helpers import InlineAdminForm
from django.contrib.auth.models import User, Permission
from django.contrib.contenttypes.models import ContentType
from django.test import TestCase
from... |
romain-li/edx-platform | refs/heads/master | common/lib/xmodule/xmodule/tests/__init__.py | 61 | """
unittests for xmodule
Run like this:
paver test_lib -l common/lib/xmodule
"""
import inspect
import json
import os
import pprint
import sys
import traceback
import unittest
from contextlib import contextmanager, nested
from functools import wraps
from lazy import lazy
from mock import Mock, patch
from oper... |
arante/pyloc | refs/heads/master | py2/htp/ex04/cai.py | 2 | #!/usr/bin/python
#
# cai.py
#
# Exercise 4.6:
# Computers are playing an increasing role in education. The use of computers
# in education is referred to as computer-assisted instruction (CAI). Write a
# program that will help an elementary school student learn multiplication. Use
# the random module to produce two p... |
macdiesel/mongo-python-driver | refs/heads/master | pymongo/periodic_executor.py | 16 | # 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... |
bzero/bitex | refs/heads/master | libs/jsonrpc/cgiwrapper.py | 64 | import sys, os
from jsonrpc import ServiceHandler
class CGIServiceHandler(ServiceHandler):
def __init__(self, service):
if service == None:
import __main__ as service
ServiceHandler.__init__(self, service)
def handleRequest(self, fin=None, fout=None, env=None):
if fin==Non... |
knowsis/django | refs/heads/nonrel-1.6 | tests/choices/tests.py | 150 | from __future__ import absolute_import
from django.test import TestCase
from .models import Person
class ChoicesTests(TestCase):
def test_display(self):
a = Person.objects.create(name='Adrian', gender='M')
s = Person.objects.create(name='Sara', gender='F')
self.assertEqual(a.gender, 'M')... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.