repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
Gagaro/django | refs/heads/master | django/contrib/postgres/aggregates/statistics.py | 493 | from django.db.models import FloatField, IntegerField
from django.db.models.aggregates import Aggregate
__all__ = [
'CovarPop', 'Corr', 'RegrAvgX', 'RegrAvgY', 'RegrCount', 'RegrIntercept',
'RegrR2', 'RegrSlope', 'RegrSXX', 'RegrSXY', 'RegrSYY', 'StatAggregate',
]
class StatAggregate(Aggregate):
def __in... |
oleg-cherednik/hackerrank | refs/heads/master | Python/Basic Data Types/Nested Lists/solution.py | 1 | #!/bin/python3
if __name__ == '__main__':
data = []
for _ in range(int(input())):
name = input()
score = float(input())
data.append([name, score])
mark = sorted(list(set([marks for name, marks in data])))[1]
data = sorted(data)
for item in data:
if item[1] == mark... |
eJRF/ejrf | refs/heads/master | questionnaire/features/pages/sections.py | 1 | from questionnaire.features.pages.base import PageObject
class CreateSectionPage(PageObject):
def __init__(self, browser, questionnaire):
super(CreateSectionPage, self).__init__(browser)
self.url = '/questionnaire/entry/%s/section/new/' % questionnaire.id
def verify_current_position_of_sectio... |
aequitas/home-assistant | refs/heads/dev | homeassistant/components/picotts/tts.py | 7 | """Support for the Pico TTS speech service."""
import logging
import os
import shutil
import subprocess
import tempfile
import voluptuous as vol
from homeassistant.components.tts import CONF_LANG, PLATFORM_SCHEMA, Provider
_LOGGER = logging.getLogger(__name__)
SUPPORT_LANGUAGES = ['en-US', 'en-GB', 'de-DE', 'es-ES'... |
faircoin/faircoin | refs/heads/master | share/rpcuser/rpcuser.py | 115 | #!/usr/bin/env python2
# Copyright (c) 2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import hashlib
import sys
import os
from random import SystemRandom
import base64
import hmac
if len(sys.a... |
sbtlaarzc/vispy | refs/heads/master | vispy/visuals/image.py | 3 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
from __future__ import division
import numpy as np
from ..gloo import Texture2D, VertexBuffer
from ..color import get_colormap
from .shaders import Function, FunctionChain
f... |
rhertzog/django | refs/heads/master | tests/defer/models.py | 282 | """
Tests for defer() and only().
"""
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
class Secondary(models.Model):
first = models.CharField(max_length=50)
second = models.CharField(max_length=50)
@python_2_unicode_compatible
class Primary(models.Model):
name... |
rastrexando-eu/rastrexando-eu | refs/heads/master | web/tests/test_views.py | 1 | import datetime as dt
import pytest
from core import factories
@pytest.mark.django_db
def test_landing(client):
factories.RastrexoFactory(name='I Rastrexo de Couso', date=dt.date.today(), status='ACCEPTED')
response = client.get('/')
assert 200 == response.status_code
assert 'I Rastrexo de Couso' ... |
SGCreations/Flask | refs/heads/master | Work/Trivia - Module 5/env/Lib/site-packages/pip/_vendor/html5lib/filters/alphabeticalattributes.py | 1731 | from __future__ import absolute_import, division, unicode_literals
from . import _base
try:
from collections import OrderedDict
except ImportError:
from ordereddict import OrderedDict
class Filter(_base.Filter):
def __iter__(self):
for token in _base.Filter.__iter__(self):
if token["... |
sih4sing5hong5/environment_education | refs/heads/master | 題庫/介面.py | 1 |
import json
from django.contrib.auth.decorators import login_required
from django.forms.models import model_to_dict
from django.http.response import JsonResponse
from django.shortcuts import render, redirect
from django.views.decorators.csrf import csrf_exempt
from 題庫.models import xls檔案表
from 題庫.models import 作答紀錄表
... |
nylas/sync-engine | refs/heads/master | migrations/versions/068_outlook.py | 9 | """outlook
Revision ID: 1ceff61ec112
Revises: 2e6120c97485
Create Date: 2014-07-22 10:17:33.115621
"""
# revision identifiers, used by Alembic.
revision = '1ceff61ec112'
down_revision = '322c2800c401'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.create_table('outlookaccount',
... |
dan-blanchard/thriftpy | refs/heads/master | thriftpy/rpc.py | 22 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import contextlib
import warnings
from thriftpy.protocol import TBinaryProtocolFactory
from thriftpy.server import TThreadedServer
from thriftpy.thrift import TProcessor, TClient
from thriftpy.transport import (
TBufferedTransportFactory,
TServer... |
scorphus/thefuck | refs/heads/master | tests/rules/test_grep_arguments_order.py | 5 | import pytest
from thefuck.rules.grep_arguments_order import get_new_command, match
from thefuck.types import Command
output = 'grep: {}: No such file or directory'.format
@pytest.fixture(autouse=True)
def os_path(monkeypatch):
monkeypatch.setattr('os.path.isfile', lambda x: not x.startswith('-'))
@pytest.mark... |
Glasgow2015/team-10 | refs/heads/master | env/lib/python2.7/site-packages/pip/commands/search.py | 344 | import sys
import textwrap
import pip.download
from pip.basecommand import Command, SUCCESS
from pip.util import get_terminal_size
from pip.log import logger
from pip.backwardcompat import xmlrpclib, reduce, cmp
from pip.exceptions import CommandError
from pip.status_codes import NO_MATCHES_FOUND
from pip._vendor imp... |
rpiotti/glances | refs/heads/master | glances/plugins/glances_docker.py | 11 | # -*- coding: utf-8 -*-
#
# This file is part of Glances.
#
# Copyright (C) 2015 Nicolargo <nicolas@nicolargo.com>
#
# Glances is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the Lic... |
facebookexperimental/eden | refs/heads/master | eden/hg-server/tests/heredoctest.py | 2 | from __future__ import absolute_import, print_function
import sys
globalvars = {}
lines = sys.stdin.readlines()
while lines:
l = lines.pop(0)
if l.startswith("SALT"):
print(l[:-1])
elif l.startswith(">>> "):
snippet = l[4:]
while lines and lines[0].startswith("... "):
... |
telminov/personnel-testing | refs/heads/master | core/views/user.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.shortcuts import redirect
from core.forms import UserCreateForm, UserSearchForm, UserUpdateForm
from core.models import User
from core.views.base import CreateOrUpdateView, ListView, DeleteView
from django.core.urlresolvers import reverse_laz... |
anthgur/servo | refs/heads/master | tests/wpt/web-platform-tests/fetch/api/resources/echo-content.py | 80 | def main(request, response):
headers = [("X-Request-Method", request.method),
("X-Request-Content-Length", request.headers.get("Content-Length", "NO")),
("X-Request-Content-Type", request.headers.get("Content-Type", "NO"))]
content = request.body
return headers, content
|
excellalabs/face-off | refs/heads/main | core/features/steps/helper.py | 4 | from selenium.webdriver.support.wait import WebDriverWait
import random
import time
from selenium.webdriver.common.action_chains import ActionChains
# Helper methods to consolidate steps.py
def login(context, username, password):
context.browser.find_element_by_name('signIn').click()
context.browser.find_elem... |
mrunge/openstack_horizon | refs/heads/master | openstack_horizon/dashboards/project/data_processing/job_binaries/panel.py | 1 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... |
ovnicraft/odoo | refs/heads/8.0 | addons/website_mail/models/mail_message.py | 264 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# 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 ... |
PythonNut/servo | refs/heads/master | python/mach/mach/commands/commandinfo.py | 96 | # 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/.
from __future__ import absolute_import, print_function, unicode_literals
from mach.decorators import (
CommandPro... |
titasakgm/brc-stock | refs/heads/master | openerp/addons/account_asset/wizard/account_asset_change_duration.py | 40 | # -*- encoding: 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 t... |
yarbelk/django-admin2 | refs/heads/develop | djadmin2/viewmixins.py | 2 | # -*- coding: utf-8 -*-
from __future__ import division, absolute_import, unicode_literals
import os
from django.contrib.auth.views import redirect_to_login
from django.core.exceptions import PermissionDenied
from django.core.urlresolvers import reverse, reverse_lazy
from django.forms.models import modelform_factory
... |
Zkin/pf-kernel-updates | refs/heads/zk-4.4 | tools/perf/scripts/python/check-perf-trace.py | 1997 | # perf script event handlers, generated by perf script -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. ... |
TheKK/Shedskin | refs/heads/master | tests/122.py | 6 |
# (c) Mark Dufour
# --- mark.dufour@gmail.com
import random
random.seed(42)
from math import sqrt, e
sigmoid = lambda x: pow((1+pow(e,-x)),-1) # [lambda0]
deriv = lambda x: pow(e,-x) * pow((1+pow(e,-x)),-2) # [lambda0]
class link: # in_node: [node], weight: [float], activation: [], out_n... |
mlperf/training_results_v0.7 | refs/heads/master | Fujitsu/benchmarks/resnet/implementations/implementation_open/mxnet/python/mxnet/gluon/model_zoo/vision/inception.py | 11 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
yinsu/grpc | refs/heads/master | src/python/grpcio/grpc/framework/crust/_control.py | 2 | # Copyright 2015, 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... |
tomshen/penn-projects | refs/heads/master | projects/views.py | 1 | from django.template import Context, loader
from projects.models import Project
from django.http import HttpResponse, Http404, HttpResponseRedirect
from django.shortcuts import render_to_response, get_object_or_404, render
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.utils import... |
PXke/invenio | refs/heads/dev-pu | invenio/legacy/websubmit/inveniounoconv.py | 1 | #!@OPENOFFICE_PYTHON@
##
## This file is part of Invenio.
## Copyright (C) 2011, 2012 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your optio... |
sameetb-cuelogic/edx-platform-test | refs/heads/master | lms/djangoapps/survey/admin.py | 92 | """
Provide accessors to these models via the Django Admin pages
"""
from django import forms
from django.contrib import admin
from survey.models import SurveyForm
class SurveyFormAdminForm(forms.ModelForm):
"""Form providing validation of SurveyForm content."""
class Meta(object): # pylint: disable=missin... |
Drooids/odoo | refs/heads/8.0 | addons/mail/tests/test_mail_features.py | 172 | # -*- 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 ... |
holtwick/pyxer | refs/heads/master | tests/runtests.py | 2 | import sys
import os
import glob
import unittest
#Allow us to import the parent module
os.chdir(os.path.split(os.path.abspath(__file__))[0])
sys.path.insert(0, os.path.abspath(os.curdir))
sys.path.insert(0, os.path.abspath(os.pardir))
# sys.path.insert(0, os.path.join(os.path.abspath(os.pardir), "src"))
de... |
vikas17a/Algorithm-Implementations | refs/heads/master | Vigenere_Cipher/Python/Valery S/VigenereCipher_test.py | 20 | #Tests for vigenere_cipher.py
from VigenereCipher import VigenereCipher
VC = VigenereCipher()
assert(VC.cipher('take', 'care') == 'VABI')
assert(VC.decipher('VABI', 'care') == 'TAKE')
assert(VC.cipher('ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ') == 'ACEGIKMOQSUWYACEGIKMOQSUWY')
assert(VC.decipher('ACEGI... |
eddiehung/python-escpos | refs/heads/master | escpos/constants.py | 1 | """ ESC/POS Commands (Constants) """
# Feed control sequences
CTL_LF = '\x0a' # Print and line feed
CTL_FF = '\x0c' # Form feed
CTL_CR = '\x0d' # Carriage return
CTL_HT = '\x09' # Horizontal tab
CTL_SET_HT = '\x1b\x44' # Set horizontal tab po... |
denisov-vlad/redash | refs/heads/master | tests/query_runner/test_databricks.py | 3 | from unittest import TestCase
from redash.query_runner.databricks import split_sql_statements
class TestSplitMultipleSQLStatements(TestCase):
def _assertSplitSql(self, sql, expected_stmt):
stmt = split_sql_statements(sql)
# ignore leading and trailing whitespaces when comparing
self.assert... |
ghdk/networkx | refs/heads/master | examples/algorithms/krackhardt_centrality.py | 44 | #!/usr/bin/env python
"""
Centrality measures of Krackhardt social network.
"""
__author__ = """Aric Hagberg (hagberg@lanl.gov)"""
__date__ = "$Date: 2005-05-12 14:33:11 -0600 (Thu, 12 May 2005) $"
__credits__ = """"""
__revision__ = "$Revision: 998 $"
# Copyright (C) 2004 by
# Aric Hagberg <hagberg@lanl.gov>
# ... |
alexnikolov/German-dictionary | refs/heads/master | german_dictionary/quiz.py | 1 | from german_dictionary.db_handler import DatabaseHandler
from german_dictionary.word import Word
from random import randint
class Quiz:
def __init__(self, database, parts_of_speech, fields_to_be_guessed):
self.database = database
self.parts_of_speech = parts_of_speech
self.fields_to_be_gue... |
mibanescu/pulp | refs/heads/master | server/pulp/server/db/fields.py | 8 | """
This defines custom fields to be stored in the database.
Each field class is inherited from one or more mongoengine fields
and it provides it's own validation code.
"""
from isodate import ISO8601Error
from mongoengine import StringField
from pulp.common import dateutils
class ISO8601StringField(StringField):
... |
RJVB/audacity | refs/heads/master | lib-src/lv2/lv2/plugins/eg03-metro.lv2/waflib/Options.py | 330 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import os,tempfile,optparse,sys,re
from waflib import Logs,Utils,Context
cmds='distclean configure build install clean uninstall check dist distcheck'.split()
options={}
comma... |
drummonds/galleria | refs/heads/master | galleria/contacts/admin.py | 1 | from django.contrib import admin
from .models import ContactType, Contact, PhoneNumber, Address, Note
class ContactTypeAdmin(admin.ModelAdmin):
list_display = ('__str__', 'name')
list_editable = ('name',)
class NoteInline(admin.TabularInline):
model = Note
def formfield_for_dbfield(self, db_field, **... |
labordoc/labordoc-next | refs/heads/labordoc-next | modules/websubmit/lib/functions/Print_Success_Approval_Request.py | 39 | ## This file is part of Invenio.
## Copyright (C) 2008, 2010, 2011 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option) any later versio... |
NewpTone/stacklab-nova | refs/heads/master | nova/network/l3.py | 7 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Nicira Networks, 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.apach... |
joram/sickbeard-orange | refs/heads/ThePirateBay | lib/unidecode/x00c.py | 252 | data = (
'[?]', # 0x00
'N', # 0x01
'N', # 0x02
'H', # 0x03
'[?]', # 0x04
'a', # 0x05
'aa', # 0x06
'i', # 0x07
'ii', # 0x08
'u', # 0x09
'uu', # 0x0a
'R', # 0x0b
'L', # 0x0c
'[?]', # 0x0d
'e', # 0x0e
'ee', # 0x0f
'ai', # 0x10
'[?]', # 0x11
'o', # 0x12
'oo', # 0x... |
Toshakins/wagtail | refs/heads/master | wagtail/contrib/settings/views.py | 5 | from __future__ import absolute_import, unicode_literals
from django.core.exceptions import PermissionDenied
from django.http import Http404
from django.shortcuts import get_object_or_404, redirect, render
from django.utils.lru_cache import lru_cache
from django.utils.text import capfirst
from django.utils.translation... |
zlfben/gem5 | refs/heads/develop | src/arch/x86/isa/insts/simd64/integer/compare/compare_and_write_minimum_or_maximum.py | 91 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implemen... |
aleGpereira/libcloud | refs/heads/trunk | libcloud/test/dns/test_pointdns.py | 17 | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... |
krintoxi/NoobSec-Toolkit | refs/heads/master | NoobSecToolkit - MAC OSX/tools/inject/tamper/randomcase.py | 10 | #!/usr/bin/env python
"""
Copyright (c) 2006-2015 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
import re
from lib.core.common import randomRange
from lib.core.data import kb
from lib.core.enums import PRIORITY
__priority__ = PRIORITY.NORMAL
def dependencies():
pa... |
Gadal/sympy | refs/heads/master | sympy/polys/tests/test_polyutils.py | 46 | """Tests for useful utilities for higher level polynomial classes. """
from sympy import S, Integer, sin, cos, sqrt, symbols, pi, Eq, Integral, exp
from sympy.utilities.pytest import raises
from sympy.polys.polyutils import (
_nsort,
_sort_gens,
_unify_gens,
_analyze_gens,
_sort_factors,
paral... |
Peddle/hue | refs/heads/master | desktop/core/ext-py/boto-2.38.0/boto/ec2/cloudwatch/listelement.py | 152 | # Copyright (c) 2006-2009 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, modi... |
KaranToor/MA450 | refs/heads/master | google-cloud-sdk/platform/gsutil/third_party/rsa/rsa/pem.py | 216 | # -*- coding: utf-8 -*-
#
# Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu>
#
# 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
#
# Unl... |
fengmk2/node-gyp | refs/heads/master | gyp/tools/graphviz.py | 2679 | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""Using the JSON dumped by the dump-dependency-json generator,
generate input suitable for graphviz to render a dependency graph of
targets... |
fyfcauc/android_external_chromium-org | refs/heads/du44 | tools/json_schema_compiler/memoize.py | 128 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
def memoize(fn):
'''Decorates |fn| to memoize.
'''
memory = {}
def impl(*args, **optargs):
full_args = args + tuple(optargs.iteritems())
if f... |
cryptoproofinfo/webapp | refs/heads/master | popsite/tests.py | 24123 | from django.test import TestCase
# Create your tests here.
|
taige/PyTools | refs/heads/master | tsproxy/httphelper2.py | 1 | import asyncio
import collections
import logging
import time
from http.client import responses
from urllib.parse import urlparse
from urllib.parse import urlunparse
import aiohttp
from aiohttp import hdrs
from aiohttp import http_exceptions as errors
from aiohttp import http_parser
from tsproxy import common
NO_CONT... |
felipebetancur/numpy | refs/heads/master | numpy/core/tests/test_print.py | 63 | from __future__ import division, absolute_import, print_function
import sys
import locale
import nose
import numpy as np
from numpy.testing import (
run_module_suite, assert_, assert_equal
)
if sys.version_info[0] >= 3:
from io import StringIO
else:
from StringIO import StringIO
_REF = {np.inf: 'inf', ... |
FeiZhan/Algo-Collection | refs/heads/master | answers/leetcode/Intersection of Two Linked Lists/Intersection of Two Linked Lists.py | 1 | # Definition for singly-linked list.
# class ListNode(object):
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution(object):
def getIntersectionNode(self, headA, headB):
"""
:type head1, head1: ListNode
:rtype: ListNode
"""
lena = 0
... |
agrista/odoo-saas | refs/heads/master | addons/l10n_fr_hr_payroll/report/__init__.py | 424 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# d$
#
# This program is free software: you can redistribute it and/or modify
# it... |
pasv/Empire | refs/heads/master | lib/modules/situational_awareness/network/mapdomaintrusts.py | 10 | from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'Invoke-MapDomainTrusts',
'Author': ['@harmj0y'],
'Description': ('Maps all reachable domain trusts with .CSV output. Part of PowerView.'),
'Backg... |
1tush/sentry | refs/heads/master | src/sentry/api/endpoints/organization_projects.py | 5 | from __future__ import absolute_import
from rest_framework.response import Response
from sentry.api.base import DocSection
from sentry.api.bases.organization import OrganizationEndpoint
from sentry.api.serializers import serialize
from sentry.models import Project
class OrganizationProjectsEndpoint(OrganizationEndp... |
CLOUGH/info3180-project-3 | refs/heads/master | lib/werkzeug/_compat.py | 448 | import sys
import operator
import functools
try:
import builtins
except ImportError:
import __builtin__ as builtins
PY2 = sys.version_info[0] == 2
_identity = lambda x: x
if PY2:
unichr = unichr
text_type = unicode
string_types = (str, unicode)
integer_types = (int, long)
int_to_byte = c... |
bionikspoon/ebay | refs/heads/develop | docs/source/conf.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from os.path import abspath, relpath
import sphinx.environment
def _warn_node(func):
def wrapper(self, msg, node):
if not msg.startswith('nonlocal image URI found:'):
return func(self, msg, node)
return wrapper
sphinx.environmen... |
leereilly/django-1 | refs/heads/master | django/contrib/gis/gdal/prototypes/__init__.py | 12133432 | |
spacy-io/spaCy | refs/heads/master | spacy/tests/lang/de/__init__.py | 12133432 | |
nikhilsaraf/Twitter-Analytics | refs/heads/master | venv/lib/python2.7/site-packages/requests/packages/urllib3/poolmanager.py | 359 | from __future__ import absolute_import
import collections
import functools
import logging
try: # Python 3
from urllib.parse import urljoin
except ImportError:
from urlparse import urljoin
from ._collections import RecentlyUsedContainer
from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool
from ... |
rutgers-apl/Atomicity-Violation-Detector | refs/heads/master | tdebug-llvm/llvm/utils/lit/lit/formats/googletest.py | 6 | from __future__ import absolute_import
import os
import sys
import lit.Test
import lit.TestRunner
import lit.util
from .base import TestFormat
kIsWindows = sys.platform in ['win32', 'cygwin']
class GoogleTest(TestFormat):
def __init__(self, test_sub_dir, test_suffix):
self.test_sub_dir = os.path.normcase... |
debugger06/MiroX | refs/heads/master | tv/lib/frontends/cli/util.py | 3 | # Miro - an RSS based video player application
# Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011
# Participatory Culture Foundation
#
# 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... |
otadmor/Open-Knesset | refs/heads/master | persons/migrations/0001_initial.py | 15 | # 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 'Title'
db.create_table('persons_title', (
('id', self.gf('django.db.models.fie... |
gusyussh/learntosolveit | refs/heads/version1 | languages/python/design_caseinsensitivedict.py | 7 | #!/usr/bin/python
# $Id$
"""
Case Insenstive Dictionary Lookup. Dictionary keys are case sensitive. However
you might want some facilities to do a case-insenstive dictiionary lookup at
times. This provides the facility for the same.
"""
class CaseInsensitiveDict(dict):
def __init__(self, *args, **kwargs):
... |
MrLoick/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/tkinter/test/test_ttk/__init__.py | 12133432 | |
arhik/nupic | refs/heads/master | tests/integration/nupic/algorithms/tp_likelihood_test.py | 5 | # ----------------------------------------------------------------------
# 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... |
w4n9H/PythonSkillTree | refs/heads/master | Distributed/ProcessThread/LocalThread-2.py | 1 | # !/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@author: mango
@contact: w4n9@sina.com
@create: 16/7/4
hail hydra!
"""
__author__ = "mango"
__version__ = "0.1"
import threading, time
from time import sleep, ctime
def now():
return str(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime()))
class myThread (... |
Red680812/X920D | refs/heads/master | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py | 12980 | # SchedGui.py - Python extension for perf script, basic GUI code for
# traces drawing and overview.
#
# Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com>
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
... |
lcnature/brainiak | refs/heads/master | tests/factoranalysis/test_htfa.py | 7 | # Copyright 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 required by applicable law or agreed to... |
masters3d/coursebuilder-masters3d | refs/heads/master | common/tags.py | 4 | # Copyright 2013 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 ... |
luckylavish/zamboni | refs/heads/master | mkt/commonplace/tests/test_views.py | 4 | from gzip import GzipFile
import json
from StringIO import StringIO
from django.core.urlresolvers import reverse
from django.test.utils import override_settings
import mock
from nose.tools import eq_, ok_
from pyquery import PyQuery as pq
import mkt.site.tests
from mkt.commonplace.models import DeployBuildId
class... |
kdwink/intellij-community | refs/heads/master | python/testData/stubs/MetaClass.py | 80 | class M(type):
pass
__metaclass__ = M
class C(object):
__metaclass__ = type
class D(object):
pass
|
freenas/samba | refs/heads/freenas/master | source4/torture/drs/python/cracknames.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) Catalyst .Net Ltd 2017
#
# 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) an... |
jossef/vmwc | refs/heads/master | examples/virtual-switches-create-new.py | 1 | #!/usr/bin/env python
from vmwc import VMWareClient
def main():
host = '192.168.1.1'
username = '<username>'
password = '<password>'
virtual_switch_name = 'Custom Network 1'
with VMWareClient(host, username, password) as client:
# Good configuration for traffic recording
client.... |
underbluewaters/marinemap | refs/heads/master | lingcod/raster_stats/tests.py | 3 | from lingcod.common.test_settings_manager import SettingsTestCase as TestCase
from lingcod.raster_stats.models import ZonalStatsCache, RasterDataset, zonal_stats, clear_cache
from django.contrib.gis.gdal.datasource import DataSource
from django.core import serializers
import os
import sys
def test_data():
rastpath... |
tuxinhang1989/mezzanine | refs/heads/master | mezzanine/blog/management/__init__.py | 12133432 | |
jeremy-bernon/Lilith | refs/heads/master | lilith/internal/__init__.py | 12133432 | |
GhostThrone/django | refs/heads/master | django/utils/termcolors.py | 46 | """
termcolors.py
"""
from django.utils import six
color_names = ('black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white')
foreground = {color_names[x]: '3%s' % x for x in range(8)}
background = {color_names[x]: '4%s' % x for x in range(8)}
RESET = '0'
opt_dict = {'bold': '1', 'underscore': '4', 'blink... |
xiaoxq/apollo | refs/heads/master | modules/tools/dump_gpsbin/dump_gpsbin.py | 3 | #!/usr/bin/env python3
###############################################################################
# Copyright 2018 The Apollo 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... |
antoinecarme/pyaf | refs/heads/master | tests/model_control/detailed/transf_None/model_control_one_enabled_None_MovingAverage_Seasonal_MonthOfYear_NoAR.py | 1 | import tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['None'] , ['MovingAverage'] , ['Seasonal_MonthOfYear'] , ['NoAR'] ); |
rismalrv/edx-platform | refs/heads/master | common/test/acceptance/tests/lms/test_library.py | 92 | # -*- coding: utf-8 -*-
"""
End-to-end tests for LibraryContent block in LMS
"""
import ddt
import textwrap
from nose.plugins.attrib import attr
from ..helpers import UniqueCourseTest, TestWithSearchIndexMixin
from ...pages.studio.auto_auth import AutoAuthPage
from ...pages.studio.overview import CourseOutlinePage
fro... |
allenp/odoo | refs/heads/9.0 | addons/hw_posbox_homepage/__init__.py | 502 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import controllers
|
aodarc/tennis_club | refs/heads/master | members/migrations/0001_initial.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-11-20 19:42
from __future__ import unicode_literals
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateM... |
erudit/django-plupload | refs/heads/master | plupload/__init__.py | 12133432 | |
CollabQ/CollabQ | refs/heads/master | .google_appengine/lib/django/tests/regressiontests/httpwrappers/__init__.py | 12133432 | |
sullo/webbies | refs/heads/master | lib/__init__.py | 12133432 | |
dnlcrl/TensorFlow-Playground | refs/heads/master | 2.example-apps/android/__init__.py | 12133432 | |
jagguli/intellij-community | refs/heads/master | python/testData/resolve/multiFile/stackOverflowOnEmptyFile/tornado/options.py | 12133432 | |
KarlTDebiec/md_format_converter | refs/heads/master | Mol2TrajOutput.py | 2 | # -*- coding: utf-8 -*-
# md_format_converter.Mol2TrajOutput.py
#
# Copyright (C) 2012-2016 Karl T Debiec
# All rights reserved.
#
# This software may be modified and distributed under the terms of the
# BSD license. See the LICENSE file for details.
"""
Manages addition of mol2 output information to segments... |
anant-dev/django | refs/heads/master | tests/syndication_tests/tests.py | 90 | from __future__ import unicode_literals
import datetime
from xml.dom import minidom
from django.contrib.sites.models import Site
from django.contrib.syndication import views
from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase, override_settings
from django.test.utils import requir... |
asimonia/pricing-alerts | refs/heads/master | src/common/__init__.py | 12133432 | |
UQ-UQx/edx-platform_lti | refs/heads/master | cms/djangoapps/contentstore/__init__.py | 12133432 | |
kawasaki2013/python-for-android-x86 | refs/heads/master | python3-alpha/extra_modules/gdata/apps/organization/__init__.py | 12133432 | |
andreaso/ansible | refs/heads/devel | lib/ansible/modules/network/iosxr/__init__.py | 12133432 | |
zhoulingjun/django | refs/heads/master | django/core/__init__.py | 12133432 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.