repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
SnowOnion/CodeForcesLee
refs/heads/master
thisAndThat/71a.py
1
n=int(raw_input()) for i in xrange(n): print (lambda word:word if len(word)<=10 else word[0]+str(len(word)-2)+word[-1])(raw_input())
neerajvashistha/pa-dude
refs/heads/master
lib/python2.7/site-packages/image/storage.py
4
# coding=UTF-8 from django.core.exceptions import ImproperlyConfigured from django.core.files.storage import get_storage_class, FileSystemStorage from image import settings from image.settings import IMAGE_CACHE_STORAGE, STATICFILES_STORAGE __author__ = 'franki' STORAGE = None class ImageCacheStorage(FileSystemSt...
sergio-incaser/odoo
refs/heads/8.0
addons/sale_order_dates/sale_order_dates.py
223
# -*- 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...
TakingInitiative/wesnoth
refs/heads/master
data/tools/wesnoth/wmlgrammar.py
9
""" wmlgrammar -- parses a given schema into a more usable form """ from __future__ import print_function import collections import re REQUIRED = 1 OPTIONAL = 2 REPEATED = 3 FORBIDDEN = 4 class Grammar(object): def __init__(self, schema): schema = schema.get_first("schema") self.datatypes = {} ...
mingwpy/numpy
refs/heads/master
numpy/polynomial/setup.py
264
from __future__ import division, print_function def configuration(parent_package='',top_path=None): from numpy.distutils.misc_util import Configuration config = Configuration('polynomial', parent_package, top_path) config.add_data_dir('tests') return config if __name__ == '__main__': from numpy.di...
bflaven/BlogArticlesExamples
refs/heads/master
python_playing_with_facial_recognition/python_face_recognition_mysql/003_find_extract_faces_in_picture.py
1
""" cd /Users/brunoflaven/Documents/02_copy/_000_IA_bruno_light/facial_recognition/007_play_with_face_recognition/python_face_recognition_mysql/ python 003_find_extract_faces_in_picture.py -- several images group_protesters_image_1170x530_un_news_shirin_yaseen.jpg group_protesters_parliament_london_june_6_frank_a...
liu88620/ProjetoLiu
refs/heads/master
backend/src/lib/tekton/__init__.py
4
__version__="2.1.2"
switchboardOp/ansible
refs/heads/devel
lib/ansible/modules/remote_management/ipmi/ipmi_boot.py
69
#!/usr/bin/python # -*- coding: utf-8 -*- # # 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. ...
tjanez/ansible
refs/heads/devel
lib/ansible/modules/files/fetch.py
50
# this is a virtual module that is entirely implemented server side # 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 op...
ip-tools/ip-navigator
refs/heads/master
patzilla/access/drawing.py
1
# -*- coding: utf-8 -*- # (c) 2013-2018 Andreas Motl <andreas.motl@ip-tools.org> import logging from six import BytesIO from beaker.cache import cache_region from pyramid.httpexceptions import HTTPNotFound from patzilla.util.numbers.common import split_patent_number from patzilla.util.numbers.normalize import normaliz...
ambikeshwar1991/gnuradio
refs/heads/master
gnuradio-core/src/python/gnuradio/gr/qa_mute.py
18
#!/usr/bin/env python # # Copyright 2004,2005,2007,2010 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at ...
mrknow/filmkodi
refs/heads/master
plugin.video.mrknow/lib/mrknow_urlparser.py
2
# -*- coding: utf-8 -*- import cookielib, os, string, StringIO import os, time, base64, logging, calendar import urllib, urllib2, re, sys, math import xbmcaddon, xbmc, xbmcgui try: import simplejson as json except ImportError: import json import urlparse import httplib import resolveurl as urlresolver ptv =...
ProjectSWGCore/NGECore2
refs/heads/master
scripts/object/building/poi/base/base_poi_large.py
85615
import sys def setup(core, object): return
ProjectSWGCore/NGECore2
refs/heads/master
scripts/object/mobile/jedi_robe_light_jedi.py
85615
import sys def setup(core, object): return
Timus1712/boto
refs/heads/master
tests/unit/s3/test_website.py
21
# Copyright (c) 2013 Amazon.com, Inc. or its affiliates. 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 the rights ...
leorochael/odoo
refs/heads/8.0
addons/website_crm_partner_assign/models/__init__.py
1273
import res_partner
mglukhikh/intellij-community
refs/heads/master
python/testData/stubs/inheritorsWhenSuperClassImportedWithAs/a.py
239
class C: pass
raycarnes/hr
refs/heads/8.0
__unported__/hr_salary_rule_variable/hr_salary_rule.py
27
# -*- coding:utf-8 -*- ############################################################################## # # Copyright (C) 2014 Savoir-faire Linux. All Rights Reserved. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as publish...
ESSS/numpy
refs/heads/master
numpy/doc/creation.py
118
""" ============== Array Creation ============== Introduction ============ There are 5 general mechanisms for creating arrays: 1) Conversion from other Python structures (e.g., lists, tuples) 2) Intrinsic numpy array array creation objects (e.g., arange, ones, zeros, etc.) 3) Reading arrays from disk, either from...
mexeniz/django-oscar
refs/heads/master
src/oscar/test/factories/contrib.py
23
import factory from django.contrib.auth import models as auth_models __all__ = ['PermissionFactory'] class PermissionFactory(factory.DjangoModelFactory): name = 'Dummy permission' codename = 'dummy' class Meta: model = auth_models.Permission django_get_or_create = ('content_type', 'code...
Jonekee/chromium.src
refs/heads/nw12
chrome/browser/chromeos/extensions/PRESUBMIT.py
393
# 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. """Presubmit script for extensions and apps. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for more details about the presubmi...
lucasrodes/whatstk
refs/heads/main
whatstk/scripts/generate_chats.py
1
"""Generate chats in all hformats with `size` number of messages and export them to a given `output_path`.""" import argparse from datetime import datetime from whatstk.whatsapp.generation import generate_chats_hformats def _parse_args(): parser = argparse.ArgumentParser( "Generate chat. Make sure to in...
ACSOP/android_external_chromium
refs/heads/master
testing/gmock/scripts/upload_gmock.py
770
#!/usr/bin/env python # # Copyright 2009, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
qsnake/gpaw
refs/heads/master
gpaw/test/pbe_pw91.py
3
from math import pi import numpy as np from gpaw.xc.libxc import LibXC x0 = LibXC('LDA_X') def f0(xc, rs, s): n = 3 / (4 * pi * rs**3) third = 1.0 / 3.0 kF = (3 * pi**2 * n)**third a2 = (2 * kF * n * s)**2 e = np.zeros(1) xc.calculate(e, np.array([[n]]), np.zeros((1, 1)), ...
zhukite/nikola-install
refs/heads/master
nikola/plugins/task/sitemap/__init__.py
3
# -*- coding: utf-8 -*- # Copyright © 2012-2013 Roberto Alsina and others. # 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 t...
shuffle2/dolphin
refs/heads/master
Externals/fmt/support/rst2md.py
42
#!/usr/bin/env python # reStructuredText (RST) to GitHub-flavored Markdown converter import re, sys from docutils import core, nodes, writers def is_github_ref(node): return re.match('https://github.com/.*/(issues|pull)/.*', node['refuri']) class Translator(nodes.NodeVisitor): def __init__(self, document):...
blademainer/intellij-community
refs/heads/master
plugins/hg4idea/testData/bin/mercurial/patch.py
90
# patch.py - patch file parsing routines # # Copyright 2006 Brendan Cully <brendan@kublai.com> # Copyright 2007 Chris Mason <chris.mason@oracle.com> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. import cStringIO, email.Parser, o...
Rashed97/caf-kernel-msm-3.14
refs/heads/LA.HB.1.1.1_rb1.10
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py
12527
# Util.py - Python extension for perf script, miscellaneous utility code # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. import errno, os FUTEX_WAIT = 0...
jjz/mezzanine
refs/heads/master
mezzanine/generic/__init__.py
46
""" Provides various models and associated functionality, that can be related to any other model using generic relationshipswith Django's contenttypes framework, such as comments, keywords/tags and voting. """ from __future__ import unicode_literals # These methods are part of the API for django_comments def get_mod...
RuudBurger/CouchPotatoServer
refs/heads/master
couchpotato/core/notifications/boxcar2.py
13
from couchpotato.core.helpers.encoding import toUnicode from couchpotato.core.logger import CPLog from couchpotato.core.notifications.base import Notification log = CPLog(__name__) autoload = 'Boxcar2' class Boxcar2(Notification): url = 'https://new.boxcar.io/api/notifications' LOGO_URL = 'https://raw.gith...
xodus7/tensorflow
refs/heads/master
tensorflow/contrib/tpu/python/tpu/topology.py
9
# 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...
chiara-paci/dinosaurus
refs/heads/master
dinosaurus_lib/functions.py
1
def unicode_convert(txt): if type(txt)==unicode: return txt if type(txt)!=str: return unicode(txt) return unicode(txt.decode('utf-8'))
krvss/django-social-auth
refs/heads/master
contrib/tests/test_core.py
14
# -*- coding: utf-8 -*- import urlparse from selenium import webdriver from django.test import TestCase from django.conf import settings class BackendsTest(TestCase): def setUp(self): self.driver = webdriver.Firefox() def tearDown(self): self.driver.quit() def url(self, path): ...
quark0/AnchorClouds
refs/heads/master
main.py
1
import numpy as np import sys from sklearn.preprocessing import normalize import time import manifold_generator from algorithm import tools from algorithm import nearest_neighbors from algorithm import anchor_points from algorithm import anchor_clouds from algorithm import prototype_vector_machines from algorithm impo...
ken-muturi/pombola
refs/heads/master
pombola/hansard/models/source.py
4
import os import re import httplib2 from django.db import models from django.conf import settings from django.core.exceptions import ImproperlyConfigured from pombola.hansard.models.base import HansardModelBase # check that the cache is setup and the directory exists try: HANSARD_CACHE = settings.HANSARD_CACHE ...
csrocha/OpenUpgrade
refs/heads/8.0
openerp/modules/graph.py
9
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2010-2014 OpenERP s.a. (<http://openerp.com>). # # This program is free software: you ca...
GoogleCloudPlatform/grpc-gcp-python
refs/heads/master
tests/grpc_gcp_test/stress/client.py
1
import random import sys import threading import timeit import traceback import google.protobuf.struct_pb2 import google.protobuf.text_format import grpc import grpc_gcp import pkg_resources from absl import flags from google.auth.transport.grpc import AuthMetadataPlugin from google.auth.transport.requests import Requ...
dagwieers/ansible
refs/heads/devel
lib/ansible/modules/storage/netapp/_sf_volume_access_group_manager.py
59
#!/usr/bin/python # (c) 2017, NetApp, Inc # 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 ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['deprecated'], ...
cosmicAsymmetry/zulip
refs/heads/master
zproject/dev_settings.py
13
# For the Dev VM environment, we use the same settings as the # sample prod_settings.py file, with a few exceptions. from .prod_settings_template import * import os LOCAL_UPLOADS_DIR = 'var/uploads' # Default to subdomains disabled in development until we can update # the development documentation to make sense with ...
petebachant/Nortek-Python
refs/heads/master
nortek/files.py
1
import os import re import nortek.structures import logging import pdb import struct import numpy import math import matplotlib class DataFile(dict): def __init__(self, filepath, instrument_type="unknown"): dict.__init__(self) self.instrument_type = instrument_type self.filesize = os.path....
ToonBoxEntertainment/rez
refs/heads/master
src/rez/vendor/yaml/reader.py
425
# This module contains abstractions for the input stream. You don't have to # looks further, there are no pretty code. # # We define two classes here. # # Mark(source, line, column) # It's just a record and its only use is producing nice error messages. # Parser does not use it for any other purposes. # # Reader(so...
glenjarvis/ansible_tutorial
refs/heads/develop
src/example_02/auto_update_machine.py
3
#!/usr/bin/env python # pylint: disable=W0621,C0103 """Example 02: Automatically update system packages This is only a placeholder to help new participants understand how remote ssh commands are executed. Like the previous exercise, they will need to have two things: 1) The IP address of the machine created (that ...
yuanagain/seniorthesis
refs/heads/master
venv/lib/python2.7/site-packages/scipy/io/netcdf.py
29
""" NetCDF reader/writer module. This module is used to read and create NetCDF files. NetCDF files are accessed through the `netcdf_file` object. Data written to and from NetCDF files are contained in `netcdf_variable` objects. Attributes are given as member variables of the `netcdf_file` and `netcdf_variable` objects...
Johnetordoff/osf.io
refs/heads/develop
api_tests/nodes/views/test_node_sparse_fieldsets.py
6
import pytest from api.base.settings.defaults import API_BASE from osf_tests.factories import ( ProjectFactory, AuthUserFactory, PrivateLinkFactory, ) from osf.utils import permissions @pytest.fixture() def user(): return AuthUserFactory() @pytest.mark.django_db @pytest.mark.enable_quickfiles_creat...
patriciolobos/desa8
refs/heads/master
openerp/addons/crm_partner_assign/__openerp__.py
244
# -*- 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...
wavelets/zulip
refs/heads/master
zproject/local_settings.py
98
# Non-secret secret Django settings for the Zulip project import platform import ConfigParser from base64 import b64decode config_file = ConfigParser.RawConfigParser() config_file.read("/etc/zulip/zulip.conf") # Whether we're running in a production environment. Note that PRODUCTION does # **not** mean hosted on Zuli...
omakk/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/py/py/_path/__init__.py
278
""" unified file system api """
fnouama/intellij-community
refs/heads/master
python/testData/inspections/PyPep8NamingInspection/className.py
83
class <weak_warning descr="Class names should use CamelCase convention">A_B</weak_warning>: def foo(self): pass
tlangerak/Multi-Agent-Systems
refs/heads/master
build/lib.win32-2.7/xmppd/modules/__init__.py
4
# $Id: __init__.py,v 1.4 2004/10/23 08:58:45 snakeru Exp $ # -*- coding: utf-8 -*- import os #from psyco.classes import * #for m in os.listdir('modules'): # if m[:2]=='__' or m[-3:]<>'.py': continue # exec "import "+m[:-3] import jep0078 import roster import config import message import router import db_fake i...
coinkeeper/2015-06-22_19-00_ziftrcoin
refs/heads/master
contrib/qt_translations.py
4110
#!/usr/bin/env python # Helpful little script that spits out a comma-separated list of # language codes for Qt icons that should be included # in binary bitcoin distributions import glob import os import re import sys if len(sys.argv) != 3: sys.exit("Usage: %s $QTDIR/translations $BITCOINDIR/src/qt/locale"%sys.arg...
sunil07t/e-mission-server
refs/heads/master
emission/analysis/result/metrics/time_grouping.py
1
from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import from future import standard_library standard_library.install_aliases() from builtins import range from builtins import * import enum import pandas as pd import arrow as ar...
drrk/micropython
refs/heads/master
esp8266/makeimg.py
6
import sys SEGS_MAX_SIZE = 0x9000 assert len(sys.argv) == 4 with open(sys.argv[3], 'wb') as fout: with open(sys.argv[1], 'rb') as f: data_flash = f.read() fout.write(data_flash) print('flash ', len(data_flash)) pad = b'\xff' * (SEGS_MAX_SIZE - len(data_flash)) fout.write(pad)...
sallyyoo/ced2
refs/heads/master
py/换行加读文件.py
1
text = "\nthis is an append paragraph" f = open('file2.txt','a') f.write(text) f.close()
senttech/Cura
refs/heads/pl-i18n
cura/ProfileReader.py
6
# Copyright (c) 2016 Ultimaker B.V. # Cura is released under the terms of the AGPLv3 or higher. from UM.PluginObject import PluginObject ## A type of plug-ins that reads profiles from a file. # # The profile is then stored as instance container of the type user profile. class ProfileReader(PluginObject): def _...
bobbyluig/Eclipse
refs/heads/master
src/cerebral/pack2/demo.py
1
from agility.gait import Dynamic from cerebral.pack2.hippocampus import Android from agility.main import Agility import math # Definition. robot = Android.robot # Initialize objects. agility = Agility(robot) gait = Dynamic(robot) def execute_vector(vector): g = gait.generate(*vector) frames, dt = agility.p...
kireledan/molecule
refs/heads/master
molecule/migrate.py
2
# Copyright (c) 2015-2017 Cisco Systems, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge...
savi-dev/nova
refs/heads/silver
nova/tests/integrated/test_xml.py
11
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 Justin Santa Barbara # 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.apach...
albmarvil/The-Eternal-Sorrow
refs/heads/master
dependencies/luabind/boost-build/test/core_dependencies.py
4
#!/usr/bin/python # Copyright 2003 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) # This tests correct handling of dependencies, specifically, on # generated sources, and from generated sources. import Bo...
archivsozialebewegungen/AlexandriaPlugins
refs/heads/master
tests/systematic/test_systematic_gui_elements.py
1
''' Created on 31.10.2016 @author: michael ''' import unittest from alexandriabase.domain import Tree, NoSuchNodeException from integration.baseintegrationtest import BaseIntegrationTest from unittest.mock import MagicMock import os import tempfile import pytest from alexpresenters.MessageBroker import ERROR_MESSAGE, ...
tectronics/mythbox
refs/heads/master
resources/lib/twisted/twisted/spread/pb.py
57
# -*- test-case-name: twisted.test.test_pb -*- # Copyright (c) 2001-2010 Twisted Matrix Laboratories. # See LICENSE for details. """ Perspective Broker \"This isn\'t a professional opinion, but it's probably got enough internet to kill you.\" --glyph Introduction ============ This is a broker for proxies for and co...
dstftw/youtube-dl
refs/heads/master
youtube_dl/extractor/ooyala.py
1
from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_b64decode, compat_str, compat_urllib_parse_urlencode, ) from ..utils import ( determine_ext, ExtractorError, float_or_none, int_or_none, try_get, unsmuggle_url, ) cla...
x4dr/NossiNet
refs/heads/master
NossiPack/DiceParser.py
1
import re import traceback from typing import List, Union, Dict import numexpr from NossiPack.Dice import Dice from NossiPack.RegexRouter import ( RegexRouter, DuplicateKeyException, PartialMatchException, ) from NossiPack.krypta import DescriptiveError, tuple_overlap class DiceCodeError(Exception): ...
sachintaware/sublime-wakatime
refs/heads/master
packages/wakatime/packages/simplejson/tests/test_fail.py
147
import sys from unittest import TestCase import simplejson as json # 2007-10-05 JSONDOCS = [ # http://json.org/JSON_checker/test/fail1.json '"A JSON payload should be an object or array, not a string."', # http://json.org/JSON_checker/test/fail2.json '["Unclosed array"', # http://json.org/JSON_che...
codilime/contrail-controller
refs/heads/windows3.1
src/config/svc-monitor/svc_monitor/tests/test_common_utils.py
2
from svc_monitor.config_db import * from vnc_api.vnc_api import * class VMObjMatcher(object): """ Object for assert_called_with to check if vm object is created properly """ def __init__(self, index, check_delete=False): self.check_delete = check_delete self.index = index def _has_...
mcgoddard/widgetr
refs/heads/master
env/Lib/site-packages/pip/_vendor/distlib/index.py
571
# -*- coding: utf-8 -*- # # Copyright (C) 2013 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # import hashlib import logging import os import shutil import subprocess import tempfile try: from threading import Thread except ImportErr...
kangkot/arangodb
refs/heads/devel
3rdParty/V8-4.3.61/third_party/python_26/Lib/json/tests/test_speedups.py
53
import decimal from unittest import TestCase from json import decoder from json import encoder class TestSpeedups(TestCase): def test_scanstring(self): self.assertEquals(decoder.scanstring.__module__, "_json") self.assert_(decoder.scanstring is decoder.c_scanstring) def test_encode_basestring...
acshi/osf.io
refs/heads/develop
addons/github/apps.py
4
import os from addons.base.apps import BaseAddonAppConfig from addons.github.views import github_hgrid_data HERE = os.path.dirname(os.path.abspath(__file__)) NODE_SETTINGS_TEMPLATE = os.path.join( HERE, 'templates', 'github_node_settings.mako', ) class GitHubAddonConfig(BaseAddonAppConfig): name = '...
soupytwist/judge
refs/heads/master
judge/models.py
1
from django.db import models from django.contrib.auth.models import User from django.core.urlresolvers import reverse from judge import settings from functools import partial from datetime import datetime import os import random import string def get_upload_path(ft, instance, filename): if ft == "out": ext...
Martin404/ssdb
refs/heads/master
deps/cpy/antlr3/exceptions.py
118
"""ANTLR3 exception hierarchy""" # begin[licence] # # [The "BSD licence"] # Copyright (c) 2005-2008 Terence Parr # 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 c...
andreimatveyeu/pyorgtree
refs/heads/master
timestamp.py
1
"""Org-mode timestamp parser module .. moduleauthor:: Andrei Matveyeu <andrei@ideabulbs.com> """ import re import datetime import sys class MalformedTimestamp(Exception): def __init__(self, message): Exception.__init__(self, message) class Timestamp(object): string = None active = None ...
jart/tensorflow
refs/heads/master
tensorflow/contrib/training/python/training/tensor_queue_dataset_test.py
11
# 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...
nozuono/calibre-webserver
refs/heads/master
src/cherrypy/_cpchecker.py
87
import os import warnings import cherrypy from cherrypy._cpcompat import iteritems, copykeys, builtins class Checker(object): """A checker for CherryPy sites and their mounted applications. When this object is called at engine startup, it executes each of its own methods whose names start with ``che...
abstract-open-solutions/OCB
refs/heads/8.0
addons/edi/controllers/__init__.py
829
import main # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
morelab/weblabdeusto
refs/heads/master
server/src/weblab/experiment/devices/xilinx/programmers/jtag_blazer.py
3
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2005 onwards University of Deusto # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. # # This software consists of contributions made by many individual...
bjorncooley/travelguide
refs/heads/master
accounts/admin.py
13848
from django.contrib import admin # Register your models here.
geopython/QGIS
refs/heads/master
tests/src/python/test_qgsgraduatedsymbolrenderer.py
8
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsGraduatedSymbolRenderer .. note:: 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 of the License, or (at your option) any later vers...
Ulauncher/Ulauncher
refs/heads/dev
ulauncher/api/shared/item/ExtensionResultItem.py
1
import os import sys from ulauncher.api.shared.action.BaseAction import BaseAction from ulauncher.api.shared.item.ResultItem import ResultItem from ulauncher.utils.image_loader import load_image from ulauncher.search.QueryHistoryDb import QueryHistoryDb class ExtensionResultItem(ResultItem): """ Should be us...
yac/packstack
refs/heads/master
setup.py
5
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import shutil import subprocess import sys from setuptools import setup, find_packages, Command from packstack import version MODULES_DIR = os.environ.get('PACKSTACK_PUPPETDIR', '/usr/share/openstack-puppet/modules') MODULES_REPO ...
Timeship/scrapy
refs/heads/master
tests/test_settings/__init__.py
98
import six import unittest import warnings from scrapy.settings import Settings, SettingsAttribute, CrawlerSettings from tests import mock from . import default_settings class SettingsAttributeTest(unittest.TestCase): def setUp(self): self.attribute = SettingsAttribute('value', 10) def test_set_gre...
matt-hayden/cutils
refs/heads/master
pycutils/cutils/cver.py
2
#!/usr/bin/env python3 ## INFO ######################################################################## ## ## ## cutils ## ## ====== ...
luci/recipes-py
refs/heads/master
recipe_modules/raw_io/api.py
2
# -*- encoding: utf-8 -*- # Copyright 2014 The LUCI Authors. All rights reserved. # Use of this source code is governed under the Apache License, Version 2.0 # that can be found in the LICENSE file. """Provides objects for reading and writing raw data to and from steps.""" from future import standard_library standard...
futurepr0n/Books-solutions
refs/heads/master
Python-For-Everyone-Horstmann/Chapter9-Objects-and-Classes/test_P9_24.py
1
# Unit tests for P9_24.py # IMPORTS from P9_24 import Message import unittest # main class MessageTests(unittest.TestCase): def setUp(self): self.m = Message("John", "Mary") def test_to_string(self): self.assertEqual("From: John\nTo: Mary\n", self.m.to_string()) def test_add_message(se...
plusky/spec-cleaner
refs/heads/master
spec_cleaner/rpmcheck.py
1
# vim: set ts=4 sw=4 et: coding=UTF-8 from .rpmsection import Section class RpmCheck(Section): """ Replace various troublemakers in check phase """ def add(self, line): line = self._complete_cleanup(line) # smp_mflags for jobs if not self.reg.re_comment.match(line) and ...
tysonclugg/django
refs/heads/master
tests/template_tests/syntax_tests/test_named_endblock.py
521
from django.template import TemplateSyntaxError from django.test import SimpleTestCase from ..utils import setup class NamedEndblockTests(SimpleTestCase): @setup({'namedendblocks01': '1{% block first %}_{% block second %}' '2{% endblock second %}_{% endblock first %}3'}) def ...
nlholdem/icodoom
refs/heads/master
.venv/lib/python2.7/site-packages/pip/_vendor/distlib/version.py
335
# -*- coding: utf-8 -*- # # Copyright (C) 2012-2016 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # """ Implementation of a flexible versioning scheme providing support for PEP-440, setuptools-compatible and semantic versioning. """ import logging import re from .compat import string_types ...
participedia/pontoon
refs/heads/master
pontoon/base/apps.py
3
from django.apps import AppConfig from django.contrib import admin from django.contrib.admin.sites import AdminSite import session_csrf from session_csrf import anonymous_csrf class BaseConfig(AppConfig): name = 'pontoon.base' verbose_name = 'Base' _has_patched = False def ready(self): supe...
chengduoZH/Paddle
refs/heads/develop
python/paddle/fluid/tests/unittests/test_cos_sim_op.py
5
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
yukaReal/selenium
refs/heads/master
py/selenium/webdriver/common/action_chains.py
67
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
SungEun-Steve-Kim/test-mp
refs/heads/master
tests/bytecode/mp-tests/try3.py
22
def f(): try: f() except: g() finally: f() try: f() except Exception: g() finally: f()
dvliman/jaikuengine
refs/heads/master
common/protocol/__init__.py
1073
# Copyright 2009 Google 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 writing, ...
talumbau/blaze
refs/heads/master
blaze/io/sql/query.py
6
""" SQL query execution. """ from __future__ import absolute_import, division, print_function from . import db from datashape import DataShape, Record from dynd import nd def execute(conn, dshape, query, params): """ Execute a query on the given connection and return a Result that can be iterated over ...
40223134/w16b_test
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/unittest/test/support.py
770
import unittest class TestEquality(object): """Used as a mixin for TestCase""" # Check for a valid __eq__ implementation def test_eq(self): for obj_1, obj_2 in self.eq_pairs: self.assertEqual(obj_1, obj_2) self.assertEqual(obj_2, obj_1) # Check for a valid __ne__ impl...
AccelAI/accel.ai
refs/heads/master
flask-aws/lib/python2.7/site-packages/boto/gs/__init__.py
265
# Copyright 2010 Google Inc. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, dis- # trib...
synweap15/pyload
refs/heads/stable
module/plugins/hoster/FiredriveCom.py
15
# -*- coding: utf-8 -*- from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo class FiredriveCom(DeadHoster): __name__ = "FiredriveCom" __type__ = "hoster" __version__ = "0.06" __status__ = "testing" __pattern__ = r'https?://(?:www\.)?(firedrive|putlocker)\.com/(mobile...
vogelsgesang/checkmate
refs/heads/master
checkmate/contrib/plugins/javascript/jshint/issues_data.py
5
""" This file is part of checkmate, a meta code checker written in Python. Copyright (C) 2015 Andreas Dewes, QuantifiedCode UG This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3...
gitromand/phantomjs
refs/heads/master
test/www/status.py
101
import cStringIO as StringIO import urlparse def handle_request(req): url = urlparse.urlparse(req.path) body = "<!doctype html><h1>Status: {}</h1>".format(url.query) req.send_response(int(url.query)) req.send_header('Content-Type', 'text/html') req.send_header('Content-Length', str(len(body))) ...
ehenneken/webhook-test
refs/heads/master
gunicorn.conf.py
1
import multiprocessing, os _s = os.environ.get('SERVICE', None) _e = os.environ.get('ENVIRONMENT', 'staging') if _s is None or _s == '': if os.path.exists('/repository'): _s = open('/repository', 'r').read().strip().split('/')[-1] else: _s = os.environ.get('HOSTNAME', 'unknown') APP_NAME = '{...
fusionbox/django-mptt
refs/heads/master
mptt/forms.py
10
""" Form components for working with trees. """ from __future__ import unicode_literals from django import forms from django.forms.forms import NON_FIELD_ERRORS try: from django.utils.encoding import smart_text except ImportError: # pragma: no cover (Django 1.4 compatibility) from django.utils.encoding import ...
LaoZhongGu/kbengine
refs/heads/master
kbe/src/lib/python/Lib/test/test_univnewlines.py
70
# Tests universal newline support for both reading and parsing files. import io import _pyio as pyio import unittest import os import sys from test import support if not hasattr(sys.stdin, 'newlines'): raise unittest.SkipTest( "This Python does not have universal newline support") FATX = 'x' * (2**14) DA...
zwChan/VATEC
refs/heads/master
~/eb-virt/Lib/site-packages/pip/req/req_file.py
143
""" Requirements file parsing """ from __future__ import absolute_import import os import re import shlex import sys import optparse import warnings from pip._vendor.six.moves.urllib import parse as urllib_parse from pip._vendor.six.moves import filterfalse import pip from pip.download import get_file_content from ...