repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
timoschwarzer/blendworks | refs/heads/master | BlendWorks Server/python/Lib/idlelib/ObjectBrowser.py | 67 | # XXX TO DO:
# - popup menu
# - support partial or total redisplay
# - more doc strings
# - tooltips
# object browser
# XXX TO DO:
# - for classes/modules, add "open source" to object browser
from idlelib.TreeWidget import TreeItem, TreeNode, ScrolledCanvas
from reprlib import Repr
myrepr = Repr()
myrepr.maxstring... |
Cisco-Talos/pyrebox | refs/heads/master | scripts/getset_var_example.py | 1 | # -------------------------------------------------------------------------------
#
# Copyright (C) 2017 Cisco Talos Security Intelligence and Research Group
#
# PyREBox: Python scriptable Reverse Engineering Sandbox
# Author: Xabier Ugarte-Pedrero
#
# This program is free software; you can redistribute it and/... |
CUCWD/edx-platform | refs/heads/master | common/djangoapps/third_party_auth/settings.py | 9 | """Settings for the third-party auth module.
The flow for settings registration is:
The base settings file contains a boolean, ENABLE_THIRD_PARTY_AUTH, indicating
whether this module is enabled. startup.py probes the ENABLE_THIRD_PARTY_AUTH.
If true, it:
a) loads this module.
b) calls apply_settings(), passi... |
msullivan/advent-of-code | refs/heads/master | 2017/12.py | 1 | #!/usr/bin/env python3
import sys
def dfs(graph, seen, nobe):
if nobe in seen: return
seen.add(nobe)
for child in graph[nobe]:
dfs(graph, seen, child)
def main(args):
data = [s.strip() for s in sys.stdin]
graph = {}
for line in data:
k, vs = line.split(" <-> ")
vs = vs... |
trevor/calendarserver | refs/heads/master | twistedcaldav/simpleresource.py | 1 | ##
# Copyright (c) 2009-2014 Apple 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 l... |
mercycorps/tola-activity | refs/heads/master | htdocs/customdashboard/admin.py | 2 | from django.contrib import admin
from .models import ProjectStatus, ProjectStatusAdmin, Gallery, GalleryAdmin, ProgramLinks,ProgramLinksAdmin, Link, LinkAdmin
class GalleryAdmin(admin.ModelAdmin):
change_form_template = 'customdashboard/admin/change_form.html'
admin.site.register(ProjectStatus, ProjectStatusAdm... |
jorsea/odoo-saas-tools | refs/heads/master | saas_utils/connector.py | 13 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010, 2014 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... |
martonw/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/QueueStatusServer/model/queuelog.py | 122 | # 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 ... |
Poles/Poles | refs/heads/master | platforms/linux/SDL2_ttf-2.0.12/external/freetype-2.4.12/src/tools/chktrcmp.py | 381 | #!/usr/bin/env python
#
# Check trace components in FreeType 2 source.
# Author: suzuki toshiya, 2009
#
# This code is explicitly into the public domain.
import sys
import os
import re
SRC_FILE_LIST = []
USED_COMPONENT = {}
KNOWN_COMPONENT = {}
SRC_FILE_DIRS = [ "src" ]
TRACE_DEF_FILES = [ "include/freetype/in... |
trevor/calendarserver | refs/heads/master | txdav/who/xml.py | 1 | # -*- test-case-name: txdav.who.test.test_xml -*-
##
# Copyright (c) 2014 Apple 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/LI... |
C-Aniruddh/ace-kernel_lettuce | refs/heads/cm-12.1 | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
import errno, os
FUTEX_WAIT = 0... |
icodedev7/customap | refs/heads/master | devkit/mingw/bin/lib/lib2to3/fixer_base.py | 305 | # Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Base class for fixers (optional, but recommended)."""
# Python imports
import logging
import itertools
# Local imports
from .patcomp import PatternCompiler
from . import pygram
from .fixer_util import does_tree_imp... |
Xaltotun/conan | refs/heads/develop | conans/test/command/help_test.py | 3 | import unittest
from conans.test.tools import TestClient
class BasicTest(unittest.TestCase):
def help_test(self):
conan = TestClient()
conan.run("")
self.assertIn('Conan commands. Type $conan "command" -h', conan.user_io.out)
|
snahelou/awx | refs/heads/devel | awx/main/tests/functional/api/test_job_runtime_params.py | 1 | import mock
import pytest
import yaml
from awx.api.serializers import JobLaunchSerializer
from awx.main.models.credential import Credential
from awx.main.models.inventory import Inventory, Host
from awx.main.models.jobs import Job, JobTemplate
from awx.api.versioning import reverse
@pytest.fixture
def runtime_data(... |
danny200309/anaconda | refs/heads/master | commands/doc.py | 5 |
# Copyright (C) 2013 - Oscar Campos <oscar.campos@member.fsf.org>
# This program is Free Software see LICENSE file for details
from functools import partial
import sublime
import sublime_plugin
from ..anaconda_lib.worker import Worker
from ..anaconda_lib.tooltips import Tooltip
from ..anaconda_lib.callback import C... |
marcoantoniooliveira/labweb | refs/heads/master | oscar/apps/offer/south_migrations/0023_slugify_range_names.py | 16 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
from oscar.core.utils import slugify
class Migration(DataMigration):
def forwards(self, orm):
"Write your forwards methods here."
# Note: Remember to use orm['appname.Mo... |
minlexx/xnovacmd | refs/heads/master | ui/xnova/xn_world.py | 1 | # -*- coding: utf-8 -*-
import datetime
import re
from PyQt5.QtCore import pyqtSignal, QThread, QMutex
from .xn_page_cache import XNovaPageCache
from .xn_page_dnl import XNovaPageDownload
from .xn_data import XNAccountInfo, XNCoords, XNFlight, XNPlanet, XNPlanetBuildingItem
from .xn_techtree import XNTechTree_instanc... |
k11a/snmpconverter | refs/heads/master | pyasn1/type/useful.py | 8 | #
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2017, Ilya Etingof <etingof@gmail.com>
# License: http://pyasn1.sf.net/license.html
#
import datetime
from pyasn1.type import univ, char, tag
from pyasn1.compat import string, dateandtime
from pyasn1 import error
__all__ = ['ObjectDescriptor', 'Generaliz... |
gspilio/nova | refs/heads/master | nova/tests/api/openstack/__init__.py | 143 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 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.apach... |
SurpriseTRex/nuke-quick-import | refs/heads/master | projectbin.py | 1 | import nuke
import os
import re
from PySide import QtGui
from PySide import QtCore
from nukescripts import panels
class QuickReadBrowser(QtGui.QMainWindow):
def __init__(self):
QtGui.QMainWindow.__init__(self)
self.sequence_list = []
self.nuke_file_path = "/".join(nuke.ro... |
txm/potato | refs/heads/master | django/http/utils.py | 200 | """
Functions that modify an HTTP request or response in some way.
"""
# This group of functions are run as part of the response handling, after
# everything else, including all response middleware. Think of them as
# "compulsory response middleware". Be careful about what goes here, because
# it's a little fiddly to ... |
georgemarshall/django | refs/heads/master | tests/template_tests/syntax_tests/i18n/test_filters.py | 133 | from django.test import SimpleTestCase
from django.utils import translation
from ...utils import setup
class I18nFiltersTests(SimpleTestCase):
libraries = {
'custom': 'template_tests.templatetags.custom',
'i18n': 'django.templatetags.i18n',
}
@setup({'i18n32': '{% load i18n %}{{ "hu"|lan... |
dantebarba/docker-media-server | refs/heads/master | plex/Sub-Zero.bundle/Contents/Libraries/Shared/requests_toolbelt/auth/http_proxy_digest.py | 3 | # -*- coding: utf-8 -*-
"""The module containing HTTPProxyDigestAuth."""
import re
from requests import cookies, utils
from . import _digest_auth_compat as auth
class HTTPProxyDigestAuth(auth.HTTPDigestAuth):
"""HTTP digest authentication between proxy
:param stale_rejects: The number of rejects indicate t... |
aronsky/home-assistant | refs/heads/dev | tests/components/sensor/test_rmvtransport.py | 14 | """The tests for the rmvtransport platform."""
import datetime
from unittest.mock import patch
from homeassistant.setup import async_setup_component
from tests.common import mock_coro
VALID_CONFIG_MINIMAL = {'sensor': {
'platform': 'rmvtransport',
'next_departure': [
{'station': '3000010'}
]... |
indashnet/InDashNet.Open.UN2000 | refs/heads/master | android/external/mesa3d/src/gallium/drivers/llvmpipe/lp_tile_soa.py | 13 | #!/usr/bin/env python
CopyRight = '''
/**************************************************************************
*
* Copyright 2009 VMware, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "... |
jasonabele/gnuradio | refs/heads/rfx2200 | gnuradio-core/src/python/gnuradio/blks2impl/dqpsk2.py | 9 | #
# Copyright 2009,2010 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 option)
# any later versi... |
mlskit/astromlskit | refs/heads/master | DOE/doefront1.py | 3 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'fullfactorial.ui'
#
# Created: Wed Apr 08 07:09:29 2015
# by: PyQt4 UI code generator 4.10.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except ... |
sirpercival/kivy | refs/heads/master | kivy/input/postproc/retaintouch.py | 80 | '''
Retain Touch
============
Reuse touch to counter lost finger behavior
'''
__all__ = ('InputPostprocRetainTouch', )
from kivy.config import Config
from kivy.vector import Vector
import time
class InputPostprocRetainTouch(object):
'''
InputPostprocRetainTouch is a post-processor to delay the 'up' event o... |
veatch/elasticsearch-py | refs/heads/master | elasticsearch/client/cat.py | 4 | from .utils import NamespacedClient, query_params, _make_path
class CatClient(NamespacedClient):
@query_params('h', 'help', 'local', 'master_timeout', 'v')
def aliases(self, name=None, params=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-alias.html>`_
... |
hammerlab/varlens | refs/heads/master | varlens/reads_util.py | 2 | # Copyright (c) 2015. Mount Sinai School of Medicine
#
# 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... |
javierhuerta/unach-photo-server | refs/heads/master | unach_photo_server/apps.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.apps import AppConfig
class UnachPhotoServerConfig(AppConfig):
name = 'unach_photo_server'
|
jwinzer/OpenSlides | refs/heads/master | server/openslides/assignments/migrations/0001_initial.py | 9 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-03-02 01:22
from __future__ import unicode_literals
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
import openslides.utils.models
class Migration(migrations.Migration):
initial = True
de... |
gfreed/android_external_chromium-org | refs/heads/android-4.4 | net/tools/quic/benchmark/run_client.py | 165 | #!/usr/bin/env python
# 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.
import csv
import datetime
import json
import os
import shlex
import subprocess
import sys
from optparse import OptionParser
"""Start... |
tlakshman26/cinder-new-branch | refs/heads/master | cinder/tests/unit/api/contrib/test_volume_encryption_metadata.py | 23 | # 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/... |
fmyzjs/horizon-hacker | refs/heads/master | horizon/test/test_dashboards/dogs/puppies/urls.py | 46 | from django.conf.urls.defaults import patterns, url
from .views import IndexView
urlpatterns = patterns('',
url(r'^$', IndexView.as_view(), name='index'),
)
|
choonho/qemu-beagle | refs/heads/master | scripts/qemu-gdb.py | 12 | #!/usr/bin/python
# GDB debugging support
#
# Copyright 2012 Red Hat, Inc. and/or its affiliates
#
# Authors:
# Avi Kivity <avi@redhat.com>
#
# This work is licensed under the terms of the GNU GPL, version 2. See
# the COPYING file in the top-level directory.
#
# Contributions after 2012-01-13 are licensed under the... |
jbedorf/tensorflow | refs/heads/master | tensorflow/python/data/experimental/kernel_tests/optimization/shuffle_and_repeat_fusion_test.py | 10 | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
rew4332/tensorflow | refs/heads/rew4332-patch-1 | tensorflow/contrib/learn/python/learn/dataframe/transforms/difference.py | 4 | # 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... |
LaurentClaessens/phystricks | refs/heads/master | testing/demonstration/phystricksVNJWooDeKdcy.py | 1 | # -*- coding: utf8 -*-
from __future__ import division
from phystricks import *
def VNJWooDeKdcy():
pspict,fig = SinglePicture("VNJWooDeKdcy")
pspict.dilatation(0.8)
A=Point(0,0)
O=Point(3,2)
B=Point(1.9266624057974,-0.751559074504527)
s1=Segment(A,O)
s2=Segment(B,O)
angle=AngleAOB(A... |
biomodels/BIOMD0000000017 | refs/heads/master | BIOMD0000000017/model.py | 1 | import os
path = os.path.dirname(os.path.realpath(__file__))
sbmlFilePath = os.path.join(path, 'BIOMD0000000017.xml')
with open(sbmlFilePath,'r') as f:
sbmlString = f.read()
def module_exists(module_name):
try:
__import__(module_name)
except ImportError:
return False
else:
ret... |
roca-nation/microblog | refs/heads/master | profile.py | 28 | #!flask/bin/python
from werkzeug.contrib.profiler import ProfilerMiddleware
from app import app
app.config['PROFILE'] = True
app.wsgi_app = ProfilerMiddleware(app.wsgi_app, restrictions=[30])
app.run(debug=True)
|
google-research/google-research | refs/heads/master | aloe/aloe/common/plot_2d.py | 1 | # coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
cloudbase/nova-virtualbox | refs/heads/virtualbox_driver | nova/api/openstack/compute/plugins/v3/quota_sets.py | 1 | # Copyright 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 requ... |
sgelb/impositioner | refs/heads/master | impositioner/cli.py | 1 | #!/usr/bin/env python
"""
Main entry point for command-line program, invoke as `impositioner'
"""
from sys import exit
from argparse import ArgumentParser, Namespace, RawDescriptionHelpFormatter
import textwrap
from pdfrw import PdfReader
import math
from . import core
from . import __version__
from typing import Di... |
kubov/rp | refs/heads/master | scripts/extract_archive_from_universal_bin.py | 46 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# extract_archives_from_universal_bin.py - It extracts the binaries embeded into a Universal Binary Mach-o
# Copyright (C) 2012 Axel "0vercl0k" Souchet - http://www.twitter.com/0vercl0k
#
# This program is free software: you can redistribute it and/or modify
# ... |
frouty/odoogoeen | refs/heads/prod | addons/point_of_sale/wizard/pos_sales_user.py | 55 | # -*- 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... |
Eric-Gaudiello/tensorflow_dev | refs/heads/master | tensorflow_home/tensorflow_venv/lib/python3.4/site-packages/numpy/core/tests/test_indexing.py | 33 | from __future__ import division, absolute_import, print_function
import sys
import warnings
import functools
import numpy as np
from numpy.core.multiarray_tests import array_indexing
from itertools import product
from numpy.testing import (
TestCase, run_module_suite, assert_, assert_equal, assert_raises,
ass... |
jalexvig/tensorflow | refs/heads/master | tensorflow/contrib/data/python/kernel_tests/interleave_dataset_op_test.py | 11 | # Copyright 2017 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... |
richardcs/ansible | refs/heads/devel | lib/ansible/modules/clustering/consul_kv.py | 35 | #!/usr/bin/python
#
# (c) 2015, Steve Gargan <steve.gargan@gmail.com>
# (c) 2018 Genome Research Ltd.
# 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_versio... |
albertomurillo/ansible | refs/heads/devel | test/units/modules/network/f5/test_bigip_file_copy.py | 16 | # -*- 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
import os
import json
import pytest
import sys
if sys.version_info < (2... |
EVEprosper/ProsperTradier | refs/heads/master | tests/utilities.py | 1 | """utilities.py: helper functions for testing"""
from os import path, getenv
import configparser
import logging
HERE = path.abspath(path.dirname(__file__))
ROOT = path.abspath(path.dirname(HERE))
TEST_CONFIG_FILE = path.join(HERE, 'test.cfg')
def parse_test_config(config_filepath=TEST_CONFIG_FILE):
"""loads test.... |
YelaSeamless/mysql-connector-python | refs/heads/master | lib/mysql/connector/dbapi.py | 35 | # MySQL Connector/Python - MySQL driver written in Python.
# Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
# MySQL Connector/Python is licensed under the terms of the GPLv2
# <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
# MySQL Connectors. There are special exceptio... |
hkchenhongyi/django | refs/heads/master | tests/m2m_multiple/tests.py | 227 | from __future__ import unicode_literals
from datetime import datetime
from django.test import TestCase
from .models import Article, Category
class M2MMultipleTests(TestCase):
def test_multiple(self):
c1, c2, c3, c4 = [
Category.objects.create(name=name)
for name in ["Sports", "N... |
X-DataInitiative/tick | refs/heads/master | tick/robust/tests/model_epsilon_insensitive_test.py | 2 | # License: BSD 3 clause
import unittest
import numpy as np
from scipy.sparse import csr_matrix
from tick.robust import ModelEpsilonInsensitive
from tick.base_model.tests.generalized_linear_model import TestGLM
from tick.linear_model import SimuLinReg
class Test(TestGLM):
def test_ModelEpsilonInsensitive(self):... |
nickanderson/ansible | refs/heads/devel | v2/ansible/compat/__init__.py | 332 | # (c) 2014, Toshio Kuratomi <tkuratomi@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 later... |
sinistance/PokemonGo-Bot | refs/heads/dev | pokemongo_bot/walkers/polyline_generator.py | 23 | import time
from itertools import chain
from math import ceil
import haversine
import polyline
import requests
class Polyline(object):
def __init__(self, origin, destination, speed):
self.DISTANCE_API_URL='https://maps.googleapis.com/maps/api/directions/json?mode=walking'
self.origin = origin
... |
plumgrid/plumgrid-nova | refs/heads/master | nova/scheduler/utils.py | 1 | # 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 agreed to in... |
ctrlaltdylan/CouchPotato | refs/heads/master | library/minify/js.py | 10 | #!/usr/bin/python
# This code is original from jsmin by Douglas Crockford, it was translated to
# Python by Baruch Even. The original code had the following copyright and
# license.
#
# /* jsmin.c
# 2007-05-22
#
# Copyright (c) 2002 Douglas Crockford (www.crockford.com)
#
# Permission is hereby granted, free of ch... |
ecatkins/instabilly | refs/heads/master | project/manage.py | 404 | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
|
g-wydrzynski/YASim | refs/heads/master | thirdparty/gtest-1.7.0/test/gtest_env_var_test.py | 2408 | #!/usr/bin/env python
#
# Copyright 2008, 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... |
vlachoudis/sl4a | refs/heads/master | python/src/Demo/tkinter/matt/canvas-reading-tag-info.py | 47 | from Tkinter import *
class Test(Frame):
def printit(self):
print "hi"
def createWidgets(self):
self.QUIT = Button(self, text='QUIT', foreground='red',
command=self.quit)
self.QUIT.pack(side=BOTTOM, fill=BOTH)
self.drawing = Canvas(self, width="5i",... |
was4444/chromium.src | refs/heads/nw15 | tools/perf/page_sets/top_desktop_sites_2012Q3.py | 21 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.page import page
from telemetry import story
TOP_2013_URLS = [
'http://www.facebook.com/barackobama',
'https://www.google.com/search?q=b... |
kenshay/ImageScripter | refs/heads/master | ProgramData/SystemFiles/Python/Lib/site-packages/elan/Video_Camera.py | 2 | import sys
import os
import sys
import os
import hashlib
import time
from threading import Thread
import sys
from PyQt4 import QtGui,uic
from threading import Thread
from time import sleep
import os
import os
import datetime
import win32security
import win32api
import sys
import os, shutil
import shutil
import time
fr... |
Arafatk/sympy | refs/heads/master | sympy/polys/domains/pythonrational.py | 70 | """Rational number type based on Python integers. """
from __future__ import print_function, division
import operator
from sympy.polys.polyutils import PicklableWithSlots
from sympy.polys.domains.domainelement import DomainElement
from sympy.core.compatibility import integer_types
from sympy.core.sympify import con... |
xkcd1253/SocialNetworkforTwo | refs/heads/master | flask/lib/python2.7/site-packages/migrate/versioning/schemadiff.py | 52 | """
Schema differencing support.
"""
import logging
import sqlalchemy
from sqlalchemy.types import Float
log = logging.getLogger(__name__)
def getDiffOfModelAgainstDatabase(metadata, engine, excludeTables=None):
"""
Return differences of model against database.
:return: object which will evaluate to... |
gkc1000/pyscf | refs/heads/master | examples/mcscf/03-natural_orbital.py | 2 | #!/usr/bin/env python
#
# Author: Qiming Sun <osirpt.sun@gmail.com>
#
'''
Generally, the CASSCF solver does NOT return the natural orbitals.
1. Attribute .natorb controls whether the active space orbitals are transformed
to natural orbitals in the results.
2. When .natorb is set, the natural orbitals may NOT be sort... |
mwx1993/TACTIC | refs/heads/master | src/tactic/active_directory/ad_connect.py | 6 | ###########################################################
#
# Copyright (c) 2005-2009, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without w... |
jaraco/pytest | refs/heads/master | doc/en/example/assertion/test_setup_flow_example.py | 217 | def setup_module(module):
module.TestStateFullThing.classcount = 0
class TestStateFullThing:
def setup_class(cls):
cls.classcount += 1
def teardown_class(cls):
cls.classcount -= 1
def setup_method(self, method):
self.id = eval(method.__name__[5:])
def test_42(self):
... |
javierwilson/forocacao | refs/heads/master | docs/__init__.py | 887 | # Included so that Django's startproject comment runs against the docs directory
|
manaschaturvedi/oscarbuddy | refs/heads/master | requests-master/requests/packages/chardet/mbcharsetprober.py | 2923 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... |
mdanielwork/intellij-community | refs/heads/master | python/testData/completion/heavyStarPropagation/lib/_pkg1/_pkg1_0/_pkg1_0_1/_pkg1_0_1_1/_pkg1_0_1_1_0/_mod1_0_1_1_0_2.py | 30 | name1_0_1_1_0_2_0 = None
name1_0_1_1_0_2_1 = None
name1_0_1_1_0_2_2 = None
name1_0_1_1_0_2_3 = None
name1_0_1_1_0_2_4 = None |
atodorov/pykickstart | refs/heads/master | tests/commands/upgrade.py | 3 | #
# Martin Gracik <mgracik@redhat.com>
#
# Copyright 2009 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use, modify,
# copy, or redistribute it subject to the terms and conditions of the GNU
# General Public License v.2. This program is distributed in the hope that it
# will be use... |
2015fallproject/2015fallcase2 | refs/heads/master | static/Brython3.2.0-20150701-214155/Lib/test/unittests/test_runpy.py | 29 | # Test the runpy module
import unittest
import os
import os.path
import sys
import re
import tempfile
import importlib
import py_compile
from test.support import (
forget, make_legacy_pyc, run_unittest, unload, verbose, no_tracing,
create_empty_file)
from test.script_helper import (
make_pkg, make_script, m... |
farr/plotutils | refs/heads/master | plotutils/parameterizations.py | 1 | """Useful parameterizations for various commonly-found elements of
models.
"""
import numpy as np
def _cov_matrix_dim(x):
x = np.atleast_1d(x)
M = x.shape[0]
N = int(round(0.5*(np.sqrt(1.0 + 8.0*M) - 1)))
if not ((N+1)*N/2 == M):
raise ValueError('input must have shape (N+1)*N/2 for some N')... |
SUSE-Cloud/nova | refs/heads/stable/havana | nova/tests/api/openstack/compute/contrib/test_networks.py | 7 | # Copyright 2011 Grid Dynamics
# Copyright 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... |
YYWen0o0/python-frame-django | refs/heads/master | django/contrib/messages/storage/session.py | 288 | import json
from django.contrib.messages.storage.base import BaseStorage
from django.contrib.messages.storage.cookie import MessageEncoder, MessageDecoder
from django.utils import six
class SessionStorage(BaseStorage):
"""
Stores messages in the session (that is, django.contrib.sessions).
"""
session... |
igor-toga/local-snat | refs/heads/master | neutron/tests/unit/notifiers/test_batch_notifier.py | 56 | # Copyright (c) 2014 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... |
vedujoshi/tempest | refs/heads/master | tempest/api/compute/servers/test_attach_interfaces.py | 1 | # Copyright 2013 IBM Corp.
# 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 app... |
darac/powerline | refs/heads/develop | tests/lib/fsconfig.py | 24 | # vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, division, absolute_import, print_function)
import os
import json
from subprocess import check_call
from shutil import rmtree
from itertools import chain
from powerline import Powerline
CONFIG_DIR = os.path.join(os.path.dirname(os.path.dirname(... |
psawaya/Mental-Ginger | refs/heads/master | django/contrib/admindocs/utils.py | 314 | "Misc. utility functions/classes for admin documentation generator."
import re
from email.Parser import HeaderParser
from email.Errors import HeaderParseError
from django.utils.safestring import mark_safe
from django.core.urlresolvers import reverse
from django.utils.encoding import smart_str
try:
import docutils.... |
gilt/incubator-airflow | refs/heads/hbc_prod | airflow/migrations/versions/2e82aab8ef20_rename_user_table.py | 62 | # -*- coding: utf-8 -*-
#
# 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
... |
jiachenning/odoo | refs/heads/8.0 | addons/web_diagram/controllers/main.py | 70 | import openerp
class DiagramView(openerp.http.Controller):
@openerp.http.route('/web_diagram/diagram/get_diagram_info', type='json', auth='user')
def get_diagram_info(self, req, id, model, node, connector,
src_node, des_node, label, **kw):
visible_node_fields = kw.get('visibl... |
haad/ansible | refs/heads/devel | lib/ansible/modules/notification/campfire.py | 114 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: Ansible Project
# 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',
... |
pizzapanther/Super-Neutron-Drive | refs/heads/master | server/editor/admin.py | 1 | from django.contrib import admin
from .models import BeamApiKey, EKey
class BAdmin (admin.ModelAdmin):
list_display = ('beam', 'user', 'generated')
date_hierarchy = 'generated'
raw_id_fields = ('user',)
autocomplete_lookup_fields = {'fk': ['user']}
class EAdmin (admin.ModelAdmin):
list_display = ('bea... |
jjack15/CS402-Project-UTK | refs/heads/master | OnlinePythonTutor/v3/opt-ipy-server.py | 1 | # Adapted from https://github.com/facebook/tornado/tree/master/demos/websocket
import logging
import tornado.ioloop
import tornado.options
import tornado.web
import tornado.websocket
import os.path
from tornado.options import define, options
import json
define("port", default=8888, help="run on the given port", ty... |
asteca/ASteCA | refs/heads/master | packages/synth_clust/completeness_rm.py | 1 |
import numpy as np
def main(isoch_binar, completeness):
"""
Remove a number of stars according to the percentages of star loss found in
the 'mag_completeness' function of the luminosity module, for the real
observation.
"""
# Remember that 'comp_perc' here means the percentage of stars that ... |
DenL/pogom-webhook | refs/heads/webhook | pogom/pgoapi/protos/POGOProtos/Networking/Requests/Messages/UpgradePokemonMessage_pb2.py | 15 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: POGOProtos/Networking/Requests/Messages/UpgradePokemonMessage.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _me... |
rosscdh/pinax-eventlog | refs/heads/master | pinax/eventlog/tests/tests.py | 29 | from django.test import TestCase
class Tests(TestCase):
def setUp(self):
pass
|
HAYASAKA-Ryosuke/faker | refs/heads/master | faker/providers/company/de_DE/__init__.py | 21 | # coding=utf-8
from __future__ import unicode_literals
from .. import Provider as CompanyProvider
class Provider(CompanyProvider):
formats = (
'{{last_name}} {{company_suffix}}',
'{{last_name}} {{last_name}} {{company_suffix}}',
'{{last_name}}',
)
company_suffixes = (
'AG... |
syci/l10n-spain | refs/heads/8.0 | l10n_es_aeat_sii/wizards/__init__.py | 7 | # -*- coding: utf-8 -*-
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from . import account_invoice_refund
from . import aeat_sii_password
from . import send_first_semester
|
katrid/django | refs/heads/master | django/contrib/gis/utils/srs.py | 450 | from django.contrib.gis.gdal import SpatialReference
from django.db import DEFAULT_DB_ALIAS, connections
def add_srs_entry(srs, auth_name='EPSG', auth_srid=None, ref_sys_name=None,
database=None):
"""
This function takes a GDAL SpatialReference system and adds its information
to the `spa... |
apavlo/peloton | refs/heads/master | script/porting/push.py | 25 | #!/usr/bin/python
## ==============================================
## GOAL : Push all branches to github
## ==============================================
from __future__ import (absolute_import, division,
print_function, unicode_literals)
import sys
import shlex
import shutil
import tempfil... |
eworm-de/pacman | refs/heads/master | test/pacman/tests/sync103.py | 27 | self.description = "Sysupgrade with a local package not existing in sync db"
sp = pmpkg("spkg")
self.addpkg2db("sync", sp)
lp = pmpkg("lpkg")
self.addpkg2db("local", lp)
self.args = "-Su"
self.addrule("PACMAN_RETCODE=0")
self.addrule("PKG_EXIST=lpkg")
self.addrule("!PKG_EXIST=spkg")
|
opensim-org/opensim-core | refs/heads/master | Bindings/Python/tests/test_swig_additional_interface.py | 1 | """The tests here ensure the proper functionality of modifications/additions we
make to the C++ API, via the SWIG interface (*.i) file.
"""
import os
import unittest
import opensim as osim
# TODO __str__() for numeric types.
# TODO iterators for Vec3, Vector, Set's, and ComponentList's.
# TODO typemaps for Vec3 and... |
epyatopal/geocoder-1 | refs/heads/master | geocoder/bing.py | 2 | #!/usr/bin/python
# coding: utf8
from __future__ import absolute_import
from geocoder.base import Base
from geocoder.keys import bing_key
import re
class Bing(Base):
"""
Bing Maps REST Services
=======================
The Bing™ Maps REST Services Application Programming Interface (API)
provides a... |
VikParuchuri/scan | refs/heads/master | core/tasks/__init__.py | 248 | __author__ = 'vik'
|
jenalgit/django | refs/heads/master | tests/expressions/models.py | 93 | """
Tests for F() query expression syntax.
"""
from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Employee(models.Model):
firstname = models.CharField(max_length=50)
lastname = models.CharField... |
philoniare/horizon | refs/heads/master | horizon/management/commands/startdash.py | 79 | # 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 t... |
ThiagoGarciaAlves/intellij-community | refs/heads/master | python/testData/completion/structuralType.after.py | 79 | def f(x):
x.foo
x.bar
x.bar
|
akatsoulas/coss | refs/heads/master | coss/opensource_clubs/migrations/0013_resourcespage.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-09-11 15:45
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import wagtail.wagtailcore.blocks
import wagtail.wagtailcore.fields
class Migration(migrations.Migration):
dependencies = [
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.