repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
Branlala/docker-sickbeardfr | refs/heads/master | sickbeard/lib/dateutil/tz.py | 270 | """
Copyright (c) 2003-2007 Gustavo Niemeyer <gustavo@niemeyer.net>
This module offers extensions to the standard python 2.3+
datetime module.
"""
__author__ = "Gustavo Niemeyer <gustavo@niemeyer.net>"
__license__ = "PSF License"
import datetime
import struct
import time
import sys
import os
relativedelta = None
pa... |
npp/npp-api | refs/heads/master | data/migrations/0028_auto__add_usaspendingassistanceraw.py | 1 | # -*- 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):
# Adding model 'UsaspendingAssistanceRaw'
db.create_table('data_usaspendingassistanceraw', (
('i... |
Yuriy-Leonov/nova | refs/heads/master | nova/openstack/common/notifier/rpc_notifier.py | 14 | # Copyright 2011 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 req... |
montanapr/Plugin.Video.Mercy | refs/heads/master | servers/sockshare.py | 44 | # -*- coding: iso-8859-1 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para sockshare
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os
from cor... |
GustavoHennig/ansible | refs/heads/devel | lib/ansible/modules/cloud/docker/docker_login.py | 2 | #!/usr/bin/python
#
# (c) 2016 Olaf Kilian <olaf.kilian@symanex.com>
# Chris Houseknecht, <house@redhat.com>
# James Tanner, <jtanner@redhat.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 ... |
TimYi/django | refs/heads/master | django/template/exceptions.py | 483 | """
This module contains generic exceptions used by template backends. Although,
due to historical reasons, the Django template language also internally uses
these exceptions, other exceptions specific to the DTL should not be added
here.
"""
class TemplateDoesNotExist(Exception):
"""
The exception used when ... |
scalable-networks/gnuradio-3.7.2.1 | refs/heads/master | grc/gui/PropsDialog.py | 6 | """
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... |
jasonwee/asus-rt-n14uhp-mrtg | refs/heads/master | tmp/ve_asus-rt-n14uhp-mrtg/lib/python3.4/site-packages/django/test/testcases.py | 15 | from __future__ import unicode_literals
import difflib
import errno
import json
import os
import posixpath
import socket
import sys
import threading
import unittest
import warnings
from collections import Counter
from contextlib import contextmanager
from copy import copy
from functools import wraps
from unittest.util... |
hynnet/openwrt-mt7620 | refs/heads/master | staging_dir/host/lib/python2.7/test/test_xrange.py | 36 | # Python test set -- built-in functions
import test.test_support, unittest
import sys
import pickle
import itertools
import warnings
warnings.filterwarnings("ignore", "integer argument expected",
DeprecationWarning, "unittest")
# pure Python implementations (3 args only), for comparison
def p... |
aspose-pdf/Aspose.Pdf-for-Cloud | refs/heads/master | Examples/Python/Examples/GetSpecificAnnotation.py | 2 | import asposepdfcloud
from asposepdfcloud.PdfApi import PdfApi
from asposepdfcloud.PdfApi import ApiException
import asposestoragecloud
from asposestoragecloud.StorageApi import StorageApi
from asposestoragecloud.StorageApi import ResponseMessage
apiKey = "XXXXX" #sepcify App Key
appSid = "XXXXX" #sepcify App SID
api... |
mmmaaaxxx77/Python-Django-AdminLTE2 | refs/heads/master | SwampdragonTest/SwampdragonTest/sockserver.py | 28 | from swampdragon.connections.sockjs_connection import DjangoSubscriberConnection
class DataConnection(DjangoSubscriberConnection):
pass
|
ptmr3/L900_Kernel | refs/heads/master | tools/perf/scripts/python/failed-syscalls-by-pid.py | 11180 | # failed system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... |
dcsquared13/Diamond | refs/heads/master | src/collectors/mysqlstat/mysqlstat.py | 21 | # coding=utf-8
"""
#### Grants
* Normal usage
```
GRANT REPLICATION CLIENT on *.* TO 'user'@'hostname' IDENTIFIED BY
'password';
```
* For innodb engine status
```
GRANT SUPER ON *.* TO 'user'@'hostname' IDENTIFIED BY
'password';
```
* For innodb engine status on MySQL versions 5.1.24+
```
GRANT PROCESS ON *.* ... |
cuongnv23/ansible | refs/heads/devel | lib/ansible/inventory/helpers.py | 116 | # (c) 2017, Ansible by RedHat Inc,
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ans... |
Wojtechnology/Muzit | refs/heads/master | StreetMuse/lib/python2.7/site-packages/pip/utils/__init__.py | 23 | from __future__ import absolute_import
import contextlib
import locale
import logging
import re
import os
import posixpath
import shutil
import stat
import subprocess
import sys
import tarfile
import zipfile
from pip.exceptions import InstallationError, BadCommand
from pip.compat import console_to_str, stdlib_pkgs
fr... |
mtnman38/Aggregate | refs/heads/master | Executables/Aggregate 0.8.5 for Macintosh.app/Contents/Resources/lib/python2.7/email/mime/base.py | 573 | # Copyright (C) 2001-2006 Python Software Foundation
# Author: Barry Warsaw
# Contact: email-sig@python.org
"""Base class for MIME specializations."""
__all__ = ['MIMEBase']
from email import message
class MIMEBase(message.Message):
"""Base class for MIME specializations."""
def __init__(self, _maintype... |
kylecrawshaw/ShareMounter | refs/heads/master | ShareMounter/main.py | 1 | # -*- coding: utf-8 -*-
#
# main.py
# ShareMounter
#
# Created by Mr. Kyle Crawshaw on 9/27/15.
# Copyright (c) 2015 Kyle Crawshaw. All rights reserved.
#
# import modules required by application
import objc
import Foundation
import AppKit
from PyObjCTools import AppHelper
# import modules containing classes req... |
davidlee1435/MusicWebs | refs/heads/master | run.py | 2 | from app import app
if __name__ == '__main__':
app.run(host='0.0.0.0', port=5000) |
hellojerry/buddy | refs/heads/master | analytics/admin.py | 13848 | from django.contrib import admin
# Register your models here.
|
imarban/socialparq | refs/heads/master | socialparq/views.py | 1 | from django.http.response import JsonResponse
# Create your views here.
from django.views.generic.base import TemplateView
from mongoengine.errors import DoesNotExist
import numpy
import geometry
from socialparq.models import ZonaParquimetro
class JSONResponseMixin(object):
def render_to_json_response(self, cont... |
asm0dey/Flexget | refs/heads/master | flexget/plugins/modify/extension.py | 11 | from __future__ import unicode_literals, division, absolute_import
import logging
from flexget import plugin
from flexget.event import event
log = logging.getLogger('extension')
class ModifyExtension(object):
"""
Allows specifying file extension explicitly when all other built-in detection mechanisms f... |
jspargo/AneMo | refs/heads/master | django/lib/python2.7/site-packages/django/contrib/sitemaps/tests/test_generic.py | 111 | from __future__ import unicode_literals
from django.test import override_settings
from .base import TestModel, SitemapTestsBase
@override_settings(ABSOLUTE_URL_OVERRIDES={})
class GenericViewsSitemapTests(SitemapTestsBase):
def test_generic_sitemap(self):
"A minimal generic sitemap can be rendered"
... |
Boussadia/weboob | refs/heads/master | modules/cmso/test.py | 4 | # -*- coding: utf-8 -*-
# Copyright(C) 2012 Romain Bignon
#
# This file is part of weboob.
#
# weboob 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 of the License, or
# (at your opti... |
belmiromoreira/nova | refs/heads/master | nova/virt/libvirt/utils.py | 17 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright (c) 2010 Citrix Systems, Inc.
# Copyright (c) 2011 Piston Cloud Computing, Inc
# Copyright (c) 2011 OpenStack Foundation
# (c) Cop... |
fuglu/jenkins-job-builder | refs/heads/master | jenkins_jobs/modules/hudson_model.py | 51 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Li... |
ganeshnalawade/ansible | refs/heads/devel | test/units/modules/test_pip.py | 35 | # Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
import pytest
from ansible.modules import pip
pytestmark = pytest.mark.usefixtures('p... |
Aplopio/elasticsearch_backup | refs/heads/master | elasticsearch_backup/elasticsearch_backup.py | 1 | # -*- coding: utf-8 -*-
import sys
import json
import time
import requests
import datetime
REPO_URI = 'http://{es_node}:9200/_snapshot/{repo}'
def create_s3_repo(node, repo, bucket):
_sys_print('Creating S3 repository...')
repository_config = {
"type": "s3",
"settings": {
"bucket... |
Ashatta/qreal | refs/heads/master | plugins/tools/visualInterpreter/examples/robotsCodeGeneration/reactionsStorage/BalanceGenerator.py | 12 | # Application condition
balance.id == max_used_id and not cur_node_is_processed
# Reaction
balance_code = "balance_control((F32)" + balancer.forward + ", (F32)" + balancer.turn + ", (F32)ecrobot_get_gyro_sensor(NXT_PORT_S" + balancer.port + "), (F32)" + balancer.gyroOffset + ", (F32)nxt_motor_get_count(NXT_PORT_" + ba... |
leki75/ansible | refs/heads/devel | lib/ansible/utils/module_docs_fragments/aws.py | 135 | # (c) 2014, Will Thames <will@thames.id.au>
#
# 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... |
SurfasJones/djcmsrc3 | refs/heads/master | venv/lib/python2.7/site-packages/djangocms_text_ckeditor/cms_plugins.py | 3 | from django.forms.fields import CharField
from django.utils.translation import ugettext_lazy as _
from cms import __version__ as cms_version
from cms.plugin_base import CMSPluginBase
from cms.plugin_pool import plugin_pool
from djangocms_text_ckeditor.widgets import TextEditorWidget
from djangocms_text_ckeditor.models... |
mixja/dpdk | refs/heads/master | app/test/autotest_runner.py | 26 | #!/usr/bin/python
# BSD LICENSE
#
# Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
# 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 sourc... |
uberamd/NGECore2 | refs/heads/master | scripts/object/tangible/furniture/gcw/gcw_loyalty_painting_01.py | 85615 | import sys
def setup(core, object):
return |
elhuhdron/emdrp | refs/heads/master | emdrp/emdrp/cudaFRAG/parallel-cuda/FRAG_optimize/driver-cpu-FRAG-superchunk.py | 1 | #!/usr/bin/env python
# use python3
import numpy as np
import time
import sys
import argparse
import networkx as nx
import scipy
#from dpLoadh5 import dpLoadh5
from dpFRAG import dpFRAG
import _FRAG_extension as FRAG_extension
#read the input arguments
parser = argparse.ArgumentParser()
parser.add_argument('--size_o... |
dpazel/music_rep | refs/heads/master | transformation/harmonictranscription/t_harmonic_transcription_examples.py | 1 | from harmoniccontext.harmonic_context import HarmonicContext
from harmoniccontext.harmonic_context_track import HarmonicContextTrack
from structure.LineGrammar.core.line_grammar_executor import LineGrammarExecutor
from transformation.harmonictranscription.t_harmonic_transcription import THarmonicTranscription
from time... |
matk86/pymatgen | refs/heads/master | pymatgen/cli/feff_plot_dos.py | 11 | #!/usr/bin/env python
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
Script to plot density of states (DOS) generated by an FEFF run
either by site, element, or orbital
"""
from __future__ import division
__author__ = "Alan Dozier"
__credits__= "Anub... |
playfulgod/kernel_lge_l1m | refs/heads/master | tools/perf/scripts/python/check-perf-trace.py | 11214 | # perf script event handlers, generated by perf script -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. ... |
vSlipenchuk/ac100hd | refs/heads/master | tools/perf/scripts/python/check-perf-trace.py | 11214 | # perf script event handlers, generated by perf script -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. ... |
transtats/transtats | refs/heads/devel | dashboard/services/consume/decorators.py | 1 | # Copyright 2020 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
agry/NGECore2 | refs/heads/master | scripts/object/tangible/lair/base/poi_all_lair_garbage_small_fog_red.py | 85615 | import sys
def setup(core, object):
return |
haad/ansible | refs/heads/devel | test/units/plugins/lookup/test_lastpass.py | 153 | # (c)2016 Andrew Zenk <azenk@umn.edu>
#
# 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.
#
# ... |
FireWRT/OpenWrt-Firefly-Libraries | refs/heads/master | staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python2.7/test/test_nis.py | 45 | from test import test_support
import unittest
nis = test_support.import_module('nis')
class NisTests(unittest.TestCase):
def test_maps(self):
try:
maps = nis.maps()
except nis.error, msg:
# NIS is probably not active, so this test isn't useful
self.skipTest(str(... |
LiveZenLK/CeygateERP | refs/heads/master | addons/website_membership/__init__.py | 3964 | import controllers
import models
|
tallakahath/pymatgen | refs/heads/master | pymatgen/analysis/diffraction/xrd.py | 2 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import division, unicode_literals
from math import sin, cos, asin, pi, degrees, radians
import os
import collections
import numpy as np
import json
from pymatgen.symmetry.analyzer import Spac... |
Chilledheart/chromium | refs/heads/master | tools/telemetry/third_party/gsutilz/third_party/protorpc/protorpc/wsgi/service.py | 19 | #!/usr/bin/env python
#
# Copyright 2011 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 o... |
Designist/audacity | refs/heads/master | lib-src/lv2/lv2/plugins/eg-fifths.lv2/waflib/Tools/qt4.py | 177 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
try:
from xml.sax import make_parser
from xml.sax.handler import ContentHandler
except ImportError:
has_xml=False
ContentHandler=object
else:
has_xml=True
import os,sys
f... |
irwinlove/scrapy | refs/heads/master | scrapy/squeues.py | 133 | """
Scheduler queues
"""
import marshal
from six.moves import cPickle as pickle
from queuelib import queue
def _serializable_queue(queue_class, serialize, deserialize):
class SerializableQueue(queue_class):
def push(self, obj):
s = serialize(obj)
super(SerializableQueue, self).p... |
Stok/EDMSuite | refs/heads/master | EDMScripts/EDMLoop_neg_slope.py | 2 | # Import a whole load of stuff
from System.IO import *
from System.Drawing import *
from System.Runtime.Remoting import *
from System.Threading import *
from System.Windows.Forms import *
from System.Xml.Serialization import *
from System import *
from Analysis.EDM import *
from DAQ.Environment import *
fro... |
dylanaraps/pywal | refs/heads/master | pywal/theme.py | 1 | """
Theme file handling.
"""
import logging
import os
import random
import sys
from .settings import CACHE_DIR, CONF_DIR, MODULE_DIR
from . import util
def list_out():
"""List all themes in a pretty format."""
dark_themes = [theme.name.replace(".json", "")
for theme in list_themes()]
l... |
fakedrake/WikipediaBase | refs/heads/master | tests/test_fetcher.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_fetcher
----------------------------------
Tests for `fetcher` module.
"""
try:
import unittest2 as unittest
except ImportError:
import unittest
import re
from wikipediabase import fetcher
class TestFetcher(unittest.TestCase):
def setUp(self):
... |
lucius-feng/cookiecutter | refs/heads/master | tests/test_utils.py | 26 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_utils
------------
Tests for `cookiecutter.utils` module.
"""
import os
import pytest
import stat
import sys
from cookiecutter import utils
def make_readonly(path):
"""Helper function that is called in the tests to change the access
permissions of the... |
zenlambda/pip | refs/heads/develop | pip/_vendor/requests/packages/__init__.py | 1849 | from __future__ import absolute_import
from . import urllib3
|
amisrs/one-eighty | refs/heads/master | angular_flask/lib/python2.7/site-packages/sqlalchemy/orm/instrumentation.py | 10 | # orm/instrumentation.py
# Copyright (C) 2005-2013 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
"""Defines SQLAlchemy's system of class instrumentation.
This module is usuall... |
AndroidOpenDevelopment/android_external_chromium_org | refs/heads/lp | native_client_sdk/src/doc/_sphinxext/chromesite_builder.py | 10 | # 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.
#
# This is a Sphinx extension.
#
from __future__ import print_function
import codecs
from collections import namedtuple, OrderedDict
import os
import strin... |
egabancho/invenio | refs/heads/pu | invenio/modules/formatter/format_elements/bfe_abstract.py | 4 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## ... |
Quihico/repository.spartacus | refs/heads/master | script.trtv/dixie.py | 1 | #
# Copyright (C) 2014 Richard Dean
#
# 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, or (at your option)
# any later version.
#
# This Program is distributed in the ... |
ramusus/django-oauth-tokens | refs/heads/master | settings_test.py | 1 | INSTALLED_APPS = (
'taggit',
)
OAUTH_TOKENS_TWITTER_CLIENT_ID = 'NLKrDQAE6YcSi76b0PGSg'
OAUTH_TOKENS_TWITTER_CLIENT_SECRET = '4D8TBznBjiJWlRE00G4qETLNNmfFadiKbREDrmNSDE'
OAUTH_TOKENS_TWITTER_USERNAME = 'baranus1@mail.ru'
OAUTH_TOKENS_TWITTER_PASSWORD = 'jcej9EIAQrrptDBy'
|
brinbois/Sick-Beard | refs/heads/development | lib/hachoir_core/language.py | 90 | from lib.hachoir_core.iso639 import ISO639_2
class Language:
def __init__(self, code):
code = str(code)
if code not in ISO639_2:
raise ValueError("Invalid language code: %r" % code)
self.code = code
def __cmp__(self, other):
if other.__class__ != Language:
... |
ajaysaini725/spark | refs/heads/master | python/pyspark/ml/wrapper.py | 8 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
GoogleCloudPlatform/mlops-on-gcp | refs/heads/master | on_demand/kfp-caip-sklearn/lab-02-kfp-pipeline/pipeline/covertype_training_pipeline.py | 3 | # Copyright 2019 Google LLC
#
# 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, ... |
dcprojects/CoolProp | refs/heads/master | Web/scripts/fluid_properties.REFPROPcomparison.py | 3 | from __future__ import print_function
import os.path
import CoolProp, CoolProp.CoolProp as CP
import subprocess
import sys
web_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
root_dir = os.path.abspath(os.path.join(web_dir, '..'))
fluids_path = os.path.join(web_dir,'fluid_properties','fluids')
plo... |
BeATz-UnKNoWN/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/encodings/bz2_codec.py | 55 | """Python 'bz2_codec' Codec - bz2 compression encoding.
This codec de/encodes from bytes to bytes and is therefore usable with
bytes.transform() and bytes.untransform().
Adapted by Raymond Hettinger from zlib_codec.py which was written
by Marc-Andre Lemburg (mal@lemburg.com).
"""
import codecs
import bz2 # this code... |
billyhunt/osf.io | refs/heads/develop | scripts/consistency/impute_wiki_date.py | 64 | """Due to an unknown bug, wiki pages were saved without dates between
September 4 and 6. This script identifies wiki pages without dates and
imputes dates using ObjectIds.
Dry run: python -m scripts/consistency/impute_wiki_date
Real: python -m scripts/consistency/impute_wiki_date false
"""
from bson import ObjectId
... |
jalavik/inspire-next | refs/heads/master | inspire/testsuite/__init__.py | 3 | # -*- coding: utf-8 -*-
#
# This file is part of INSPIRE.
# Copyright (C) 2014, 2015 CERN.
#
# INSPIRE 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... |
galaxor/Nodewatcher | refs/heads/master | generator/build_image.py | 1 | #!/usr/bin/python
#
# nodewatcher OpenWRT image builder
#
# Copyright (C) 2008 Jernej Kos <kostko@unimatrix-one.org>
#
from config_generator import OpenWrtConfig, portLayouts
from optparse import OptionParser
import os
import sys
print "============================================================================"
prin... |
lmEshoo/st2contrib | refs/heads/master | packs/mqtt/actions/publish.py | 10 | from st2actions.runners.pythonrunner import Action
import paho.mqtt.publish as publish
class PublishAction(Action):
def __init__(self, config):
super(PublishAction, self).__init__(config)
# Sensor/Action Mismatch
self._config = self.config
self._client = None
self._hostna... |
bootswithdefer/ansible | refs/heads/devel | v2/ansible/utils/listify.py | 26 | # (c) 2014 Michael DeHaan, <michael@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later ve... |
RyanChinSang/ECNG3020-ORSS4SCVI | refs/heads/master | BETA/TestCode/Tensorflow/Test/object_detection/protos/image_resizer_pb2.py | 7 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: object_detection/protos/image_resizer.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protob... |
mugurrus/superdesk-core | refs/heads/master | content_api/publish/__init__.py | 7 | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
import super... |
s40523139/2017springwcm_hw | refs/heads/gh-pages | data/hw1/wcm_hw1.py | 10 | import os
adata = open("wcm_w1_hw.txt", encoding="UTF-8").read()
alist = adata.splitlines()
#n = 0
# 以 row 當作 ethercalc 取資料的列數
row = 0
for stud_num in alist:
row = row + 1
blist=stud_num.split("\t")
# 從 len(數列) 可以知道其長度
# 以下利用 for 迴圈與 range() 一一取出個數列元素
# 以 column 當作 ethercalc 取資料的行數
column = 0
... |
foreni-packages/pefile | refs/heads/master | pefile.py | 18 | # -*- coding: Latin-1 -*-
"""pefile, Portable Executable reader module
All the PE file basic structures are available with their default names
as attributes of the instance returned.
Processed elements such as the import table are made available with lowercase
names, to differentiate them from the upper case basic s... |
wooga/airflow | refs/heads/master | tests/providers/google/cloud/hooks/test_dlp.py | 1 | #
# 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... |
menardorama/ReadyNAS-Add-ons | refs/heads/master | headphones-1.0.0/debian/headphones/apps/headphones/lib/requests/packages/chardet/latin1prober.py | 1777 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... |
soapy/soapy | refs/heads/master | versioneer.py | 47 |
# Version: 0.12
"""
The Versioneer
==============
* like a rocketeer, but for versions!
* https://github.com/warner/python-versioneer
* Brian Warner
* License: Public Domain
* Compatible With: python2.6, 2.7, 3.2, 3.3, 3.4, and pypy
[]... |
gordon-elliott/glod | refs/heads/master | src/glod/unittests/db/__init__.py | 9 | __copyright__ = 'Copyright(c) Gordon Elliott 2017'
"""
"""
|
eatmore/python_learning | refs/heads/master | break.py | 1 | n = 1
while n <= 100:
if n > 10:
break
print(n)
n = n +1
print('END')
|
elifesciences/lax | refs/heads/develop | src/publisher/relation_logic.py | 1 | from functools import partial
from publisher import models, codes
from publisher.utils import create_or_update, lmap, ensure, first, StateError, msid2doi
import logging
from django.conf import settings
LOG = logging.getLogger(__name__)
def remove_relationships(av):
"destroys any relationships that may exist for ... |
pinkavaj/gnuradio | refs/heads/master | gr-blocks/python/blocks/__init__.py | 47 | #
# Copyright 2012 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 your option)
# any later version.
#
#... |
conejoninja/plugin.video.pelisalacarta | refs/heads/master | core/platform_name.py | 10 | PLATFORM_NAME = "xbmceden" |
donniexyz/calligra | refs/heads/master | 3rdparty/google-breakpad/src/tools/gyp/test/scons_tools/gyptest-tools.py | 240 | #!/usr/bin/env python
# Copyright (c) 2009 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.
"""
Verifies that a scons build picks up tools modules specified
via 'scons_tools' in the 'scons_settings' dictionary.
"""
import TestGyp
... |
jmr2704/betakore-alien | refs/heads/master | src/scons-local-2.0.1/SCons/Variables/PackageVariable.py | 61 | """engine.SCons.Variables.PackageVariable
This file defines the option type for SCons implementing 'package
activation'.
To be used whenever a 'package' may be enabled/disabled and the
package path may be specified.
Usage example:
Examples:
x11=no (disables X11 support)
x11=yes (will search for the... |
MingdaZhou/gnuradio | refs/heads/master | gr-digital/python/digital/utils/alignment.py | 68 | #!/usr/bin/env python
#
# Copyright 2011 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 your option)
... |
fernandog/Medusa | refs/heads/optimized | ext/js2py/py_node_modules/__init__.py | 1 | """this package contains all the npm modules translated by js2py via node import"""
|
Faylixe/screenflow | refs/heads/master | screenflow/screenflow.py | 1 | #!/usr/bin/env python
# coding: utf-8
"""
ScreenFlow
==========
ScreenFlow class is the library entry point, which implements all the logic
to manages event, handles screen creation, and so on.
Screen binding
--------------
Each screen belonging to your screenflow can be retrieved using
... |
pydoit/doit | refs/heads/master | doc/samples/verbosity.py | 10 | def task_print():
return {'actions': ['echo hello'],
'verbosity': 2}
|
snbuback/django-guardian | refs/heads/master | guardian/tests/shortcuts_test.py | 37 | from __future__ import unicode_literals
import warnings
from django.contrib.contenttypes.models import ContentType
from django.db.models.query import QuerySet
from django.test import TestCase
from guardian.shortcuts import get_perms_for_model
from guardian.core import ObjectPermissionChecker
from guardian.compat imp... |
52ai/django-ccsds | refs/heads/master | tests/auth_tests/test_handlers.py | 328 | from __future__ import unicode_literals
from django.contrib.auth.handlers.modwsgi import (
check_password, groups_for_user,
)
from django.contrib.auth.models import Group, User
from django.contrib.auth.tests.custom_user import CustomUser
from django.test import TransactionTestCase, override_settings
# This must ... |
N3MIS15/maraschino-webcam | refs/heads/master | lib/werkzeug/templates.py | 95 | # -*- coding: utf-8 -*-
r"""
werkzeug.templates
~~~~~~~~~~~~~~~~~~
A minimal template engine.
:copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD License.
"""
import sys
import re
import __builtin__ as builtins
from compiler import ast, parse
from compiler.pycode... |
pdsteele/socialNetworksProject | refs/heads/master | proj-TransChungLu.py | 2 |
import time
import random
from PriorityQueue import *
from sets import Set
import sys
import os
import bisect
import math
def Bernouli(p):
rand = random.random()
if rand > p:
return 1 #Failure/Random Node Selection
return 0 #Success/Specific Node
def ChungLu():# We must set both FileName,edg... |
mhilton/juju-juju | refs/heads/master | scripts/jujuman.py | 27 | """Functions for generating the manpage using the juju command."""
import subprocess
import textwrap
import time
class JujuMan(object):
def __init__(self):
self.version = self._version()
def get_filename(self, options):
"""Provides name of manpage"""
return 'juju.1'
def run_juj... |
yury-s/v8-inspector | refs/heads/master | Source/chrome/tools/json_schema_compiler/schema_util_test.py | 169 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from schema_util import JsFunctionNameToClassName
from schema_util import StripNamespace
import unittest
class SchemaUtilTest(unit... |
rholy/librepo | refs/heads/master | examples/python/download_remote_yum_repo.py | 6 | #!/usr/bin/python
"""
librepo - example of usage
"""
import os
import sys
import shutil
from pprint import pprint
import librepo
DESTDIR = "downloaded_metadata"
PROGRESSBAR_LEN = 50
def callback(data, total_to_download, downloaded):
"""Progress callback"""
if total_to_download <= 0:
return
comp... |
ktnyt/chainer | refs/heads/master | examples/caffe_export/export.py | 2 | import argparse
import os
import numpy as np
import chainer
from chainer.exporters import caffe
from chainer.links.model.vision import googlenet
from chainer.links.model.vision import resnet
from chainer.links.model.vision import vgg
archs = {
'googlenet': googlenet.GoogLeNet,
'resnet50': resnet.ResNet50Laye... |
maniteja123/sympy | refs/heads/master | sympy/benchmarks/bench_symbench.py | 96 | #!/usr/bin/env python
from __future__ import print_function, division
from sympy.core.compatibility import range
from random import random
from sympy import factor, I, Integer, pi, simplify, sin, sqrt, Symbol, sympify
from sympy.abc import x, y, z
from timeit import default_timer as clock
def bench_R1():
"real(f... |
nesi/easybuild-framework | refs/heads/master | easybuild/toolchains/__init__.py | 9 | ##
# Copyright 2012-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
# the Hercules foundation (htt... |
caveman-dick/ansible | refs/heads/devel | test/units/module_utils/basic/test_argument_spec.py | 37 | # Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division)
__metaclass__ = type
import json
from ansible.compat.tests import unittest
from ansible.compat.tests.mock import MagicMock
from units.mo... |
Acehaidrey/incubator-airflow | refs/heads/master | tests/providers/microsoft/mssql/hooks/__init__.py | 5130 | #
# 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... |
rahul003/mxnet | refs/heads/master | example/gluon/style_transfer/dataset/download_dataset.py | 35 | # 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... |
nvoron23/arangodb | refs/heads/devel | 3rdParty/V8-4.3.61/build/gyp/test/mac/gyptest-xcode-env-order.py | 75 | #!/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.
"""
Verifies that dependent Xcode settings are processed correctly.
"""
import TestGyp
import subprocess
import sys
def XcodeVersion():
... |
internap/fake-switches | refs/heads/master | fake_switches/brocade/command_processor/enabled.py | 4 | # Copyright 2015-2016 Internap.
#
# 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 writin... |
kundancool/android_kernel_xiaomi_msm8974 | refs/heads/cm-13.0 | scripts/build-all.py | 1474 | #! /usr/bin/env python
# Copyright (c) 2009-2013, The Linux Foundation. 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
# ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.