repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
theojulienne/PySignals | refs/heads/master | pysignals/saferef.py | 1 | """
"Safe weakrefs", originally from pyDispatcher.
Provides a way to safely weakref any function, including bound methods (which
aren't handled by the core weakref module).
"""
import weakref, traceback
def safeRef(target, onDelete = None):
"""Return a *safe* weak reference to a callable target
target -- th... |
Yukinoshita47/Yuki-Chan-The-Auto-Pentest | refs/heads/master | Module/metagoofil/hachoir_parser/video/fourcc.py | 186 | #
# fourcc are codes to specify the encoding method a audio or video string
# in RIFF file (.avi and .wav).
#
# The following lists come from mmpython project:
# file: mmpython/video/fourcc.py
# url: http://sourceforge.net/projects/mmpython/
#
# List of codecs with no compression (compression rate=1.0)
UNCOMPRE... |
deluge-clone/libtorrent | refs/heads/master | tools/parse_peer_log.py | 35 | #!/usr/bin/env python
import glob
import os
import sys
# usage: parse_peer_log <path-to-libtorrent-peer-logs>
log_files = []
for p in glob.iglob(os.path.join(sys.argv[1], '*.log')):
name = os.path.split(p)[1]
if name == 'main_session.log': continue
print name
f = open(p, 'r')
out_file = p + '.dat'
log_files.ap... |
petecummings/django-cms | refs/heads/develop | cms/test_utils/project/fakemlng/south_migrations/0001_initial.py | 46 | # -*- 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 'MainModel'
db.create_table(u'fakemlng_mainmodel', (
... |
openmv/micropython | refs/heads/master | tests/float/python36.py | 15 | # tests for things that only Python 3.6 supports, needing floats
# underscores in numeric literals
print(1_000.1_8)
print("%.2g" % 1e1_2)
# underscore supported by int/float constructors
print(float("1_2_3"))
print(float("1_2_3.4"))
print("%.2g" % float("1e1_3"))
|
pol51/django-ajax-filtered-fields | refs/heads/master | setup.py | 11 | from distutils.core import setup
import os
root_dir = os.path.dirname(__file__)
if root_dir:
os.chdir(root_dir)
data_files = []
for dirpath, dirnames, filenames in os.walk('ajax_filtered_fields'):
for i, dirname in enumerate(dirnames):
if dirname.startswith('.'): del dirnames[i]
if '__init__.py' i... |
rmehta/frappe | refs/heads/develop | frappe/utils/response.py | 2 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import json
import datetime
import mimetypes
import os
import frappe
from frappe import _
import frappe.model.document
import frappe.utils
import frappe.sessions
import werkzeug.u... |
rizumu/django | refs/heads/master | django/views/generic/__init__.py | 597 | from django.views.generic.base import RedirectView, TemplateView, View
from django.views.generic.dates import (
ArchiveIndexView, DateDetailView, DayArchiveView, MonthArchiveView,
TodayArchiveView, WeekArchiveView, YearArchiveView,
)
from django.views.generic.detail import DetailView
from django.views.generic.e... |
Svolcano/python_exercise | refs/heads/master | play/wtf.py | 1 | import requests
import json
import csv
def t_bqc():
tel = '05535312598'
name = '安徽省芜湖鼎力电机有限公司'
url = ("http://172.18.52.175:8000/v2/qualityname?"
f"tel={tel}&third_party=1"
f"&name={name}"
"&switch=1_2_3")
print(url)
resp = requests.get(url)
print(json.loads(resp.text))
t_bqc(... |
yod/google-appengine-wx-launcher-gnome | refs/heads/master | launcher/dialoghandler.py | 28 | #!/usr/bin/env python
#
# Copyright 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
IllusionRom-deprecated/android_platform_external_chromium_org | refs/heads/illusion-4.4 | tools/telemetry/telemetry/unittest/simple_mock_unittest.py | 57 | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
from telemetry.unittest import simple_mock
_ = simple_mock.DONT_CARE
class SimpleMockUnitTest(unittest.TestCase):
def testBasic(self)... |
kristjankorjus/Replicating-DeepMind | refs/heads/master | libraries/cuda-convnet2/shownet.py | 180 | # Copyright 2014 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... |
ankur-gupta91/horizon-net-ip | refs/heads/master | openstack_dashboard/enabled/_9010_preview.py | 22 | # Copyright 2015 Cisco Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... |
minidron/django-geoaddress | refs/heads/master | django_geoaddress/widgets.py | 1 | # --coding: utf8--
from django import forms
class AddressWidget(forms.TextInput):
class Media:
css = {
'all': ('django_geoaddress/css/jquery.geoaddress.css',)
}
js = (
'django_geoaddress/js/jquery.autocomplete.min.js',
'django_geoaddress/js/jquery.geoad... |
ThinkingBridge/platform_external_chromium_org | refs/heads/kitkat | chrome/test/pyautolib/pyauto.py | 23 | #!/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.
"""PyAuto: Python Interface to Chromium's Automation Proxy.
PyAuto uses swig to expose Automation Proxy interfaces to Python.
For comp... |
crakensio/django_training | refs/heads/master | lib/python2.7/site-packages/django/views/csrf.py | 235 | from django.http import HttpResponseForbidden
from django.template import Context, Template
from django.conf import settings
# We include the template inline since we need to be able to reliably display
# this error message, especially for the sake of developers, and there isn't any
# other way of making it available ... |
ff94315/hiwifi-openwrt-HC5661-HC5761 | refs/heads/master | staging_dir/target-mipsel_r2_uClibc-0.9.33.2/root-ralink/usr/lib/python2.7/cProfile.py | 169 | #! /usr/bin/env python
"""Python interface for the 'lsprof' profiler.
Compatible with the 'profile' module.
"""
__all__ = ["run", "runctx", "help", "Profile"]
import _lsprof
# ____________________________________________________________
# Simple interface
def run(statement, filename=None, sort=-1):
"""Run s... |
adedayo/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/contrib/gis/db/backends/oracle/introspection.py | 388 | import cx_Oracle
from django.db.backends.oracle.introspection import DatabaseIntrospection
class OracleIntrospection(DatabaseIntrospection):
# Associating any OBJECTVAR instances with GeometryField. Of course,
# this won't work right on Oracle objects that aren't MDSYS.SDO_GEOMETRY,
# but it is the only o... |
rohan07/flask-peewee | refs/heads/master | example/main.py | 8 | from app import app, db
from auth import *
from admin import admin
from api import api
from models import *
from views import *
admin.setup()
api.setup()
if __name__ == '__main__':
app.run()
|
yoer/hue | refs/heads/master | desktop/core/ext-py/Django-1.6.10/django/core/serializers/__init__.py | 105 | """
Interfaces for serializing Django objects.
Usage::
from django.core import serializers
json = serializers.serialize("json", some_queryset)
objects = list(serializers.deserialize("json", json))
To add your own serializers, use the SERIALIZATION_MODULES setting::
SERIALIZATION_MODULES = {
... |
tchernomax/ansible | refs/heads/devel | lib/ansible/modules/web_infrastructure/jenkins_plugin.py | 12 | #!/usr/bin/python
# encoding: utf-8
# (c) 2016, Jiri Tyr <jiri.tyr@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... |
orchidinfosys/odoo | refs/heads/master | addons/im_livechat/report/__init__.py | 67 | # -*- coding: utf-8 -*-
import im_livechat_report_channel
import im_livechat_report_operator
|
saurabh6790/medsynaptic-app | refs/heads/develop | selling/doctype/customer/customer.py | 5 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
from webnotes.model.doc import Document, make_autoname
from webnotes import msgprint, _
import webnotes.defaults
from utilities.tr... |
aakashsharan/Google-Python-Exercises | refs/heads/master | basic/string1.py | 1 | #!/usr/bin/python -tt
# 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/
# Basic string exercises
# Fill in the code for the functions below. main() is already se... |
j-griffith/cinder | refs/heads/master | cinder/tests/unit/volume/drivers/vmware/test_fcd.py | 2 | # Copyright (c) 2017 VMware, 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... |
MikeAmy/django | refs/heads/master | django/contrib/gis/db/backends/spatialite/base.py | 445 | import sys
from ctypes.util import find_library
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db.backends.sqlite3.base import (
Database, DatabaseWrapper as SQLiteDatabaseWrapper, SQLiteCursorWrapper,
)
from django.utils import six
from .client import SpatiaL... |
Ukrainian-History/autoBWF | refs/heads/master | autoBWF/export_dialog.py | 1 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'export_dialog.ui'
#
# Created by: PyQt5 UI code generator 5.12.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Export(object):
def setupUi(self, Export):
Export.se... |
jibe-b/searx | refs/heads/master | searx/engines/scanr_structures.py | 4 | """
ScanR Structures (Science)
@website https://scanr.enseignementsup-recherche.gouv.fr
@provide-api yes (https://scanr.enseignementsup-recherche.gouv.fr/api/swagger-ui.html)
@using-api yes
@results JSON
@stable yes
@parse url, title, content, img_src
"""
from json import loads, dumps
fro... |
Ernir/bufftracker | refs/heads/master | bufftracker/migrations/0008_auto_20150829_1933.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('bufftracker', '0007_auto_20150530_0053'),
]
operations = [
migrations.AlterModelOptions(
name='casterlevelformul... |
ajoshpratt/westpa | refs/heads/master | lib/west_tools/westpa/binning/bins.py | 2 | # Copyright (C) 2013 Matthew C. Zwier and Lillian T. Chong
#
# This file is part of WESTPA.
#
# WESTPA 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... |
astorije/ansible-modules-core | refs/heads/devel | cloud/openstack/os_keypair.py | 21 | #!/usr/bin/python
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2013, Benno Joy <benno@ansible.com>
# Copyright (c) 2013, John Dewey <john@dewey.ws>
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publish... |
js0701/chromium-crosswalk | refs/heads/master | components/exo/PRESUBMIT.py | 21 | # Copyright 2015 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.
"""Top-level presubmit script for Exosphere.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmi... |
janrinze/loox7xxport | refs/heads/master | arch/ia64/scripts/unwcheck.py | 916 | #!/usr/bin/env python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthe... |
FusionSP/android_external_chromium_org | refs/heads/lp5.1 | tools/telemetry/telemetry/core/local_server.py | 26 | # 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.
import collections
import json
import os
import re
import subprocess
import sys
from telemetry.core import forwarders
from telemetry.core import util
Named... |
ragnarekker/Ice-modelling | refs/heads/master | experimental/energybalancedefaults.py | 1 | #! /usr/bin/python
# -*- coding: utf-8 -*-
__author__ = 'ragnarekker'
# energybalance.py
# energy_balance_from_temp_sfc
default_cloud_cover_method = "Binary"
# temp_surface_from_eb
default_iteration_method = "Newton_Raphson"
default_iteration_error = 10.
# temp_surface_from_eb --> method == "Delta_T"
delta_t_eb_frac... |
miptliot/edx-platform | refs/heads/ginkgo_openedu_docker | common/djangoapps/xblock_django/user_service.py | 11 | """
Support for converting a django user to an XBlock user
"""
from django.contrib.auth.models import User
from opaque_keys.edx.keys import CourseKey
from xblock.reference.user_service import UserService, XBlockUser
from openedx.core.djangoapps.user_api.preferences.api import get_user_preferences
from student.models i... |
byterom/android_external_chromium_org | refs/heads/12.1 | tools/json_schema_compiler/cpp_bundle_generator.py | 36 | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import code
import cpp_util
from model import Platforms
from schema_util import CapitalizeFirstLetter
from schema_util import JsFunctionNameToClassName
... |
coderbone/SickRage | refs/heads/master | lib/sqlalchemy/util/topological.py | 79 | # util/topological.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Topological sorting algorithms."""
from ..exc import CircularDependencyError
f... |
karyon/django | refs/heads/master | django/contrib/auth/apps.py | 472 | from django.apps import AppConfig
from django.contrib.auth.checks import check_user_model
from django.core import checks
from django.db.models.signals import post_migrate
from django.utils.translation import ugettext_lazy as _
from .management import create_permissions
class AuthConfig(AppConfig):
name = 'django... |
s40523203/2016fallcp_hw | refs/heads/gh-pages | plugin/render_math/__init__.py | 371 | from .math import *
|
davidl1/hortonworks-extension | refs/heads/master | build/contrib/hod/hodlib/NodePools/__init__.py | 1638 | #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 thi... |
hnlab/fpdb | refs/heads/master | fpdb/fpdb.py | 1 | #!/bin/env python
import math
#import simtk.openmm.app as soa
#import simtk.unit as su
import sys,os
import numpy as np
from .fhet import hetnames,cofactors
import copy
MASS = {'O':15.999, 'N':14.010,
'C':12.010, 'H': 1.008,
'F':19.000,
'Na':22.99, 'NA':22.99,
'P':30.9... |
fighterlyt/bite-project | refs/heads/master | deps/mrtaskman/common/split_stream.py | 16 | #!/usr/bin/python
# 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
# di... |
MiczFlor/Booktype | refs/heads/master | lib/booktype/api/tokens.py | 7 | from django.contrib.auth.tokens import PasswordResetTokenGenerator
class SessionTokenGenerator(PasswordResetTokenGenerator):
"""
Simple strategy object that inherits from default PasswordResetTokenGenerator
used to generate and check tokens for the api authentication/session mechanism.
"""
key_sa... |
vipul-sharma20/oh-mainline | refs/heads/master | vendor/packages/Django/django/conf/locale/ta/formats.py | 434 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j F, Y'
TIME_FORMAT = 'g:i:s A'
# DATETIME_FORMAT =
# YEAR_MONTH_FORMAT ... |
mtury/scapy | refs/heads/master | scapy/contrib/eddystone.py | 3 | # -*- mode: python3; indent-tabs-mode: nil; tab-width: 4 -*-
# eddystone.py - protocol handlers for Eddystone beacons
#
# This file is part of Scapy
# See http://www.secdev.org/projects/scapy for more information
# Copyright (C) Michael Farrell <micolous+git@gmail.com>
# This program is published under a GPLv2 (or late... |
akhilari7/pa-dude | refs/heads/master | lib/python2.7/site-packages/django/contrib/staticfiles/urls.py | 567 | from django.conf import settings
from django.conf.urls.static import static
from django.contrib.staticfiles.views import serve
urlpatterns = []
def staticfiles_urlpatterns(prefix=None):
"""
Helper function to return a URL pattern for serving static files.
"""
if prefix is None:
prefix = setti... |
Livit/Livit.Learn.EdX | refs/heads/labster/develop | common/djangoapps/course_action_state/tests/test_rerun_manager.py | 148 | """
Tests specific to the CourseRerunState Model and Manager.
"""
from django.test import TestCase
from opaque_keys.edx.locations import CourseLocator
from course_action_state.models import CourseRerunState
from course_action_state.managers import CourseRerunUIStateManager
from student.tests.factories import UserFacto... |
Doveps/mono | refs/heads/master | bassist/bassist/systems/common.py | 2 | # Copyright (c) 2015 Kurt Yoder
# See the file LICENSE for copying permission.
import collections
class MergeableDict(collections.MutableMapping):
'''A dictionary that allows for custom merging behavior.'''
def __init__(self, *args, **kwargs):
self.data = dict()
self.update(dict(*args, **kwarg... |
lupyuen/RaspberryPiImage | refs/heads/master | home/pi/GrovePi/Software/Python/others/temboo/Library/Amazon/Marketplace/Products/GetCompetitivePricingForASIN.py | 2 | # -*- coding: utf-8 -*-
###############################################################################
#
# GetCompetitivePricingForASIN
# Returns the current competitive pricing of products, based on ASIN values and the MarketplaceId that you specify.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.... |
geonition/django_opensocial_people | refs/heads/master | setup.py | 1 | from setuptools import setup
from setuptools import find_packages
setup(
name='opensocial_people',
version='4.0.1',
author='Kristoffer Snabb',
url='https://github.com/geonition/django_opensocial_people',
packages=find_packages(),
include_package_data=True,
package_data = {
"opensoci... |
Genymobile/gm_pr | refs/heads/master | gm_pr/migrations/0003_project_column.py | 1 | #
# Copyright 2015 Genymobile
#
# 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,... |
punchagan/zulip | refs/heads/master | zerver/openapi/markdown_extension.py | 3 | # Zulip's OpenAPI-based API documentation system is documented at
# https://zulip.readthedocs.io/en/latest/documentation/api.html
#
# This file defines the special Markdown extension that is used to
# render the code examples, example responses, etc. that appear in
# Zulip's public API documentation.
import inspect
... |
ROGUE-JCTD/geonode | refs/heads/master | geonode/base/tests.py | 31 | from django.test import TestCase
from geonode.base.models import ResourceBase
class ThumbnailTests(TestCase):
def setUp(self):
self.rb = ResourceBase.objects.create()
def test_initial_behavior(self):
self.assertFalse(self.rb.has_thumbnail())
missing = self.rb.get_thumbnail_url()
... |
elkingtonmcb/shogun | refs/heads/develop | examples/undocumented/python_static/distance_manhattenword.py | 22 | from tools.load import LoadMatrix
from sg import sg
lm=LoadMatrix()
traindna=lm.load_dna('../data/fm_train_dna.dat')
testdna=lm.load_dna('../data/fm_test_dna.dat')
parameter_list=[[traindna,testdna,3,0,'n'],[traindna,testdna,4,0,'n']]
def distance_manhattenword (fm_train_dna=traindna,fm_test_dna=testdna,order=3,
... |
ashishtanwer/DFS | refs/heads/master | traffic_generators/simple.py | 1 | from trafgen import TrafficGenerator
from fslib.util import *
from ipaddr import IPAddress, IPNetwork
from socket import IPPROTO_UDP, IPPROTO_TCP, IPPROTO_ICMP
from fslib.flowlet import Flowlet, FlowIdent
from fslib.common import fscore
# FIXME
haveIPAddrGen = False
class SimpleTrafficGenerator(TrafficGenerator):
... |
DESHONOR/android_kernel_huawei_msm8916 | refs/heads/cm-12.1 | arch/ia64/scripts/unwcheck.py | 13143 | #!/usr/bin/python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthew Ch... |
msambol/ursula | refs/heads/master | plugins/action/sensu_metrics_check.py | 4 | from ansible.utils import parse_kv, template
class ActionModule(object):
"""
TODO: FIXME when upgrading to Ansible 2.x
"""
TRANSFERS_FILES = False
def __init__(self, runner):
self.runner = runner
self.basedir = runner.basedir
def _arg_or_fact(self, arg_name, fact_name, args,... |
MFoster/breeze | refs/heads/master | tests/regressiontests/staticfiles_tests/storage.py | 125 | from datetime import datetime
from django.core.files import storage
from django.contrib.staticfiles.storage import CachedStaticFilesStorage
class DummyStorage(storage.Storage):
"""
A storage class that does implement modified_time() but raises
NotImplementedError when calling
"""
def _save(self, na... |
alexsmx/djangoAppengineSrcTemplate | refs/heads/master | django/conf/locale/lt/formats.py | 332 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = r'Y \m. F j \d.'
TIME_FORMAT = 'H:i:s'
# DATETIME_FORMAT =
# YEAR_MONTH_F... |
carl-mastrangelo/grpc | refs/heads/master | tools/profiling/microbenchmarks/bm_diff/bm_diff.py | 14 | #!/usr/bin/env python2.7
#
# Copyright 2017 gRPC 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 applicable ... |
nistormihai/superdesk-core | refs/heads/master | content_api/assets/__init__.py | 6 | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2015 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
"""Assets mod... |
v-legoff/accertin | refs/heads/master | lyntin/hooks.py | 1 | #######################################################################
# This file is part of Lyntin.
# copyright (c) Free Software Foundation 1996 - 2002
#
# Lyntin is distributed under the GNU General Public License license. See the
# file LICENSE for distribution details.
# $Id: hooks.py,v 1.6 2003/08/28 01:46:47 ... |
EmmanuelJohnson/ssquiz | refs/heads/master | flask/lib/python2.7/site-packages/pip/_vendor/requests/packages/charade/universaldetector.py | 200 | ######################## 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... |
jawilson/home-assistant | refs/heads/master | homeassistant/components/keyboard.py | 49 | """
Provides functionality to emulate keyboard presses on host machine.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/keyboard/
"""
import voluptuous as vol
from homeassistant.const import (
SERVICE_MEDIA_NEXT_TRACK, SERVICE_MEDIA_PLAY_PAUSE,
... |
anryko/ansible | refs/heads/devel | lib/ansible/modules/system/authorized_key.py | 9 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2012, Brad Olson <brado@movedbylight.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_versio... |
jorik041/weevely3 | refs/heads/master | modules/net/scan.py | 16 | from core.vectors import PhpFile
from core.module import Module
from core.argparsers import SUPPRESS
from core import modules
from core.loggers import log
from core import messages
import utils
import os
class Scan(Module):
"""TCP Port scan."""
aliases = [ 'nmap' ]
def init(self):
self.register... |
alexbrand/kubernetes | refs/heads/master | hack/boilerplate/boilerplate_test.py | 630 | #!/usr/bin/env python
# Copyright 2016 The Kubernetes 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 appli... |
ryancoleman/autodock-vina | refs/heads/master | boost_1_54_0/tools/build/v2/test/tag.py | 44 | #!/usr/bin/python
# Copyright (C) 2003. Pedro Ferreira
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
import BoostBuild
###############################################################################
#
# test_f... |
sagark123/coala | refs/heads/master | tests/output/ConsoleInteractionTest.py | 5 | import os
import unittest
from unittest.mock import patch
from collections import OrderedDict
from os.path import abspath, relpath
import logging
from pyprint.ConsolePrinter import ConsolePrinter
from coalib.bearlib.spacing.SpacingHelper import SpacingHelper
from coalib.bears.Bear import Bear
from coala_utils.Context... |
Danielhiversen/home-assistant | refs/heads/master | homeassistant/components/binary_sensor/mqtt.py | 2 | """
Support for MQTT binary sensors.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/binary_sensor.mqtt/
"""
import logging
from typing import Optional
import voluptuous as vol
from homeassistant.core import callback
from homeassistant.components import... |
tkinz27/ansible | refs/heads/devel | contrib/inventory/collins.py | 89 | #!/usr/bin/env python
"""
Collins external inventory script
=================================
Ansible has a feature where instead of reading from /etc/ansible/hosts
as a text file, it can query external programs to obtain the list
of hosts, groups the hosts are in, and even variables to assign to each host.
Collins ... |
scitran/python-client | refs/heads/master | examples/fsl_bet.py | 1 | from scitran_client import ScitranClient, query, Projects, Files, Acquisitions, Sessions
import os
client = ScitranClient()
# Sessions belong to projects. We can thus directly the 'label' field of 'projects'.
sessions = client.search(query(Sessions).filter(Projects.label.match('showdes')))
# Files belong to acquisit... |
jk1/intellij-community | refs/heads/master | python/testData/formatter/alignmentOfClosingParenthesisOfArgumentListWhenNoHangingIndent.py | 79 | option_list = BaseCommand.option_list + (
make_option('-d', '--db',
dest='db',
metavar='DB_ID',
help='Mandatory: DATABASES setting key for database'),
make_option('-p', '--project',
dest='project',
default='UNGA',
me... |
jmesteve/saas3 | refs/heads/master | openerp/addons_extra/product_images_website/product.py | 1 | # -*- coding: utf-8 -*-
#########################################################################
# Copyright (C) 2009 Sharoon Thomas, Open Labs Business solutions #
# Copyright (C) 2011 Akretion Sébastien BEAU sebastien.beau@akretion.com#
# #
... |
chokribr/invenioold | refs/heads/master | modules/bibcirculation/lib/bibcirculation_cern_ldap.py | 23 | ## This file is part of Invenio.
## Copyright (C) 2009, 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... |
luyifan/zulip | refs/heads/master | zerver/templatetags/minified_js.py | 119 | from __future__ import absolute_import
from django.template import Node, Library, TemplateSyntaxError
from django.conf import settings
from django.contrib.staticfiles.storage import staticfiles_storage
register = Library()
class MinifiedJSNode(Node):
def __init__(self, sourcefile):
self.sourcefile = sour... |
thaim/ansible | refs/heads/fix-broken-link | test/lib/ansible_test/_internal/import_analysis.py | 14 | """Analyze python import statements."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import ast
import os
from . import types as t
from .util import (
display,
ApplicationError,
is_subdir,
)
from .data import (
data_context,
)
VIRTUAL_PACKAGES = set([
... |
fuhongliang/odoo | refs/heads/8.0 | openerp/report/render/rml2txt/rml2txt.py | 442 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009, P. Christeas, Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or ... |
ProfessionalIT/maxigenios-website | refs/heads/master | sdk/google_appengine/lib/django-1.4/django/views/generic/simple.py | 81 | from django.template import loader, RequestContext
from django.http import HttpResponse, HttpResponseRedirect, HttpResponsePermanentRedirect, HttpResponseGone
from django.utils.log import getLogger
import warnings
warnings.warn(
'Function-based generic views have been deprecated; use class-based views instead.',
... |
raoulcollenteur/GWTSA | refs/heads/master | GWTSA/Time_Series.py | 1 | # -*- coding: utf-8 -*-
"""
Created on Mon Feb 8 18:58:37 2016
@author: Raoul
"""
import numpy as np
from pandas import read_csv, to_datetime
import matplotlib.pyplot as plt
import matplotlib.dates as md
from statsmodels.tsa.stattools import acf
from lmfit import minimize, Parameters, Parameter, report_fit, fit_repor... |
SecurityCompass/libcloud | refs/heads/trunk | libcloud/utils/connection.py | 59 | # 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 ... |
and3p/Export-hamster-data-to-ActiveCollab | refs/heads/forked | wafadmin/3rdpartys/boost.py | 7 | #! /usr/bin/env python
# encoding: utf-8
import os.path,glob,types,re,sys
import Configure,config_c,Options,Utils,Logs
from Logs import warn,debug
from Configure import conf
boost_code='''
#include <iostream>
#include <boost/version.hpp>
int main() { std::cout << BOOST_VERSION << std::endl; }
'''
boost_libpath=['/usr/... |
timsnyder/bokeh | refs/heads/master | bokeh/tests/test_themes.py | 2 | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2019, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... |
ibressler/pyqtgraph | refs/heads/master | pyqtgraph/widgets/BusyCursor.py | 3 | from pyqtgraph.Qt import QtGui, QtCore
__all__ = ['BusyCursor']
class BusyCursor(object):
"""Class for displaying a busy mouse cursor during long operations.
Usage::
with pyqtgraph.BusyCursor():
doLongOperation()
May be nested.
"""
active = []
def __enter__(self):
... |
dezelin/scons | refs/heads/master | scons-local/SCons/Tool/rpmutils.py | 6 | """SCons.Tool.rpmutils.py
RPM specific helper routines for general usage in the test framework
and SCons core modules.
Since we check for the RPM package target name in several places,
we have to know which machine/system name RPM will use for the current
hardware setup. The following dictionaries and functions try t... |
joelddiaz/openshift-tools | refs/heads/prod | openshift/installer/vendored/openshift-ansible-3.6.173.0.59/roles/lib_openshift/src/test/unit/test_oc_label.py | 82 | '''
Unit tests for oc label
'''
import os
import six
import sys
import unittest
import mock
# Removing invalid variable names for tests so that I can
# keep them brief
# pylint: disable=invalid-name,no-name-in-module
# Disable import-error b/c our libraries aren't loaded in jenkins
# pylint: disable=import-error
# p... |
chrisfilo/fmriprep | refs/heads/master | fmriprep/workflows/base.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
Created on Wed Dec 2 17:35:40 2015
@author: craigmoodie
"""
import os
from copy import deepcopy
from time import strftime
from nipype.pipeline import eng... |
valtech-mooc/edx-platform | refs/heads/master | common/djangoapps/track/migrations/0001_initial.py | 189 | # -*- coding: 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 'TrackingLog'
db.create_table('track_trackinglog', (
('id', self.gf('django.db.mo... |
kumarkrishna/sympy | refs/heads/master | sympy/matrices/densesolve.py | 58 | """
Solution of equations using dense matrices.
The dense matrix is stored as a list of lists.
"""
from sympy.matrices.densetools import col, eye, augment
from sympy.matrices.densetools import rowadd, rowmul, conjugate_transpose
from sympy import sqrt, var
from sympy.core.compatibility import range
import copy
def ... |
ian-garrett/meetMe | refs/heads/master | env/lib/python3.4/site-packages/googleapiclient/model.py | 77 | # Copyright 2014 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 ... |
debayanray/ironic_backup | refs/heads/fix_for_bug_1418327_node_boot_mode | ironic/common/images.py | 5 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright (c) 2010 Citrix Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in complianc... |
AriZuu/micropython | refs/heads/master | tests/basics/int_big_unary.py | 113 | # test bignum unary operations
i = 1 << 65
print(bool(i))
print(+i)
print(-i)
print(~i)
|
Fireblend/chromium-crosswalk | refs/heads/master | native_client_sdk/src/tools/run.py | 51 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Launch a local http server, then launch a executable directed at the server.
This command creates a local server (on port 5103 ... |
navrasio/mxnet | refs/heads/master | example/rcnn/rcnn/tools/train_rcnn.py | 34 | # 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... |
mozilla/stoneridge | refs/heads/master | python/src/Mac/Modules/carbonevt/CarbonEvtscan.py | 34 | # IBCarbonscan.py
import sys
import MacOS
import sys
from bgenlocations import TOOLBOXDIR, BGENDIR
sys.path.append(BGENDIR)
from scantools import Scanner, Scanner_OSX
def main():
print "---Scanning CarbonEvents.h---"
input = ["CarbonEvents.h"]
output = "CarbonEventsgen.py"
defsoutput = TOOLBOXDIR + ... |
BartoszCichecki/onlinepython | refs/heads/master | onlinepython/pypy-2.4.0-win32/lib-python/2.7/tempfile.py | 9 | """Temporary files.
This module provides generic, low- and high-level interfaces for
creating temporary files and directories. The interfaces listed
as "safe" just below can be used without fear of race conditions.
Those listed as "unsafe" cannot, and are provided for backward
compatibility only.
This module also pr... |
semonte/intellij-community | refs/heads/master | python/testData/pyi/type/functionParameter/FunctionParameter.py | 57 | def f(<caret>x):
pass
|
hybrideagle/django | refs/heads/master | tests/handlers/urls.py | 359 | from __future__ import unicode_literals
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^regular/$', views.regular),
url(r'^streaming/$', views.streaming),
url(r'^in_transaction/$', views.in_transaction),
url(r'^not_in_transaction/$', views.not_in_transaction),
url(r'^s... |
santisiri/popego | refs/heads/master | envs/ALPHA-POPEGO/lib/python2.5/site-packages/SQLAlchemy-0.4.3-py2.5.egg/sqlalchemy/orm/session.py | 1 | # session.py
# Copyright (C) 2005, 2006, 2007, 2008 Michael Bayer mike_mp@zzzcomputing.com
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Provides the Session class and related utilities."""
import weakref
from sqlalchemy import ut... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.