repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
nistormihai/superdesk-core
refs/heads/master
superdesk/datalayer.py
3
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014 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 import super...
ifduyue/sentry
refs/heads/master
src/sentry/south_migrations/0260_populate_email_addresses.py
4
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import DataMigration from django.db import models class Migration(DataMigration): def forwards(self, orm): "Write your forwards methods here." for user in orm.User.objects.all(): ...
fangeugene/the-blue-alliance
refs/heads/master
controllers/notification_controller.py
4
from google.appengine.ext import ndb from base_controller import LoggedInHandler from consts.client_type import ClientType from models.account import Account from models.mobile_client import MobileClient from notifications.ping import PingNotification class UserNotificationBroadcast(LoggedInHandler): """ Al...
nparley/mylatitude
refs/heads/master
lib/apitools/base/py/extra_types_test.py
14
# # Copyright 2015 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 or agreed to in writing...
tonnrueter/pymca_devel
refs/heads/master
PyMca/XMCDWindow.py
1
#/*########################################################################## # Copyright (C) 2004-2013 European Synchrotron Radiation Facility # # This file is part of the PyMca X-ray Fluorescence Toolkit developed at # the ESRF by the Software group. # # This toolkit is free software; you can redistribute it and/or m...
anubhav929/eden
refs/heads/eden
modules/hs/analysis/polygon.py
25
""" Healthscapes Geolytics Module ...
CivicKnowledge/ambry
refs/heads/master
ambry/orm/remote.py
1
"""Sqalchemy table for storing information about remote libraries Copyright (c) 2015 Civic Knowledge. This file is licensed under the terms of the Revised BSD License, included in this distribution as LICENSE.txt """ from sqlalchemy import Column as SAColumn, Integer from sqlalchemy import Text, String, ForeignKey fr...
Datera/lio-utils
refs/heads/master
get-py-modules-path.py
1
#!/usr/bin/python from distutils.sysconfig import get_python_lib,re; str = get_python_lib() # Fix up get_python_lib() path for Python v2.6 on Ubuntu 9.10 and SLES 11 if re.search('python2.6', str): print str.replace('/usr','/usr/local') else: print str;
phalt/django
refs/heads/master
tests/model_inheritance/tests.py
12
from __future__ import unicode_literals from operator import attrgetter from django.core.exceptions import FieldError, ValidationError from django.db import connection, models from django.test import SimpleTestCase, TestCase from django.test.utils import CaptureQueriesContext, isolate_apps from django.utils import si...
lucafavatella/intellij-community
refs/heads/cli-wip
python/lib/Lib/marshal.py
110
"""Marshal module written in Python. This doesn't marshal code objects, but supports everything else. Performance or careful error checking is not an issue. """ import cStringIO from _marshal import Marshaller, Unmarshaller def dump(x, f, version=2): Marshaller(f, version).dump(x) # XXX - added just for debugg...
lattwood/phantomjs
refs/heads/master
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/checkout/checkout_mock.py
121
# Copyright (C) 2011 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
errx/django
refs/heads/master
tests/template_tests/test_parser.py
54
""" Testing some internals of the template processing. These are *not* examples to be copied in user code. """ from __future__ import unicode_literals from unittest import TestCase from django.template import (TokenParser, FilterExpression, Parser, Variable, Template, TemplateSyntaxError, Library) from django.tes...
kkmsc17/smes
refs/heads/master
backend/players/views.py
1
from django import forms from django.contrib import auth from django.shortcuts import reverse from django.views.generic.edit import CreateView UserModel = auth.get_user_model() class ChooseUsernameForm(forms.ModelForm): class Meta: fields = ('username',) model = UserModel def __init__(self, ...
mtasic85/routingtable
refs/heads/master
protocol_command.py
1
__all__ = ['ProtocolCommand'] class ProtocolCommand(object): # protocol version 1.0 DEFAULT_PROTOCOL_VERSION_MAJOR = 1 DEFAULT_PROTOCOL_VERSION_MINOR = 0 # protocol message types PROTOCOL_REQ = 0 PROTOCOL_RES = 1 def __init__(self, node, protocol_major_version, protocol_minor_version, pro...
GoogleDeveloperExperts/experts-app-backend
refs/heads/master
apiclient/schema.py
149
# Copyright (C) 2010 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 or agreed to in writ...
cernops/nova
refs/heads/master
nova/scheduler/chance.py
9
# Copyright (c) 2010 OpenStack Foundation # Copyright 2010 United States Government as represented by the # 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 complianc...
ym-bob/TensorFlowBook
refs/heads/master
rnn/chatbot/settings.py
2
# -*- coding: UTF-8 -*- from __future__ import absolute_import, division, print_function VOCAB_DICT_FILE = './data.snippet/vocab100000' SEQ2SEQ_MODEL_DIR = './data.snippet/' SEQ2SEQ_SIZE = 1000
bleib1dj/boto
refs/heads/develop
boto/ec2/autoscale/activity.py
152
# Copyright (c) 2009-2011 Reza Lotun http://reza.lotun.name/ # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, mod...
Sodki/ansible-modules-extras
refs/heads/devel
messaging/rabbitmq_user.py
65
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Chatham Financial <oss@chathamfinancial.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...
Ant-OS/android_packages_apps_OTAUpdates
refs/heads/master
jni/boost_1_57_0/tools/build/test/rebuilds.py
45
#!/usr/bin/python # Copyright 2005 Dave Abrahams # 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 def wait_for_bar(t): """ Wait to make the test system correctly recognize the 'bar' fi...
lyceel/engine
refs/heads/master
build/android/gyp/generate_v14_compatible_resources.py
29
#!/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. """Convert Android xml resources to API 14 compatible. There are two reasons that we cannot just use API 17 attributes, so we are ge...
adit-chandra/tensorflow
refs/heads/master
tensorflow/python/debug/cli/offline_analyzer.py
162
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
erdincay/youtube-dl
refs/heads/master
youtube_dl/extractor/nytimes.py
116
from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( float_or_none, int_or_none, parse_iso8601, ) class NYTimesBaseIE(InfoExtractor): def _extract_video_from_id(self, video_id): video_data = self._download_json( 'http://www.nytimes.com/sv...
nmayorov/scikit-learn
refs/heads/master
sklearn/svm/tests/test_svm.py
29
""" Testing for Support Vector Machine module (sklearn.svm) TODO: remove hard coded numerical results when possible """ import numpy as np import itertools from numpy.testing import assert_array_equal, assert_array_almost_equal from numpy.testing import assert_almost_equal from scipy import sparse from nose.tools im...
kneeks/is210-week-04-synthesizing
refs/heads/master
tests/test_task_01.py
24
#!/usr/bin/env python # -*- coding: utf-8 -*- """Tests Task 01.""" # Import Python libs import decimal import unittest import task_01 class Task01TestCase(unittest.TestCase): """ Test cases for Task 01. """ def test_fahrenheit_to_celsius(self): """ Tests that fahrenheit_to_celsius()...
romanchyla/adsgut2
refs/heads/master
adsgut_service/config.py
1
APP_SECRET_KEY = 'fake' VERSION = 'v0.1' # Arbitrary string identifying the service (will be returned in the headers) SQLALCHEMY_DATABASE_URI = 'sqlite:///' SQLALCHEMY_ECHO = False
timxx/gitc
refs/heads/master
qgitc/mainwindow.py
1
# -*- coding: utf-8 -*- from PySide2.QtGui import * from PySide2.QtCore import * from PySide2.QtWidgets import ( QActionGroup, QLineEdit, QMessageBox, QFileDialog, QDialog) from .ui_mainwindow import Ui_MainWindow from .gitview import GitView from .preferences import Preferences from...
alanjw/GreenOpenERP-Win-X86
refs/heads/7.0
python/Lib/site-packages/win32com/test/testAXScript.py
4
# Test AXScripting the best we can in an automated fashion... import win32api, os, sys import win32com.axscript import win32com.axscript.client import unittest import win32com.test.util verbose = "-v" in sys.argv class AXScript(win32com.test.util.TestCase): def setUp(self): file = win32api....
vamsirajendra/nupic
refs/heads/master
tests/integration/nupic/algorithms/monitor_mixin/temporal_memory_monitor_mixin_test.py
35
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2014, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions ...
vvw/gensim
refs/heads/develop
gensim/summarization/commons.py
67
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html from gensim.summarization.graph import Graph def build_graph(sequence): graph = Graph() for item in sequence: if not graph.has_node(item): graph.add_node(item) re...
szymex/xbmc-finnish-tv
refs/heads/master
plugin.video.yleareena/win32/Crypto/Hash/MD2.py
124
# -*- coding: utf-8 -*- # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication to the public domain is not available, # everyone is granted a worldwide, perpetual, royalty-free, # non-exclusive license to e...
balloob/home-assistant
refs/heads/dev
homeassistant/components/dyson/vacuum.py
6
"""Support for the Dyson 360 eye vacuum cleaner robot.""" import logging from libpurecool.const import Dyson360EyeMode, PowerMode from libpurecool.dyson_360_eye import Dyson360Eye from homeassistant.components.vacuum import ( SUPPORT_BATTERY, SUPPORT_FAN_SPEED, SUPPORT_PAUSE, SUPPORT_RETURN_HOME, ...
Soya93/Extract-Refactoring
refs/heads/master
python/testData/copyPaste/singleLine/IndentInIfInDef.after.py
83
def f(self): x = 1 if True: b = 2 x = 1
sarakha63/persomov
refs/heads/master
libs/subliminal/services/thesubdb.py
107
# -*- coding: utf-8 -*- # Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com> # # This file is part of subliminal. # # subliminal 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...
catapult-project/catapult-csm
refs/heads/master
third_party/google-endpoints/urllib3/exceptions.py
223
from __future__ import absolute_import from .packages.six.moves.http_client import ( IncompleteRead as httplib_IncompleteRead ) # Base Exceptions class HTTPError(Exception): "Base exception used by this module." pass class HTTPWarning(Warning): "Base warning used by this module." pass class Po...
Xykon/pycom-micropython-sigfox
refs/heads/master
tests/basics/bytes_large.py
115
b1 = b"long bytes long bytes long bytes long bytes long bytes long bytes long bytes long bytes long bytes long bytes long bytes long bytes long bytes long bytes long bytes long bytes long bytes long bytes long bytes long bytes long bytes long bytes long bytes long bytes long bytes long bytes long bytes long bytes long ...
wangxiangyu/horizon
refs/heads/stable/kilo
openstack_dashboard/dashboards/project/access_and_security/panel.py
47
# Copyright 2012 Nebula, Inc. # Copyright 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 # # Unle...
bks/veusz
refs/heads/master
veusz/helpers/__init__.py
9
# Copyright (C) 2008 Jeremy S. Sanders # Email: Jeremy Sanders <jeremy@jeremysanders.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; either version 2 of the License, or # ...
jzitelli/poolvr.py
refs/heads/c_poly_solvers
test/test_collisions.py
1
import os.path as path from cProfile import Profile from time import perf_counter import logging _logger = logging.getLogger(__name__) import numpy as np import pytest from utils import (plot_collision_velocities, plot_collision_angular_velocities, plot_collision_velocity_maps, plot_collision_angul...
ccomb/OpenUpgrade
refs/heads/master
addons/point_of_sale/controllers/main.py
25
# -*- coding: utf-8 -*- import logging import simplejson import os import openerp import time import random from openerp import http from openerp.http import request from openerp.addons.web.controllers.main import module_boot, login_redirect _logger = logging.getLogger(__name__) html_template = """<!DOCTYPE html> <h...
Moriadry/tensorflow
refs/heads/master
tensorflow/python/ops/linalg_grad.py
23
# 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...
jmesteve/openerp
refs/heads/master
openerp/addons_extra/account_invoice/report/account_print_invoice.py
2
# -*- 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...
google/google-ctf
refs/heads/master
third_party/edk2/AppPkg/Applications/Python/Python-2.7.2/Lib/test/crashers/gc_inspection.py
16
""" gc.get_referrers() can be used to see objects before they are fully built. Note that this is only an example. There are many ways to crash Python by using gc.get_referrers(), as well as many extension modules (even when they are using perfectly documented patterns to build objects). Identifying and removi...
ryfeus/lambda-packs
refs/heads/master
pytorch/source/PIL/WebPImagePlugin.py
2
from . import Image, ImageFile try: from . import _webp SUPPORTED = True except ImportError: SUPPORTED = False from io import BytesIO _VALID_WEBP_MODES = { "RGBX": True, "RGBA": True, "RGB": True, } _VALID_WEBP_LEGACY_MODES = { "RGB": True, "RGBA": True, } _VP8_MODES_BY_IDENT...
huanchenz/STX-h-store
refs/heads/master
src/benchmarks/edu/brown/benchmark/auctionmark/data/ebayCat.py
9
import urllib.request import re filename = 'ebayCat.txt' def getCategoryUrls(url): fp = urllib.request.urlopen(url) mybytes = fp.read() contents = mybytes.decode("utf8") fp.close() regex = re.compile("<td colspan=\"5\"><a href=\"(.*?)\"><i>(.*?)<\/i><\/a><\/td>",re.IGNORECASE)...
stackforge/kwapi
refs/heads/master
kwapi/security.py
1
# -*- coding: utf-8 -*- # # Author: François Rossigneux <francois.rossigneux@inria.fr> # # 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 # # Unles...
etkirsch/legends-of-erukar
refs/heads/master
erukar/content/enemies/templates/Undead.py
1
from erukar.system.engine import Enemy import erukar class Undead(Enemy): def __init__(self, name='', random=True): super().__init__(name, random) erukar.content.conditions.magical.Undead(self)
rhinoman/wikifeat
refs/heads/master
frontend/web_app/node_modules/grunt-sass/node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/generator/android.py
446
# Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # Notes: # # This generates makefiles suitable for inclusion into the Android build system # via an Android.mk file. It is based on make.py, the standard makefile ...
yamila-moreno/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...
CSSIP-AIR/PatentsProcessor
refs/heads/master
test/test_alchemy.py
6
import unittest import os import sys import shutil sys.path.append('../lib/') sys.path.append(os.path.dirname(os.path.realpath(__file__))) import alchemy from alchemy.schema import * class TestAlchemy(unittest.TestCase): def setUp(self): # this basically resets our testing database path = config....
google-research/falken
refs/heads/main
sdk/build/cmake_runner_test.py
1
# Copyright 2021 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
paweljasinski/ironpython3
refs/heads/master
Src/StdLib/Lib/test/test_codecmaps_cn.py
16
# # test_codecmaps_cn.py # Codec mapping tests for PRC encodings # from test import support from test import multibytecodec_support import unittest class TestGB2312Map(multibytecodec_support.TestBase_Mapping, unittest.TestCase): encoding = 'gb2312' mapfileurl = 'http://people.freebsd.org/...
battlemidget/juju-charm-ghost
refs/heads/master
reactive/ghost.py
1
import os.path as path import json from charms.reactive import ( when, when_not, is_state, set_state, ) from charmhelpers.core import hookenv, host from charms.layer import ghost, nginx from charms.layer.nodejs import npm, node_dist_dir config = hookenv.config() @when('nginx.available') @when_not(...
mylons/incubator-airflow
refs/heads/master
tests/contrib/operators/emr_terminate_job_flow_operator.py
56
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
marcelocure/django
refs/heads/master
django/contrib/gis/gdal/base.py
654
from ctypes import c_void_p from django.contrib.gis.gdal.error import GDALException from django.utils import six class GDALBase(object): """ Base object for GDAL objects that has a pointer access property that controls access to the underlying C pointer. """ # Initially the pointer is NULL. _...
ggtools/docker-tools
refs/heads/master
containerHelper.py
2
#!/usr/bin/env python3 __author__ = 'Christophe Labouisse' import argparse import re import os from docker import Client from docker.utils import kwargs_from_env def display_cpu(args): detail = c.inspect_container(args.container) if bool(detail["State"]["Running"]): container_id = detail['Id'] ...
sibsibsib/pressureNET-server
refs/heads/master
readings/migrations/0004_auto__del_field_reading_text__add_field_reading_user_id__del_unique_re.py
2
# -*- 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): # Removing unique constraint on 'Reading', fields ['latitude', 'text', 'daterecorded', 'longitude'] db.delet...
HalcyonChimera/osf.io
refs/heads/develop
addons/wiki/migrations/0007_nodewikipage_former_guid.py
17
# -*- coding: utf-8 -*- # Generated by Django 1.11.9 on 2018-02-22 20:15 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('addons_wiki', '0006_wikipage_wikiversion'), ] operations = [ migrations.Add...
pasiegel/SickGear
refs/heads/master
lib/lockfile/sqlitelockfile.py
487
from __future__ import absolute_import, division import time import os try: unicode except NameError: unicode = str from . import LockBase, NotLocked, NotMyLock, LockTimeout, AlreadyLocked class SQLiteLockFile(LockBase): "Demonstrate SQL-based locking." testdb = None def __init__(self, path, t...
geomcmaster/opacclient
refs/heads/master
tools/urlbisect.py
8
""" Takes an URL that works and an URL that doesn't work and finds out the difference. The URLs must have the same host/path, only the queries can differ. An URL is seen as working, if SEARCHSTR is contained in the response. """ URL_BAD = 'http://primo.ub.uni-due.de/primo_library/libweb/action/search.do?mode=Advanced&t...
SalemAmeen/BanditsBook
refs/heads/master
python/algorithms/ucb/test_ucb1.py
6
execfile("core.py") import random random.seed(1) means = [0.1, 0.1, 0.1, 0.1, 0.9] n_arms = len(means) random.shuffle(means) arms = map(lambda (mu): BernoulliArm(mu), means) print("Best arm is " + str(ind_max(means))) algo = UCB1([], []) algo.initialize(n_arms) results = test_algorithm(algo, arms, 5000, 250) f = op...
orekyuu/intellij-community
refs/heads/master
python/testData/completion/dictKeyPrefix2.py
166
s = { 'a': 'b', 'kkkappa': 'd', 'lambda': 'foo' } s['k]kap''<caret>']
bitcrystal/volatility
refs/heads/master
volatility/plugins/strings.py
44
# Volatility # Copyright (C) 2007-2013 Volatility Foundation # Copyright (C) 2009 Timothy D. Morgan (strings optimization) # # This file is part of Volatility. # # Volatility 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 Softwar...
grepme/CMPUT410Lab01
refs/heads/master
virt_env/virt1/lib/python2.7/site-packages/FormEncode-1.3.0a1-py2.7.egg/formencode/tests/test_subclassing_old.py
2
# -*- coding: utf-8 -*- import unittest import warnings from formencode.api import is_validator, FancyValidator, Invalid from formencode.compound import CompoundValidator, All from formencode.validators import Int with warnings.catch_warnings(record=True) as custom_warnings: warnings.simplefilter('default') ...
gavin-feng/odoo
refs/heads/8.0
addons/account/wizard/account_report_account_balance.py
378
# -*- 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...
berkmancenter/mediacloud
refs/heads/master
apps/common/src/python/mediawords/util/network.py
1
import socket import time from typing import Union from mediawords.util.log import create_logger from mediawords.util.perl import decode_object_from_bytes_if_needed log = create_logger(__name__) def tcp_port_is_open(port: int, hostname: str = 'localhost') -> bool: """Test if TCP port is open.""" hostname =...
minhphung171093/GreenERP
refs/heads/master
openerp/addons/sale_expense/__openerp__.py
23
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. { 'name': 'Sales Expense', 'version': '1.0', 'category': 'Hidden', 'summary': 'Quotation, Sale Orders, Delivery & Invoicing Control', 'description': """ Module used for demo data =====================...
keedio/hue
refs/heads/master
desktop/libs/indexer/src/indexer/settings.py
30
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
jnayak1/osf.io
refs/heads/develop
scripts/populate_conferences.py
11
#!/usr/bin/env python # encoding: utf-8 import os import sys from modularodm import Q from modularodm.exceptions import ModularOdmException from framework.auth.core import User from website import settings from website.app import init_app from website.conferences.model import Conference from datetime import datetim...
mornsun/javascratch
refs/heads/master
src/topcoder.py/3SumClosest.py
2
''' Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input would have exactly one solution. For example, given array S = {-1 2 1 -4}, and target = 1. The sum that is closest to the ta...
HashNuke/stripe-python
refs/heads/master
stripe/test/test_integration.py
6
# -*- coding: utf-8 -*- import os import sys import unittest2 import stripe from mock import patch from stripe.test.helper import (StripeTestCase, NOW, DUMMY_CHARGE, DUMMY_CARD) class FunctionalTests(StripeTestCase): request_client = stripe.http_client.Urllib2Client def setUp(self): super(Functional...
arnif/CouchPotatoServer
refs/heads/master
libs/guessit/transfo/guess_properties.py
150
#!/usr/bin/env python # -*- coding: utf-8 -*- # # GuessIt - A library for guessing information from filenames # Copyright (c) 2012 Nicolas Wack <wackou@gmail.com> # # GuessIt is free software; you can redistribute it and/or modify it under # the terms of the Lesser GNU General Public License as published by # the Free ...
tanghaibao/goatools
refs/heads/main
goatools/godag/reldepth.py
1
"""Manages a user-specified subset of a GO DAG.""" from __future__ import print_function __copyright__ = "Copyright (C) 2016-present, DV Klopfenstein, H Tang, All rights reserved." __author__ = "DV Klopfenstein" from goatools.godag.consts import RELATIONSHIP_SET def get_go2reldepth(goterms, relationship_set): ...
joxer/Raspi-IR-Camera
refs/heads/master
lib/config.py
2
import ConfigParser class Config: def __init__(self,filename): self.config = ConfigParser.ConfigParser() self.config.read(filename) self.dictionary = {} for section in self.config.sections(): options = self.config.options(section) for option in options: ...
kanarelo/reportlab
refs/heads/master
src/reportlab/platypus/paraparser.py
4
#Copyright ReportLab Europe Ltd. 2000-2012 #see license.txt for license details #history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/platypus/paraparser.py __version__=''' $Id$ ''' __doc__='''The parser used to process markup within paragraphs''' import string import re import sys im...
winndows/cinder
refs/heads/master
cinder/volume/drivers/dell/dell_storagecenter_common.py
14
# Copyright 2015 Dell 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 agree...
sellnat77/Lectures
refs/heads/master
Python/strings.py
20
# strings can be enclosed in single, double, or triple quotes a = "Hello world" b = 'CECS 424 is awesome' c = """Triple-quoted strings can go more than one line""" # can index strings with [] d = a[0] # d = 'H' # the slicing operator [i:j] can extract substrings from index # i <= k < j e = a[2:5] # e == "llo" f = b[...
FlorianLudwig/code-owl
refs/heads/master
codeowl/ast/nodes.py
1
def to_unicode(children): if not children: return '' child = children[0] line_no = child.line_no line_pos = child.line_pos c = [] for child in children: if line_no < child.line_no: c.append('\n' * (child.line_no - line_no)) line_no = child.line_no ...
remik/django-page-cms
refs/heads/master
example/urls.py
1
from django.conf import settings from django.conf.urls import include, url from django.conf.urls.static import static from django.contrib import admin admin.autodiscover() urlpatterns = [ url(r'^i18n/', include('django.conf.urls.i18n')), # url(r'^grappelli/', include('grappelli.urls')), # grappelli URLS ...
xmbcrios/xmbcrios.repository
refs/heads/master
plugin.video.SportsDevil/lib/utils/github/Permissions.py
7
# -*- coding: utf-8 -*- # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net # This file is part of PyGithub. http://vincent-jacques.net/PyGithub # PyGithub 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 Softwar...
Krossom/python-for-android
refs/heads/master
python-build/python-libs/gdata/build/lib/gdata/tlslite/utils/ASN1Parser.py
281
"""Class for parsing ASN.1""" from compat import * from codec import * #Takes a byte array which has a DER TLV field at its head class ASN1Parser: def __init__(self, bytes): p = Parser(bytes) p.get(1) #skip Type #Get Length self.length = self._getASN1Length(p) #Get Value ...
trilliumtransit/oba_rvtd_deployer
refs/heads/master
oba_rvtd_deployer/aws.py
1
try: input = raw_input except NameError: pass import os import sys import time import boto.ec2 from fabric.api import env, run, sudo, cd, put from fabric.context_managers import settings from fabric.contrib.files import exists from fabric.exceptions import NetworkError from oba_rvtd_deployer import REPORTS_...
hottwaj/django
refs/heads/master
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...
jianghaolu/AutoRest
refs/heads/master
src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDateTime/auto_rest_date_time_test_service/version.py
1003
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
sandias42/mlware
refs/heads/master
models/RF_tfifd.py
1
from sklearn.ensemble import RandomForestClassifier from sklearn.linear_model import SGDClassifier #from sklearn.model_selection import cross_val_score from scipy.io import mmread import numpy as np malware_classes = ["Agent", "AutoRun", "FraudLoad", "FraudPack", "Hupigon", "Krap", "Lipler", "Magania", "Non...
etherkit/OpenBeacon2
refs/heads/master
client/linux-x86/venv/lib/python3.8/site-packages/PyInstaller/hooks/hook-gi.repository.PangoCairo.py
4
#----------------------------------------------------------------------------- # Copyright (c) 2005-2020, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License (version 2 # or later) with exception for distributing the bootloader. # # The full license is in the file COPYING.txt...
molmod/molmod
refs/heads/master
doc/conf.py
1
# -*- coding: utf-8 -*- # MolMod is a collection of molecular modelling tools for python. # Copyright (C) 2007 - 2019 Toon Verstraelen <Toon.Verstraelen@UGent.be>, Center # for Molecular Modeling (CMM), Ghent University, Ghent, Belgium; all rights # reserved unless otherwise stated. # # This file is part of MolMod. # #...
ArcherSys/ArcherSys
refs/heads/master
archersys/Lib/site-packages/pip/_vendor/requests/packages/chardet/mbcsgroupprober.py
2768
######################## 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...
mycFelix/heron
refs/heads/master
heronpy/api/cloudpickle.py
5
""" This class is defined to override standard pickle functionality The goals of it follow: -Serialize lambdas and nested functions to compiled byte code -Deal with main module correctly -Deal with other non-serializable objects It does not include an unpickler, as standard python unpickling suffices. This module was e...
shubhdev/edxOnBaadal
refs/heads/master
lms/djangoapps/shoppingcart/processors/tests/test_CyberSource2.py
164
# -*- coding: utf-8 -*- """ Tests for the newer CyberSource API implementation. """ from mock import patch from django.test import TestCase from django.conf import settings import ddt from student.tests.factories import UserFactory from shoppingcart.models import Order, OrderItem from shoppingcart.processors.CyberSour...
JetBrains/intellij-community
refs/heads/master
python/helpers/pydev/_pydevd_bundle/pydevd_plugin_utils.py
13
import types from _pydev_bundle import pydev_log from _pydevd_bundle import pydevd_trace_api from _pydevd_bundle.pydevd_constants import IS_PYCHARM try: from pydevd_plugins import django_debug except: django_debug = None pydev_log.debug('Unable to load django_debug plugin') try: from pydevd_plugins i...
wanggang3333/scikit-learn
refs/heads/master
sklearn/naive_bayes.py
128
# -*- coding: utf-8 -*- """ The :mod:`sklearn.naive_bayes` module implements Naive Bayes algorithms. These are supervised learning methods based on applying Bayes' theorem with strong (naive) feature independence assumptions. """ # Author: Vincent Michel <vincent.michel@inria.fr> # Minor fixes by Fabian Pedre...
wenqiuhua/mkdocs
refs/heads/master
setup.py
6
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function from setuptools import setup import re import os import sys name = 'mkdocs' package = 'mkdocs' description = 'Project documentation with Markdown.' url = 'http://www.mkdocs.org' author = 'Tom Christie' author_email = 'tom@tomchristie...
dmitry-sobolev/ansible
refs/heads/devel
lib/ansible/modules/cloud/cloudstack/cs_domain.py
39
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2015, René Moser <mail@renemoser.net> # # 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 Lice...
campagnola/acq4
refs/heads/develop
acq4/util/ContourPlotter/ContourPlotterTemplate.py
3
# -*- coding: utf-8 -*- from __future__ import print_function # Form implementation generated from reading ui file './acq4/util/ContourPlotter/ContourPlotterTemplate.ui' # # Created: Tue Dec 24 01:49:16 2013 # by: PyQt4 UI code generator 4.10 # # WARNING! All changes made in this file will be lost! from PyQt4 im...
StephenWeber/ansible
refs/heads/devel
lib/ansible/modules/cloud/openstack/os_server_volume.py
15
#!/usr/bin/python #coding: utf-8 -*- # Copyright (c) 2014 Hewlett-Packard Development Company, L.P. # # This module 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 yo...
cooldudezach/android_kernel_zte_nex
refs/heads/master
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...
chuukai/ponyo-kernel-nAa
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...
wfxiang08/django190
refs/heads/master
tests/i18n/patterns/urls/wrong.py
384
from django.conf.urls import include, url from django.conf.urls.i18n import i18n_patterns from django.utils.translation import ugettext_lazy as _ urlpatterns = i18n_patterns( url(_(r'^account/'), include('i18n.patterns.urls.wrong_namespace', namespace='account')), )
signed/intellij-community
refs/heads/master
python/testData/completion/protectedClassNames.py
39
class A: def _foo(self): pass A()._f<caret>