repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
PeteAndersen/swarfarm | refs/heads/master | bestiary/parse/util.py | 1 | import difflib
def update_bestiary_obj(model, com2us_id, defaults):
obj, created = model.objects.get_or_create(com2us_id=com2us_id, defaults=defaults)
if created:
print(f'!!! Created new {model.__name__} {com2us_id}')
else:
# Compare parsed values to existing object
updated = Fals... |
jwren/intellij-community | refs/heads/master | python/testData/refactoring/extractmethod/DuplicateSingleLine.after.py | 79 | def bar():
a = foo()
print a
a = foo()
print a
def foo():
a = 1
return a
|
CeltonMcGrath/TACTIC | refs/heads/master | src/pyasm/web/html_wdg_test.py | 6 | #!/usr/bin/python
###########################################################
#
# Copyright (c) 2005, 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 wit... |
tracedeng/shuhe | refs/heads/master | region/tests.py | 24123 | from django.test import TestCase
# Create your tests here.
|
chriskmanx/qmole | refs/heads/master | QMOLEDEV/node/tools/scons/scons-local-1.2.0/SCons/Tool/pdftex.py | 12 | """SCons.Tool.pdftex
Tool-specific initialization for pdftex.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 The SCons Foundation
#
# Permiss... |
Arcensoth/cogbot | refs/heads/master | cogbot/cogs/robo_mod/conditions/author_has_been_member_for.py | 1 | from datetime import datetime, timedelta
from typing import Optional
from cogbot.cogs.robo_mod.robo_mod_condition import RoboModCondition
from cogbot.cogs.robo_mod.robo_mod_trigger import RoboModTrigger
class AuthorHasBeenMemberForCondition(RoboModCondition):
def __init__(self):
self.more_than: Optional[... |
wjfwzzc/Kaggle_Script | refs/heads/master | word2vec_nlp_tutorial/multinomial_naive_bayes.py | 1 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import generators
from __future__ import nested_scopes
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import with_statement
import sklearn.naive_bayes
import d... |
shiora/The-Perfect-Pokemon-Team-Balancer | refs/heads/master | libs/env/Lib/site-packages/whoosh/qparser/dateparse.py | 95 | # Copyright 2010 Matt Chaput. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the... |
wilkerwma/codeschool | refs/heads/master | vendor/github.com/fabiommendes/django-viewpack/src/viewpack/packs/crud.py | 2 | from django import forms
from django.core.exceptions import ImproperlyConfigured
from viewpack.packs import (
ViewPack, SingleObjectPackMixin, TemplateResponsePackMixin
)
from viewpack.views import (
View, DetailView, CreateView, ListView, DeleteView, UpdateView, TemplateView
)
from viewpack.views.mixins impor... |
tonk/ansible | refs/heads/devel | test/support/integration/plugins/modules/aws_az_info.py | 11 | #!/usr/bin/python
# Copyright (c) 2017 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',
'supported_by': 'community... |
home-assistant/home-assistant | refs/heads/dev | homeassistant/components/evohome/water_heater.py | 2 | """Support for WaterHeater devices of (EMEA/EU) Honeywell TCC systems."""
from __future__ import annotations
import logging
from homeassistant.components.water_heater import (
SUPPORT_AWAY_MODE,
SUPPORT_OPERATION_MODE,
WaterHeaterEntity,
)
from homeassistant.const import PRECISION_TENTHS, PRECISION_WHOLE,... |
vks/servo | refs/heads/master | tests/wpt/harness/wptrunner/metadata.py | 34 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import os
import shutil
import sys
import tempfile
import types
import uuid
from collections import defaultdict
from mo... |
DataDog/integrations-core | refs/heads/master | crio/tests/test_crio.py | 1 | # (C) Datadog, Inc. 2018-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import os
import mock
import pytest
from datadog_checks.crio import CrioCheck
instance = {'prometheus_url': 'http://localhost:10249/metrics'}
CHECK_NAME = 'crio'
NAMESPACE = 'crio'
@pytest.fixture()
... |
tara-sova/qreal | refs/heads/master | plugins/tools/visualInterpreter/examples/robotsCodeGeneration/reactionsStorage/WaitForColorIntensityBlockGenerator.py | 12 | # Application condition
waitFor.id == max_used_id and not cur_node_is_processed
# Reaction
port = "NXT_PORT_S" + waitFor.Port
condition = convertCondition(waitFor.Sign) + " " + waitFor.Intensity
wait_for_color_intensity_code = "while (!(ecrobot_get_nxtcolorsensor_light(" + port + ") " + condition + ")) {}\n"
wait_ini... |
jagguli/intellij-community | refs/heads/master | python/testData/inspections/AddCallSuperCommentAfterColonPreserved.py | 74 | class Example1:
def __init__(self):
self.field1 = 1
class Example2(Example1):
def <warning descr="Call to __init__ of super class is missed">__init<caret>__</warning>(self): # Some valuable comment here
pass |
anirudhSK/chromium | refs/heads/master | tools/telemetry/telemetry/core/platform/posix_platform_backend.py | 2 | # 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 distutils.spawn
import logging
import os
import re
import stat
import subprocess
from telemetry.core.platform import desktop_platform_backend
from te... |
luuloe/python-duco | refs/heads/master | duco/modbus.py | 1 | """Support for Modbus."""
import logging
import struct
import threading
from duco.const import (
PROJECT_PACKAGE_NAME,
DUCO_MODBUS_BAUD_RATE,
DUCO_MODBUS_BYTE_SIZE,
DUCO_MODBUS_STOP_BITS,
DUCO_MODBUS_PARITY,
DUCO_MODBUS_METHOD
)
from duco.helpers import (twos_comp)
_LOGGER = log... |
odoomrp/odoomrp-wip | refs/heads/8.0 | quality_control_sale_stock/__init__.py | 87 | # -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
|
tongwang01/tensorflow | refs/heads/master | tensorflow/python/platform/control_imports.py | 68 | # 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... |
ConnorGBrewster/servo | refs/heads/master | tests/wpt/web-platform-tests/webdriver/tests/get_named_cookie/get.py | 6 | from datetime import datetime, timedelta
from tests.support.asserts import assert_success
from tests.support.fixtures import clear_all_cookies
from tests.support.inline import inline
def get_named_cookie(session, name):
return session.transport.send(
"GET", "session/{session_id}/cookie/{name}".format(
... |
Kast0rTr0y/ansible | refs/heads/devel | lib/ansible/modules/storage/netapp/netapp_e_snapshot_volume.py | 13 | #!/usr/bin/python
# (c) 2016, NetApp, Inc
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.... |
shahbazn/neutron | refs/heads/master | neutron/extensions/dhcpagentscheduler.py | 29 | # Copyright (c) 2013 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... |
Shrhawk/edx-platform | refs/heads/master | common/djangoapps/student/migrations/0025_auto__add_field_courseenrollmentallowed_auto_enroll.py | 114 | # -*- 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 field 'CourseEnrollmentAllowed.auto_enroll'
db.add_column('student_courseenrollmentallowed', 'auto_... |
RAFTDevTeam/raft | refs/heads/master | thirdparty/pyamf/pyamf/adapters/util.py | 11 | # Copyright (c) The PyAMF Project.
# See LICENSE.txt for details.
"""
Useful helpers for adapters.
@since: 0.4
"""
import builtins
if not hasattr(__builtins__, 'set'):
from sets import Set as set
def to_list(obj, encoder):
"""
Converts an arbitrary object C{obj} to a C{list}.
"""
return list(o... |
Jaccorot/django-cms | refs/heads/develop | cms/south_migrations/0071_mptt_to_mp.py | 51 | # -*- coding: utf-8 -*-
from django.db.models import F
from django.middleware import transaction
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
from treebeard.numconv import NumConv
STEPLEN = 4
ALPHABET = '0123456789ABCDEFGHIJ... |
kparal/anaconda | refs/heads/master | tests/gui/inside/welcome.py | 13 | # Copyright (C) 2014 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
#
# This program is distr... |
hassanabidpk/django | refs/heads/master | django/db/backends/sqlite3/schema.py | 309 | import codecs
import contextlib
import copy
from decimal import Decimal
from django.apps.registry import Apps
from django.db.backends.base.schema import BaseDatabaseSchemaEditor
from django.utils import six
class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
sql_delete_table = "DROP TABLE %(table)s"
sql_c... |
codeaudit/gp-structure-search | refs/heads/master | source/mitparallel/util.py | 7 | import config
import os
import tempfile
def mkstemp_safe(directory, suffix):
(os_file_handle, file_name) = tempfile.mkstemp(dir=directory, suffix=suffix)
os.close(os_file_handle)
return file_name
def create_temp_file(extension):
return mkstemp_safe(config.TEMP_PATH, extension)
|
pp-mo/iris-grib | refs/heads/master | iris_grib/tests/unit/save_rules/test_identification.py | 1 | # (C) British Crown Copyright 2016, Met Office
#
# This file is part of iris-grib.
#
# iris-grib is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) an... |
luo66/scikit-learn | refs/heads/master | sklearn/preprocessing/label.py | 137 | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Mathieu Blondel <mathieu@mblondel.org>
# Olivier Grisel <olivier.grisel@ensta.org>
# Andreas Mueller <amueller@ais.uni-bonn.de>
# Joel Nothman <joel.nothman@gmail.com>
# Hamzeh Alsalhi <ha258@cornell.edu>
# Licens... |
Luciden/easl | refs/heads/master | easl/visualize/visualizer.py | 1 | __author__ = 'Dennis'
class Visual(object):
@staticmethod
def visualize(self):
"""
Parameters
----------
self : object
Any object that will be visualized.
Returns
-------
visualization : Visualization
"""
rais... |
GunoH/intellij-community | refs/heads/master | python/testData/quickFixes/PyAddImportQuickFixTest/orderingPathComponentsNumber/b/c/__init__.py | 119 | foo = 2 |
zturchan/CMPUT410-Lab6 | refs/heads/master | v1/lib/python2.7/site-packages/django/conf/locale/el/__init__.py | 12133432 | |
SRabbelier/Melange | refs/heads/master | thirdparty/google_appengine/lib/django_1_2/tests/modeltests/proxy_model_inheritance/app1/__init__.py | 12133432 | |
paboldin/rally | refs/heads/master | rally/plugins/openstack/scenarios/designate/__init__.py | 12133432 | |
beck/django | refs/heads/master | tests/migrations/migrations_test_apps/unspecified_app_with_conflict/migrations/__init__.py | 12133432 | |
Qalthos/ansible | refs/heads/devel | lib/ansible/modules/web_infrastructure/__init__.py | 12133432 | |
Zlash65/erpnext | refs/heads/develop | erpnext/patches/v6_21/rename_material_request_fields.py | 61 | # 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 frappe
from frappe.model.utils.rename_field import rename_field
def execute():
frappe.reload_doc('stock', 'doctype', 'material_request_item'... |
Kiiv/CouchPotatoServer | refs/heads/develop | libs/requests/packages/chardet/chardetect.py | 743 | #!/usr/bin/env python
"""
Script which takes one or more file paths and reports on their detected
encodings
Example::
% chardetect somefile someotherfile
somefile: windows-1252 with confidence 0.5
someotherfile: ascii with confidence 1.0
If no paths are provided, it takes its input from stdin.
"""
from ... |
zhuwenping/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/importlib/test/source/__init__.py | 52 | import importlib.test
import os.path
import unittest
def test_suite():
directory = os.path.dirname(__file__)
return importlib.test.test_suite('importlib.test.source', directory)
if __name__ == '__main__':
from test.support import run_unittest
run_unittest(test_suite())
|
40423213/2016fallcadp_hw | refs/heads/gh-pages | plugin/liquid_tags/notebook.py | 235 | """
Notebook Tag
------------
This is a liquid-style tag to include a static html rendering of an IPython
notebook in a blog post.
Syntax
------
{% notebook filename.ipynb [ cells[start:end] ]%}
The file should be specified relative to the ``notebooks`` subdirectory of the
content directory. Optionally, this subdire... |
romain-dartigues/ansible | refs/heads/devel | lib/ansible/modules/network/fortios/fortios_webfilter_override.py | 7 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2018 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Lic... |
silly-wacky-3-town-toon/SOURCE-COD | refs/heads/master | dubrari/tools/compiler/dna/components/DNALandmarkBuilding.py | 2 | from DNANode import DNANode
from dna.base.DNAPacker import *
class DNALandmarkBuilding(DNANode):
COMPONENT_CODE = 13
def __init__(self, name):
DNANode.__init__(self, name)
self.code = ''
self.wallColor = (1, 1, 1, 1)
def setCode(self, code):
self.code = code
def setW... |
jagguli/intellij-community | refs/heads/master | python/testData/intentions/afterParamSectionBeforeKeywords.py | 53 | def f(x):
"""
Args:
x:
Keyword arguments:
Returns:
None
"""
|
fpy171/django | refs/heads/master | tests/queryset_pickle/__init__.py | 12133432 | |
cruzegoodin/TSC-ShippingDetails | refs/heads/master | flask/lib/python2.7/site-packages/pip/_vendor/requests/compat.py | 1038 | # -*- coding: utf-8 -*-
"""
pythoncompat
"""
from .packages import chardet
import sys
# -------
# Pythons
# -------
# Syntax sugar.
_ver = sys.version_info
#: Python 2.x?
is_py2 = (_ver[0] == 2)
#: Python 3.x?
is_py3 = (_ver[0] == 3)
try:
import simplejson as json
except (ImportError, SyntaxError):
# si... |
pwil3058/darning | refs/heads/master | darning/cli/__init__.py | 1 | ### Copyright (C) 2010 Peter Williams <peter_ono@users.sourceforge.net>
###
### This program is free software; you can redistribute it and/or modify
### it under the terms of the GNU General Public License as published by
### the Free Software Foundation; version 2 of the License only.
###
### This program is distribut... |
asydorchuk/ml | refs/heads/master | classes/cs231n/assignment2/cs231n/layers.py | 1 | import numpy as np
def affine_forward(x, w, b):
"""
Computes the forward pass for an affine (fully-connected) layer.
The input x has shape (N, d_1, ..., d_k) and contains a minibatch of N
examples, where each example x[i] has shape (d_1, ..., d_k). We will
reshape each input into a vector of dimension D = ... |
controlzee/ansible | refs/heads/devel | test/integration/cleanup_gce.py | 163 | '''
Find and delete GCE resources matching the provided --match string. Unless
--yes|-y is provided, the prompt for confirmation prior to deleting resources.
Please use caution, you can easily delete your *ENTIRE* GCE infrastructure.
'''
import os
import re
import sys
import optparse
import yaml
try:
from libclo... |
glewis17/fuel | refs/heads/master | fuel/converters/base.py | 13 | import os
import sys
from contextlib import contextmanager
from functools import wraps
import numpy
from progressbar import (ProgressBar, Percentage, Bar, ETA)
from fuel.datasets import H5PYDataset
from ..exceptions import MissingInputFiles
def check_exists(required_files):
"""Decorator that checks if required ... |
eugeneponomarenko/qualitybots | refs/heads/master | src/webdriver/webdriver_wrapper.py | 26 | #!/usr/bin/python2.4
#
# Copyright 2011 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... |
Curso-OpenShift/Formulario | refs/heads/master | OverFlow/ProjectFormulario/env/lib/python2.7/site-packages/pip/vcs/__init__.py | 170 | """Handles all VCS (version control) support"""
from __future__ import absolute_import
import errno
import logging
import os
import shutil
from pip._vendor.six.moves.urllib import parse as urllib_parse
from pip.exceptions import BadCommand
from pip.utils import (display_path, backup_dir, call_subprocess,
... |
morissette/devopsdays-hackathon-2016 | refs/heads/master | venv/lib/python2.7/site-packages/pip/vcs/__init__.py | 170 | """Handles all VCS (version control) support"""
from __future__ import absolute_import
import errno
import logging
import os
import shutil
from pip._vendor.six.moves.urllib import parse as urllib_parse
from pip.exceptions import BadCommand
from pip.utils import (display_path, backup_dir, call_subprocess,
... |
nikolay-fedotov/networking-cisco | refs/heads/master | networking_cisco/tests/unit/ml2/drivers/cisco/nexus/__init__.py | 12133432 | |
CollabQ/CollabQ | refs/heads/master | .google_appengine/lib/django/django/contrib/flatpages/__init__.py | 12133432 | |
shail2810/nova | refs/heads/master | nova/tests/unit/servicegroup/__init__.py | 12133432 | |
zachallaun/zulip | refs/heads/master | confirmation/migrations/__init__.py | 12133432 | |
silentsokolov/django-treasuremap | refs/heads/master | treasuremap/backends/yandex.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from collections import OrderedDict
try:
from urllib import urlencode
except ImportError:
from urllib.parse import urlencode
from django.conf import settings
from .base import BaseMapBackend
class YandexMapBackend(BaseMapBackend):
NAME =... |
mmalyska/eve-wspace | refs/heads/develop | evewspace/Teamspeak/__init__.py | 12133432 | |
mcella/django | refs/heads/master | tests/user_commands/management/commands/leave_locale_alone_true.py | 428 | from django.core.management.base import BaseCommand
from django.utils import translation
class Command(BaseCommand):
can_import_settings = True
leave_locale_alone = True
def handle(self, *args, **options):
return translation.get_language()
|
yosefm/postptv | refs/heads/master | scripts/analyse_fhdf.py | 2 | #! /usr/bin/python
# -*- coding: utf-8 -*-
"""
Runs an analysis of a tracer/inertial scene encoded by two FHDF files.
Created on Sun Aug 10 17:22:04 2014
@author: yosef
"""
from flowtracks.scene import read_dual_scene
from flowtracks.analysis import analysis, FluidVelocitiesAnalyser
if __name__ == "__main__":
... |
benpatterson/edx-platform | refs/heads/master | lms/djangoapps/courseware/tests/test_model_data.py | 43 | """
Test for lms courseware app, module data (runtime data storage for XBlocks)
"""
import json
from mock import Mock, patch
from nose.plugins.attrib import attr
from functools import partial
from courseware.model_data import DjangoKeyValueStore, FieldDataCache, InvalidScopeError
from courseware.models import StudentM... |
eyohansa/django | refs/heads/master | tests/i18n/urls.py | 205 | from __future__ import unicode_literals
from django.conf.urls.i18n import i18n_patterns
from django.http import HttpResponse, StreamingHttpResponse
from django.test import ignore_warnings
from django.utils.deprecation import RemovedInDjango110Warning
from django.utils.translation import ugettext_lazy as _
# test depr... |
linjoahow/w17test_1 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/unittest/test/test_break.py | 785 | import gc
import io
import os
import sys
import signal
import weakref
import unittest
@unittest.skipUnless(hasattr(os, 'kill'), "Test requires os.kill")
@unittest.skipIf(sys.platform =="win32", "Test cannot run on Windows")
@unittest.skipIf(sys.platform == 'freebsd6', "Test kills regrtest on freebsd6 "
"if threa... |
RockySteveJobs/python-for-android | refs/heads/master | python-build/python-libs/gdata/build/lib/atom/http_interface.py | 133 | #!/usr/bin/python
#
# Copyright (C) 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 ... |
sebrandon1/neutron | refs/heads/master | neutron/agent/l3/ha_router.py | 3 | # Copyright (c) 2015 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 applicable ... |
darconny/liveblog | refs/heads/master | server/app.py | 2 | #!/usr/bin/env python
# -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014, 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/sup... |
tobegit3hub/keystone_docker | refs/heads/master | keystone/common/sql/migrate_repo/versions/058_placeholder.py | 70 | # 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
# d... |
NeuralEnsemble/neuroConstruct | refs/heads/master | lib/jython/Lib/test/test_shutil.py | 14 | # Copyright (C) 2003 Python Software Foundation
import unittest
import shutil
import tempfile
import sys
import stat
import os
import os.path
from os.path import splitdrive
from distutils.spawn import find_executable, spawn
from shutil import (_make_tarball, _make_zipfile, make_archive,
register_ar... |
fernandog/Medusa | refs/heads/optimized | ext/feedparser/parsers/strict.py | 43 | # The strict feed parser that interfaces with an XML parsing library
# Copyright 2010-2015 Kurt McKee <contactme@kurtmckee.org>
# Copyright 2002-2008 Mark Pilgrim
# All rights reserved.
#
# This file is a part of feedparser.
#
# Redistribution and use in source and binary forms, with or without modification,
# are perm... |
pyKun/rally | refs/heads/master | rally/plugins/openstack/scenarios/tempest/__init__.py | 12133432 | |
shakamunyi/nova | refs/heads/master | nova/api/openstack/compute/plugins/v3/__init__.py | 12133432 | |
rotoudjimaye/django-jy | refs/heads/master | src/main/python/djangojy/db/backends/postgresql/__init__.py | 12133432 | |
sagarc/zookeeperGla | refs/heads/master | contrib/zkpython/src/test/connection_test.py | 26 | #!/usr/bin/python
#
# 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
# "Lic... |
ryfeus/lambda-packs | refs/heads/master | Tensorflow_LightGBM_Scipy_nightly/source/numpy/lib/recfunctions.py | 10 | """
Collection of utilities to manipulate structured arrays.
Most of these functions were initially implemented by John Hunter for
matplotlib. They have been rewritten and extended for convenience.
"""
from __future__ import division, absolute_import, print_function
import sys
import itertools
import numpy as np
im... |
plotly/python-api | refs/heads/master | packages/python/plotly/plotly/validators/scattergeo/marker/colorbar/tickformatstop/_value.py | 1 | import _plotly_utils.basevalidators
class ValueValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self,
plotly_name="value",
parent_name="scattergeo.marker.colorbar.tickformatstop",
**kwargs
):
super(ValueValidator, self).__init__(
plotly... |
MetSystem/PTVS | refs/heads/master | Python/Tests/TestData/Grammar/MixedWhitespace4.py | 18 | if True:
print('hello')
if True:
print 'goodbye' |
xiaxia47/Python-learning | refs/heads/master | spiders/downloadpic.py | 1 | import os
from urllib.request import urlretrieve
from urllib.request import urlopen
from bs4 import BeautifulSoup
def getAbsoluteUrl(baseUrl, source):
if source.startswith("http://www."):
url= "http://" + source[11:]
elif source.startswith("http://"):
url = source
elif source.star... |
LucHermitte/ITK | refs/heads/optimize-vectorimage-unsorted | Wrapping/Generators/Python/Tests/LaplacianImageFilter.py | 19 | #==========================================================================
#
# Copyright Insight Software Consortium
#
# 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... |
kenshay/ImageScript | refs/heads/master | Script_Runner/PYTHON/Lib/site-packages/pip/_internal/__init__.py | 8 | #!/usr/bin/env python
from __future__ import absolute_import
import locale
import logging
import os
import optparse
import warnings
import sys
# 2016-06-17 barry@debian.org: urllib3 1.14 added optional support for socks,
# but if invoked (i.e. imported), it will issue a warning to stderr if socks
# isn't available. ... |
StackStorm/st2 | refs/heads/master | st2common/st2common/runners/utils.py | 3 | # Copyright 2020 The StackStorm Authors.
# Copyright 2019 Extreme Networks, 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 ... |
felipebetancur/scipy | refs/heads/master | benchmarks/benchmarks/sparse_linalg_expm.py | 52 | """benchmarks for the scipy.sparse.linalg._expm_multiply module"""
from __future__ import division, print_function, absolute_import
import math
import numpy as np
try:
import scipy.linalg
from scipy.sparse.linalg import expm_multiply
except ImportError:
pass
from .common import Benchmark
def random_sp... |
DR08/mxnet | refs/heads/stable | example/neural-style/nstyle.py | 52 | # 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... |
levkar/odoo | refs/heads/10.0 | addons/l10n_br/migrations/9.0.1.0/post-migrate_tags_on_taxes.py | 832 | # -*- coding: utf-8 -*-
import odoo
def migrate(cr, version):
registry = odoo.registry(cr.dbname)
from odoo.addons.account.models.chart_template import migrate_tags_on_taxes
migrate_tags_on_taxes(cr, registry)
|
vmayoral/basic_reinforcement_learning | refs/heads/master | tutorial14/code/train_ppo1.py | 1 | import gym
from baselines.ppo1 import mlp_policy, pposgd_simple
import tensorflow as tf
import argparse
#parser
parser = argparse.ArgumentParser()
parser.add_argument('--environment', dest='environment', type=str, default='MountainCarContinuous-v0')
parser.add_argument('--num_timesteps', dest='num_timesteps', type=int... |
TruLtd/tru-reputation-token | refs/heads/master | docs/conf.py | 1 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Tru Reputation Token documentation build configuration file, created by
# sphinx-quickstart on Fri Nov 24 19:00:17 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present... |
AgenttiX/fys-1010 | refs/heads/master | specific_charge_of_electron/tools.py | 1 | # insert copyleft licence here
import numpy as np
from math import log10, floor
import math
from bokeh.models import Label
class iterating_colors:
"""
This class is made to mimic matlab-like color plotting behavior. Calling get_next() method
returns new color in list, without hazzle. By default colorset ... |
gmacchi93/serverInfoParaguay | refs/heads/master | apps/venv/lib/python2.7/site-packages/rest_framework/pagination.py | 8 | # coding: utf-8
"""
Pagination serializers determine the structure of the output that should
be used for paginated responses.
"""
from __future__ import unicode_literals
from base64 import b64encode, b64decode
from collections import namedtuple
from django.core.paginator import InvalidPage, Paginator as DjangoPaginator... |
rohitwaghchaure/erpnext_smart | refs/heads/develop | erpnext/accounts/doctype/fiscal_year/fiscal_year.py | 35 | # 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 frappe
from frappe import msgprint, _
from frappe.utils import getdate
from frappe.model.document import Document
class FiscalYear(Document)... |
Shuailong/Leetcode | refs/heads/master | solutions/summary-ranges.py | 1 | #!/usr/bin/env python
# encoding: utf-8
"""
summary-ranges.py
Created by Shuailong on 2016-03-08.
https://leetcode.com/problems/summary-ranges/.
"""
class Solution(object):
def summaryRanges(self, nums):
"""
:type nums: List[int]
:rtype: List[str]
"""
if len(nums) == 0:... |
TimJay/platformio | refs/heads/develop | platformio/commands/serialports.py | 3 | # Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details.
import json
import sys
import click
from serial.tools import miniterm
from platformio.util import get_serialports
@click.group(short_help="List or Monitor Serial ports")
def cli():
pass
@cli.command("list", short_help="List Serial port... |
ichuang/sympy | refs/heads/master | sympy/polys/domains/fractionfield.py | 1 | """Implementation of :class:`FractionField` class. """
from sympy.polys.domains.field import Field
from sympy.polys.domains.compositedomain import CompositeDomain
from sympy.polys.domains.characteristiczero import CharacteristicZero
from sympy.polys.polyclasses import DMF
from sympy.polys.polyerrors import Generators... |
bbozhev/flask-test | refs/heads/master | flask/lib/python2.7/site-packages/wtforms/form.py | 35 | 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... |
xbmc/xbmc-rbp | refs/heads/master | tools/Linux/FEH-ARM.py | 47 | import os
import sys
import re
AvailableOutputs = []
Output = None
try:
from qt import *
AvailableOutputs.append("--error-output=Qt")
except:
pass
try:
import pygtk
pygtk.require('2.0')
import gtk
AvailableOutputs.append("--error-output=GTK")
except:
pass
try:
import pygame
imp... |
zzicewind/nova | refs/heads/master | nova/virt/hyperv/imagecache.py | 42 | # Copyright 2013 Cloudbase Solutions Srl
# 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 r... |
mdanielwork/intellij-community | refs/heads/master | python/helpers/pycharm/pytest_teamcity.py | 35 | import os
import sys
helpers_dir = os.getenv("PYCHARM_HELPERS_DIR", sys.path[0])
if sys.path[0] != helpers_dir:
sys.path.insert(0, helpers_dir)
from tcmessages import TeamcityServiceMessages
from pycharm_run_utils import adjust_sys_path
adjust_sys_path(False)
# Directory where test script exist
CURRENT_DIR_NAME ... |
cvandeplas/plaso | refs/heads/master | plaso/parsers/winreg_plugins/run.py | 1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2013 The Plaso Project Authors.
# Please see the AUTHORS file for details on individual 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 L... |
QinerTech/QinerApps | refs/heads/master | openerp/addons/website_portal_sale/controllers/main.py | 17 | # -*- coding: utf-8 -*-
import datetime
from openerp import http
from openerp.http import request
from openerp.addons.website_portal.controllers.main import website_account
class website_account(website_account):
@http.route(['/my/home'], type='http', auth="user", website=True)
def account(self, **kw):
... |
amisrs/one-eighty | refs/heads/master | venv2/lib/python2.7/site-packages/setuptools/windows_support.py | 1015 | import platform
import ctypes
def windows_only(func):
if platform.system() != 'Windows':
return lambda *args, **kwargs: None
return func
@windows_only
def hide_file(path):
"""
Set the hidden attribute on a file or directory.
From http://stackoverflow.com/questions/19622133/
`path` ... |
Lujeni/ansible | refs/heads/devel | lib/ansible/modules/cloud/amazon/iam.py | 10 | #!/usr/bin/python
# 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',
'status': ['stableinterf... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.