repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
almeidapaulopt/erpnext | refs/heads/develop | erpnext/healthcare/doctype/dosage_form/test_dosage_form.py | 30 | # -*- coding: utf-8 -*-
# Copyright (c) 2017, ESS LLP and Contributors
# See license.txt
from __future__ import unicode_literals
import unittest
class TestDosageForm(unittest.TestCase):
pass
|
ganeshrn/ansible | refs/heads/devel | test/integration/targets/collections/collections/ansible_collections/testns/content_adj/plugins/cache/custom_jsonfile.py | 119 | # (c) 2014, Brian Coca, Josh Drake, et al
# (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
cache: jsonfi... |
jamespcole/home-assistant | refs/heads/master | tests/components/demo/test_remote.py | 11 | """The tests for the demo remote component."""
# pylint: disable=protected-access
import unittest
from homeassistant.setup import setup_component
import homeassistant.components.remote as remote
from homeassistant.const import STATE_ON, STATE_OFF
from tests.common import get_test_home_assistant
from tests.components.... |
bigfatpaulyj/py-airfoil | refs/heads/master | scons-local-2.2.0/SCons/Errors.py | 14 | #
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
#
# 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
... |
jelugbo/ddi | refs/heads/master | common/lib/supertrace.py | 74 | """
A handy util to print a django-debug-screen-like stack trace with
values of local variables.
"""
import sys
import traceback
from django.utils.encoding import smart_unicode
def supertrace(max_len=160):
"""
Print the usual traceback information, followed by a listing of all the
local variables in each... |
cloudera/hue | refs/heads/master | desktop/core/ext-py/SQLAlchemy-1.3.17/test/dialect/mysql/test_query.py | 2 | # coding: utf-8
from sqlalchemy import all_
from sqlalchemy import and_
from sqlalchemy import any_
from sqlalchemy import Boolean
from sqlalchemy import cast
from sqlalchemy import Column
from sqlalchemy import false
from sqlalchemy import ForeignKey
from sqlalchemy import Integer
from sqlalchemy import MetaData
from... |
ahotam/micropython | refs/heads/master | tests/basics/list_compare.py | 86 | print([] == [])
print([] > [])
print([] < [])
print([] == [1])
print([1] == [])
print([] > [1])
print([1] > [])
print([] < [1])
print([1] < [])
print([] >= [1])
print([1] >= [])
print([] <= [1])
print([1] <= [])
print([1] == [1])
print([1] != [1])
print([1] == [2])
print([1] == [1, 0])
print([1] > [1])
print([1] > [2... |
IoTGateway/gst-omx-1.0.0 | refs/heads/master | common/scangobj-merge.py | 8 | #!/usr/bin/python
# -*- Mode: Python -*-
# vi:si:et:sw=4:sts=4:ts=4
"""
parse, merge and write gstdoc-scanobj files
"""
from __future__ import print_function, unicode_literals
import sys
import os
def debug(*args):
pass
# OrderedDict class based on
# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/1077... |
3dfxsoftware/cbss-addons | refs/heads/master | psm/model/__init__.py | 1 | # -*- encoding: utf-8 -*-
############################################################################
# Module Writen to OpenERP, Open Source Management Solution #
# Copyright (C) OpenERP Venezuela (<http://openerp.com.ve>). #
# All Rights Reserved ... |
pombredanne/http-repo.gem5.org-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... |
toroio-alex/heroku-python | refs/heads/master | hello/models.py | 43 | from django.db import models
# Create your models here.
class Greeting(models.Model):
when = models.DateTimeField('date created', auto_now_add=True)
|
otherness-space/myProject003 | refs/heads/master | my_project_003/lib/python2.7/site-packages/django/contrib/admin/models.py | 104 | from __future__ import unicode_literals
from django.db import models
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.contrib.admin.util import quote
from django.core.urlresolvers import reverse, NoReverseMatch
from django.utils.translation import ugettext, ugette... |
ganeshrn/ansible | refs/heads/devel | test/units/utils/display/test_warning.py | 44 | # -*- coding: utf-8 -*-
# Copyright (c) 2020 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
import pytest
from ansible.utils.display import Display
@pytest.fixture
def... |
amishb/youtube-dl | refs/heads/master | youtube_dl/extractor/openfilm.py | 25 | from __future__ import unicode_literals
import json
from .common import InfoExtractor
from ..utils import (
parse_iso8601,
compat_urllib_parse,
parse_age_limit,
int_or_none,
)
class OpenFilmIE(InfoExtractor):
_VALID_URL = r'http://(?:www\.)openfilm\.com/videos/(?P<id>.+)'
_TEST = {
'... |
FlorentChamault/My_sickbeard | refs/heads/master | lib/requests/certs.py | 65 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
ceritfi.py
~~~~~~~~~~
This module returns the installation location of cacert.pem.
"""
import os
try:
import certifi
except ImportError:
certifi = None
def where():
if certifi:
return certifi.where()
else:
f = os.path.split(__file__... |
procamora/Wiki-Personal | refs/heads/master | pelican-plugins/liquid_tags/flickr.py | 6 | """
Flickr Tag
----------
This implements a Liquid-style flickr tag for Pelican.
IMPORTANT: You have to create a API key to access the flickr api.
You can do this `here <https://www.flickr.com/services/apps/create/apply>`_.
Add the created key to your config under FLICKR_API_KEY.
Syntax
------
{% flickr image_id [sma... |
midnightradio/gensim | refs/heads/develop | gensim/models/fasttext.py | 2 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Authors: Gensim Contributors
# Copyright (C) 2018 RaRe Technologies s.r.o.
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Introduction
------------
Learn word representations via fastText: `Enriching Word Vectors with Subword Information... |
jaywink/shoop | refs/heads/master | shoop/utils/__init__.py | 6 | # This file is part of Shoop.
#
# Copyright (c) 2012-2015, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
# There's a small elephant in this file.
# ,
# ((_,-.
# '-.\_)'-,
# ) _ ... |
MycChiu/tensorflow | refs/heads/master | tensorflow/python/kernel_tests/decode_csv_op_test.py | 57 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
fogcitymarathoner/djfb | refs/heads/master | django_facebook/test_utils/convert_json.py | 2 | from django.utils import simplejson
def json_to_python(json_string):
'''
I receive error mails encoded as json, this function converts the data into
easy usable python dicts and pprint them
'''
python_dict = simplejson.loads(json_string)
return python_dict
if __name__ == '__main_... |
HyperloopTeam/FullOpenMDAO | refs/heads/master | lib/python2.7/site-packages/requests-2.2.1-py2.7.egg/requests/status_codes.py | 695 | # -*- coding: utf-8 -*-
from .structures import LookupDict
_codes = {
# Informational.
100: ('continue',),
101: ('switching_protocols',),
102: ('processing',),
103: ('checkpoint',),
122: ('uri_too_long', 'request_uri_too_long'),
200: ('ok', 'okay', 'all_ok', 'all_okay', 'all_good', '\\o/'... |
rschnapka/hr | refs/heads/8.0 | hr_employee_data_from_work_address/__init__.py | 23 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2015 Therp BV <http://therp.nl>.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of th... |
tzulberti/entrenamiento-arqueria | refs/heads/master | alembic/versions/022_dia_semana.py | 1 | """Dia semana
Revision ID: 4022
Revises: 021
Create Date: 2014-06-23 07:38:57.942347
"""
# revision identifiers, used by Alembic.
revision = '022'
down_revision = '021'
import inspect
import imp
import os
from alembic import op
def upgrade():
utils_path = os.path.join(os.path.dirname(os.path.abspath(inspect.ge... |
geopython/QGIS | refs/heads/master | python/plugins/processing/modeler/AddModelFromFileAction.py | 10 | # -*- coding: utf-8 -*-
"""
***************************************************************************
EditScriptAction.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
**********************... |
boundlessgeo/qgis-geoserver-plugin | refs/heads/master | geoserverexplorer/gui/contextualhelp.py | 1 | # -*- coding: utf-8 -*-
#
# (c) 2016 Boundless, http://boundlessgeo.com
# This code is licensed under the GPL 2.0 license.
#
"""
Contextual help components for use in dialogs, etc.
"""
import os
from qgis.PyQt.QtGui import *
from qgis.PyQt.QtCore import *
from qgis.PyQt.QtWidgets import *
# noinspection PyAttributeOu... |
jherico/qtwebkit | refs/heads/5.5 | Tools/Scripts/webkitpy/tool/steps/cleanworkingdirectory_unittest.py | 124 | # Copyright (C) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... |
Spoken-tutorial/spoken-website | refs/heads/master | donate/urls.py | 1 | from django.conf.urls import include, url
from donate.views import *
app_name = 'donate'
urlpatterns = [
url(r'^$', donatehome, name='donatehome'),
url(r'^initiate_payment/(?P<purpose>\w+)/$', controller, name='initiate_payment'),
url(r'send_onetime', send_onetime, name='send_onetime'),
url(r'valida... |
freedomtan/tensorflow | refs/heads/master | tensorflow/python/kernel_tests/spacetobatch_op_test.py | 5 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
ndokos/pbench | refs/heads/master | lib/pbench/test/functional/agent/cli/commands/conftest.py | 3 | import configparser
import shutil
import pytest
@pytest.fixture
def opt_pbench(tmp_path):
opt_pbench = tmp_path / "opt" / "pbench-agent"
opt_pbench.mkdir(parents=True, exist_ok=True)
yield opt_pbench
@pytest.fixture
def pbench_cfg(tmp_path, opt_pbench):
pbench_cfg = opt_pbench / "config"
pbenc... |
TheMOOCAgency/edx-platform | refs/heads/master | lms/djangoapps/discussion/views.py | 7 | """
Views handling read (GET) requests for the Discussion tab and inline discussions.
"""
from functools import wraps
import logging
from django.contrib.auth.decorators import login_required
from django.core.context_processors import csrf
from django.core.urlresolvers import reverse
from django.contrib.auth.models im... |
LLNL/spack | refs/heads/develop | var/spack/repos/builtin/packages/brpc/package.py | 2 | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Brpc(CMakePackage):
"""An industrial-grade RPC framework used throughout Baidu, with
1... |
jasielserra/PythonDevs | refs/heads/master | cudo_3D_grid.py | 1 | x = int ( raw_input())
y = int ( raw_input())
z = int ( raw_input())
n = int ( raw_input())
print[[ i , j, x] for i in range ( x + 1 ) for j in range( y + 1) for x in range( z + 1) if ((i+j+x) != n)]
|
Drelucas/dotfiles | refs/heads/master | scripts/rmshit.py | 1 | #! /usr/bin/env python
import os
import sys
import shutil
shittyfiles = [
'~/.adobe', # Flash crap
'~/.macromedia', # Flash crap
'~/.recently-used',
'~/.local/share/recently-used.xbel',
'~/Desktop', # Firefox creates this
'~/.thumbnails',
'~/.gconfd',
... |
CEG-FYP-OpenStack/scheduler | refs/heads/master | nova/tests/unit/image/test_transfer_modules.py | 9 | # 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... |
jmcarp/osf.io | refs/heads/develop | scripts/add_conference.py | 61 | #!/usr/bin/env python
# encoding: utf-8
from website.conferences.model import Conference
from website.models import User
from modularodm import Q
from modularodm.exceptions import ModularOdmException
from website.app import init_app
import sys
import argparse
def main():
init_app(set_backends=True, routes=False)
... |
mcgill-robotics/ros-tritech-micron | refs/heads/master | src/tritech_micron/tools.py | 1 | # -*- coding: utf-8 -*-
"""Tritech Micron sonar tools."""
import math
import rospy
from tritech_micron.msg import TritechMicronConfig
from tf.transformations import quaternion_from_euler
from sensor_msgs.msg import ChannelFloat32, PointCloud
from geometry_msgs.msg import Point32, Pose, PoseStamped, Quaternion
__autho... |
Qalthos/ansible | refs/heads/devel | lib/ansible/modules/cloud/google/gcp_compute_target_https_proxy_facts.py | 9 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... |
meganbkratz/acq4 | refs/heads/develop | acq4/util/flowchart/__main__.py | 4 | import os, sys
path = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, os.path.join(path, '..'))
sys.path.insert(0, os.path.join(path, '..', '..', '..'))
from PyQt4 import QtCore, QtGui
import acq4.util.flowchart as flowchart
app = QtGui.QApplication([])
fc = flowchart.Flowchart(terminals={
'dataIn':... |
signed/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/conf/app_template/models.py | 10644 | from django.db import models
# Create your models here.
|
mleger45/turnex | refs/heads/master | msn/urls.py | 1 | from django.conf.urls import url
from . import views
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
url(r'^forms/$', views.forms, name="view"),
url(r'^board/$', views.board, name="board"),
url(r'^config/$', views.config, name="config"),
url(r'^$', views.ma... |
bitmazk/django-rapid-prototyping | refs/heads/master | rapid_prototyping/tests/rapid_prototyping_tags_tests.py | 1 | """Tests for the templatetags of the rapid_prototyping app."""
from django.test import TestCase
from ..templatetags.rapid_prototyping_tags import (
calculate_costs,
get_difference,
get_hourly_rate,
)
class CalculateCostTestCase(TestCase):
"""Tests for the ``calculate_costs`` template filter."""
l... |
ramcn/demo3 | refs/heads/master | venv/lib/python3.4/site-packages/django/contrib/admin/util.py | 82 | import warnings
from django.utils.deprecation import RemovedInDjango19Warning
warnings.warn(
"The django.contrib.admin.util module has been renamed. "
"Use django.contrib.admin.utils instead.", RemovedInDjango19Warning)
from django.contrib.admin.utils import * # NOQA isort:skip
|
tseaver/google-cloud-python | refs/heads/master | videointelligence/google/cloud/videointelligence_v1p3beta1/gapic/streaming_video_intelligence_service_client.py | 2 | # -*- coding: utf-8 -*-
#
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... |
AdaEne/CATMAID | refs/heads/master | django/applications/catmaid/migrations/0043_add_webgl_layers_userprofile_setting.py | 3 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'UserProfile.prefer_webgl_layers'
db.add_column(u'catmaid_... |
Winand/pandas | refs/heads/master | scripts/groupby_speed.py | 6 | from __future__ import print_function
from pandas import *
rng = DatetimeIndex('1/3/2011', '11/30/2011', offset=offsets.Minute())
df = DataFrame(np.random.randn(len(rng), 5), index=rng,
columns=list('OHLCV'))
rng5 = DatetimeIndex('1/3/2011', '11/30/2011', offset=offsets.Minute(5))
gp = rng5.asof
group... |
meghana1995/sympy | refs/heads/master | sympy/core/tests/test_args.py | 4 | """Test whether all elements of cls.args are instances of Basic. """
# NOTE: keep tests sorted by (module, class name) key. If a class can't
# be instantiated, add it here anyway with @SKIP("abstract class) (see
# e.g. Function).
import os
import re
import warnings
import io
from sympy import Basic, S, symbols, sqrt... |
lduarte1991/edx-platform | refs/heads/master | lms/djangoapps/mobile_api/users/serializers.py | 2 | """
Serializer for user API
"""
from rest_framework import serializers
from rest_framework.reverse import reverse
from certificates.api import certificate_downloadable_status
from courseware.access import has_access
from student.models import CourseEnrollment, User
from util.course import get_encoded_course_sharing_u... |
guorendong/iridium-browser-ubuntu | refs/heads/ubuntu/precise | third_party/chromite/appengine/cq_stats/build_annotations/build_row_controller.py | 2 | # Copyright 2015 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Controller for the build_annotations app.
This controller sits between the django models for cidb tables and the views
that power the app.
Keep non-tr... |
pombredanne/MOG | refs/heads/master | nova/tests/consoleauth/test_consoleauth.py | 9 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack Foundation
# Administrator of the National Aeronautics and Space Administration.
# 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... |
ingokegel/intellij-community | refs/heads/master | python/testData/inspections/AddFunctionFromFString_after.py | 31 | def my_function():
pass
class C:
def method(self):
print(f'{my_function()}') |
raycarnes/hr | refs/heads/8.0 | __unported__/hr_employee_id/hr_contract.py | 20 | # -*- coding:utf-8 -*-
#
#
# Copyright (C) 2011,2013 Michael Telahun Makonnen <mmakonnen@gmail.com>.
# All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation... |
dmccue/ansible | refs/heads/devel | lib/ansible/plugins/connections/ssh.py | 2 | # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... |
GunoH/intellij-community | refs/heads/master | python/testData/completion/classNameInDocstring.py | 48 | class MyClass:
pass
def f(x):
"""
@param x:
@type x: MyC<caret>
""" |
kittiu/odoo | refs/heads/8.0 | 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... |
wrouesnel/ansible | refs/heads/devel | lib/ansible/modules/network/iosxr/iosxr_banner.py | 16 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... |
lumig242/Hue-Integration-with-CDAP | refs/heads/pull3 | desktop/core/ext-py/Django-1.6.10/tests/m2m_and_m2o/tests.py | 150 | from __future__ import absolute_import
from django.db.models import Q
from django.test import TestCase
from .models import Issue, User, UnicodeReferenceModel
class RelatedObjectTests(TestCase):
def test_m2m_and_m2o(self):
r = User.objects.create(username="russell")
g = User.objects.create(userna... |
OpenWinCon/OpenWinNet | refs/heads/master | web-gui/myvenv/lib/python3.4/site-packages/django/contrib/admin/widgets.py | 18 | """
Form Widget classes specific to the Django admin site.
"""
from __future__ import unicode_literals
import copy
from django import forms
from django.contrib.admin.templatetags.admin_static import static
from django.core.urlresolvers import reverse
from django.db.models.deletion import CASCADE
from django.forms.uti... |
willdavidc/piel | refs/heads/master | catkin_ws/src/piel/scripts/venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/__init__.py | 580 | from __future__ import absolute_import
# For backwards compatibility, provide imports that used to be here.
from .connection import is_connection_dropped
from .request import make_headers
from .response import is_fp_closed
from .ssl_ import (
SSLContext,
HAS_SNI,
IS_PYOPENSSL,
assert_fingerprint,
re... |
bluedynamics/yafowil.widget.alohaeditor | refs/heads/master | src/yafowil/widget/__init__.py | 13048 | __import__('pkg_resources').declare_namespace(__name__)
|
dynius/densecoin | refs/heads/master | contrib/qt_translations.py | 4110 | #!/usr/bin/env python
# Helpful little script that spits out a comma-separated list of
# language codes for Qt icons that should be included
# in binary bitcoin distributions
import glob
import os
import re
import sys
if len(sys.argv) != 3:
sys.exit("Usage: %s $QTDIR/translations $BITCOINDIR/src/qt/locale"%sys.arg... |
Akanoa/swift | refs/heads/master | test/probe/test_container_failures.py | 20 | #!/usr/bin/python -u
# Copyright (c) 2010-2012 OpenStack Foundation
#
# 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 ap... |
garbled1/ansible | refs/heads/devel | lib/ansible/utils/module_docs_fragments/junos.py | 101 | #
# (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... |
Pafcholini/Nadia-kernel-LL-N910F-EUR-LL-OpenSource | refs/heads/master | tools/perf/scripts/python/futex-contention.py | 11261 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... |
ArcherSys/ArcherSys | refs/heads/master | Lib/site-packages/twisted/test/stdio_test_loseconn.py | 7 | # -*- test-case-name: twisted.test.test_stdio.StandardInputOutputTests.test_loseConnection -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Main program for the child process run by
L{twisted.test.test_stdio.StandardInputOutputTests.test_loseConnection} to
test that ITransport.loseConnec... |
dreamapplehappy/myblog | refs/heads/master | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/pygments/styles/vim.py | 364 | # -*- coding: utf-8 -*-
"""
pygments.styles.vim
~~~~~~~~~~~~~~~~~~~
A highlighting style for Pygments, inspired by vim.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token import Keywor... |
andrescodas/casadi | refs/heads/master | docs/examples/python/modelica/fritzson_application_examples/thermodynamics_example.py | 3 | #
# This file is part of CasADi.
#
# CasADi -- A symbolic framework for dynamic optimization.
# Copyright (C) 2010-2014 Joel Andersson, Joris Gillis, Moritz Diehl,
# K.U. Leuven. All rights reserved.
# Copyright (C) 2011-2014 Greg Horn
#
# CasADi is free software; you can... |
immesys/RiSyn | refs/heads/master | tests/driver_grove_ledbar/tests/01-run.py | 6 | #!/usr/bin/env python3
# Copyright (C) 2016 Kaspar Schleiser <kaspar@schleiser.de>
# 2017 Sebastian Meiling <s@mlng.net>
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
import os
imp... |
JoshRosen/spark | refs/heads/master | examples/src/main/python/ml/string_indexer_example.py | 123 | #
# 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 us... |
srm912/servo | refs/heads/master | tests/wpt/web-platform-tests/websockets/handlers/echo-query_wsh.py | 266 | #!/usr/bin/python
from mod_pywebsocket import msgutil, util
def web_socket_do_extra_handshake(request):
pass # Always accept.
def web_socket_transfer_data(request):
msgutil.send_message(request, request.unparsed_uri.split('?', 1)[1] or '')
|
Jaemu/haiku.py | refs/heads/master | lib/werkzeug/useragents.py | 317 | # -*- coding: utf-8 -*-
"""
werkzeug.useragents
~~~~~~~~~~~~~~~~~~~
This module provides a helper to inspect user agent strings. This module
is far from complete but should work for most of the currently available
browsers.
:copyright: (c) 2013 by the Werkzeug Team, see AUTHORS for more deta... |
dronefly/dronefly.github.io | refs/heads/master | flask/lib/python2.7/site-packages/wtforms/form.py | 140 | import itertools
try:
from collections import OrderedDict
except ImportError:
from ordereddict import OrderedDict
from wtforms.compat import with_metaclass, iteritems, itervalues
from wtforms.meta import DefaultMeta
__all__ = (
'BaseForm',
'Form',
)
class BaseForm(object):
"""
Base Form Clas... |
iModels/ffci | refs/heads/master | account/migrations/0014_reposstatus.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-04-13 17:59
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('account', '0013_auto_20160324_1734'),
]
operations ... |
jshiv/turntable | refs/heads/master | test/lib/python2.7/site-packages/pip/_vendor/html5lib/__init__.py | 316 | """
HTML parsing library based on the WHATWG "HTML5"
specification. The parser is designed to be compatible with existing
HTML found in the wild and implements well-defined error recovery that
is largely compatible with modern desktop web browsers.
Example usage:
import html5lib
f = open("my_document.html")
tree = ht... |
aimas/TuniErp-8.0 | refs/heads/master | addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/functions.py | 1 | ##########################################################################
#
# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
# Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>).
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser Gener... |
arju88nair/projectCulminate | refs/heads/master | venv/lib/python3.5/site-packages/pylint/test/regrtest_data/classdoc_usage.py | 9 | """ds"""
__revision__ = None
class SomeClass(object):
"""cds"""
doc = __doc__
def __init__(self):
"""only to make pylint happier"""
def please(self):
"""public method 1/2"""
def besilent(self):
"""public method 2/2"""
|
gravyboat/docka-docka-docka | refs/heads/master | docka-project/app.py | 1 | from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return('Hello World! :)')
if __name__ == '__main__':
app.run(host="0.0.0.0")
|
duongbaoduy/gtools | refs/heads/gtools | third_party/protobuf26/internal/python_message.py | 26 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions o... |
rhd/meson | refs/heads/master | test cases/common/152 link depends custom target/make_file.py | 14 | #!/usr/bin/env python3
import sys
with open(sys.argv[1], 'w') as f:
print('# this file does nothing', file=f)
|
qmarlats/pyquizz | refs/heads/master | env/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/util/__init__.py | 201 | from __future__ import absolute_import
# For backwards compatibility, provide imports that used to be here.
from .connection import is_connection_dropped
from .request import make_headers
from .response import is_fp_closed
from .ssl_ import (
SSLContext,
HAS_SNI,
assert_fingerprint,
resolve_cert_reqs,
... |
IronLanguages/ironpython2 | refs/heads/master | Src/StdLib/Lib/socket.py | 24 | # Wrapper module for _socket, providing some additional facilities
# implemented in Python.
"""\
This module provides socket operations and some related functions.
On Unix, it supports IP (Internet Protocol) and Unix domain sockets.
On other systems, it only supports IP. Functions specific for a
socket are available a... |
GanjaBuck/ganjabuck | refs/heads/master | contrib/wallettools/walletchangepass.py | 2299 | from jsonrpc import ServiceProxy
access = ServiceProxy("http://127.0.0.1:8332")
pwd = raw_input("Enter old wallet passphrase: ")
pwd2 = raw_input("Enter new wallet passphrase: ")
access.walletpassphrasechange(pwd, pwd2) |
RockySteveJobs/python-for-android | refs/heads/master | python3-alpha/python3-src/Tools/pynche/StripViewer.py | 113 | """Strip viewer and related widgets.
The classes in this file implement the StripViewer shown in the top two thirds
of the main Pynche window. It consists of three StripWidgets which display
the variations in red, green, and blue respectively of the currently selected
r/g/b color value.
Each StripWidget shows the co... |
nikdoof/vapemap | refs/heads/master | app/stores/migrations/0006_add_moderation_types.py | 1 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
depends_on = (
('moderation', '0001_initial'),
)
def forwards(self, orm):
orm['moderation.FlagType'].objects.create(name='Incorre... |
gdietz/OpenMEE | refs/heads/master | common_wizard_pages/scatterplot_dataselect_page.py | 1 | import sys
#from functools import partial
from PyQt4 import QtCore, QtGui
from PyQt4.Qt import *
from ome_globals import *
import ui_scatterplot_dataselect_page
# prev_scatterplot_data is a dictionary: {'x':var1, 'y':var2}
#
class ScatterplotDataSelectPage(QWizardPage, ui_scatterplot_dataselect_page... |
maferelo/saleor | refs/heads/master | saleor/product/migrations/0050_auto_20180131_0746.py | 3 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2018-01-31 13:46
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("product", "0049_collection")]
operations = [
migrations.AlterField(
model_na... |
uccser/cs4teachers | refs/heads/develop | dthm4kaiako/config/templatetags/query_replace.py | 1 | """Module for the custom query_replace template tag."""
from django import template
register = template.Library()
@register.simple_tag(takes_context=True)
def query_replace(context, **kwargs):
"""Render URL query string with given values replaced.
Args:
context (dict): Dictionary of view context.
... |
blbarker/spark-tk | refs/heads/master | python/sparktk/doc/docgen.py | 9 | # vim: set encoding=utf-8
# Copyright (c) 2016 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... |
han-han/googlePythonCourse | refs/heads/master | copyspecial/copyspecial.py | 1 | #!/usr/bin/python
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
import sys
import re
import os
import shutil
import commands
"""Copy Special exercise
"""
#... |
JCBarahona/edX | refs/heads/master | openedx/core/djangoapps/course_groups/migrations/0005_cohort_membership.py | 9 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'CohortMembership'
db.create_table('course_groups_cohortme... |
sungkim11/mhargadh | refs/heads/master | django/contrib/localflavor/cz/forms.py | 157 | """
Czech-specific form helpers
"""
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Select, RegexField, Field
from django.utils.translation import ugettext_lazy as _
import re
birth_number = re.compile(r'^(?P<birth>\d{6})/?(?P<id>\d{3,4})$')
ic_... |
Architektor/PySnip | refs/heads/master | venv/lib/python2.7/site-packages/zope/interface/tests/dummy.py | 57 | ##############################################################################
#
# Copyright (c) 2001, 2002 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# TH... |
Lonchadepavo/EstacionCisma | refs/heads/master | bot/C_eightball.py | 36 | from random import choice as fsample #Yay for added speed!
global responses
responses = ['Yes','Too bad','Will you turn me off if I tell you?','Absolutely',
"Not at all", "Nope", "It does", "No", "All the time",
"I don't really know", "Could be","Possibly","You're still here?",# Chaoticag
... |
gophronesis/ernest | refs/heads/master | enrich/generic/generic_meta_enrich.py | 2 | #!/usr/bin/env python
import argparse
import json
import logging
import re
from elasticsearch import Elasticsearch
class GENERIC_META_ENRICH:
def __init__(self, args, parent_logger):
self.logger = logging.getLogger(parent_logger + '.generic_meta_enrich')
self.month_lookup = {'jan': 1, 'feb': 2, ... |
nish10z/CONCUSS | refs/heads/master | lib/pattern_counting/double_count/inclusion_exclusion.py | 3 | #
# This file is part of CONCUSS, https://github.com/theoryinpractice/concuss/,
# and is Copyright (C) North Carolina State University, 2015. It is licensed
# under the three-clause BSD license; see LICENSE.
#
from count_combiner import CountCombiner
from lib.util.itertools_ext import choose
class InclusionExclusio... |
aam-at/tensorflow | refs/heads/master | tensorflow/python/keras/integration_test/function_test.py | 8 | # Copyright 2020 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... |
vergecurrency/VERGE | refs/heads/master | contrib/zmq/zmq_sub.py | 1 | #!/usr/bin/env python3
# Copyright (c) 2014-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""
ZMQ example using python3's asyncio
VERGE should be started with the command line arguments:... |
kasioumis/invenio | refs/heads/master | invenio/legacy/oaiharvest/templates.py | 15 | # This file is part of Invenio.
# Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2014 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 ... |
pwoodworth/intellij-community | refs/heads/master | python/testData/paramInfo/IgnoreNewInOldStyleClass.py | 83 | # makes sense for python 2.x
class A:
def __init__(self, one):
pass
class B(A):
def __new__(cls, one, two):
pass
b = B(<arg1>"only_one")
|
zentol/flink | refs/heads/master | flink-python/pyflink/table/catalog.py | 4 | ################################################################################
# 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... |
pyamg/pyamg | refs/heads/lloyd-unify | pyamg/gallery/tests/test_stencil.py | 1 | import numpy as np
from pyamg.gallery.stencil import stencil_grid
from numpy.testing import TestCase, assert_equal
class TestStencil(TestCase):
def test_1d(self):
stencil = np.array([1, 2, 3])
result = stencil_grid(stencil, (3,)).toarray()
expected = np.array([[2, 3, 0],
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.