repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
jrnold/pystache
refs/heads/master
setup.py
13
#!/usr/bin/env python # coding: utf-8 """ This script supports publishing Pystache to PyPI. This docstring contains instructions to Pystache maintainers on how to release a new version of Pystache. (1) Prepare the release. Make sure the code is finalized and merged to master. Bump the version number in setup.py, u...
SoftwearDevelopment/spynl
refs/heads/master
spynl/main/dateutils.py
1
""" Functions for handling dates and times. """ from datetime import datetime import dateutil.parser # pylint: disable=E0611 from pytz import utc, timezone from spynl.main.utils import get_request, get_settings, get_user_info def now(tz=None): """Current time, with timezone localised.""" return localize_da...
Alidron/demo-nao
refs/heads/master
alidron-env/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/timeout.py
713
from __future__ import absolute_import # The default socket timeout, used by httplib to indicate that no timeout was # specified by the user from socket import _GLOBAL_DEFAULT_TIMEOUT import time from ..exceptions import TimeoutStateError # A sentinel value to indicate that no timeout was specified by the user in # u...
izadorozhna/tempest
refs/heads/master
tempest/api/compute/admin/test_availability_zone_negative.py
28
# Copyright 2013 NEC Corporation. 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 ...
Kiiwi/Kiiwi.github.io
refs/heads/source
plugins/ipynb/core.py
1
""" Core module that handles the conversion from notebook to HTML plus some utilities """ from __future__ import absolute_import, print_function, division import re import IPython try: # Jupyter from traitlets.config import Config from traitlets import Integer except ImportError: # IPython < 4.0 f...
ofer43211/unisubs
refs/heads/staging
apps/videos/migrations/0047_auto__add_field_nullsubtitles_last_saved_packet__add_field_subtitlever.py
5
# encoding: 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 field 'NullSubtitles.last_saved_packet' db.add_column('videos_nullsubtitles', 'last_saved_pac...
lantianlz/zx
refs/heads/master
www/admin/views_stock.py
1
# -*- coding: utf-8 -*- import json from django.http import HttpResponse, HttpResponseRedirect from django.template import RequestContext from django.shortcuts import render_to_response from django.conf import settings from www.misc.decorators import staff_required, common_ajax_response, verify_permission from www.mi...
MFoster/breeze
refs/heads/master
django/db/backends/postgresql_psycopg2/creation.py
107
import psycopg2.extensions from django.db.backends.creation import BaseDatabaseCreation from django.db.backends.util import truncate_name class DatabaseCreation(BaseDatabaseCreation): # This dictionary maps Field objects to their associated PostgreSQL column # types, as strings. Column-type strings can conta...
olin-computing/assignment-dashboard
refs/heads/master
migrations/versions/be985ed5f992_.py
2
"""add organization_users table Revision ID: be985ed5f992 Revises: Create Date: 2017-02-28 19:51:48.711414 """ import sqlalchemy as sa from alembic import op # revision identifiers, used by Alembic. revision = 'be985ed5f992' down_revision = None branch_labels = None depends_on = None def upgrade(): op.create_t...
RevansChen/online-judge
refs/heads/master
Codewars/6kyu/unique-in-order/Python/solution1.py
1
# Python - 3.6.0 def unique_in_order(iterable): if len(iterable) == 0: return [] cmp = iterable[0] result = [cmp] for e in iterable[1:]: if cmp != e: result.append(e) cmp = e return result
SivagnanamCiena/robotframework
refs/heads/master
atest/robot/output/html_output_stats.py
30
from robot.api import logger class WrongStat(AssertionError): ROBOT_CONTINUE_ON_FAILURE = True def get_total_stats(path): return get_all_stats(path)[0] def get_tag_stats(path): return get_all_stats(path)[1] def get_suite_stats(path): return get_all_stats(path)[2] def get_all_stats(path): logg...
fabioz/pyspeedtin
refs/heads/master
pyspeedtin/tests/test_local_cache.py
1
from pyspeedtin.local_cache import LocalCache def test_local_cache(tmpdir): print(tmpdir) local_cache = LocalCache(str(tmpdir)) local_cache.add('benchmark', {'name': 'bench1'}) local_cache.add('benchmark', {'name': 'bench1'}) # Ignore this one (don't add duplicate data) local_cache.add('benchmark',...
rosmo/ansible
refs/heads/devel
test/units/modules/network/eos/test_eos_bgp.py
38
# # (c) 2019, Ansible by Red Hat, 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 from ansible.module_utils.network.eos.providers.cli.config.bgp.process import Provider from ansib...
a2sheppy/kuma
refs/heads/master
kuma/dashboards/tests/test_views.py
2
import datetime import json from unittest import mock import pytest from django.conf import settings from django.contrib.auth.models import Group, Permission from django.contrib.contenttypes.models import ContentType from django.core.exceptions import ImproperlyConfigured from django.utils.translation import override ...
fkorotkov/pants
refs/heads/master
tests/python/pants_test/backend/graph_info/tasks/test_paths_integration.py
5
# coding=utf-8 # Copyright 2017 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.pant...
shubhdev/edxOnBaadal
refs/heads/master
common/djangoapps/util/json_request.py
110
from functools import wraps import json from django.core.serializers import serialize from django.core.serializers.json import DjangoJSONEncoder from django.db.models.query import QuerySet from django.http import HttpResponse, HttpResponseBadRequest def expect_json(view_function): """ View decorator for simpl...
zylpascal/forum_django
refs/heads/master
forum/urls.py
1
"""forum URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/dev/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-based...
dimven/ClockworkForDynamo
refs/heads/master
nodes/0.9.x/python/Element.ResetOverridesInView.py
12
import clr clr.AddReference('RevitAPI') from Autodesk.Revit.DB import * clr.AddReference("RevitNodes") import Revit clr.ImportExtensions(Revit.Elements) clr.AddReference("RevitServices") import RevitServices from RevitServices.Persistence import DocumentManager from RevitServices.Transactions import TransactionManage...
salberin/libsigrokdecode
refs/heads/master
decoders/onewire_network/__init__.py
5
## ## This file is part of the libsigrokdecode project. ## ## Copyright (C) 2012 Uwe Hermann <uwe@hermann-uwe.de> ## ## 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 Li...
EvanK/ansible
refs/heads/devel
lib/ansible/modules/messaging/rabbitmq/rabbitmq_plugin.py
22
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2013, Chatham Financial <oss@chathamfinancial.com> # 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 = { 'm...
EuroPython/djep
refs/heads/develop
pyconde/accounts/widgets.py
3
# -*- coding: utf-8 -*- from django import forms from django.conf import settings from django.utils.html import escape, conditional_escape from django.utils.safestring import mark_safe from django.utils.translation import ugettext_lazy as _ from easy_thumbnails.files import get_thumbnailer class AvatarWidget(forms.Cl...
xfournet/intellij-community
refs/heads/master
python/helpers/pydev/tests_pydevd_python/debugger_unittest.py
10
try: from urllib import quote, quote_plus, unquote_plus except ImportError: from urllib.parse import quote, quote_plus, unquote_plus #@UnresolvedImport import os import socket import subprocess import sys import threading import time from _pydev_bundle import pydev_localhost IS_PY3K = sys.version_info[0] >...
typemytype/Mechanic
refs/heads/master
Mechanic.roboFontExt/lib/site-packages/requests/packages/chardet/big5freq.py
3132
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
KanchanChauhan/erpnext
refs/heads/develop
erpnext/schools/doctype/room/room.py
54
# -*- coding: utf-8 -*- # Copyright (c) 2015, Frappe Technologies and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document class Room(Document): pass
sacharya/nova
refs/heads/master
nova/tests/virt/baremetal/test_driver.py
1
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # coding=utf-8 # Copyright 2012 Hewlett-Packard Development Company, L.P. # Copyright (c) 2012 NTT DOCOMO, INC. # Copyright (c) 2011 University of Southern California / ISI # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may ...
armani-dev/android_kernel_xiaomi_armani_OLD
refs/heads/cm-12.1
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py
11088
# Core.py - Python extension for perf script, core functions # # 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. from collections import defaultdict def aut...
jpaton/xen-4.1-LJX1
refs/heads/master
tools/xm-test/tests/create/09_create_mem256_pos.py
42
#!/usr/bin/python # Copyright (C) International Business Machines Corp., 2005 # Author: Li Ge <lge@us.ibm.com> # Test Description: # Positive Test # Test for creating domain with mem=256. import sys import re import time from XmTestLib import * rdpath = os.environ.get("RD_PATH") if not rdpath: rdpath = "../ram...
aviciimaxwell/odoo
refs/heads/8.0
addons/website_forum/tests/test_forum.py
199
# -*- coding: utf-8 -*- from .common import KARMA, TestForumCommon from ..models.forum import KarmaError from openerp.exceptions import Warning, AccessError from openerp.tools import mute_logger class TestForum(TestForumCommon): @mute_logger('openerp.addons.base.ir.ir_model', 'openerp.models') def test_ask(...
chinnuabhi/pjsip
refs/heads/master
tests/pjsua/scripts-sendto/200_ice_success_3.py
22
# $Id$ import inc_sip as sip import inc_sdp as sdp sdp = \ """ v=0 o=- 0 0 IN IP4 127.0.0.1 s=pjmedia c=IN IP4 127.0.0.1 t=0 0 m=audio 4000 RTP/AVP 0 101 a=ice-ufrag:1234 a=ice-pwd:5678 a=rtpmap:0 PCMU/8000 a=sendrecv a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-15 a=candidate:XX 1 UDP 1234 127.0.0.1 4000 typ host a...
Fireblend/chromium-crosswalk
refs/heads/master
tools/telemetry/telemetry/timeline/inspector_importer.py
32
# 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. """Imports event data obtained from the inspector's timeline.""" from telemetry.timeline import importer import telemetry.timeline.slice as tracing_slice imp...
zhreshold/mxnet
refs/heads/master
python/mxnet/_ffi/_ctypes/function.py
6
# 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...
mulkieran/justbytes
refs/heads/master
tests/test_deterministic/test_size/test_operations.py
1
# Copyright (C) 2015 - 2019 Red Hat, Inc. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or any later version. # # This library is distributed in t...
bmallin/rosalind-solutions
refs/heads/master
inferring_mrna_from_protein.py
1
from bioinformatics.genetics import AMINO_ACID_TO_RNA_CODON def count_possible_rna_strings(protein, modulus): n = len(AMINO_ACID_TO_RNA_CODON['Stop']) for amino_acid in protein: n *= len(AMINO_ACID_TO_RNA_CODON[amino_acid]) return n % modulus with open('data/inferring_mrna_from_protein.txt') as...
maohongyuan/kbengine
refs/heads/master
kbe/src/lib/python/Tools/scripts/h2py.py
42
#! /usr/bin/env python3 # Read #define's and translate to Python code. # Handle #include statements. # Handle #define macros with one argument. # Anything that isn't recognized or doesn't translate into valid # Python is ignored. # Without filename arguments, acts as a filter. # If one or more filenames are given, ou...
turbokongen/home-assistant
refs/heads/dev
homeassistant/components/gdacs/__init__.py
19
"""The Global Disaster Alert and Coordination System (GDACS) integration.""" import asyncio from datetime import timedelta import logging from aio_georss_gdacs import GdacsFeedManager import voluptuous as vol from homeassistant.config_entries import SOURCE_IMPORT from homeassistant.const import ( CONF_LATITUDE, ...
mdietrichc2c/OCB
refs/heads/8.0
openerp/report/render/render.py
457
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
TNT-Samuel/Coding-Projects
refs/heads/master
DNS Server/Source/Lib/distutils/command/__init__.py
202
"""distutils.command Package containing implementation of all the standard Distutils commands.""" __all__ = ['build', 'build_py', 'build_ext', 'build_clib', 'build_scripts', 'clean', 'install', 'install_lib', 'install_headers', ...
Plain-Andy-legacy/android_external_chromium_org
refs/heads/lp-5.1r1
tools/perf_expectations/PRESUBMIT.py
129
# Copyright (c) 2011 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 perf_expectations. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for details on the presubmit API ...
Jzarecta/pythonjr
refs/heads/master
codigo/raise.py
1
#! /usr/bin/python # -*- coding:utf-8 -*- """ Este programa levantará una excepción con un mensaje propio en caso de que el número ingresado sea negativo. El programa pedirá un número y desplegará la raíz cuadrado de dicho número. En caso de que ocurra un error definido, el programa desplegará el mensaje ...
qitan/SOMS
refs/heads/master
userauth/views.py
1
#!/usr/bin/env python # coding: utf8 ''' @author: qitan @contact: qqing_lai@hotmail.com @file: views.py.py @time: 2017/3/30 16:07 @desc: ''' import functools import warnings from django.shortcuts import render, get_object_or_404, redirect from django.contrib import auth # Create your views here. from django.http impo...
neubot/neubot-client
refs/heads/master
neubot/speedtest/wrapper.py
2
# neubot/speedtest/wrapper.py # # Copyright (c) 2011 Simone Basso <bassosimone@gmail.com>, # NEXA Center for Internet & Society at Politecnico di Torino # # This file is part of Neubot <http://www.neubot.org/>. # # Neubot is free software: you can redistribute it and/or modify # it under the terms of the GNU General ...
disnesquick/ripley
refs/heads/master
scratch/py/backups/backup-20150510b/headers.py
4
HEADER_HUP = b"\x00" HEADER_RESOLVE = b"\x11" HEADER_NOTIFY = b"\x12" HEADER_EVAL = b"\x13" HEADER_REPLY = b"\x14" HEADER_MESSAGE_ERROR = b"\x15" HEADER_GENERAL_ERROR = b"\x16" HEADER_TIME = b"\x17" HEADER_FILTER_IN = b"\x18" HEADER_FILTER_OUT = b"\x19" HEADER_FIL...
pwalczysko/openmicroscopy
refs/heads/develop
components/tools/OmeroPy/test/integration/cmdtest/test_columbus.py
9
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2011-2014 Glencoe Software, Inc. All Rights Reserved. # Use is subject to license terms supplied in LICENSE.txt # # 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...
ledinhphuong/electron-builder
refs/heads/master
packages/dmg-builder/vendor/mac_alias/utils.py
17
# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime ZERO = datetime.timedelta(0) class UTC (datetime.tzinfo): def utcoffset(self, dt): return ZERO def dst(self, dt): return ZERO def tzname(self, dt): return 'UTC' utc = UTC() mac_epoch = datetime.datetim...
abhishek-ch/hue
refs/heads/master
desktop/core/ext-py/Django-1.6.10/tests/admin_scripts/management/commands/noargs_command.py
131
from django.core.management.base import NoArgsCommand class Command(NoArgsCommand): help = "Test No-args commands" requires_model_validation = False def handle_noargs(self, **options): print('EXECUTE:NoArgsCommand options=%s' % sorted(options.items()))
msabramo/ansible
refs/heads/devel
lib/ansible/modules/network/nxos/nxos_evpn_global.py
38
#!/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...
mitchellcash/bitcoin
refs/heads/master
test/functional/test_framework/descriptors.py
51
#!/usr/bin/env python3 # Copyright (c) 2019 Pieter Wuille # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Utility functions related to output descriptors""" import re INPUT_CHARSET = "0123456789()[],'/*abcdefgh@:$%{}IJKLMNOPQR...
groppe/mario
refs/heads/development
src/api/ranking.py
1
#!/usr/bin/python3.6 import json import lib.common.web as webutil import logging from lib import rank @webutil.log_event def average(event, context): ranking_average = { 'rankings': rank.average_individual() } return webutil.respond_success_json(json.dumps(ranking_average)) @webutil.log_event def...
robertwb/incubator-beam
refs/heads/master
learning/katas/python/IO/TextIO/ReadFromText/tests.py
7
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may...
tjcsl/ion
refs/heads/master
intranet/apps/eighth/models.py
1
# pylint: disable=too-many-lines; Allow more than 1000 lines import datetime import logging import string from typing import Collection, Iterable, List, Optional, Union from cacheops import invalidate_obj from sentry_sdk import add_breadcrumb, capture_exception from simple_history.models import HistoricalRecords from...
Onager/plaso
refs/heads/master
tests/cli/helpers/dynamic_output.py
1
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Tests for the dynamic output module CLI arguments helper.""" import argparse import unittest from plaso.cli.helpers import dynamic_output from plaso.lib import errors from plaso.output import dynamic from tests.cli import test_lib as cli_test_lib from tests.cli.helpe...
dpniel/snapcraft
refs/heads/master
snaps_tests/tour_tests/00-SNAPCRAFT/test_01_easy_start.py
11
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 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 the h...
lanzz/sqlbuilder
refs/heads/master
sqlbuilder/sql/base.py
1
# -*- coding: utf-8 -*- """ SQL base syntax """ from __future__ import absolute_import class SQL(object): """ Base for classes that can be rendered as SQL Used as a wrapper for primitive values (values and identifiers) """ @staticmethod def merge(iterable, sep=', '): """ Mer...
siddhika1889/Pydev-Editor
refs/heads/master
tests/pysrc/relative/__init__.py
11
from rel1 import DTest from . import rel1 from . import rel1 as bar
acsone/account-financial-reporting
refs/heads/8.0
account_chart_report/__init__.py
34
# -*- coding: utf-8 -*- ############################################################################### # # OpenERP, Open Source Management Solution # Copyright (C) 2014 Savoir-faire Linux (<www.savoirfairelinux.com>). # # This program is free software: you can redistribute it and/or modify # it under the ...
kochie/TwitterBot
refs/heads/master
TwitterBotServer/manage.py
1
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "TwitterBotServer.settings") try: from django.core.management import execute_from_command_line except ImportError: # The above import may fail for some other reason. Ensure ...
clarkperkins/stackdio
refs/heads/master
stackdio/api/users/migrations/0001_0_8_initial.py
2
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] replaces = [ ...
eatbyte/depot_tools
refs/heads/master
third_party/coverage/version.py
49
"""The version and URL for coverage.py""" # This file is exec'ed in setup.py, don't import anything! __version__ = "3.7" # see detailed history in CHANGES.txt __url__ = "http://nedbatchelder.com/code/coverage" if max(__version__).isalpha(): # For pre-releases, use a version-specific URL. _...
archen/django
refs/heads/master
tests/get_object_or_404/tests.py
63
from __future__ import unicode_literals from django.http import Http404 from django.shortcuts import get_object_or_404, get_list_or_404 from django.test import TestCase from .models import Author, Article class GetObjectOr404Tests(TestCase): def test_get_object_or_404(self): a1 = Author.objects.create(n...
TheWizoid/Basic-discord-bot
refs/heads/master
bot.py
1
#It works! import asyncio import discord import json import oauth2 import os import pafy import pickle import simplejson import sys import time from datetime import datetime from random import randint import urllib import urllib.request import urllib.response import urllib.error import youtube_dl im...
mediafactory/yats
refs/heads/master
modules/yats/admin.py
1
# -*- coding: utf-8 -*- from django.contrib import admin from django.contrib.auth.admin import UserAdmin from django.contrib.auth.models import User from yats.models import UserProfile, organisation, ticket_type, ticket_priority, ticket_resolution, ticket_flow @admin.register(organisation, ticket_type, ticket_priority...
collex100/odoo
refs/heads/8.0
openerp/addons/base/tests/test_qweb.py
289
# -*- coding: utf-8 -*- import cgi import json import os.path import glob import re import collections from lxml import etree import openerp.addons.base.ir.ir_qweb import openerp.modules from openerp.tests import common from openerp.addons.base.ir import ir_qweb class TestQWebTField(common.TransactionCase): def ...
theoryno3/luigi
refs/heads/master
sitecustomize.py
56
import os import sys def patch_process_for_coverage(): # patch multiprocessing module to get coverage # https://bitbucket.org/ned/coveragepy/issue/117/enable-coverage-measurement-of-code-run-by from coverage.collector import Collector from coverage import coverage import multiprocessing # dete...
sgraham/nope
refs/heads/master
chrome/common/extensions/docs/server2/empty_dir_file_system.py
95
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from file_system import FileNotFoundError, FileSystem, StatInfo from future import Future from path_util import IsDirectory class EmptyDirFileSystem(FileSy...
dc3-plaso/plaso
refs/heads/master
plaso/parsers/winreg_plugins/task_scheduler.py
1
# -*- coding: utf-8 -*- """This file contains the Task Scheduler Registry keys plugins.""" import construct from plaso.containers import windows_events from plaso.containers import time_events from plaso.parsers import winreg from plaso.parsers.winreg_plugins import interface class TaskCacheEvent(time_events.Fileti...
angi2/phpDocumentor2
refs/heads/release-2.0.2
docs/.templates/bare/conf.py
23
import sys, os project = u'phpDocumentor' copyright = u'2013, Mike van Riel' version = '2.1' release = '2.1.0' sys.path.append(os.path.abspath('../../.exts')) extensions = ['sphinx.ext.intersphinx', 'sphinx.ext.ifconfig', 'plantuml'] templates_path = ['.'] source_suffix = '.rst' master_doc = 'index' e...
amaork/raspi-io
refs/heads/master
raspi_io/gpio.py
1
# -*- coding: utf-8 -*- import uuid from .client import RaspiWsClient from .core import RaspiBaseMsg, RaspiAckMsg __all__ = ['GPIO', 'GPIOEvent', 'GPIOChannel', 'GPIOCtrl', 'GPIOSetup', 'GPIOMode', 'GPIOCleanup', 'SoftSPI', 'GPIOSoftSPI', 'GPIOSoftSPIXfer', 'GPIOSoftSPIRead', 'GPIOSoftSPIWrite', '...
crcresearch/osf.io
refs/heads/develop
scripts/analytics/run_keen_events.py
13
import django django.setup() from framework.celery_tasks import app as celery_app from scripts.analytics.base import DateAnalyticsHarness from scripts.analytics.node_log_events import NodeLogEvents from scripts.analytics.user_domain_events import UserDomainEvents class EventAnalyticsHarness(DateAnalyticsHarness): ...
plantigrade/geni-tools
refs/heads/develop
src/gcf/gcf_version.py
1
#---------------------------------------------------------------------- # Copyright (c) 2011-2015 Raytheon BBN Technologies # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and/or hardware specification (the "Work") to # deal in the Work without restriction, including ...
PaulStoffregen/Arduino-1.6.5r5-Teensyduino
refs/heads/master
arduino-core/src/processing/app/i18n/python/requests/packages/urllib3/packages/__init__.py
2161
from __future__ import absolute_import from . import ssl_match_hostname
dmvieira/ETL-example
refs/heads/master
crawler/grant.gov/spiders/grants.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- import json import urllib2 from modules.item_properties import get_attachment_or_description url = ( 'http://www.grants.gov/grantsws/OppsSearch?jp={' '"rows":1000000,' '"searchOnly":true,' '"fundingInstruments":"G",' '"startRecordNum":0,' '"oppSta...
sgmap/mes-aides-ui
refs/heads/master
openfisca/config.py
1
import os bind = os.getenv('OPENFISCA_BIND_HOST', '127.0.0.1:2000') timeout = 120 workers = os.getenv('OPENFISCA_WORKERS', 8) profiler = False if profiler: import cProfile import pstats from io import StringIO import logging import os import tempfile import time def pre_request(worker...
camptocamp/ngo-addons-backport
refs/heads/master
addons/project/wizard/project_task_reevaluate.py
56
# -*- 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...
fdft/ml
refs/heads/master
ch07/figure4.py
2
# This code is supporting material for the book # Building Machine Learning Systems with Python # by Willi Richert and Luis Pedro Coelho # published by PACKT Publishing # # It is made available under the MIT License # This script plots prediction-vs-actual on training set for the Boston dataset # using OLS regression...
jbassen/edx-platform
refs/heads/master
common/test/acceptance/tests/video/test_studio_video_editor.py
69
# -*- coding: utf-8 -*- """ Acceptance tests for CMS Video Editor. """ from nose.plugins.attrib import attr from .test_studio_video_module import CMSVideoBaseTest @attr('shard_6') class VideoEditorTest(CMSVideoBaseTest): """ CMS Video Editor Test Class """ def setUp(self): super(VideoEditorT...
sklam/numba
refs/heads/master
numba/cuda/tests/cudasim/support.py
10
from numba import cuda @cuda.jit(device=True) def cuda_module_in_device_function(): return cuda.threadIdx.x
vollovs/doonvalley
refs/heads/master
tools/parser/datereader.py
1
import os, calendar class ProjectParser: def __init__(self): self.local_psf_path = '..\sql.txt' def load(self, file_path): print '#### 2015 basketball game schedule ####' self.file_buffer = [] contents = [] try: with open(file_path, "...
bbenko/shinkicker
refs/heads/master
django/dispatch/saferef.py
345
""" "Safe weakrefs", originally from pyDispatcher. Provides a way to safely weakref any function, including bound methods (which aren't handled by the core weakref module). """ import weakref, traceback def safeRef(target, onDelete = None): """Return a *safe* weak reference to a callable target target -- th...
dgraham66/ECE-435
refs/heads/master
node_modules/meanio/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py
989
#!/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. import sys # TODO(mark): sys.path manipulation is some temporary testing stuff. try: import gyp except ImportError, e: import os.path ...
hernad/erpnext
refs/heads/develop
erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.py
120
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document class StockEntryDetail(Document): pass
aam-at/tensorflow
refs/heads/master
tensorflow/python/eager/pywrap_tfe_test.py
1
# Copyright 2018 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...
nkcr/WebIndex
refs/heads/master
app/venv/lib/python3.5/site-packages/pip/wheel.py
78
""" Support for installing and building the "wheel" binary package format. """ from __future__ import absolute_import import compileall import csv import errno import functools import hashlib import logging import os import os.path import re import shutil import stat import sys import tempfile import warnings from ba...
bsipocz/astropy
refs/heads/hacking
astropy/modeling/tests/test_compound.py
1
# Licensed under a 3-clause BSD style license - see LICENSE.rst import pytest import pickle from copy import deepcopy import numpy as np from numpy.testing.utils import assert_allclose, assert_array_equal from astropy.utils import minversion from astropy.modeling.core import Model, ModelDefinitionError from astrop...
archen/django
refs/heads/master
django/db/models/sql/query.py
5
""" Create SQL statements for QuerySets. The code in here encapsulates all of the SQL construction so that QuerySets themselves do not have to (and could be backed by things other than SQL databases). The abstraction barrier only works one way: this module has to know all about the internals of models in order to get ...
berggren/foorep
refs/heads/master
foorep/cli.py
1
# Copyright (C) 2012 Johan Berggren. # This file is part of foorep # See the file 'LICENSE.txt' for copying permission. """ foorep is a forensic repository """ import foorep from bson import json_util import argparse import json def main(): """ The main entry point for the foorep cli tool """ def ad...
MakeHer/edx-platform
refs/heads/dashboard.2
lms/djangoapps/courseware/tests/test_courses.py
14
# -*- coding: utf-8 -*- """ Tests for course access """ import itertools import ddt from django.conf import settings from django.test.utils import override_settings from django.core.urlresolvers import reverse from django.test.client import RequestFactory import mock from nose.plugins.attrib import attr from opaque_ke...
triveous/LearnFlask
refs/heads/master
flask/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/response.py
315
def is_fp_closed(obj): """ Checks whether a given file-like object is closed. :param obj: The file-like object to check. """ if hasattr(obj, 'fp'): # Object is a container for another file-like object that gets released # on exhaustion (e.g. HTTPResponse) return obj....
2014c2g23/w16b_test
refs/heads/master
static/Brython3.1.3-20150514-095342/Lib/types.py
756
""" Define names for built-in types that aren't directly accessible as a builtin. """ import sys # Iterators in Python aren't a matter of type but of protocol. A large # and changing number of builtin types implement *some* flavor of # iterator. Don't check the type! Use hasattr to check for both # "__iter__" and "...
cyberark-bizdev/ansible
refs/heads/devel
lib/ansible/modules/network/avi/avi_sslkeyandcertificate.py
41
#!/usr/bin/python # # @author: Gaurav Rastogi (grastogi@avinetworks.com) # Eric Anderson (eanderson@avinetworks.com) # module_check: supported # Avi Version: 17.1.1 # # Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses...
helloworldajou/webserver
refs/heads/master
demos/classifier.py
1
#!/usr/bin/env python2 # # Example to classify faces. # Brandon Amos # 2015/10/11 # # Copyright 2015-2016 Carnegie Mellon University # # 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 # # ht...
chipx86/reviewboard
refs/heads/master
reviewboard/test.py
2
"""Test runner for the Review Board test suite. This is used by :file:`manage.py` or when running ``./tests/runtests.py`` from the top of the source tree. """ from __future__ import unicode_literals import os import sys from django.conf import settings from django.contrib import admin from djblets.testing.testrunne...
flipjack/suventa
refs/heads/master
allauth/socialaccount/providers/vimeo/provider.py
75
from allauth.socialaccount import providers from allauth.socialaccount.providers.base import ProviderAccount from allauth.socialaccount.providers.oauth.provider import OAuthProvider class VimeoAccount(ProviderAccount): pass class VimeoProvider(OAuthProvider): id = 'vimeo' name = 'Vimeo' package = 'a...
Suninus/NewsBlur
refs/heads/master
utils/hostname_ssh.py
5
import sys import os import dop.client from django.conf import settings sys.path.append('/srv/newsblur') os.environ['DJANGO_SETTINGS_MODULE'] = 'settings' if __name__ == '__main__': doapi = dop.client.Client(settings.DO_CLIENT_KEY, settings.DO_API_KEY) droplets = doapi.show_active_droplets() for droplet ...
courtarro/gnuradio
refs/heads/master
gr-fec/python/fec/polar/channel_construction.py
7
#!/usr/bin/env python # # Copyright 2015 Free Software Foundation, Inc. # # 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. # # GNU Radio is...
dmulholland/ark
refs/heads/master
malt/cli/__init__.py
1
# -------------------------------------------------------------------------- # This package processes the application's command-line arguments. # -------------------------------------------------------------------------- import os import clio import sys from . import build from . import init from . import clear from ...
antoinecarme/sklearn_explain
refs/heads/master
tests/skl_datasets_reg/gen_all.py
1
import os from sklearn_explain.tests.skl_datasets_reg import skl_datasets_test as skltest def createDirIfNeeded(dirname): try: os.makedirs(dirname); except: pass lRegDatasets = skltest.define_tested_reg_datasets(); lRegifiers = skltest.define_tested_regressors(); def create_script(ds , mo...
henryfjordan/django
refs/heads/master
django/utils/lru_cache.py
335
try: from functools import lru_cache except ImportError: # backport of Python's 3.3 lru_cache, written by Raymond Hettinger and # licensed under MIT license, from: # <http://code.activestate.com/recipes/578078-py26-and-py30-backport-of-python-33s-lru-cache/> # Should be removed when Django only sup...
ayoubg/gem5-graphics
refs/heads/master
gem5-gpu/configs/ruby_random_test_fusion.py
1
# Copyright (c) 2006-2007 The Regents of The University of Michigan # Copyright (c) 2009 Advanced Micro Devices, 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 co...
jacksonwilliams/arsenalsuite
refs/heads/master
cpp/lib/sip/blur_build.py
11
import sys, os from blur.build import * path = os.path.dirname(os.path.abspath(__file__)) plat = 'win32-g++' if 'QMAKESPEC' in os.environ: plat = os.environ['QMAKESPEC'] elif sys.platform != 'win32': if os.system('uname -p | grep x86_64') == 0: plat = 'linux-g++-64' else: plat = 'linux-g++' class SipSipTarge...
jtorrents/networkx
refs/heads/master
doc/make_gallery.py
12
#!/usr/bin/env python # generate a thumbnail gallery of examples template = """\ {%% extends "layout.html" %%} {%% set title = "Gallery" %%} {%% block body %%} <h3>Click on any image to see source code</h3> <br/> %s {%% endblock %%} """ link_template = """\ <a href="%s"><img src="%s" border="0" alt="%s"/></a> """ ...