repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
diogocs1/comps | refs/heads/master | web/addons/account/report/__init__.py | 381 | # -*- 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... |
marchantes/foodtruck-finder-api | refs/heads/master | foodtrucks/serializers.py | 2 | from foodtrucks.models import *
from rest_framework import serializers
class FoodtruckSerializer(serializers.ModelSerializer):
location_object = serializers.ReadOnlyField(source='location_parser')
owner = serializers.ReadOnlyField(source='owner.email')
rating = serializers.ReadOnlyField(source='average_r... |
DGRC-PT/hic_manipulation_scripts | refs/heads/master | select_interactions_interval.py | 1 | #uses a input file as:
#chrA\tstart cordA\t end cordA\tchrB\tstart cordB\tend cordB\t number of interactions
#and retrive the interactions from this file that are inside the interval given by the user
#the output has the same format as the input file
#command:
#python select_interactions_interval.py infile start_interv... |
dweinstein/elsim | refs/heads/master | elsim/similarity/hashtype.py | 46 | """
Base class from which hash types can be created.
Part of python-hashes by sangelone. See README and LICENSE.
"""
default_hashbits = 96
class hashtype(object):
def __init__(self, value='', hashbits=default_hashbits, hash=None):
"Relies on create_hash() provided by subclass"
self.hashbits = has... |
biicode/client | refs/heads/develop | dev/node/runners_tools.py | 5 | from biicode.common.utils.file_utils import load_resource, save
from biicode.client.dev.node import DEV_NODE_DIR
import platform
import os
import stat
def create_noderunner(project_path, blocks_folder, deps_folder):
if platform.system() == 'Windows':
runner = "noderunner.bat"
else:
runner = "n... |
saurabh6790/ON-RISLIB | refs/heads/master | core/doctype/scheduler_log/scheduler_log.py | 798 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
# For license information, please see license.txt
from __future__ import unicode_literals
import webnotes
class DocType:
def __init__(self, d, dl):
self.doc, self.doclist = d, dl |
whitepages/nova | refs/heads/master | nova/keymgr/__init__.py | 70 | # Copyright (c) 2013 The Johns Hopkins University/Applied Physics Laboratory
# 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/... |
Shiroy/servo | refs/heads/master | tests/wpt/web-platform-tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/css-tmpl.py | 246 | def main(request, response):
encoding = request.GET['encoding']
tmpl = request.GET['tmpl']
sheet = tmpl % u'\\0000E5'
return [("Content-Type", "text/css; charset=%s" % encoding)], sheet.encode(encoding)
|
dobre-robert-marius/rockstar | refs/heads/master | examples/dart_rockstar.py | 8 | from RockStar import RockStar
dart_code = "main() { print('Hello Word'); }"
rock_it_bro = RockStar(days=400, file_name='helloWorld.dart', code=dart_code)
rock_it_bro.make_me_a_rockstar()
|
NextDevBoard/Arduino | refs/heads/master | libraries/ArduinoJson/third-party/gtest-1.7.0/test/gtest_xml_test_utils.py | 1815 | #!/usr/bin/env python
#
# Copyright 2006, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... |
ibelem/crosswalk-test-suite | refs/heads/master | apptools/apptools-windows-tests/apptools/check_host.py | 15 | #!/usr/bin/env python
#
# Copyright (c) 2015 Intel Corporation.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of works must retain the original copyright notice, this
# list of conditions and t... |
mysociety/polipop | refs/heads/master | polipop/popit/migrations/0006_auto__add_organisationname__del_field_organisation_name.py | 1 | # 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 'OrganisationName'
db.create_table('popit_organisationname', (
('id', self.gf('... |
christoph-buente/phantomjs | refs/heads/master | src/qt/qtwebkit/Source/WebCore/inspector/CodeGeneratorInspector.py | 117 | #!/usr/bin/env python
# Copyright (c) 2011 Google Inc. All rights reserved.
# Copyright (c) 2012 Intel Corporation. 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 sou... |
weolar/miniblink49 | refs/heads/master | third_party/WebKit/Source/build/scripts/name_utilities.py | 14 | # Copyright (C) 2013 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... |
jpec/raspyplayer | refs/heads/master | src/raspyplayer-lite.py | 2 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#-------------------------------------------------------------------------#
# raspyplayer-lite.py - Video player designed for Raspberry Pi.
#-------------------------------------------------------------------------#
PROGRAM = 'Raspyplayer Lite'
VERSION = 'v0.2'
#----------... |
mcedit/mcedit | refs/heads/master | editortools/editortool.py | 1 | from OpenGL import GL
import numpy
from depths import DepthOffset
from pymclevel import BoundingBox
class EditorTool(object):
surfaceBuild = False
panel = None
optionsPanel = None
toolIconName = None
worldTooltipText = None
previewRenderer = None
tooltipText = "???"
def levelChanged(s... |
Fusion-Rom/android_external_chromium_org | refs/heads/lp5.1 | google_apis/google_api_keys.py | 87 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Python API for retrieving API keys.
Note that this does not have the exact same semantics as the C++ API
in google_api_keys.h, ... |
miptliot/edx-platform | refs/heads/ginkgo_openedu_docker | lms/djangoapps/teams/views.py | 2 | """HTTP endpoints for the Teams API."""
import logging
from django.conf import settings
from django.contrib.auth.models import User
from django.db.models.signals import post_save
from django.dispatch import receiver
from django.http import Http404
from django.shortcuts import get_object_or_404, render_to_response
fro... |
erdincay/pyload | refs/heads/stable | module/lib/beaker/session.py | 44 | import Cookie
import os
import random
import time
from datetime import datetime, timedelta
from beaker.crypto import hmac as HMAC, hmac_sha1 as SHA1, md5
from beaker.util import pickle
from beaker import crypto
from beaker.cache import clsmap
from beaker.exceptions import BeakerException, InvalidCryptoBackendErro... |
afraser/CellProfiler-Analyst | refs/heads/master | cpa/icons/__init__.py | 1 | import wx
import os.path
import glob
import sys
# This bit of code provides simple importing of images, as instances
# of wx.Image. An image in a file named ABC.png copied into the icons
# directory can be imported as icons.ABC.
if 'library.zip' in __path__[0]:
# py2exe puts this module into its library.zip, an... |
crwilcox/PTVS | refs/heads/master | Python/Tests/TestData/SomeLinkedFile.py | 692 | print('hello world') |
nanolearningllc/edx-platform-cypress | refs/heads/master | lms/djangoapps/commerce/api/v1/urls.py | 56 | """ API v1 URLs. """
from django.conf import settings
from django.conf.urls import patterns, url, include
from commerce.api.v1 import views
COURSE_URLS = patterns(
'',
url(r'^$', views.CourseListView.as_view(), name='list'),
url(r'^{}/$'.format(settings.COURSE_ID_PATTERN), views.CourseRetrieveUpdateView.... |
willingc/oh-mainline | refs/heads/master | vendor/packages/gdata/src/gdata/webmastertools/service.py | 79 | #!/usr/bin/python
#
# Copyright (C) 2008 Yu-Jie Lin
#
# 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... |
chrisburr/scikit-learn | refs/heads/master | sklearn/svm/base.py | 18 | from __future__ import print_function
import numpy as np
import scipy.sparse as sp
import warnings
from abc import ABCMeta, abstractmethod
from . import libsvm, liblinear
from . import libsvm_sparse
from ..base import BaseEstimator, ClassifierMixin
from ..preprocessing import LabelEncoder
from ..multiclass import _ov... |
Statoil/libres | refs/heads/master | python/res/enkf/enums/enkf_truncation_type.py | 2 | # Copyright (C) 2013 Equinor ASA, Norway.
#
# The file 'content_type_enum.py' is part of ERT - Ensemble based Reservoir Tool.
#
# ERT 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 t... |
systembugtj/electron | refs/heads/master | script/update-external-binaries.py | 124 | #!/usr/bin/env python
import errno
import sys
import os
from lib.config import get_target_arch
from lib.util import safe_mkdir, rm_rf, extract_zip, tempdir, download
VERSION = 'v0.7.0'
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
FRAMEWORKS_URL = 'http://github.com/atom/atom-shell-frame... |
vintasoftware/fix-my-django-lib | refs/heads/master | fixmydjango/tests/test_technical_500_response.py | 3 | import sys
import pytest
from django.core.urlresolvers import reverse
from django.views.debug import technical_500_response
from termcolor import colored
import requests
from fixmydjango import (
FIX_MY_DJANGO_MESSAGE, FIX_MY_DJANGO_MESSAGE_PLAIN,
FIX_MY_DJANGO_MESSAGE_TO_ADMIN, FIX_MY_DJANGO_MESSAGE_TO_ADMIN_... |
unnikrishnankgs/va | refs/heads/master | venv/lib/python3.5/site-packages/tensorflow/contrib/tensor_forest/hybrid/python/models/hard_decisions_to_data_then_nn.py | 189 | # Copyright 2016 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... |
eddiep1101/django-oscar | refs/heads/master | src/oscar/apps/dashboard/pages/__init__.py | 59 | default_app_config = 'oscar.apps.dashboard.pages.config.PagesDashboardConfig'
|
youngkin/subpub | refs/heads/master | fabfile/config.py | 2 | #
# brokers is a list of RabbitMQ hosts that prospero will try
# to connect to.
#
brokers=[
{
"name": "one",
"host": "",
"username": "guest",
"password": "guest"
}
]
#
# rest controls the way that the server handles the REST port
# that the system presents to fulfill ser... |
Chilledheart/chromium | refs/heads/master | tools/telemetry/third_party/gsutilz/third_party/boto/boto/connection.py | 49 | # Copyright (c) 2006-2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates.
# Copyright (c) 2010 Google
# Copyright (c) 2008 rPath, Inc.
# Copyright (c) 2009 The Echo Nest Corporation
# Copyright (c) 2010, Eucalyptus Systems, Inc.
# Copyright (c) 2011, Nexenta Systems Inc.
# All... |
yograterol/django | refs/heads/master | tests/utils_tests/test_baseconv.py | 326 | from unittest import TestCase
from django.utils.baseconv import (
BaseConverter, base2, base16, base36, base56, base62, base64,
)
from django.utils.six.moves import range
class TestBaseConv(TestCase):
def test_baseconv(self):
nums = [-10 ** 10, 10 ** 10] + list(range(-100, 100))
for converte... |
Srisai85/scikit-learn | refs/heads/master | sklearn/linear_model/tests/test_perceptron.py | 378 | import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_raises
from sklearn.utils import check_random_state
from sklearn.datasets import load_iris
from sklearn.linear_model import Pe... |
eabatalov/criu | refs/heads/master | test/others/ext-tty/run.py | 7 | #!/usr/bin/env python
import subprocess
import os, sys, time, signal, pty
master, slave = pty.openpty()
p = subprocess.Popen(["setsid", "--ctty", "sleep", "10000"],
stdin = slave, stdout = slave, stderr = slave, close_fds = True)
st = os.stat("/proc/self/fd/%d" % slave)
ttyid = "tty[%x:%x]" % (st.st_rdev, st.st_de... |
adazey/Muzez | refs/heads/master | libs/youtube_dl/extractor/ebaumsworld.py | 87 | from __future__ import unicode_literals
from .common import InfoExtractor
class EbaumsWorldIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?ebaumsworld\.com/videos/[^/]+/(?P<id>\d+)'
_TEST = {
'url': 'http://www.ebaumsworld.com/videos/a-giant-python-opens-the-door/83367677/',
'info_dict'... |
scs/uclinux | refs/heads/master | user/python/python-2.4.4/Tools/freeze/makefreeze.py | 46 | import marshal
import bkfile
# Write a file containing frozen code for the modules in the dictionary.
header = """
#include "Python.h"
static struct _frozen _PyImport_FrozenModules[] = {
"""
trailer = """\
{0, 0, 0} /* sentinel */
};
"""
# if __debug__ == 0 (i.e. -O option given), set Py_OptimizeFlag in frozen... |
BPI-SINOVOIP/BPI-Mainline-kernel | refs/heads/master | toolchains/gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabihf/share/gdb/python/gdb/printer/__init__.py | 10 | # Copyright (C) 2014-2018 Free Software Foundation, 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 License, or
# (at your option) any later version.
#
# This progr... |
lidavidm/mathics-heroku | refs/heads/master | venv/lib/python2.7/site-packages/sympy/simplify/tests/test_function.py | 124 | """ Unit tests for Hyper_Function"""
from sympy.core import symbols, Dummy, Tuple, S
from sympy.functions import hyper
from sympy.simplify.hyperexpand import Hyper_Function
def test_attrs():
a, b = symbols('a, b', cls=Dummy)
f = Hyper_Function([2, a], [b])
assert f.ap == Tuple(2, a)
assert f.bq == Tup... |
keyboard-k/youtube-dl-pet | refs/heads/master | youtube_dl/downloader/fragment.py | 77 | from __future__ import division, unicode_literals
import os
import time
from .common import FileDownloader
from .http import HttpFD
from ..utils import (
encodeFilename,
sanitize_open,
)
class HttpQuietDownloader(HttpFD):
def to_screen(self, *args, **kargs):
pass
class FragmentFD(FileDownloade... |
ychen820/microblog | refs/heads/master | flask/lib/python2.7/site-packages/pkg_resources/_vendor/packaging/specifiers.py | 258 | # Copyright 2014 Donald Stufft
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... |
jcai19/smm_gem5 | refs/heads/master | util/gem5img.py | 86 | #!/usr/bin/python
#
# gem5img.py
# Script for managing a gem5 disk image.
#
from optparse import OptionParser
import os
from os import environ as env
import string
from subprocess import CalledProcessError, Popen, PIPE, STDOUT
from sys import exit, argv
# Some constants.
MaxLBACylinders = 16383
MaxLBAHeads = 16
MaxL... |
dfdx2/django | refs/heads/master | django/test/html.py | 30 | """Compare two HTML documents."""
import re
from django.utils.html_parser import HTMLParseError, HTMLParser
WHITESPACE = re.compile(r'\s+')
def normalize_whitespace(string):
return WHITESPACE.sub(' ', string)
class Element:
def __init__(self, name, attributes):
self.name = name
self.attri... |
buildingenergy/buildingenergy-platform | refs/heads/master | seed/views/api.py | 1 | from annoying.decorators import ajax_request
from seed.utils.api import (
get_api_endpoints, format_api_docstring, api_endpoint
)
@api_endpoint
@ajax_request
def get_api_schema(request):
"""
Returns a hash of all API endpoints and their descriptions.
Returns::
{'/example/url/here': {
... |
caot/intellij-community | refs/heads/master | python/testData/resolve/MultiTargetTuple.py | 83 | (aa, (bb, cc)) = (1, (2, 3))
b<ref>b |
pmmre/Bares | refs/heads/master | settings.py | 2 | """
Django settings for bares project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
import dj_database_url
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', ... |
aringh/odl | refs/heads/master | odl/operator/__init__.py | 1 | # Copyright 2014-2017 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/.
"""Representation of mathematical operators... |
pigeonflight/strider-plone | refs/heads/master | docker/appengine/lib/django-1.5/tests/regressiontests/indexes/models.py | 80 | from django.db import connection
from django.db import models
class Article(models.Model):
headline = models.CharField(max_length=100)
pub_date = models.DateTimeField()
class Meta:
index_together = [
["headline", "pub_date"],
]
# Indexing a TextField on Oracle or MySQL resul... |
40423110/cpaw2 | refs/heads/master | plugin/liquid_tags/literal.py | 332 | """
Literal Tag
-----------
This implements a tag that allows explicitly showing commands which would
otherwise be interpreted as a liquid tag.
For example, the line
{% literal video arg1 arg2 %}
would result in the following line:
{% video arg1 arg2 %}
This is useful when the resulting line would be inter... |
jk1/intellij-community | refs/heads/master | python/helpers/py2only/docutils/nodes.py | 104 | # $Id: nodes.py 7595 2013-01-21 17:33:56Z milde $
# Author: David Goodger <goodger@python.org>
# Maintainer: docutils-develop@lists.sourceforge.net
# Copyright: This module has been placed in the public domain.
"""
Docutils document tree element class library.
Classes in CamelCase are abstract base classes or auxilia... |
romankagan/DDBWorkbench | refs/heads/master | python/lib/Lib/encodings/cp1256.py | 593 | """ Python Character Mapping Codec cp1256 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1256.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,in... |
YourCyborg/Sun-RPI | refs/heads/master | src/utils/utils.py | 1 | """
General helper functions that don't fit neatly under any given category.
They provide some useful string and conversion methods that might
be of use when designing your own game.
"""
import os, sys, imp, types, math, re
import textwrap, datetime, random, traceback, inspect
from inspect import ismodule
from colle... |
xiaoyaozi5566/DiamondCache | refs/heads/master | tests/configs/memtest.py | 7 | # Copyright (c) 2006-2007 The Regents of The University of Michigan
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above copyright
# notice, this ... |
engla/kupfer | refs/heads/master | waflib/Tools/c_osx.py | 10 | #!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy 2008-2010
"""
MacOSX related tools
"""
import os, shutil, sys, platform
from waflib import TaskGen, Task, Build, Options, Utils, Errors
from waflib.TaskGen import taskgen_method, feature, after_method, before_method
app_info = '''
<?xml version="1.0" encoding="UT... |
DeltaEpsilon-HackFMI2/FMICalendar-REST | refs/heads/master | venv/lib/python2.7/site-packages/django/contrib/sitemaps/tests/https.py | 219 | from __future__ import unicode_literals
from datetime import date
from django.test.utils import override_settings
from .base import SitemapTestsBase
class HTTPSSitemapTests(SitemapTestsBase):
protocol = 'https'
urls = 'django.contrib.sitemaps.tests.urls.https'
def test_secure_sitemap_index(self):
... |
Apoorv13/fest_crawl | refs/heads/master | webscrape/knowafest.py | 1 | import scrapy
class AuthorSpider(scrapy.Spider):
name = 'author'
start_urls = ['http://www.knowafest.com/college-fests/events']
def parse(self, response):
# follow links to author pages
for href in response.css('.author+a::attr(href)').extract():
yield scrapy.Request(response... |
pgmillon/ansible | refs/heads/devel | lib/ansible/modules/web_infrastructure/ansible_tower/tower_credential.py | 2 | #!/usr/bin/python
# coding: utf-8 -*-
# Copyright: (c) 2017, Wayne Witzel III <wayne@riotousliving.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_ver... |
prune998/ansible | refs/heads/devel | lib/ansible/module_utils/openswitch.py | 87 | #
# (c) 2015 Peter Sprygada, <psprygada@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any late... |
darolt/ndnSIMQoS | refs/heads/master | src/tap-bridge/bindings/modulegen__gcc_LP64.py | 5 | 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))
... |
abhishek-ch/hue | refs/heads/master | desktop/core/ext-py/Django-1.6.10/django/contrib/sitemaps/tests/test_flatpages.py | 225 | from __future__ import unicode_literals
from django.conf import settings
from django.utils.unittest import skipUnless
from .base import SitemapTestsBase
class FlatpagesSitemapTests(SitemapTestsBase):
@skipUnless("django.contrib.flatpages" in settings.INSTALLED_APPS,
"django.contrib.flatpages app... |
ruitian/flasky | refs/heads/master | app/auth/__init__.py | 326 | from flask import Blueprint
auth = Blueprint('auth', __name__)
from . import views
|
jeremiahyan/odoo | refs/heads/master | odoo/addons/base/__init__.py | 5 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import controllers
from . import models
from . import populate
from . import report
from . import wizard
def post_init(cr, registry):
"""Rewrite ICP's to force groups"""
from odoo import api, SUPERUSER_I... |
Kashomon/online-ratings | refs/heads/master | web/app/ratings_helpers.py | 2 |
def rating_to_traditional_range(rating_f):
""" Returns a rating from 0-40 in the traditional -30 to 10ish,
with the -1 to 1 kyu/dan boundary expanded.
"""
rating = rating_f - 30.0
if (rating > -1.0):
rating += 2.0
return rating
def rating_to_rank(rating_f):
""" Returns a rating fr... |
sgiavasis/nipype | refs/heads/master | nipype/workflows/dmri/fsl/dti.py | 6 | # coding: utf-8
from __future__ import absolute_import
from ....pipeline import engine as pe
from ....interfaces import utility as niu
from ....interfaces import fsl
from ....algorithms import misc
# backwards compatibility
from .epi import create_eddy_correct_pipeline
def transpose(samples_over_fibres):
impor... |
Shiroy/servo | refs/heads/master | tests/wpt/web-platform-tests/XMLHttpRequest/resources/auth1/auth.py | 1282 | import imp
import os
here = os.path.split(os.path.abspath(__file__))[0]
def main(request, response):
auth = imp.load_source("", os.path.join(here,
"..",
"authentication.py"))
return auth.main(request, response)
|
praaline/Praaline | refs/heads/master | dependency-builds/sv/src/libsndfile-1.0.27/src/binheader_writef_check.py | 8 | #!/usr/bin/python
# Copyright (C) 2006-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the ... |
wreckJ/intellij-community | refs/heads/master | python/testData/refactoring/rename/renameInstanceVar_after.py | 83 | class Point:
def __init__(self, x, y):
self._x = x
self.y = y |
baruch/traces | refs/heads/master | interactive_reader/widgets.py | 1 | import urwid
class AnsiText(urwid.Text):
foregrounds = {'30' : 'black',
'31' : 'light red',
'32' : 'light green',
'33' : 'yellow',
'34' : 'light blue',
'35' : 'light magenta',
'36' : 'light cyan',
... |
hurricup/intellij-community | refs/heads/master | plugins/hg4idea/testData/bin/mercurial/__version__.py | 88 | # this file is autogenerated by setup.py
version = "2.6.2"
|
simontakite/sysadmin | refs/heads/master | pythonscripts/learningPython/formats.py | 1 | #!python
"""
File: formats.py (2.X and 3.X)
Various specialized string display formatting utilities.
Test me with canned self-test or command-line arguments.
To do: add parens for negative money, add more features.
"""
def commas(N):
"""
Format positive integer-like N for display with
commas bet... |
Timus1712/boto | refs/heads/master | boto/emr/emrobject.py | 14 | # Copyright (c) 2010 Spotify AB
# Copyright (c) 2010 Jeremy Thurgood <firxen+boto@gmail.com>
# Copyright (c) 2010-2011 Yelp
#
# 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 restricti... |
pong3489/TEST_Mission | refs/heads/master | Lib/distutils/command/install_egg_info.py | 66 | """distutils.command.install_egg_info
Implements the Distutils 'install_egg_info' command, for installing
a package's PKG-INFO metadata."""
from distutils.cmd import Command
from distutils import log, dir_util
import os, sys, re
class install_egg_info(Command):
"""Install an .egg-info file for the pa... |
CalebSLane/openelisglobal-core | refs/heads/develop | liquibase/OE5.1/testCatalogKenya/Scripts/panels.py | 9 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
panels = []
used = ['']
panel_file = open('panels.txt','r')
for line in panel_file:
if len(line) > 1:
panels.append(line.strip())
panel_file.close()
def esc_name(name):
if "'" in name:
return "$$" + name.strip() + "$$"
else:
... |
HunseopJeong/WATT | refs/heads/master | tools/WebIDLBinder/third_party/ply/test/lex_re3.py | 174 | # lex_re3.py
#
# Regular expression rule matches empty string
import sys
if ".." not in sys.path: sys.path.insert(0,"..")
import ply.lex as lex
tokens = [
"PLUS",
"MINUS",
"NUMBER",
"POUND",
]
t_PLUS = r'\+'
t_MINUS = r'-'
t_NUMBER = r'(\d+)'
t_POUND = r'#'
def t_error(t):
pass
lex.lex()... |
codeboardio/mantra | refs/heads/master | test/test_resources/python/py_several_files/Root/application.py | 9 | from b import foo
foo()
print "Goodbye, World!" |
shhui/nova | refs/heads/master | nova/tests/api/openstack/compute/contrib/test_hosts.py | 13 | # Copyright (c) 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... |
s142857/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/wptserve/wptserve/routes.py | 329 | import handlers
from router import any_method
routes = [(any_method, "*.py", handlers.python_script_handler),
("GET", "*.asis", handlers.as_is_handler),
("GET", "*", handlers.file_handler),
]
|
jk1/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/contrib/gis/geos/prototypes/errcheck.py | 623 | """
Error checking functions for GEOS ctypes prototype functions.
"""
import os
from ctypes import c_void_p, string_at, CDLL
from django.contrib.gis.geos.error import GEOSException
from django.contrib.gis.geos.libgeos import GEOS_VERSION
from django.contrib.gis.geos.prototypes.threadsafe import GEOSFunc
# Getting the... |
uroslates/django-allauth | refs/heads/master | allauth/account/models.py | 7 | import sys
from datetime import datetime
from django.conf import settings
from django.db import models
from django.db.models.signals import post_save
from django.utils.translation import get_language_from_request, ugettext_lazy as _
from django.contrib.auth.models import User, AnonymousUser
from emailconfirmation.m... |
matmutant/sl4a | refs/heads/master | python/gdata/src/atom/mock_http_core.py | 135 | #!/usr/bin/env python
#
# Copyright (C) 2009 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 ... |
hstaugaard/notejam | refs/heads/master | django/notejam/notejam/settings.py | 6 | import os
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ALLOWED_HOSTS = []
PROJECT_DIR = "{}/../".format(os.path.dirname(__file__))
ADMINS = (
('Sergey Komar', 'komarserjio@gmail.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'notejam.db',
... |
enthought/shiboken | refs/heads/master | tests/samplebinding/addedfunction_test.py | 6 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is part of the Shiboken Python Bindings Generator project.
#
# Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
#
# Contact: PySide team <contact@pyside.org>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms... |
ddrmanxbxfr/servo | refs/heads/master | components/script/dom/bindings/codegen/parser/tests/test_special_method_signature_mismatch.py | 241 | def WebIDLTest(parser, harness):
threw = False
try:
parser.parse("""
interface SpecialMethodSignatureMismatch1 {
getter long long foo(long index);
};
""")
results = parser.finish()
except:
threw = True
harness.ok(threw, "Should have... |
Netuitive/netuitive-client-python | refs/heads/master | setup.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read().replace('.. :changelog:', ... |
ryangallen/django | refs/heads/master | django/core/checks/security/sessions.py | 477 | from django.conf import settings
from .. import Tags, Warning, register
def add_session_cookie_message(message):
return message + (
" Using a secure-only session cookie makes it more difficult for "
"network traffic sniffers to hijack user sessions."
)
W010 = Warning(
add_session_cookie_... |
tpo/ansible | refs/heads/devel | test/integration/targets/collections/collections/ansible_collections/testns/content_adj/plugins/vars/custom_adj_vars.py | 58 | # Copyright 2019 RedHat, inc
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible i... |
shubhdev/edx-platform | refs/heads/master | cms/djangoapps/contentstore/tests/test_users_default_role.py | 48 | """
Unit tests for checking default forum role "Student" of a user when he creates a course or
after deleting it creates same course again
"""
from contentstore.tests.utils import AjaxEnabledTestClient
from contentstore.utils import delete_course_and_groups, reverse_url
from courseware.tests.factories import UserFactor... |
GladeRom/android_external_chromium_org | refs/heads/gr-3.1 | ash/resources/PRESUBMIT.py | 120 | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Presubmit script for Chromium Ash resources.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the p... |
bocaaust/FreshLife | refs/heads/master | django_project/env/lib/python2.7/site-packages/pip/_vendor/cachecontrol/caches/__init__.py | 962 | from textwrap import dedent
try:
from .file_cache import FileCache
except ImportError:
notice = dedent('''
NOTE: In order to use the FileCache you must have
lockfile installed. You can install it via pip:
pip install lockfile
''')
print(notice)
try:
import redis
from .redis_cach... |
autrilla/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/pywebsocket/src/test/testdata/handlers/sub/exception_in_transfer_wsh.py | 499 | # Copyright 2009, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... |
cpcloud/numba | refs/heads/master | examples/ufuncs.py | 4 | #!/usr/bin/env python
from numba import vectorize
from numba import autojit, double, jit
import math
import numpy as np
@vectorize(['f8(f8)','f4(f4)'])
def sinc(x):
if x == 0:
return 1.0
else:
return math.sin(x*math.pi) / (x*math.pi)
@vectorize(['int8(int8,int8)',
'int16(int16,int1... |
kazemakase/scikit-learn | refs/heads/master | sklearn/externals/joblib/disk.py | 320 | """
Disk management utilities.
"""
# Authors: Gael Varoquaux <gael dot varoquaux at normalesup dot org>
# Lars Buitinck <L.J.Buitinck@uva.nl>
# Copyright (c) 2010 Gael Varoquaux
# License: BSD Style, 3 clauses.
import errno
import os
import shutil
import sys
import time
def disk_used(path):
""" Return... |
jgmanzanas/CMNT_004_15 | refs/heads/master | project-addons/stock_custom/partner.py | 1 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2016 Comunitea Servicios Tecnológicos
# $Omar Castiñeira Saavedra <omar@comunitea.com>$
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of th... |
SPKian/Testing2 | refs/heads/master | erpnext/setup/doctype/sales_partner/test_sales_partner.py | 104 | # 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
test_records = frappe.get_test_records('Sales Partner') |
nelsongoh/tembotsu | refs/heads/master | libs/future/moves/http/server.py | 82 | from __future__ import absolute_import
from future.utils import PY3
if PY3:
from http.server import *
else:
__future_module__ = True
from BaseHTTPServer import *
from CGIHTTPServer import *
from SimpleHTTPServer import *
try:
from CGIHTTPServer import _url_collapse_path # needed for... |
savoirfairelinux/OpenUpgrade | refs/heads/master | addons/auth_ldap/users_ldap.py | 38 | ##############################################################################
#
# 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 GNU Affero General Publ... |
ossdemura/django-miniblog | refs/heads/dev | src/Lib/site-packages/django/utils/safestring.py | 51 | """
Functions for working with "safe strings": strings that can be displayed safely
without further escaping in HTML. Marking something as a "safe string" means
that the producer of the string has already turned characters that should not
be interpreted by the HTML engine (e.g. '<') into the appropriate entities.
"""
i... |
krsjoseph/youtube-dl | refs/heads/master | youtube_dl/downloader/http.py | 76 | from __future__ import unicode_literals
import errno
import os
import socket
import time
import re
from .common import FileDownloader
from ..compat import (
compat_urllib_request,
compat_urllib_error,
)
from ..utils import (
ContentTooShortError,
encodeFilename,
sanitize_open,
)
class HttpFD(Fil... |
h2oai/h2o-2 | refs/heads/master | py/testdir_release/c6/test_c6_maprfs_fvec.py | 9 | import unittest, time, sys, time, random, json
sys.path.extend(['.','..','../..','py'])
import h2o, h2o_cmd, h2o_browse as h2b, h2o_import as h2i, h2o_common, h2o_jobs as h2j
DO_RANDOM_SAMPLE = True
DO_RF = False
print "Assumes you ran ../build_for_clone.py in this directory"
print "Using h2o-nodes.json. Also the sand... |
oxfordyang2016/learnfluentpython | refs/heads/master | 17-futures/countries/flags3_threadpool.py | 7 | """Download flags and names of countries.
ThreadPool version
"""
import collections
from concurrent import futures
import requests
import tqdm
from flags2_common import main, save_flag, HTTPStatus, Result
from flags2_sequential import get_flag
DEFAULT_CONCUR_REQ = 30
MAX_CONCUR_REQ = 1000
def get_country(base_ur... |
AnthonyBroadCrawford/servo | refs/heads/master | tests/wpt/web-platform-tests/XMLHttpRequest/resources/invalid-utf8-html.py | 253 | def main(request, response):
headers = [("Content-type", "text/html;charset=utf-8")]
content = chr(0xff)
return headers, content
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.