repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
DPaaS-Raksha/raksha | refs/heads/master | raksha/openstack/common/excutils.py | 1 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack Foundation.
# Copyright 2012, Red Hat, 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:/... |
noisemaster/AdamTestBot | refs/heads/master | unidecode/x022.py | 165 | data = (
'[?]', # 0x00
'[?]', # 0x01
'[?]', # 0x02
'[?]', # 0x03
'[?]', # 0x04
'[?]', # 0x05
'[?]', # 0x06
'[?]', # 0x07
'[?]', # 0x08
'[?]', # 0x09
'[?]', # 0x0a
'[?]', # 0x0b
'[?]', # 0x0c
'[?]', # 0x0d
'[?]', # 0x0e
'[?]', # 0x0f
'[?]', # 0x10
'[?]', # 0x11
'-', ... |
aguadev/aguadev | refs/heads/master | apps/node/node-v0.10.15/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py | 95 | # 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.
"""Xcode project file generator.
This module is both an Xcode project file generator and a documentation of the
Xcode project file format. Knowledge of the proje... |
BoltzmannBrain/nupic | refs/heads/master | src/nupic/regions/RecordSensorFilters/ModifyFields.py | 39 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... |
kbrebanov/ansible-modules-extras | refs/heads/devel | messaging/rabbitmq_vhost.py | 2 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Chatham Financial <oss@chathamfinancial.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... |
avaly/quicktile | refs/heads/master | test_quicktile.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Unit Test Suite for QuickTile using Nose test discovery"""
__author__ = "Stephan Sokolow (deitarion/SSokolow)"
__license__ = "GNU GPL 2.0 or later"
try:
import pygtk
pygtk.require('2.0')
except ImportError as err:
# Apparently Travis-CI's build environment ... |
fitermay/intellij-community | refs/heads/master | python/testData/quickdoc/OptionalParameterType.py | 4 | def open(file, mode='r', buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None):
"""This is an alias for the builtin open() function.
:type file: str
:type mode: str
:type buffering: numbers.Integral
:type encoding: str | None
:type errors: str | None
:type newli... |
vmax-feihu/hue | refs/heads/master | desktop/core/ext-py/kazoo-2.0/kazoo/tests/test_paths.py | 37 | import sys
from unittest import TestCase
from kazoo.protocol import paths
if sys.version_info > (3, ): # pragma: nocover
def u(s):
return s
else: # pragma: nocover
def u(s):
return unicode(s, "unicode_escape")
class NormPathTestCase(TestCase):
def test_normpath(self):
self.as... |
treejames/erpnext | refs/heads/develop | erpnext/hr/doctype/department/department.py | 100 | # 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 Department(Document):
pass |
avinashkunuje/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/system/zip_mock.py | 167 | # Copyright (C) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and th... |
dlopes-samba/dlopes-maps-sambatech | refs/heads/master | django/contrib/localflavor/sk/sk_districts.py | 543 | """
Slovak districts according to http://sk.wikipedia.org/wiki/Administrat%C3%ADvne_%C4%8Dlenenie_Slovenska
"""
from django.utils.translation import ugettext_lazy as _
DISTRICT_CHOICES = (
('BB', _('Banska Bystrica')),
('BS', _('Banska Stiavnica')),
('BJ', _('Bardejov')),
('BN', _('Banovce nad Bebravo... |
vitmod/enigma2-test | refs/heads/master | tools/create_picon_links.py | 192 | #
# create links for picon
# usage: create_picon_links lamedb
# run in picon directory.
# It will read the servicenames from the lamedb and create symlinks
# for the servicereference names.
import os, sys
f = open(sys.argv[1]).readlines()
f = f[f.index("services\n")+1:-3]
while len(f):
ref = [int(x, 0x10) for x ... |
joebowen/movement_validation_cloud | refs/heads/master | djangodev/lib/python2.7/site-packages/boto/pyami/installers/ubuntu/installer.py | 153 | # Copyright (c) 2006,2007,2008 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy,... |
Jgarcia-IAS/SAT | refs/heads/master | openerp/addons/portal_project/tests/__init__.py | 260 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... |
T3CHNOLOG1C/Zoidbot | refs/heads/master | addons/kickban.py | 3 | import datetime
import discord
import json
import re
import time
from discord.ext import commands
from sys import argv
class KickBan:
"""
Kicking and banning users.
"""
def __init__(self, bot):
self.bot = bot
print('Addon "{}" loaded'.format(self.__class__.__name__))
@commands.has_... |
donkirkby/django | refs/heads/master | tests/gis_tests/admin.py | 481 | try:
from django.contrib.gis import admin
except ImportError:
from django.contrib import admin
admin.OSMGeoAdmin = admin.ModelAdmin
|
Tejal011089/trufil-erpnext | refs/heads/master | erpnext/crm/doctype/newsletter_list/test_newsletter_list.py | 59 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
class TestNewletterList(unittest.TestCase):
def test_import(self):
new_list = frappe.get_doc({
"doctype": "Newslet... |
hryamzik/ansible | refs/heads/devel | test/units/modules/network/cloudvision/__init__.py | 12133432 | |
tysonclugg/django | refs/heads/master | django/conf/locale/fr/__init__.py | 12133432 | |
Yong-Lee/django | refs/heads/master | django/contrib/sessions/management/commands/__init__.py | 12133432 | |
trawick/httpd.py | refs/heads/AC2016 | Django/app/app/__init__.py | 12133432 | |
EttusResearch/gnuradio | refs/heads/master | gr-comedi/python/comedi/qa_comedi.py | 57 | #!/usr/bin/env python
#
# Copyright 2005,2007,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 ... |
linearhub/titanium_mobile | refs/heads/master | apidoc/odict/pyodict.py | 49 | # Python Software Foundation License
# XXX: it feels like using the class with "is" and "is not" instead of "==" and
# "!=" should be faster.
class _Nil(object):
def __repr__(self):
return "nil"
def __eq__(self, other):
if (isinstance(other, _Nil)):
return True
else:
... |
ewandor/home-assistant | refs/heads/dev | homeassistant/components/binary_sensor/abode.py | 10 | """
This component provides HA binary_sensor support for Abode Security System.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/binary_sensor.abode/
"""
import logging
from homeassistant.components.abode import (AbodeDevice, AbodeAutomation,
... |
sparkslabs/kamaelia | refs/heads/master | Sketches/MPS/BugReports/FixTests/Kamaelia/Kamaelia/Codec/__init__.py | 6 | # -*- coding: utf-8 -*-
# Needed to allow import
#
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache Lice... |
grange74/dropwizard | refs/heads/master | docs/source/conf.py | 46 | # -*- coding: utf-8 -*-
#
# Dropwizard documentation build configuration file, created by
# sphinx-quickstart on Mon Feb 13 11:29:49 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# ... |
rdipietro/tensorflow | refs/heads/master | tensorflow/python/kernel_tests/softmax_op_test.py | 11 | # 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... |
hsuantien/scikit-learn | refs/heads/master | examples/mixture/plot_gmm.py | 248 | """
=================================
Gaussian Mixture Model Ellipsoids
=================================
Plot the confidence ellipsoids of a mixture of two Gaussians with EM
and variational Dirichlet process.
Both models have access to five components with which to fit the
data. Note that the EM model will necessari... |
Khroki/MCEdit-Unified | refs/heads/master | pymclevel/player.py | 2 | import nbt
import player_cache
class Player:
def __init__(self, playerNBTFile):
self.nbtFile = playerNBTFile
self.nbtFileName = playerNBTFile.split("\\")[-1]
self.root_tag = nbt.load(playerNBTFile)
# Properties setup
self._uuid = self.nbtFileName.split(".")[0]
pla... |
andriibekker/biddingsbase | refs/heads/master | django/utils/unittest/runner.py | 571 | """Running tests"""
import sys
import time
import unittest
from django.utils.unittest import result
try:
from django.utils.unittest.signals import registerResult
except ImportError:
def registerResult(_):
pass
__unittest = True
class _WritelnDecorator(object):
"""Used to decorate file-like obj... |
tbinjiayou/Odoo | refs/heads/master | openerp/addons/test_documentation_examples/tests/test_delegation.py | 366 | # -*- coding: utf-8 -*-
from openerp.tests import common
class TestDelegation(common.TransactionCase):
def setUp(self):
super(TestDelegation, self).setUp()
env = self.env
record = env['delegation.parent'].create({
'child0_id': env['delegation.child0'].create({'field_0': 0}).id,... |
wzbozon/statsmodels | refs/heads/master | statsmodels/miscmodels/tests/test_poisson.py | 27 | '''Testing GenericLikelihoodModel variations on Poisson
'''
import numpy as np
from numpy.testing import assert_almost_equal
import statsmodels.api as sm
from statsmodels.miscmodels.count import PoissonGMLE, PoissonOffsetGMLE, \
PoissonZiGMLE
from statsmodels.discrete.discrete_model import Poi... |
holmes/intellij-community | refs/heads/master | python/testData/copyPaste/singleLine/Indent11.after.py | 83 | class C:
def foo(self):
x = 1y = 2
|
ibinti/intellij-community | refs/heads/master | python/testData/copyPaste/TopLevelIfStatementWithMultilineCondition.dst.py | 795 | <caret> |
hectord/lettuce | refs/heads/master | tests/integration/lib/Django-1.2.5/tests/regressiontests/dispatch/tests/test_dispatcher.py | 50 | from django.dispatch import Signal
import unittest
import sys
import gc
import django.utils.copycompat as copy
if sys.platform.startswith('java'):
def garbage_collect():
"""Run the garbage collector and wait a bit to let it do his work"""
import time
gc.collect()
time.sleep(0.1)
els... |
sosguns2002/interactive-mining | refs/heads/master | interactive-mining-3rdparty-madis/madis/src/functionslocal/aggregate/__init__.py | 12133432 | |
rgardner/ouimeaux | refs/heads/master | ouimeaux/device/api/__init__.py | 12133432 | |
smn/onadata | refs/heads/master | onadata/apps/sms_support/models.py | 12133432 | |
nrmay/hpctardis | refs/heads/master | tardis/tardis_portal/management/commands/__init__.py | 12133432 | |
gotcha/vimpdb | refs/heads/master | src/vimpdb/tests/test_debugger.py | 1 | from mock import Mock
from mock import patch
def test_klass_after_setup_method():
from vimpdb.debugger import setupMethod
mocked_method = Mock(name='orig')
class Klass:
method = mocked_method
new_method = Mock(name='new')
new_method.__name__ = 'method'
setupMethod(Klass, new_metho... |
phobson/statsmodels | refs/heads/master | statsmodels/base/elastic_net.py | 2 | import numpy as np
import statsmodels.base.wrapper as wrap
from statsmodels.base.model import Results
import statsmodels.base.wrapper as wrap
from statsmodels.tools.decorators import cache_readonly
"""
Elastic net regularization.
Routines for fitting regression models using elastic net
regularization. The elastic ne... |
vincentltz/ns-3-dev-git | refs/heads/master | src/csma-layout/bindings/modulegen__gcc_ILP32.py | 16 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... |
synasius/django | refs/heads/master | tests/test_discovery_sample/pattern_tests.py | 641 | from unittest import TestCase
class Test(TestCase):
def test_sample(self):
self.assertEqual(1, 1)
|
simonwydooghe/ansible | refs/heads/devel | lib/ansible/modules/network/f5/bigip_asm_policy_manage.py | 38 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... |
Pakoach/Sick-Beard-Animes | refs/heads/master | lib/hachoir_parser/misc/chm.py | 90 | """
InfoTech Storage Format (ITSF) parser, used by Microsoft's HTML Help (.chm)
Document:
- Microsoft's HTML Help (.chm) format
http://www.wotsit.org (search "chm")
- chmlib library
http://www.jedrea.com/chmlib/
Author: Victor Stinner
Creation date: 2007-03-04
"""
from lib.hachoir_parser import Parser
from lib.h... |
olatoft/reverse-hangman | refs/heads/master | lib/python3.5/site-packages/setuptools/ssl_support.py | 100 | import os
import socket
import atexit
import re
from setuptools.extern.six.moves import urllib, http_client, map
import pkg_resources
from pkg_resources import ResolutionError, ExtractionError
try:
import ssl
except ImportError:
ssl = None
__all__ = [
'VerifyingHTTPSHandler', 'find_ca_bundle', 'is_avail... |
OpusVL/odoo | refs/heads/master | addons/l10n_be_hr_payroll/l10n_be_hr_payroll.py | 8 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP SA (<http://openerp.com>). All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under th... |
lzambella/Qyoutube-dl | refs/heads/master | youtube_dl/extractor/addanime.py | 117 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_HTTPError,
compat_str,
compat_urllib_parse,
compat_urllib_parse_urlparse,
)
from ..utils import (
ExtractorError,
qualities,
)
class AddAnimeIE(InfoExtractor):
_VALID_URL = r... |
Microsoft/PTVS | refs/heads/master | Python/Product/Miniconda/Miniconda3-x64/Lib/json/tool.py | 11 | r"""Command-line tool to validate and pretty-print JSON
Usage::
$ echo '{"json":"obj"}' | python -m json.tool
{
"json": "obj"
}
$ echo '{ 1.2:3.4}' | python -m json.tool
Expecting property name enclosed in double quotes: line 1 column 3 (char 2)
"""
import argparse
import json
import sys
... |
gawrysz/piernik | refs/heads/master | bin/validate.py | 5 | #!/usr/bin/env python
# @todo
# get rid of paths
# sanitize
# problem_name is de facto var passed directly to setup, so it can be
# anything, make it configurable
import sys
import os
import json
import tempfile
import hashlib
import argparse
import time
import base64
import getpass
from DirWalk import Director... |
jaksmid/gensim | refs/heads/develop | gensim/corpora/lowcorpus.py | 73 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Corpus in GibbsLda++ format of List-Of-Words.
"""
from __future__ import with_statement
import logging
from gensim import utils
... |
anhstudios/swganh | refs/heads/develop | data/scripts/templates/object/tangible/wearables/ithorian/shared_ith_dress_s03.py | 2 | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/wearables/ithorian/shared_ith_dress_s03.iff"
result.attribute_templ... |
adamjmcgrath/glancydesign | refs/heads/master | src/django-nonrel/tests/regressiontests/forms/tests/validators.py | 81 | from django import forms
from django.core import validators
from django.core.exceptions import ValidationError
from django.utils.unittest import TestCase
class TestFieldWithValidators(TestCase):
def test_all_errors_get_reported(self):
field = forms.CharField(
validators=[validators.validate_in... |
3dfxsoftware/cbss-addons | refs/heads/master | mass_mailing/tests/__init__.py | 121 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... |
rodorad/spark-tk | refs/heads/master | regression-tests/generatedata/movie_user_3ratings.py | 14 | # vim: set encoding=utf-8
# Copyright (c) 2016 Intel Corporation
#
# 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 require... |
daj0ker/BinPy | refs/heads/develop | BinPy/examples/source/ic/Series_7400/IC7437.py | 5 | # -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <headingcell level=2>
# Usage of IC 7437
# <codecell>
from __future__ import print_function
from BinPy import *
# <codecell>
# Usage of IC 7437:
ic = IC_7437()
print(ic.__doc__)
# <codecell>
# The Pin configuration is:
inp = {1: 1, 2: 0, 4: 0, 5: 0, 7: 0, ... |
Guidobelix/pyload | refs/heads/stable | module/plugins/crypter/TinyurlCom.py | 5 | # -*- coding: utf-8 -*-
from module.plugins.internal.SimpleCrypter import SimpleCrypter
class TinyurlCom(SimpleCrypter):
__name__ = "TinyurlCom"
__type__ = "crypter"
__version__ = "0.06"
__status__ = "testing"
__pattern__ = r'https?://(?:www\.)?(preview\.)?tinyurl\.com/[\w\-]+'
__conf... |
overtherain/scriptfile | refs/heads/master | software/googleAppEngine/lib/django_1_2/tests/regressiontests/admin_scripts/management/commands/app_command.py | 102 | from django.core.management.base import AppCommand
class Command(AppCommand):
help = 'Test Application-based commands'
requires_model_validation = False
args = '[appname ...]'
def handle_app(self, app, **options):
print 'EXECUTE:AppCommand app=%s, options=%s' % (app, sorted(options.items()))
... |
jmighion/ansible | refs/heads/devel | lib/ansible/modules/storage/purestorage/purefa_volume.py | 44 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Simon Dodsley (simon@purestorage.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 = {'metadata_version': '1.1',... |
honghaoz/Wattpad-Life | refs/heads/master | Wattpad Life API/wattpad-life/libs/requests/packages/chardet/langthaimodel.py | 2929 | ######################## 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... |
hernad/frappe | refs/heads/develop | frappe/model/docfield.py | 61 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
"""docfield utililtes"""
import frappe
def rename(doctype, fieldname, newname):
"""rename docfield"""
df = frappe.db.sql("""select * from tabDocField where parent=%s and field... |
ddy88958620/lib | refs/heads/master | Python/scrapy/tigerchef/wasserstrom.py | 2 | from urlparse import urlparse, parse_qs
from urllib import urlencode
import re
from scrapy.spider import BaseSpider
from scrapy.selector import HtmlXPathSelector
from scrapy.http import Request, FormRequest, HtmlResponse
from scrapy.utils.response import get_base_url
from scrapy.utils.url import urljoin_rfc
from pro... |
benjaminrigaud/django | refs/heads/master | tests/model_options/test_default_related_name.py | 41 | from django.test import TestCase
from .models.default_related_name import Author, Editor, Book
class DefaultRelatedNameTests(TestCase):
def setUp(self):
self.author = Author.objects.create(first_name="Dave", last_name="Loper")
self.editor = Editor.objects.create(name="Test Editions",
... |
kvh/match | refs/heads/master | travis_pypi_setup.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Update encrypted deploy password in Travis config file
"""
from __future__ import print_function
import base64
import json
import os
from getpass import getpass
import yaml
from cryptography.hazmat.primitives.serialization import load_pem_public_key
from cryptography.h... |
pegasuslw/vi_config | refs/heads/master | vim/ftplugin/python/pyflakes/pyflakes/test/test_script.py | 44 |
"""
Tests for L{pyflakes.scripts.pyflakes}.
"""
import sys
from StringIO import StringIO
from twisted.python.filepath import FilePath
from twisted.trial.unittest import TestCase
from pyflakes.scripts.pyflakes import checkPath
def withStderrTo(stderr, f):
"""
Call C{f} with C{sys.stderr} redirected to C{std... |
aparo/django-nonrel | refs/heads/master | django/db/backends/sqlite3/creation.py | 63 | import os
import sys
from django.db.backends.creation import BaseDatabaseCreation
class DatabaseCreation(BaseDatabaseCreation):
# SQLite doesn't actually support most of these types, but it "does the right
# thing" given more verbose field definitions, so leave them as is so that
# schema inspection is mor... |
HueyPark/Unreal-Knights | refs/heads/master | Server/Code/logic/rank/rank_logic.py | 1 | from redis_client import redis_client
from redis_client.key import RANK_KEY
class RankLogic:
@staticmethod
def read(user_id) -> int:
rank = redis_client.zrevrank(RANK_KEY, user_id)
return rank + 1
@staticmethod
def update(user_id, score):
redis_client.zadd(RANK_KEY, score, use... |
fabrickit/fabkit | refs/heads/master | core/webapp/manage.py | 1 | #!/usr/bin/env python
import os
import sys
import pymysql
pymysql.install_as_MySQLdb()
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "web_conf.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
|
demichen0824/OMOOC2py | refs/heads/master | _src/om2py1w/1wex1/main.py | 12133432 | |
ryanahall/django | refs/heads/master | tests/responses/__init__.py | 12133432 | |
ojengwa/talk | refs/heads/master | venv/lib/python2.7/site-packages/django/conf/locale/ca/formats.py | 82 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = r'j \d\e F \d\e Y'
TIME_FORMAT = '... |
luo66/scikit-learn | refs/heads/master | sklearn/kernel_ridge.py | 155 | """Module :mod:`sklearn.kernel_ridge` implements kernel ridge regression."""
# Authors: Mathieu Blondel <mathieu@mblondel.org>
# Jan Hendrik Metzen <jhm@informatik.uni-bremen.de>
# License: BSD 3 clause
import numpy as np
from .base import BaseEstimator, RegressorMixin
from .metrics.pairwise import pairwise... |
patmarion/director | refs/heads/master | src/python/director/lcmlogplayer.py | 1 | from director import lcmUtils
from director.timercallback import TimerCallback
from director.qtutils import BlockSignals
import lcm
import numpy as np
from PythonQt import QtCore, QtGui
class LcmLogPlayer(object):
def __init__(self, lcmHandle=None):
if not lcmHandle:
lcmHandle = lcmUtils.get... |
bkahlert/seqan-research | refs/heads/master | raw/pmbs12/pmsb13-data-20120615/trunk/misc/renaming/helpers.py | 14 | import os
import os.path
def test_file_type(filename):
"""
Tests whether the given filename is a C++ header or implementation file
(based on the filename extension.)
"""
pos = filename.rfind(".")
if (pos >= 0): ext = filename[pos+1:]
else: ext = ""
return ext in ["c", "C", "cpp", "CPP"... |
googleads/google-ads-python | refs/heads/master | google/ads/googleads/v6/services/types/__init__.py | 22 | # -*- coding: utf-8 -*-
# Copyright 2020 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 o... |
JetBrains/intellij-community | refs/heads/master | python/testData/resolve/multiFile/importPackageIntoSelfInit/mygame/display.py | 249 | def foo(): pass
|
tianweizhang/nova | refs/heads/v0 | nova/tests/cells/fakes.py | 45 | # Copyright (c) 2012 Rackspace Hosting
# 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... |
jcsp/manila | refs/heads/master | manila/tests/api/contrib/test_share_unmanage.py | 4 | # Copyright 2015 Mirantis 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... |
open-contracting/mapper | refs/heads/master | ocds_mapper/mapper.py | 1 | #!/usr/bin/env python
import argparse
import contextlib
import copy
import csv
import json
import urllib2
import urlparse
import uuid
from datetime import date
def is_url(file_path_or_url):
return urlparse.urlparse(file_path_or_url).scheme != ''
@contextlib.contextmanager
def open_file_path_or_url(file_path_or_... |
graphql-python/graphql-epoxy | refs/heads/master | epoxy/utils/to_camel_case.py | 1 | def to_camel_case(snake_str):
components = snake_str.split('_')
return components[0] + ''.join(x.title() for x in components[1:])
|
diorcety/intellij-community | refs/heads/master | python/testData/resolve/QualifiedVar.py | 83 | class Foo:
bar = 0
Foo().<ref>bar
|
KelSolaar/Snippets | refs/heads/develop | katana/snippets/libraries/naming.py | 1 | import ast
import re
import snippets.libraries.utilities
NODES_NAMES_MAPPING_TABLE = {"ArnoldShadingNode" : "ArnoldSN",
"PrmanShadingNode" : "PrmanSN"}
def getDefaultNodeName(node, mappingTable=NODES_NAMES_MAPPING_TABLE):
"""
Returns given node default name.
:param nodes: Node to get the default name.
:t... |
stephaniejn/stephaniejn.github.io | refs/heads/master | node_modules/node-gyp/gyp/pylib/gyp/generator/cmake.py | 1355 | # 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.
"""cmake output module
This module is under development and should be considered experimental.
This module produces cmake (2.8.8+) input as its output. One CMake... |
alanljj/oca_hr | refs/heads/8.0 | hr_skill/__openerp__.py | 5 | # -*- coding: utf-8 -*-
###############################################################################
#
# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public L... |
signed/intellij-community | refs/heads/master | python/testData/editing/sectionIndentInsideGoogleDocString.py | 101 | def f(param):
"""
Args:<caret>
""" |
asbjornu/arana | refs/heads/master | app/Web/aranalibtest/common/appenginepatch/appenginepatcher/conf/__init__.py | 12133432 | |
benpicco/mate-panflute | refs/heads/master | src/panflute/daemon/xmms2.py | 1 | #! /usr/bin/env python
# Panflute
# Copyright (C) 2009 Paul Kuliniewicz <paul@kuliniewicz.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; either version 2, or (at your option)
# any late... |
lucasdavila/web2py-appreport | refs/heads/master | modules/plugin_appreport/libs/appreport/libs/pisa/libs/reportlab/src/reportlab/lib/fontfinder.py | 10 | #Copyright ReportLab Europe Ltd. 2000-2007
#see license.txt for license details
__version__=''' $Id: fontfinder.py 3660 2010-02-08 18:17:33Z damian $ '''
#modification of users/robin/ttflist.py.
__doc__="""This provides some general-purpose tools for finding fonts.
The FontFinder object can search for font files. It... |
nathanljustin/teamwork-analysis | refs/heads/master | teamworkApp/lib/tests.py | 1 | # muddersOnRails()
# Sara McAllister November 8, 2017
# Last updated: 11-11-2017
# unittests for dbCalls.py and importData.py
# currently assumes an empty, created test database
# initialize db/test.sqlite3 by running
# $ rails db:migrate RAILS_ENV=test
# if the database is created but not empty, first run
# $ rail... |
slisson/intellij-community | refs/heads/master | python/testData/inspections/PyCompatibilityInspection/matMul.py | 65 | x <warning descr="Python versions < 3.5 do not support matrix multiplication operators">@</warning> y
x <warning descr="Python versions < 3.5 do not support matrix multiplication operators">@=</warning> y
|
Balannen/LSMASOMM | refs/heads/master | atom3/Formalisms/LSMASOMM/LSMASOMM_MDL.sync-conflict-20180203-213920-RQOO52T.py | 1 | """
__LSMASOMM_MDL.py_____________________________________________________
Automatically generated AToM3 Model File (Do not modify directly)
Author: bogdan
Modified: Fri Feb 2 01:44:47 2018
______________________________________________________________________
"""
from stickylink import *
from widthXfillXdecoration i... |
eemirtekin/edx-platform | refs/heads/master | lms/djangoapps/mobile_api/social_facebook/groups/views.py | 86 | """
Views for groups info API
"""
from rest_framework import generics, status, mixins
from rest_framework.response import Response
from django.conf import settings
import facebook
from ...utils import mobile_view
from . import serializers
@mobile_view()
class Groups(generics.CreateAPIView, mixins.DestroyModelMixin)... |
izonder/intellij-community | refs/heads/master | python/testData/completion/dunderClass.after.py | 83 | class Foo(object):
xyzzy = 3
def fun(self):
a = self.__class__.xyzzy |
rodo/django-perf | refs/heads/master | foo/banana/__init__.py | 12133432 | |
kylebush/bigdata-tools | refs/heads/master | vagrant/__init__.py | 12133432 | |
iwaseyusuke/ryu | refs/heads/master | ryu/tests/unit/sample/__init__.py | 12133432 | |
dekom/threepress-bookworm-read-only | refs/heads/master | threepress/__init__.py | 12133432 | |
LockScreen/Backend | refs/heads/master | venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/contrib/__init__.py | 12133432 | |
kenshay/ImageScript | refs/heads/master | ProgramData/SystemFiles/Python/Lib/site-packages/skimage/color/colorconv.py | 2 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Functions for converting between color spaces.
The "central" color space in this module is RGB, more specifically the linear
sRGB color space using D65 as a white-point [1]_. This represents a
standard monitor (w/o gamma correction). For a good FAQ on color spaces see... |
yvaucher/l10n-canada | refs/heads/8.0 | __unported__/l10n_ca_qc_hr_payroll/l10n_ca_qc_hr_payroll.py | 3 | # -*- coding:utf-8 -*-
##############################################################################
#
# Copyright (C) 2010 - 2014 Savoir-faire Linux. All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.