repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
todaychi/hue | refs/heads/master | desktop/core/ext-py/Django-1.6.10/django/contrib/admindocs/models.py | 634 | # Empty models.py to allow for specifying admindocs as a test label.
|
sandeepgupta2k4/tensorflow | refs/heads/master | tensorflow/python/summary/plugin_asset.py | 117 | # 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... |
glatard/nipype | refs/heads/master | nipype/interfaces/c3.py | 15 | """The ants module provides basic functions for interfacing with ants functions.
Change directory to provide relative paths for doctests
>>> import os
>>> filepath = os.path.dirname( os.path.realpath( __file__ ) )
>>> datadir = os.path.realpath(os.path.join(filepath, '../testing/data'))
>>> os.chdir(dat... |
TomBaxter/osf.io | refs/heads/develop | api_tests/nodes/views/test_node_sparse_fieldsets.py | 5 | import pytest
from api.base.settings.defaults import API_BASE
from osf_tests.factories import (
ProjectFactory,
AuthUserFactory,
PrivateLinkFactory,
)
from tests.base import ApiTestCase
from website.util import permissions
@pytest.fixture()
def user():
return AuthUserFactory()
@pytest.mark.django_db
... |
deepmind/lab2d | refs/heads/main | dmlab2d/python/dmlab2d_env.py | 1 | # Copyright 2019 The DMLab2D Authors.
#
# 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... |
citrix-openstack-build/glance | refs/heads/master | glance/db/sqlalchemy/migrate_repo/versions/009_add_mindisk_and_minram.py | 4 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack LLC.
# 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/... |
ptonner/GPy | refs/heads/master | GPy/util/choleskies.py | 8 | # Copyright James Hensman and Max Zwiessele 2014, 2015
# Licensed under the BSD 3-clause license (see LICENSE.txt)
import numpy as np
from . import linalg
from .config import config
try:
from . import choleskies_cython
config.set('cython', 'working', 'True')
except ImportError:
config.set('cython', 'workin... |
yashwanth686007/TizenRTOS | refs/heads/master | external/iotivity/iotivity_1.2-rel/extlibs/gtest/gtest-1.7.0/scripts/fuse_gtest_files.py | 2577 | #!/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... |
SMERM/TR-2015-2016 | refs/heads/master | A.A.-2015-2016/20160125/crescendi100000.py | 1 | import math
import Pro_crescendi_gliss_amp
import random
print "f1 0 4096 10 1"
amp= -30 #Conversione all'incirca di 1000 in db (1000/32768)
num_note= 100
n=0
totdur= 60.0
ampmin= 20*math.log10(100.0/32768)
ampmax= 20*math.log10(1500.0/32768)
amprange= (ampmax-ampmin)/2
ampfreq= 5/totdur
ampoffset= ampmin+amprange
prin... |
goodwinnk/intellij-community | refs/heads/master | python/testData/refactoring/changeSignature/overloadsAndImplementationInClassChangeCall.before.py | 58 | from typing import overload
class A:
@overload
def foo(self, value: str) -> None:
pass
@overload
def foo(self, value: int) -> str:
pass
def foo(self, value):
return None
A().foo<caret>("") |
Soya93/Extract-Refactoring | refs/heads/master | python/testData/addImport/newThirdPartyImportInBetween/main.after.py | 75 | import sys
import third_party
import a
print(sys, third_party, a) |
brocade/pynos | refs/heads/master | pynos/versions/base/yang/brocade_nameserver.py | 10 | #!/usr/bin/env python
import xml.etree.ElementTree as ET
class brocade_nameserver(object):
"""Auto generated class.
"""
def __init__(self, **kwargs):
self._callback = kwargs.pop('callback')
def get_nameserver_detail_input_rbridge_id(self, **kwargs):
"""Auto Generated Code... |
emmuchira/kps_erp | refs/heads/develop | erpnext/buying/doctype/request_for_quotation/request_for_quotation.py | 3 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe, json
from frappe import _
from frappe.model.mapper import get_mapped_doc
from frappe.utils import get_url, cint
from frap... |
janicduplessis/buck | refs/heads/master | third-party/py/unittest2/unittest2/runner.py | 164 | """Running tests"""
import sys
import time
import unittest
from unittest2 import result
try:
from unittest2.signals import registerResult
except ImportError:
def registerResult(_):
pass
__unittest = True
class _WritelnDecorator(object):
"""Used to decorate file-like objects with a handy 'w... |
globau/servo | refs/heads/master | tests/wpt/css-tests/tools/html5lib/html5lib/__init__.py | 426 | """
HTML parsing library based on the WHATWG "HTML5"
specification. The parser is designed to be compatible with existing
HTML found in the wild and implements well-defined error recovery that
is largely compatible with modern desktop web browsers.
Example usage:
import html5lib
f = open("my_document.html")
tree = ht... |
mohamed--abdel-maksoud/chromium.src | refs/heads/nw12 | tools/perf/measurements/measurement_smoke_test.py | 9 | # 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.
"""Measurement smoke test to make sure that no new action_name_to_run is
defined."""
import os
import logging
import unittest
from telemetry import benchmar... |
shinglyu/moztrap | refs/heads/master | tests/view/runtests/test_forms.py | 5 | """
Tests for runtests forms.
"""
from tests import case
class EnvironmentSelectionFormTest(case.DBTestCase):
"""Tests for environment selection form."""
@property
def form(self):
"""The form class under test."""
from moztrap.view.runtests.forms import EnvironmentSelectionForm
re... |
aksalj/whiskerboard | refs/heads/master | settings/docker.py | 1 | from base import *
import imp
#
# Sample docker settings
#
# TODO: Turn off debug
DEBUG = True
if not DEBUG:
ALLOWED_HOSTS = [
# IMPORTANT: See https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts
'status.example.com'
]
# Override SECRET_KEY
SECRET_KEY = os.environ['SECRET_KEY']
... |
yuanagain/seniorthesis | refs/heads/master | venv/lib/python2.7/site-packages/numpy/version.py | 6 |
# THIS FILE IS GENERATED FROM NUMPY SETUP.PY
#
# To compare versions robustly, use `numpy.lib.NumpyVersion`
short_version = '1.11.2'
version = '1.11.2'
full_version = '1.11.2'
git_revision = ''
release = True
if not release:
version = full_version
|
DiNitride/GAFBot | refs/heads/master | modules/gaf.py | 1 | from dinnerplate import BaseCog
import discord
from discord.ext import commands
from utils import checks
class GAF(BaseCog):
def __init__(self, bot):
super().__init__(bot)
@commands.group(invoke_without_command=True)
async def gaf(self, ctx):
"""
Information on The Never Ending ... |
sharad/calibre | refs/heads/master | src/routes/lru.py | 39 | """LRU caching class and decorator"""
import threading
_marker = object()
class LRUCache(object):
def __init__(self, size):
""" Implements a psueudo-LRU algorithm (CLOCK) """
if size < 1:
raise ValueError('size must be >1')
self.clock = []
for i in xrange(0, size):
... |
cnsoft/kbengine-cocos2dx | refs/heads/cocos2dx-cnsoft | demo/res/scripts/cell/skills/base/__init__.py | 15 | # -*- coding: utf-8 -*-
#
"""
"""
from KBEDebug import *
def onInit():
"""
init skills.
"""
pass
|
mollstam/UnrealPy | refs/heads/master | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Python-2.7.10/Doc/includes/mp_pool.py | 11 | #
# A test of `multiprocessing.Pool` class
#
# Copyright (c) 2006-2008, R Oudkerk
# All rights reserved.
#
import multiprocessing
import time
import random
import sys
#
# Functions used by test code
#
def calculate(func, args):
result = func(*args)
return '%s says that %s%s = %s' % (
multiprocessing.... |
PandaPhysics/PandaProd | refs/heads/master | Producer/python/prod.py | 1 | from .opts import options
# Global tags
# https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuideFrontierConditions
if options.config == '31Mar2018':
# re-miniaod of 2017 legacy rereco
options.isData = True
options.globaltag = '94X_dataRun2_ReReco_EOY17_v6'
options.redojec = True
elif options.config ==... |
10clouds/edx-platform | refs/heads/dev | lms/djangoapps/django_comment_client/tests/mock_cs_server/test_mock_cs_server.py | 163 | import unittest
import threading
import json
import urllib2
from django_comment_client.tests.mock_cs_server.mock_cs_server import MockCommentServiceServer
from nose.plugins.skip import SkipTest
class MockCommentServiceServerTest(unittest.TestCase):
'''
A mock version of the Comment Service server that listens... |
t3dev/odoo | refs/heads/master | addons/payment_adyen/tests/__init__.py | 14224 | # -*- coding: utf-8 -*-
|
eduardoftoliveira/qt_scripts | refs/heads/master | tests/test_gaussian.py | 2 | #!/usr/bin/env python
# python modules
import unittest
# qt modules
import gaussian
if __name__ == '__main__':
unittest.main()
|
halberom/ansible | refs/heads/devel | lib/ansible/modules/network/nxos/nxos_gir.py | 6 | #!/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... |
timani/ansible-shell | refs/heads/master | setup.py | 3 | from setuptools import setup
setup(
name='ansible-shell',
version='0.0.5',
author='Nandor Sivok',
author_email='dominis@haxor.hu',
scripts=['ansible-shell'],
url='https://github.com/dominis/ansible-shell',
description='Interactive shell for ansible',
install_requires=[
"ansible ... |
epitron/youtube-dl | refs/heads/master | youtube_dl/extractor/twitter.py | 4 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_urlparse
from ..utils import (
determine_ext,
dict_get,
ExtractorError,
float_or_none,
int_or_none,
remove_end,
try_get,
xpath_text,
)
from .periscope import... |
3v1n0/snapcraft | refs/heads/master | integration_tests/test_dump_plugin.py | 4 | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2015, 2016 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... |
prune998/ansible | refs/heads/devel | lib/ansible/modules/utilities/logic/set_fact.py | 50 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2013 Dag Wieers <dag@wieers.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Lice... |
p2pjack/Virtuous-Beastmode | refs/heads/master | scripts/build-all.py | 308 | #! /usr/bin/env python
# Copyright (c) 2009-2011, Code Aurora Forum. 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
# n... |
lmmentel/ase-espresso | refs/heads/master | tests/test_relaxation.py | 1 |
# test adapted from Quantum Espresso PWSCF v.5.3.0 (svn rev. 11974)
# : PW/examples/example02
from __future__ import print_function
import numpy as np
from ase import Atoms
from ase.units import Rydberg, Bohr
from ase.optimize import BFGS
from espresso import Espresso, iEspresso
def test_relax_co_qe_bfgs(tmpdir... |
googleapis/python-analytics-admin | refs/heads/master | samples/properties_user_links_update_test.py | 1 | # Copyright 2021 Google LLC All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... |
filias/django | refs/heads/master | django/conf/locale/de_CH/formats.py | 504 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
from __future__ import unicode_literals
DATE_FORMAT = 'j. F Y'
TIME_FORMAT = 'H:i'
DATE... |
alefnula/perart | refs/heads/master | src/djangoappengine/tests/__init__.py | 70 | from .backend import BackendTest
from .field_db_conversion import FieldDBConversionTest
from .field_options import FieldOptionsTest
from .filter import FilterTest
from .order import OrderTest
from .not_return_sets import NonReturnSetsTest
from .decimals import DecimalTest
from .transactions import TransactionTest
|
howiworkdaily/scofield-project | refs/heads/master | scofield/core/context_processors.py | 1 | from django.contrib.auth.models import User
from category.models import *
from manufacturer.models import *
def dynamic_menus(request):
"""
If middleware is your thing and you don't mind the overhead of unneeded queries in views that don't
require these menus, uncomment the following and add to your MIDD... |
TRox1972/youtube-dl | refs/heads/master | youtube_dl/extractor/generic.py | 1 | # coding: utf-8
from __future__ import unicode_literals
import os
import re
import sys
from .common import InfoExtractor
from .youtube import YoutubeIE
from ..compat import (
compat_etree_fromstring,
compat_urllib_parse_unquote,
compat_urlparse,
compat_xml_parse_error,
)
from ..utils import (
det... |
tgsmith61591/skutil | refs/heads/master | doc/conf.py | 1 | # -*- coding: utf-8 -*-
#
# skutil documentation build configuration file, created by
# sphinx-quickstart on Sun Oct 9 00:16:56 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# Al... |
UnrememberMe/pants | refs/heads/master | contrib/node/tests/python/pants_test/contrib/node/targets/test_node_remote_module.py | 25 | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants_test.base... |
LeonardCohen/coding | refs/heads/master | py/greatest_common_divisor.py | 1 |
# http://stackoverflow.com/questions/11175131
# https://en.wikipedia.org/wiki/Euclidean_algorithm
# https://en.wikipedia.org/wiki/Greatest_common_divisor
def gcd1(a, b):
# time O(logn), space O(1), division-based version
while b:
#a, b = b, a%b
tmp = a
a = b
b = tmp%b
retu... |
edx/lettuce | refs/heads/master | tests/integration/lib/Django-1.2.5/tests/regressiontests/formwizard/forms.py | 104 | from django import forms
from django.contrib.formtools.wizard import FormWizard
from django.http import HttpResponse
class Page1(forms.Form):
name = forms.CharField(max_length=100)
thirsty = forms.NullBooleanField()
class Page2(forms.Form):
address1 = forms.CharField(max_length=100)
address2 = forms.C... |
loghaan/warmice | refs/heads/master | lib/python/docutils/writers/s5_html/__init__.py | 2 | # $Id: __init__.py 7720 2013-09-05 12:54:56Z milde $
# Authors: Chris Liechti <cliechti@gmx.net>;
# David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
S5/HTML Slideshow Writer.
"""
__docformat__ = 'reStructuredText'
import sys
import os
import re
import do... |
anthonydillon/horizon | refs/heads/master | openstack_dashboard/dashboards/admin/defaults/urls.py | 66 | # Copyright 2013 Kylin, 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... |
richard-fisher/repository | refs/heads/master | graphics/gimp/actions.py | 1 | #!/usr/bin/python
from pisi.actionsapi import get, autotools, pisitools
def setup():
autotools.configure("--disable-static --enable-shared")
def build():
autotools.make()
def install():
autotools.rawInstall("DESTDIR=%s" % get.installDIR())
pisitools.dodoc("LICENSE", "ChangeLog", "COPYING", "AUT... |
40223249-1/2015cd_midterm | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/urllib/request.py | 616 | from browser import ajax
class FileIO:
def __init__(self, data):
self._data=data
def read(self):
return self._data
def urlopen(url, data=None, timeout=None):
global result
result=None
def on_complete(req):
global result
result=req
_ajax=ajax.ajax()
_ajax.bind('co... |
mzdaniel/oh-mainline | refs/heads/master | vendor/packages/twill/twill/other_packages/_mechanize_dist/_clientcookie.py | 20 | """HTTP cookie handling for web clients.
This module originally developed from my port of Gisle Aas' Perl module
HTTP::Cookies, from the libwww-perl library.
Docstrings, comments and debug strings in this code refer to the
attributes of the HTTP cookie system as cookie-attributes, to distinguish
them clearly from Pyt... |
kennedyshead/home-assistant | refs/heads/dev | homeassistant/components/velbus/config_flow.py | 2 | """Config flow for the Velbus platform."""
import velbus
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import CONF_NAME, CONF_PORT
from homeassistant.core import HomeAssistant, callback
from homeassistant.util import slugify
from .const import DOMAIN
@callback
def velbus... |
living180/vex | refs/heads/master | vex/tests/tempdir.py | 1 | import os
import tempfile
import shutil
from vex.tests import path_type
class TempDir(object):
def __init__(self):
self.path = None
self.open()
def __enter__(self):
return self
def _sanity(self):
assert isinstance(self.path, path_type)
assert b'..' not in self.pat... |
loopCM/chromium | refs/heads/trunk | tools/usb_ids/usb_ids.py | 140 | # 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 itertools
import optparse
import re
VENDOR_PATTERN = re.compile("^(?P<id>[0-9a-fA-F]{4})\s+(?P<name>.+)$")
PRODUCT_PATTERN = re.compile("^\t(?P<i... |
Sorsly/subtle | refs/heads/master | google-cloud-sdk/platform/bq/third_party/oauth2client/file.py | 8 | #!/usr/bin/env python
# Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... |
technologiescollege/Blockly-rduino-communication | refs/heads/master | scripts_XP/Lib/site-packages/prompt_toolkit/buffer_mapping.py | 23 | """
The BufferMapping contains all the buffers for a command line interface, and it
keeps track of which buffer gets the focus.
"""
from __future__ import unicode_literals
from .enums import DEFAULT_BUFFER, SEARCH_BUFFER, SYSTEM_BUFFER, DUMMY_BUFFER
from .buffer import Buffer, AcceptAction
from .history import InMemory... |
AnhNhan/ionicons | refs/heads/master | builder/scripts/generate_font.py | 13 | # Font generation script from FontCustom
# https://github.com/FontCustom/fontcustom/
# http://fontcustom.com/
import fontforge
import os
import md5
import subprocess
import tempfile
import json
import copy
SCRIPT_PATH = os.path.dirname(os.path.abspath(__file__))
INPUT_SVG_DIR = os.path.join(SCRIPT_PATH, '..', '..', '... |
uclouvain/osis | refs/heads/dev | webservices/business.py | 1 | ##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core ... |
Dany3R9/ns-3-dev-ndnSIM | refs/heads/ndnSIM | src/stats/test/examples-to-run.py | 53 | #! /usr/bin/env python
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# A list of C++ examples to run in order to ensure that they remain
# buildable and runnable over time. Each tuple in the list contains
#
# (example_name, do_run, do_valgrind_run).
#
# See test.py for more i... |
zerobatu/edx-platform | refs/heads/master | lms/urls.py | 8 | from django.conf import settings
from django.conf.urls import patterns, include, url
from ratelimitbackend import admin
from django.conf.urls.static import static
import django.contrib.auth.views
from microsite_configuration import microsite
import auth_exchange.views
# Uncomment the next two lines to enable the admi... |
xidianwlc/caffe | refs/heads/dev | src/caffe/test/test_data/generate_sample_data.py | 52 | """
Generate data used in the HDF5DataLayer test.
"""
import os
import numpy as np
import h5py
num_cols = 8
num_rows = 10
height = 5
width = 5
total_size = num_cols * num_rows * height * width
data = np.arange(total_size)
data = data.reshape(num_rows, num_cols, height, width)
data = data.astype('float32')
label = np.... |
jalanb/dotjab | refs/heads/setuping | ipython/profile_jalanb/ipython_config.py | 6 | # Configuration file for ipython.
# pylint: disable=E0602
c = get_config()
# -----------------------------------------------------------------------------
# InteractiveShellApp configuration
# -----------------------------------------------------------------------------
# A Mixin for applications that start Interac... |
rooi/CouchPotatoServer | refs/heads/master | libs/guessit/date.py | 150 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# GuessIt - A library for guessing information from filenames
# Copyright (c) 2011 Nicolas Wack <wackou@gmail.com>
#
# GuessIt is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published by
# the Free ... |
kug3lblitz/Heat-Replay | refs/heads/master | src/code/db/mgmt/mxm/more0.py | 1 | #!/usr/bin/env python
from context import *
from settings.filemgmt import fileManager
from settings.paths import CHARTED_TIDS, MXM, MORE0
def loadSet(fileName):
setName = []
charted = fileManager(CHARTED_TIDS, 'r')
with open(fileName) as lyricsFile:
# to avoid the entire file from being read i... |
samiilvonen/abc4cde_wp4 | refs/heads/master | back-end/python/getMonthlyERA.py | 2 | #!/usr/bin/env python
from ecmwfapi import ECMWFDataServer
import sys, getopt
from dateutils import relativedelta
from datetime import date
def genDates(firstYear,lastYear):
time = date(int(firstYear), 1, 1)
string = time.strftime("%Y%m%d")
while True:
time = time + relativedelt... |
animotron/animos | refs/heads/master | plc/pyfront/encode.py | 12 | import tokenize
from tokenize import Token
if '.' in str(1.0):
from boot import *
#EOF,ADD,SUB,MUL,DIV,POW,AND,OR,CMP,GET,SET,NUMBER,STRING,GGET,GSET,MOVE,DEF,PASS,JUMP,CALL,RETURN,IF,DEBUG,EQ,LE,LT,DICT,LIST,NONE,LEN,POS,PARAMS,IGET,FILE,NAME,NE,HAS,RAISE,SETJMP,MOD,LSH,RSH,ITER,DEL,REGS = 0,1,2,3,4,5,6,7,8,9,10,... |
iheartradio/quick.io | refs/heads/master | docs/conf.py | 1 | # -*- coding: utf-8 -*-
#
# QuickIO documentation build configuration file, created by
# sphinx-quickstart on Sat Oct 13 18:41:38 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All... |
Ca1ne/Enoch-Sense-Kernel | refs/heads/master | tools/perf/scripts/python/netdev-times.py | 11271 | # Display a process of packets and processed time.
# It helps us to investigate networking or network device.
#
# options
# tx: show only tx chart
# rx: show only rx chart
# dev=: show only thing related to specified device
# debug: work with debug mode. It shows buffer status.
import os
import sys
sys.path.append(os... |
goozbach/ansible-modules-core | refs/heads/devel | cloud/amazon/rds.py | 13 | #!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed... |
dnozay/lettuce | refs/heads/master | tests/integration/lib/Django-1.3/django/contrib/messages/storage/base.py | 399 | from django.conf import settings
from django.utils.encoding import force_unicode, StrAndUnicode
from django.contrib.messages import constants, utils
LEVEL_TAGS = utils.get_level_tags()
class Message(StrAndUnicode):
"""
Represents an actual message that can be stored in any of the supported
storage class... |
WladimirSidorenko/CGSA | refs/heads/master | cgsa/lexicon/base.py | 1 | #!/usr/bin/env python
# -*- mode: python; coding: utf-8 -*-
##################################################################
# Documentation
"""Module providing abstract base for all sentiment analyzers.
Attributes:
BaseAnalyzer (class): abstract base for all sentiment analyzers
"""
############################... |
nextgis-extra/tests | refs/heads/master | lib_gdal/pyscripts/test_ogrinfo_py.py | 1 | #!/usr/bin/env python
###############################################################################
# $Id: test_ogrinfo_py.py 33793 2016-03-26 13:02:07Z goatbar $
#
# Project: GDAL/OGR Test Suite
# Purpose: ogrinfo.py testing
# Author: Even Rouault <even dot rouault @ mines-paris dot org>
#
######################... |
anryko/ansible | refs/heads/devel | test/units/modules/storage/netapp/test_na_ontap_net_routes.py | 38 | # (c) 2018, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' unit test template for ONTAP Ansible module '''
from __future__ import print_function
import json
import pytest
from units.compat import unittest
from units.compat.mock import patch, Mock
from ans... |
kernsuite-debian/lofar | refs/heads/master | SAS/DataManagement/StorageQueryService/cache.py | 1 | #!/usr/bin/env python3
# $Id$
'''
TODO: add doc
'''
import logging
import datetime
from time import sleep
from threading import Thread, RLock, Event, current_thread
import os.path
import shutil
from functools import cmp_to_key
from concurrent import futures
from lofar.messaging import EventMessage, ToBus, DEFAULT_BRO... |
openstack/ironic | refs/heads/master | ironic/tests/unit/drivers/modules/redfish/test_raid.py | 1 | # Copyright 2021 DMTF. 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 applicabl... |
npdoty/pywikibot | refs/heads/master | pywikibot/daemonize.py | 5 | # -*- coding: utf-8 -*-
"""Module to daemonize the current process on Unix."""
#
# (C) Pywikibot team, 2007-2015
#
# Distributed under the terms of the MIT license.
#
from __future__ import absolute_import, unicode_literals
__version__ = '$Id$'
import codecs
import os
import sys
is_daemon = False
def daemonize(clo... |
aignas/project_euler | refs/heads/master | src/completed/solution006.py | 2 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
The sum of the squares of the first ten natural numbers is,
1^2 + 2^2 + ... + 10^2 = 385
The square of the sum of the first ten natural numbers is,
(1 + 2 + ... + 10)^2 = 552 = 3025
Hence the difference between the sum of the squares of the first ten natural numbers ... |
kostub/dgraph | refs/heads/master | vendor/github.com/cockroachdb/c-rocksdb/internal/build_tools/amalgamate.py | 45 | #!/usr/bin/python
# amalgamate.py creates an amalgamation from a unity build.
# It can be run with either Python 2 or 3.
# An amalgamation consists of a header that includes the contents of all public
# headers and a source file that includes the contents of all source files and
# private headers.
#
# This script work... |
ubc/edx-platform | refs/heads/release | openedx/core/djangoapps/credit/migrations/0007_auto__add_field_creditprovider_enable_integration__chg_field_creditpro.py | 84 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Removing unique constraint on 'CreditProvider', fields ['provider_url']
... |
kenwang815/KodiPlugins | refs/heads/master | script.module.youtube.dl/lib/youtube_dl/extractor/helsinki.py | 165 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import js_to_json
class HelsinkiIE(InfoExtractor):
IE_DESC = 'helsinki.fi'
_VALID_URL = r'https?://video\.helsinki\.fi/Arkisto/flash\.php\?id=(?P<id>\d+)'
_TEST = {
'url': 'http://video... |
cokelaer/python_notes | refs/heads/master | source/decorators.py | 1 | # decorator without for a function with arguments
def check_validity(f):
"""decorator without for a function with arguments
:param f: function on which the decorator is applied
"""
# this is the actual wrapping
def wrap(*args, **kargs):
"""The decorator accepts functon with arguments and... |
timm/timmnix | refs/heads/master | pypy3-v5.5.0-linux64/lib-python/3/test/test_pulldom.py | 118 | import io
import unittest
import sys
import xml.sax
from xml.sax.xmlreader import AttributesImpl
from xml.dom import pulldom
from test.support import run_unittest, findfile
tstfile = findfile("test.xml", subdir="xmltestdata")
# A handy XML snippet, containing attributes, a namespace prefix, and a
# self-closing ta... |
ccn-2m/django | refs/heads/master | django/views/decorators/csrf.py | 120 | import warnings
from django.middleware.csrf import CsrfViewMiddleware, get_token
from django.utils.decorators import decorator_from_middleware, available_attrs
from functools import wraps
csrf_protect = decorator_from_middleware(CsrfViewMiddleware)
csrf_protect.__name__ = "csrf_protect"
csrf_protect.__doc__ = """
Thi... |
reedessick/lvalertHeartbeat | refs/heads/master | lvalertHeartbeat/lvalert_heartbeat.py | 1 | description = "a module housing useful functions for the heartbeat monitoring of lvalert_listen processes"
author = "Reed Essick (reed.essick@ligo.org)"
#-------------------------------------------------
import os
import socket
import getpass
import binascii
import netrc as NETRC
import json
import time
import multi... |
scalable-networks/gnuradio-3.7.0.1 | refs/heads/master | grc/gui/PropsDialog.py | 5 | """
Copyright 2007, 2008, 2009 Free Software Foundation, Inc.
This file is part of GNU Radio
GNU Radio Companion 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... |
AdaptiveApplications/carnegie | refs/heads/master | tarc_bus_locator_client/numpy-1.8.1/numpy/core/tests/test_errstate.py | 70 | from __future__ import division, absolute_import, print_function
import platform
import numpy as np
from numpy.testing import TestCase, assert_, run_module_suite, dec
class TestErrstate(TestCase):
@dec.skipif(platform.machine() == "armv5tel", "See gh-413.")
def test_invalid(self):
with np.errstate(a... |
edwardslabs/CloudBot | refs/heads/gonzobot | plugins/core/regex_chans.py | 31 | from sqlalchemy import Table, Column, UniqueConstraint, String
from cloudbot import hook
from cloudbot.util import database
table = Table(
"regex_chans",
database.metadata,
Column("connection", String),
Column("channel", String),
Column("status", String),
UniqueConstraint("connection", "channe... |
nickpetty/xerial | refs/heads/master | build/lib/xerial/xerial/__init__.py | 2 | from xerial import * |
Tranzystorek/servo | refs/heads/master | tests/wpt/css-tests/tools/pywebsocket/src/example/abort_wsh.py | 465 | # Copyright 2012, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... |
junhuac/MQUIC | refs/heads/master | src/tools/android/loading/processing.py | 15 | # Copyright 2015 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 json
import os
import os.path
import sys
import loading_model
import loading_trace
def SitesFromDir(directory):
"""Extract sites from a data dire... |
gangadharkadam/vlinkerp | refs/heads/master | erpnext/config/setup.py | 7 | from __future__ import unicode_literals
from frappe import _
from frappe.desk.moduleview import add_setup_section
def get_data():
data = [
{
"label": _("Settings"),
"icon": "icon-wrench",
"items": [
{
"type": "doctype",
"name": "Global Defaults",
"label": _("Global Settings"),
"desc... |
mglukhikh/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/middleware/gzip.py | 321 | import re
from django.utils.text import compress_string
from django.utils.cache import patch_vary_headers
re_accepts_gzip = re.compile(r'\bgzip\b')
class GZipMiddleware(object):
"""
This middleware compresses content if the browser allows gzip compression.
It sets the Vary header accordingly, so that cac... |
yelongyu/chihu | refs/heads/master | venv/lib/python2.7/site-packages/sqlalchemy/dialects/mysql/zxjdbc.py | 55 | # mysql/zxjdbc.py
# Copyright (C) 2005-2016 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
"""
.. dialect:: mysql+zxjdbc
:name: zxjdbc for Jython
:dbapi: zxjdbc
:... |
mbroadst/rethinkdb | refs/heads/next | test/common/http_support/__init__.py | 48 | from .server import *
|
lmazuel/azure-sdk-for-python | refs/heads/master | azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_ssl_predefined_policy_py3.py | 1 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
kinect110/RPSOM | refs/heads/master | src/SOM/Topology.py | 1 | import numpy as np
def hexagonal_tbl (som):
_x = som.map_size_x
_y = som.map_size_y
array = np.zeros ((_y,_x,2),dtype=float)
for i in range(_y):
for j in range(_x):
if i%2==0:
array[i][j][0] = i * np.cos(np.deg2rad(30.))
array[i][j][1] = j
else :
array[i][j][0] = i * np.cos(np.deg2rad(30.))
... |
BartoszCichecki/onlinepython | refs/heads/master | onlinepython/pypy-2.4.0-win32/lib-python/2.7/test/test_epoll.py | 45 | # Copyright (c) 2001-2006 Twisted Matrix Laboratories.
#
# 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, m... |
Ashaba/rms | refs/heads/master | rmslocalenv/lib/python2.7/site-packages/django/contrib/gis/geos/coordseq.py | 374 | """
This module houses the GEOSCoordSeq object, which is used internally
by GEOSGeometry to house the actual coordinates of the Point,
LineString, and LinearRing geometries.
"""
from ctypes import byref, c_double, c_uint
from django.contrib.gis.geos import prototypes as capi
from django.contrib.gis.geos.base import... |
AdaEne/CATMAID | refs/heads/master | scripts/database/describe-concept.py | 4 | #!/usr/bin/env python
from common import db_connection
import sys
limit = 50
if len(sys.argv) != 2:
print >> sys.stderr, "Usage: describe-concept.py <CONCEPT-ID>"
sys.exit(1)
cid = int(sys.argv[1])
c = db_connection.cursor()
# Find which table the concept is really in, and also the project_id:
select = ... |
ninapetrop/Little-Big-Blue | refs/heads/master | node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/tools/pretty_sln.py | 1831 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Prints the information in a sln file in a diffable way.
It first outputs each projects in alphabetical order with their
dependenci... |
matthew-brett/pymc | refs/heads/master | pymc/sandbox/RJMCMC/test_RJMCMC.py | 1 | from numpy.testing import *
from RJMCMC import *
import transd_model
from numpy.testing import *
def test_RJMCMC(NumpyTestCase):
def check(self):
RM = Sampler(transd_model)
RM.sample(100,10,1)
if __name__=='__main__':
NumpyTest().run()
|
sunqb/oa_qian | refs/heads/master | flask/Lib/site-packages/mako/ext/babelplugin.py | 13 | # ext/babelplugin.py
# Copyright (C) 2006-2014 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""gettext message extraction via Babel: http://babel.edgewall.org/"""
from babel.messages.extr... |
gpersistence/tstop | refs/heads/master | python/persistence/Datatypes/PersistenceDiagrams.py | 1 | #TSTOP
#
#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 License, or
#(at your option) any later version.
#
#This program is distributed in the hope that it will be useful,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.