repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
Vixionar/django | refs/heads/master | tests/migrations/test_migrations_first/__init__.py | 12133432 | |
fengbaicanhe/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/core/cache/backends/__init__.py | 12133432 | |
Udala/docforever | refs/heads/master | pycoin/__init__.py | 12133432 | |
switchboardOp/ansible | refs/heads/devel | lib/ansible/module_utils/__init__.py | 167 | # 2013, Michael DeHaan <michael.dehaan@gmail.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 v... |
LudwigOrtmann/RIOT | refs/heads/master | tests/gnrc_ipv6_nib_6ln/tests/01-run.py | 12 | #!/usr/bin/env python3
# Copyright (C) 2016 Kaspar Schleiser <kaspar@schleiser.de>
# Copyright (C) 2016 Takuo Yonezawa <Yonezawa-T2@mail.dnp.co.jp>
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
... |
sorenk/ansible | refs/heads/devel | lib/ansible/modules/network/aos/_aos_logical_device_map.py | 28 | #!/usr/bin/python
#
# (c) 2017 Apstra Inc, <community@apstra.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 opt... |
nwjs/chromium.src | refs/heads/nw45-log | third_party/blink/renderer/bindings/scripts/web_idl/operation.py | 1 | # Copyright 2019 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 functools
from .argument import Argument
from .code_generator_info import CodeGeneratorInfo
from .composition_parts import WithCodeGeneratorInfo
from... |
roselleebarle04/django | refs/heads/master | django/views/static.py | 300 | """
Views and functions for serving static files. These are only to be used
during development, and SHOULD NOT be used in a production setting.
"""
from __future__ import unicode_literals
import mimetypes
import os
import posixpath
import re
import stat
from django.http import (
FileResponse, Http404, HttpRespons... |
sirpercival/kivy | refs/heads/master | examples/tutorials/notes/final/main.py | 16 | '''
Notes
=====
Simple application for reading/writing notes.
'''
__version__ = '1.0'
import json
from os.path import join, exists
from kivy.app import App
from kivy.uix.screenmanager import ScreenManager, Screen, SlideTransition
from kivy.properties import ListProperty, StringProperty, \
NumericProperty, B... |
taknevski/tensorflow-xsmm | refs/heads/master | tensorflow/python/ops/confusion_matrix.py | 59 | # Copyright 2015 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... |
mvaled/sentry | refs/heads/master | src/sentry/south_migrations/0196_auto__del_field_organization_owner.py | 1 | # -*- 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):
# Deleting field 'Organization.owner'
db.delete_column(u'sentry_organizati... |
tecip-nes/pyot | refs/heads/master | contiki-tres/apps/pymite/tools/pmOdDecoder.py | 2 | #!/usr/bin/env python
# This file is Copyright 2009 Dean Hall.
# This file is part of the Python-on-a-Chip tools.
# This software is licensed under the MIT License.
# See the LICENSE file for details.
"""
PyMite Object Descriptor Decoder
================================
Decodes an object descriptor value into its bi... |
cmwaura/Newspade | refs/heads/master | manage.py | 1 | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "analyst.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
|
aamalev/aioworkers | refs/heads/master | aioworkers/storage/filesystem.py | 1 | import hashlib
import os
import pathlib
import shutil
import tempfile
from functools import partial
from pathlib import Path, PurePath
from .. import humanize
from ..core.base import AbstractNestedEntity, ExecutorEntity
from ..core.formatter import FormattedEntity
from . import StorageError, base
__all__ = (
'Asy... |
ideadevice/alembic | refs/heads/master | alembic/templates/generic/env.py | 71 | from __future__ import with_statement
from alembic import context
from sqlalchemy import engine_from_config, pool
from logging.config import fileConfig
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config
# Interpret the config file for Python... |
qiaofuhui/zerorpc-python | refs/heads/master | tests/test_pubpush.py | 102 | # -*- coding: utf-8 -*-
# Open Source Initiative OSI - The MIT License (MIT):Licensing
#
# The MIT License (MIT)
# Copyright (c) 2012 DotCloud Inc (opensource@dotcloud.com)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Softwa... |
proyectos-analizo-info/pybossa-analizo-info | refs/heads/master | test/helper/web.py | 1 | # -*- coding: utf8 -*-
# This file is part of PyBossa.
#
# Copyright (C) 2013 SF Isle of Man Limited
#
# PyBossa 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... |
Zlash65/erpnext | refs/heads/develop | erpnext/accounts/doctype/pricing_rule_item_code/pricing_rule_item_code.py | 9 | # -*- coding: utf-8 -*-
# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class PricingRuleItemCode(Document):
pass
|
jordan8037310/CouchPotatoServer | refs/heads/master | libs/pio/__init__.py | 12133432 | |
leilihh/novaha | refs/heads/kvm_ha_tmp | nova/tests/integrated/v3/test_deferred_delete.py | 23 | # Copyright 2012 Nebula, Inc.
# Copyright 2013 IBM Corp.
#
# 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... |
ksomemo/ciserviceex | refs/heads/master | ciserviceex/version.py | 7 | __version__ = '0.0.1'
|
webmasterraj/FogOrNot | refs/heads/master | flask/lib/python2.7/site-packages/numpy/distutils/compat.py | 264 | """Small modules to cope with python 2 vs 3 incompatibilities inside
numpy.distutils
"""
from __future__ import division, absolute_import, print_function
import sys
def get_exception():
return sys.exc_info()[1]
|
google-research/google-research | refs/heads/master | spreadsheet_coder/bert_modeling.py | 1 | # coding=utf-8
# Copyright 2021 The Google Research 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 applicab... |
ysekky/chainer | refs/heads/master | tests/chainer_tests/training_tests/test_updater.py | 4 | import unittest
import mock
import numpy
import chainer
from chainer import dataset
from chainer import testing
from chainer import training
class DummyIterator(dataset.Iterator):
epoch = 1
is_new_epoch = True
def __init__(self, next_data):
self.finalize_called = 0
self.next_called = 0... |
luser/socorro | refs/heads/master | scripts/truncate_56.py | 14 | #!/usr/bin/python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import sys
import psycopg2, psycopg2.extensions
# this script truncates the database down to 56 to 62... |
russelmahmud/mess-account | refs/heads/master | django/contrib/webdesign/templatetags/__init__.py | 12133432 | |
cctaylor/googleads-python-lib | refs/heads/master | examples/adxbuyer/v201506/__init__.py | 14 | # Copyright 2015 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 by applicable law or ... |
cyrushadavi/home_automation | refs/heads/master | yelp.py | 6 | __author__ = 'Cyrus'
import config
config_dict = config.get_dict_of_params()
|
mdhaman/superdesk-core | refs/heads/master | tests/io/feed_parsers/efe_nitf_tests.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 os
fr... |
gauribhoite/personfinder | refs/heads/master | env/google_appengine/google/appengine/tools/sdk_update_checker.py | 13 | #!/usr/bin/env python
#
# Copyright 2007 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... |
kylon/pacman-fakeroot | refs/heads/upstream | test/pacman/tests/sync022.py | 28 | self.description = "Install a group from a sync db using --needed"
lp1 = pmpkg("pkg1")
lp2 = pmpkg("pkg2")
lp3 = pmpkg("pkg3")
sp1 = pmpkg("pkg1", "1.1-1")
sp2 = pmpkg("pkg2")
sp3 = pmpkg("pkg3")
for p in lp1, lp2, lp3, sp1, sp2, sp3:
setattr(p, "groups", ["grp"])
for p in lp1, lp2, lp3:
self.addpkg2db("local", p... |
Sodki/ansible | refs/heads/devel | lib/ansible/modules/cloud/vmware/vmware_guest.py | 10 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# This module is also sponsored by E.T.A.I. (www.etai.fr)
#
# 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... |
andip71/boeffla-kernel-samsung-s5 | refs/heads/boeffla | tools/perf/scripts/python/sched-migration.py | 11215 | #!/usr/bin/python
#
# Cpu task migration overview toy
#
# Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com>
#
# perf script event handlers have been generated by perf script -g python
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Fre... |
odlgroup/odl | refs/heads/master | odl/contrib/solvers/spdhg/examples/ROF_1k2_primal.py | 2 | # Copyright 2014-2019 The ODL contributors
#
# This file is part of ODL.
#
# This Source Code Form is subject to the terms of the Mozilla Public License,
# v. 2.0. If a copy of the MPL was not distributed with this file, You can
# obtain one at https://mozilla.org/MPL/2.0/.
"""An example of using the SPDHG algorithm t... |
baffolobill/mb_test_1 | refs/heads/master | src/mbtest1/erp_client/__init__.py | 12133432 | |
frappe/erpnext | refs/heads/develop | erpnext/accounts/print_format/gst_purchase_invoice/__init__.py | 12133432 | |
vanda/DigitalLabels | refs/heads/master | labels/__init__.py | 12133432 | |
HyperBaton/ansible | refs/heads/devel | lib/ansible/modules/network/netscaler/__init__.py | 12133432 | |
google-research/tapas | refs/heads/master | tapas/retrieval/tfidf_baseline.py | 1 | # coding=utf-8
# Copyright 2019 The Google AI Language Team 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 ... |
mbauskar/sapphire-erpnext | refs/heads/master | erpnext/support/report/__init__.py | 12133432 | |
coala/coala | refs/heads/master | coalib/bears/__init__.py | 12133432 | |
mvaled/sentry | refs/heads/master | tests/sentry/utils/test_datastructures.py | 3 | from __future__ import absolute_import
import pytest
from sentry.utils.datastructures import BidirectionalMapping
def test_bidirectional_mapping():
value = BidirectionalMapping({"a": 1, "b": 2})
assert value["a"] == 1
assert value["b"] == 2
assert value.get_key(1) == "a"
assert value.get_key(2)... |
StefanRijnhart/odoomrp-wip | refs/heads/8.0 | mrp_subcontracting/models/purchase_order.py | 3 | # -*- encoding: utf-8 -*-
##############################################################################
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the... |
jbremer/androguard | refs/heads/master | androguard/core/api_specific_resources/api_permission_mappings/api_permission_mappings.py | 16 | import androguard.core.api_specific_resources.api_permission_mappings.api_permission_mappings_api9 as api9
import androguard.core.api_specific_resources.api_permission_mappings.api_permission_mappings_api10 as api10
import androguard.core.api_specific_resources.api_permission_mappings.api_permission_mappings_api14 as a... |
MediaKraken/MediaKraken_Deployment | refs/heads/master | source/common/common_metadata_anime_scudlee.py | 1 | """
Copyright (C) 2015 Quinn D Granfor <spootdev@gmail.com>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2, as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
... |
lucciano/bigcouch | refs/heads/master | couchjs/scons/scons-local-2.0.1/SCons/Action.py | 61 | """SCons.Action
This encapsulates information about executing any sort of action that
can build one or more target Nodes (typically files) from one or more
source Nodes (also typically files) given a specific Environment.
The base class here is ActionBase. The base class supplies just a few
OO utility methods and so... |
ConnorGBrewster/servo | refs/heads/master | tests/wpt/web-platform-tests/websockets/handlers/protocol_array_wsh.py | 265 | #!/usr/bin/python
from mod_pywebsocket import msgutil, util
def web_socket_do_extra_handshake(request):
line = request.headers_in.get('Sec-WebSocket-Protocol')
request.ws_protocol = line.split(',', 1)[0]
#pass
def web_socket_transfer_data(request):
while True:
msgutil.send_message(request, reque... |
mldbai/mldb | refs/heads/master | testing/ranking_test.py | 1 | #
# ranking_procedure_test.py
# Mich, 2016-01-11
# This file is part of MLDB. Copyright 2016 mldb.ai inc. All rights reserved.
#
from mldb import mldb, MldbUnitTest, ResponseException
class RankingTest(MldbUnitTest): # noqa
def test_base(self):
mldb.put('/v1/datasets/ds', {
'type' : 'sparse.m... |
ezyang/offlineimap | refs/heads/master | test/OLItest/TestRunner.py | 8 | # Copyright (C) 2012- Sebastian Spaeth & contributors
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# ... |
agrista/odoo-saas | refs/heads/master | addons/calendar/calendar.py | 11 | # -*- coding: utf-8 -*-
import pytz
import re
import time
import openerp
import openerp.service.report
import uuid
import collections
from werkzeug.exceptions import BadRequest
from datetime import datetime, timedelta
from dateutil import parser
from dateutil import rrule
from dateutil.relativedelta import relativedel... |
cernops/cloudbase-init | refs/heads/master | cloudbaseinit/openstack/common/versionutils.py | 5 | # Copyright (c) 2013 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 ... |
nicescale/docker-registry | refs/heads/master | tests/test_s3.py | 2 | # -*- coding: utf-8 -*-
import sys
import StringIO
from nose import tools
from docker_registry.core import exceptions
import docker_registry.testing as testing
from docker_registry.testing import mock_boto # noqa
from . import mock_s3 # noqa
class StringIOWithError(StringIO.StringIO):
'''Throw IOError af... |
rscnt/django-cms | refs/heads/develop | cms/migrations/0009_merge.py | 60 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('cms', '0008_auto_20150121_0059'),
('cms', '0008_auto_20150208_2149'),
]
operations = [
]
|
yuxiang-zhou/menpo | refs/heads/master | menpo/feature/test/test_gradient.py | 3 | from nose.tools import raises
import numpy as np
from numpy.testing import assert_allclose
from menpo.image import Image
from menpo.feature import gradient
from menpo.feature.features import _np_gradient
import menpo.io as mio
takeo = mio.import_builtin_asset.takeo_ppm()
example_image = np.array([[1., 2., 6.], [3., ... |
fnouama/intellij-community | refs/heads/master | python/testData/quickdoc/Method.py | 83 | # just method
class Foo:
@deco
def meth(self):
"""<the_doc>
Doc of meth.
"""
f = Foo()
f.<the_ref>meth
|
konsP/synnefo | refs/heads/develop | snf-cyclades-app/synnefo/db/migrations/0051_auto__add_bridgepooltable__add_macprefixpooltable.py | 10 | # 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 model 'BridgePoolTable'
db.create_table('db_bridgepooltable', (
('reserved_map', ... |
nitbot/iot.nitbot.com | refs/heads/master | miniPC-Program/extLibrary/wiring-x86/wiringx86.py | 1 | # -*- coding: utf-8 -*-
#
# Copyright © 2014, Emutex Ltd.
# All rights reserved.
# http://www.emutex.com
#
# Author: Nicolás Pernas Maradei <nicolas.pernas.maradei@emutex.com>
# Author: Dave Hunt <dave@emutex.com>
#
# See license in LICENSE.txt file.
#
# Wiring-x86 is a Python module that lets you use Arduino like func... |
foss-transportationmodeling/rettina-server | refs/heads/master | flask/local/lib/python2.7/site-packages/sqlparse/engine/__init__.py | 119 | # Copyright (C) 2008 Andi Albrecht, albrecht.andi@gmail.com
#
# This module is part of python-sqlparse and is released under
# the BSD License: http://www.opensource.org/licenses/bsd-license.php.
"""filter"""
from sqlparse import lexer
from sqlparse.engine import grouping
from sqlparse.engine.filter import StatementF... |
youdonghai/intellij-community | refs/heads/master | python/testData/fillParagraph/string.py | 83 | p = "my new <caret>string blah blah blah ;j;dsjv sd;fj;dsjf;ds js;djgf ;jsg s;dgj; sjd;gj sd;gj ;sjg;j asdl j;sjdg; jasdgl j;sldjg ;jsd;gj " |
pydoit/doit | refs/heads/master | tests/test_cmd_help.py | 3 | from doit.doit_cmd import DoitMain
def cmd_main(args, extra_config=None, bin_name='doit'):
if extra_config:
extra_config = {'GLOBAL': extra_config}
main = DoitMain(extra_config=extra_config)
main.BIN_NAME = bin_name
return main.run(args)
class TestHelp(object):
def test_help_usage(self, ... |
kishkaru/python-driver | refs/heads/master | cassandra/cqlengine/columns.py | 2 | # Copyright 2013-2016 DataStax, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... |
jvkops/titanium_mobile | refs/heads/master | node_modules/ioslib/node_modules/node-ios-device/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py | 240 | # Copyright (c) 2013 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.
# Notes:
#
# This is all roughly based on the Makefile system used by the Linux
# kernel, but is a non-recursive make -- we put the entire dependency
# graph in fr... |
jamespcole/home-assistant | refs/heads/master | homeassistant/components/apcupsd/sensor.py | 2 | """Support for APCUPSd sensors."""
import logging
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
import homeassistant.helpers.config_validation as cv
from homeassistant.components import apcupsd
from homeassistant.const import (TEMP_CELSIUS, CONF_RESOURCES, POWER_WATT)
from homea... |
chouseknecht/ansible | refs/heads/devel | test/units/modules/network/onyx/test_onyx_lldp.py | 23 | #
# (c) 2016 Red Hat 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.
#
# Ansible is d... |
rbbratta/virt-test | refs/heads/master | libvirt/tests/src/virsh_cmd/domain/virsh_setvcpus.py | 1 | import re, os, logging, commands
from autotest.client.shared import error
from virttest import remote, libvirt_vm, virsh, libvirt_xml
from xml.dom.minidom import parse
def run_virsh_setvcpus(test, params, env):
"""
Test command: virsh setvcpus.
The conmand can change the number of virtual CPUs in the gues... |
nsi-iff/nsi_site | refs/heads/master | web_steps.py | 1 | import re
from lettuce import world, step
from should_dsl import should
from paths import path_to
@step(r'I fill in "(.*)" with "(.*)"')
def fill_field(step, label, value):
world.browser.fill(label, value)
@step(r'I go to "(.+)"')
def i_go_to(step, page_name):
world.browser.visit(path_to(page_name))
@step(r... |
Fale/fedora-packages | refs/heads/develop | fedoracommunity/distutils/__init__.py | 12133432 | |
xuweiliang/Codelibrary | refs/heads/master | openstack_dashboard/test/jasmine/__init__.py | 12133432 | |
erikr/django | refs/heads/master | tests/view_tests/tests/__init__.py | 12133432 | |
MrPetru/spam | refs/heads/master | spam/controllers/tag.py | 2 | # -*- coding: utf-8 -*-
#
# This file is part of SPAM (Spark Project & Asset Manager).
#
# SPAM 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 ... |
apigee/edx-platform | refs/heads/master | common/djangoapps/track/migrations/0002_auto__add_field_trackinglog_host__chg_field_trackinglog_event_type__ch.py | 189 | # -*- 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 field 'TrackingLog.host'
db.add_column('track_trackinglog', 'host',
self.gf('... |
gminds/rapidnewsng | refs/heads/master | django/core/management/validation.py | 103 | import collections
import sys
from django.conf import settings
from django.core.management.color import color_style
from django.utils.encoding import force_str
from django.utils.itercompat import is_iterable
from django.utils import six
class ModelErrorCollection:
def __init__(self, outfile=sys.stdout):
... |
dantin/scrapy-utils | refs/heads/master | src/scrapy_utils/middlewares.py | 1 | # -*- coding: utf-8 -*-
import logging
import os
import random
from scrapy import signals
from scrapy.downloadermiddlewares.useragent import UserAgentMiddleware
logger = logging.getLogger(__name__)
class RandomUserAgentMiddleware(UserAgentMiddleware):
DEFAULT_USER_AGENT = os.path.normpath(os.path.dirname(__file... |
ruibarreira/linuxtrail | refs/heads/master | usr/lib/python2.7/dist-packages/zeitgeist/datamodel.py | 3 | # -.- coding: utf-8 -.-
# Zeitgeist
#
# Copyright © 2009 Mikkel Kamstrup Erlandsen <mikkel.kamstrup@gmail.com>
# Copyright © 2009 Markus Korn <thekorn@gmx.de>
# Copyright © 2009-2010 Seif Lotfy <seif@lotfy.com>
# Copyright © 2009-2010 Siegfried-Angel Gevatter Pujals <rainct@ubuntu.com>
# Copyright © 2011 Collabora Ltd... |
thatchristoph/namebench | refs/heads/master | nb_third_party/simplejson/__init__.py | 230 | r"""JSON (JavaScript Object Notation) <http://json.org> is a subset of
JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data
interchange format.
:mod:`simplejson` exposes an API familiar to users of the standard library
:mod:`marshal` and :mod:`pickle` modules. It is the externally maintained
version of ... |
eoghanbkeegan/eoghanbkeegan | refs/heads/master | eoghanbkeegan/database.py | 1 | # -*- coding: utf-8 -*-
"""Database module, including the SQLAlchemy database object and DB-related utilities."""
from .compat import basestring
from .extensions import db
# Alias common SQLAlchemy names
Column = db.Column
relationship = db.relationship
class CRUDMixin(object):
"""Mixin that adds convenience met... |
wanghe4096/website | refs/heads/master | aliyun/api/rest/Slb20130221RemoveBackendServersRequest.py | 1 | '''
Created by auto_sdk on 2015.04.21
'''
from aliyun.api.base import RestApi
class Slb20130221RemoveBackendServersRequest(RestApi):
def __init__(self,domain='slb.aliyuncs.com',port=80):
RestApi.__init__(self,domain, port)
self.backendServers = None
self.loadBalancerId = None
def getapiname(self):
... |
zhaochao/fuel-web | refs/heads/master | nailgun/nailgun/objects/notification.py | 6 | # -*- coding: utf-8 -*-
# Copyright 2013 Mirantis, 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 requi... |
detrout/debian-python-dateutil | refs/heads/master | dateutil/zoneinfo/__init__.py | 97 | # -*- coding: utf-8 -*-
import logging
import os
import warnings
import tempfile
import shutil
from subprocess import check_call
from tarfile import TarFile
from pkgutil import get_data
from io import BytesIO
from contextlib import closing
from dateutil.tz import tzfile
__all__ = ["gettz", "rebuild"]
_ZONEFILENAME =... |
amith01994/intellij-community | refs/heads/master | python/testData/completion/fromImportBinary.py | 83 | from root import b<caret> |
Notgnoshi/clippy | refs/heads/master | clippy/client.py | 1 | from .clipboard import Clipboard
from time import sleep
from socket import *
class Client(object):
# TODO: Be more intelligent with ports and addresses
def __init__(self, server='192.168.0.111', send_port=23456, receive_port=34567, listen_timeout=0.01):
self.send_address = (server, send_port)
... |
teltek/edx-platform | refs/heads/master | openedx/core/djangoapps/site_configuration/templatetags/configuration.py | 46 | """
Template tags and helper functions for displaying breadcrumbs in page titles
based on the current site.
"""
from django import template
from django.conf import settings
from django.templatetags.static import static
from django.contrib.staticfiles.storage import staticfiles_storage
from openedx.core.djangoapps.them... |
apocquet/django | refs/heads/master | tests/admin_scripts/broken_app/__init__.py | 12133432 | |
ffmmjj/kairos-face-sdk-python | refs/heads/master | kairos_face/verify.py | 1 | import base64
import requests
from kairos_face import exceptions
from kairos_face import settings
from kairos_face.utils import validate_file_and_url_presence, validate_settings
_verify_base_url = settings.base_url + 'verify'
def verify_face(subject_id, gallery_name, url=None, file=None, additional_arguments={}):
... |
jamesblunt/sympy | refs/heads/master | sympy/geometry/exceptions.py | 123 | """Geometry Errors."""
from __future__ import print_function, division
class GeometryError(ValueError):
"""An exception raised by classes in the geometry module."""
pass
|
toshywoshy/ansible | refs/heads/devel | lib/ansible/modules/network/fortios/fortios_firewall_schedule_recurring.py | 7 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# 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 Lic... |
loulich/Couchpotato | refs/heads/master | couchpotato/core/notifications/xmpp_.py | 96 | from time import sleep
import traceback
from couchpotato.core.logger import CPLog
from couchpotato.core.notifications.base import Notification
import xmpp
log = CPLog(__name__)
autoload = 'Xmpp'
class Xmpp(Notification):
def notify(self, message = '', data = None, listener = None):
if not data: data ... |
Tapisama/SL | refs/heads/master | pygame/pygame_rect.py | 1 | '''
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,
but WITHOUT... |
jroyal/plexpy | refs/heads/master | lib/concurrent/futures/process.py | 196 | # Copyright 2009 Brian Quinlan. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Implements ProcessPoolExecutor.
The follow diagram and text describe the data-flow through the system:
|======================= In-process =====================|== Out-of-process ==|
+----------+ +----------... |
Woomp/fibonacci | refs/heads/develop | docs/conf.py | 2 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
# If extensions (or modules to document with autodoc) are in another
# directory, add these directories to sys.path here. If the directory is
# relative to the documentation root, use os.path.abspath to make it
# absolute, like shown here.
thisdir = o... |
daniele-athome/kontalk-legacy-xmppserver | refs/heads/master | twisted/plugins/xmppnet.py | 1 | # -*- coding: utf-8 -*-
"""twistd plugin for XMPP net."""
"""
Kontalk XMPP server
Copyright (C) 2014 Kontalk Devteam <devteam@kontalk.org>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, eithe... |
markgrovs/alfred-airmail-to-todoist | refs/heads/develop | src/lib/requests/packages/urllib3/packages/ssl_match_hostname/__init__.py | 374 | import sys
try:
# Our match_hostname function is the same as 3.5's, so we only want to
# import the match_hostname function if it's at least that good.
if sys.version_info < (3, 5):
raise ImportError("Fallback to vendored code")
from ssl import CertificateError, match_hostname
except ImportErr... |
neale/relations | refs/heads/master | relations-aes/server/wtf.py | 2 | import Rpi.GPIO as GPIO
import serial as uart
import pymongo
from pymongo import Connection
import datetime
connection = Connection('localhost', 3000)
db = connection.test_database
port = uart.Serial("dev/ttyAMA0", baudrate=38400, timeout = 3.0)
port.flashInput()
port.flushOutput()
class packet:
expectedP... |
kandle/twitter-grab | refs/heads/master | grab.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import twitter
import ConfigParser, os
config = ConfigParser.ConfigParser()
config.readfp(open('grabber.conf'))
api = twitter.Api(consumer_key=config.get("twitter", "consumer_key"),
consumer_secret=config.get("twitter", "consumer_secret"),
access_token_key=config... |
poljeff/odoo | refs/heads/8.0 | addons/stock_picking_wave/controllers/main.py | 418 | from openerp.addons.web import http
from openerp.addons.web.http import request
class picking_wave_report(http.Controller):
@http.route('/report/stock_picking_wave.report_pickingwave/<ids>', type='http', auth='user',
website=True)
def report_picking_wave(self, ids):
self.cr, self.uid,... |
andela-sjames/team1 | refs/heads/master | main.py | 3 | import urllib2
from BeautifulSoup import BeautifulSoup
from urlparse import urlparse
import re
def analyse_web(root,max_depth):
if type(max_depth) == str:
max_depth = int(max_depth)
print "*** Fetching external links for "+root
page1, stat= get_page(root)
stat = re.sub("[!@#$']", '', stat.enco... |
bolmsten/mxcube3 | refs/heads/master | mxcube3/remote_access.py | 2 | import logging
from flask import request, session
from mxcube3 import socketio
from collections import deque
from mxcube3 import app as mxcube
MASTER = None
MASTER_ROOM = None
PENDING_EVENTS = deque()
DISCONNECT_HANDLED = True
OBSERVERS = {}
def set_master(master_sid):
global MASTER
MASTER = master_sid
de... |
steven-martins/ramassage.epitech.eu | refs/heads/master | actions/pickup.py | 1 | __author__ = 'steven'
from mixins.scm import GitMixin
from exceptions import RepositoryNameMissing
import logging
import os
import config
from api_tools import Mapping
mapping = Mapping()
class Pickup(GitMixin):
def __init__(self, task_id, project):
self._project = project
self._task_id = task_id... |
synweap15/pyload | refs/heads/stable | pyLoadCore.py | 34 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
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 prog... |
storborg/manhattan | refs/heads/master | manhattan/log/memory.py | 1 | from __future__ import absolute_import, division, print_function
import logging
from collections import deque
log = logging.getLogger(__name__)
class MemoryLog(object):
"""
An in-memory log, intended for testing only. This log does not support
resuming (server crash recovery).
"""
def __init__(s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.