repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
cchurch/ansible
refs/heads/devel
lib/ansible/modules/cloud/azure/azure_rm_devtestlabschedule_facts.py
7
#!/usr/bin/python # # Copyright (c) 2019 Zim Kalinowski, (@zikalino) # # 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', ...
casebeer/factual
refs/heads/master
factual/v3/filter_helpers.py
1
from factual.common.shared_filter_helpers import *
AutonomyLab/deep_intent
refs/heads/master
code/autoencoder_model/scripts/track.py
1
import numpy as np import cv2 file = '../gifs/vid_3.gif' cap = cv2.VideoCapture(file) # params for ShiTomasi corner detection feature_params = dict( maxCorners = 100, qualityLevel = 0.3, minDistance = 7, blockSize = 7 ) # Parameters for lucas kanade...
harshita-gupta/Harvard-FRSEM-Catalog-2016-17
refs/heads/master
flask/lib/python2.7/site-packages/jinja2/filters.py
329
# -*- coding: utf-8 -*- """ jinja2.filters ~~~~~~~~~~~~~~ Bundled jinja filters. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import re import math from random import choice from operator import itemgetter from itertools import groupby from jinja2.utils...
dabelenda/amm
refs/heads/master
src/auth/ldap.py
2
"""(c) All rights reserved. ECOLE POLYTECHNIQUE FEDERALE DE LAUSANNE, Switzerland, VPSI, 2017""" import re import ldap3 from config.settings import base class Authenticator: """ Class to authenticate users using LDAP(S) """ def __init__(self): self.ldap_server = base.get_config('LDAP_SERVER') ...
zdary/intellij-community
refs/heads/master
python/testData/intentions/PyConvertTypeCommentToVariableAnnotationIntentionTest/assignmentWithComplexUnpacking_after.py
31
y: Optional[Union[None, Any]] x: Callable[..., int] z: Any [y, (x, (z))] = undefined()
ChronoMonochrome/android_kernel_lenovo_msm8916
refs/heads/master
tools/perf/scripts/python/netdev-times.py
11271
# Display a process of packets and processed time. # It helps us to investigate networking or network device. # # options # tx: show only tx chart # rx: show only rx chart # dev=: show only thing related to specified device # debug: work with debug mode. It shows buffer status. import os import sys sys.path.append(os...
johnraz/django-rest-framework
refs/heads/master
rest_framework/exceptions.py
8
""" Handled exceptions raised by REST framework. In addition Django's built in 403 and 404 exceptions are handled. (`django.http.Http404` and `django.core.exceptions.PermissionDenied`) """ from __future__ import unicode_literals import math from django.utils import six from django.utils.encoding import force_text fr...
capchu/TextRPGOnline
refs/heads/master
rpgonline/env/lib/python2.7/os.py
4
/usr/lib/python2.7/os.py
jumpstarter-io/cinder
refs/heads/master
cinder/api/contrib/volume_mig_status_attribute.py
14
# Copyright 2013 IBM Corp. # # 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...
djangorussia/django-1.3-branch
refs/heads/master
django/conf/locale/el/formats.py
433
# -*- 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 = 'd E Y' TIME_FORMAT = 'g:i:s A' # DATETIME_FORMAT = YEAR_MONTH_FORMAT = '...
flyingk/InertialNav
refs/heads/master
code/plot_mag.py
6
#!/bin/python import matplotlib as mpl import matplotlib.pyplot as plt import matplotlib.cbook as cbook import numpy as np import math data = np.genfromtxt('MagFuse.txt', delimiter=' ', skip_header=1, skip_footer=1, names=['time', 'IMX', 'VMX', 'IMY', 'VMY', 'IMZ', 'VMZ']) fig = plt.figure() ax1 = fig.add_s...
calfonso/ansible
refs/heads/devel
lib/ansible/modules/cloud/cloudstack/cs_network_offering.py
38
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2017, David Passante (@dpassante) # Copyright (c) 2017, René Moser <mail@renemoser.net> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': [...
cdsteinkuehler/MachineKit
refs/heads/MachineKit-ubc
share/gscreen/skins/gaxis/gaxis_handler.py
7
import hal # This is a handler file for using Gscreen's infrastructure # to load a completely custom glade screen # The only things that really matters is that it's saved as a GTK builder project, # the toplevel window is caller window1 (The default name) and you connect a destroy # window signal else you can't close d...
valentin-krasontovitsch/ansible
refs/heads/devel
lib/ansible/plugins/doc_fragments/dellos10.py
8
# -*- coding: utf-8 -*- # Copyright: (c) 2015, Peter Sprygada <psprygada@ansible.com> # Copyright: (c) 2016, Dell Inc. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) class ModuleDocFragment(object): # Standard files documentation fragment DOCUMENTATION = """ opt...
dosiecki/NewsBlur
refs/heads/master
vendor/feedvalidator/demo/src/rdflib/syntax/parsers/__init__.py
19
__all__ = ["RDFXMLParser", "NTParser"]
harmslab/epistasis
refs/heads/master
epistasis/models/linear/lasso.py
2
import numpy as np from sklearn.linear_model import Lasso from ..base import BaseModel, use_sklearn from ..utils import arghandler # Suppress an annoying error from scikit-learn import warnings warnings.filterwarnings(action="ignore", module="scipy", message="^internal gelsd") @use_sklearn(L...
idncom/odoo
refs/heads/8.0
addons/pos_discount/__init__.py
315
# -*- 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...
xfournet/intellij-community
refs/heads/master
python/testData/inspections/PyArgumentListInspection/decoratedChangedParameters.py
83
def fill(f): return lambda: f('test') @fill def test(x): return x test()
peterfpeterson/mantid
refs/heads/master
Framework/PythonInterface/test/python/plugins/algorithms/WorkflowAlgorithms/ReflectometryILLPolarizationCorTest.py
3
# -*- coding: utf-8 -*-# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source, # Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS # SPDX - License - Ident...
spaivaras/gr-osmosdr-fork-sdrplay
refs/heads/master
docs/doxygen/doxyxml/doxyindex.py
223
# # Copyright 2010 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. # #...
1st/django
refs/heads/master
django/contrib/gis/admin/widgets.py
449
import logging from django.contrib.gis.gdal import GDALException from django.contrib.gis.geos import GEOSException, GEOSGeometry from django.forms.widgets import Textarea from django.template import loader from django.utils import six, translation # Creating a template context that contains Django settings # values n...
dracos/django
refs/heads/master
django/contrib/admin/migrations/0001_initial.py
95
import django.contrib.admin.models from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('contenttypes', '__first__'), ] operations = [ migratio...
zachhuff386/tunldb
refs/heads/master
tunldb.py
1
import Queue import time import collections import threading import thread import uuid import copy import itertools import json import os TRANSACTION_METHODS = { 'set', 'increment', 'decrement', 'remove', 'rename', 'expire', 'set_add', 'set_remove', 'set_pop', 'list_lpush', ...
shaobozi/googletest
refs/heads/master
test/gtest_output_test.py
496
#!/usr/bin/env python # # Copyright 2008, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
youdonghai/intellij-community
refs/heads/master
python/helpers/py2only/docutils/languages/en.py
246
# $Id: en.py 4564 2006-05-21 20:44:42Z wiemann $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. # New language mappings are welcome. Before doing a new translation, please # read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be # translated...
huntxu/neutron
refs/heads/master
neutron/manager.py
2
# Copyright 2011 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 by a...
KhronosGroup/COLLADA-CTS
refs/heads/master
StandardDataSets/collada/library_visual_scenes/visual_scene/node/transform_stack/node_trs_stack/node_trs_stack.py
4
# Copyright (c) 2012 The Khronos Group Inc. # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and /or associated documentation files (the "Materials "), to deal in the Materials without restriction, including without limitation the rights to use, copy, modify, merge, publ...
drnextgis/QGIS
refs/heads/master
tests/src/python/test_versioncompare.py
74
# -*- coding: utf-8 -*- ''' test_versioncompare.py -------------------------------------- Date : September 2016 Copyright : (C) 2016 Alexander Bruy email : alexander dot bruy at gmail dot com *******************...
zahanm/foodpedia
refs/heads/master
djangoappengine/tests/not_return_sets.py
107
from .testmodels import FieldsWithOptionsModel, OrderedModel, SelfReferenceModel import datetime from django.test import TestCase from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned class NonReturnSetsTest(TestCase): floats = [5.3, 2.6, 9.1, 1.58, 2.4] emails = ['app-engine@scholard...
legco-watch/legco-watch
refs/heads/master
app/common/models.py
2
from django.db import models class ErrorReportManager(models.Manager): def open_errors(self): return self.filter(resolved=False) class ErrorReport(models.Model): """ Reports of inaccuracies in the data """ # Timestamp of the when the report was created reported = models.DateTimeField...
qskycolor/viewfinder
refs/heads/master
backend/op/op_manager.py
13
# Copyright 2012 Viewfinder Inc. All Rights Reserved. """Viewfinder operation manager. The operation manager tracks and executes operations submitted by user devices. The key goals of the operation manager are: - Provide restart functionality for incomplete operations - Serialize operations coming from a single d...
cloakedcode/CouchPotatoServer
refs/heads/master
libs/sqlalchemy/connectors/zxJDBC.py
17
# connectors/zxJDBC.py # Copyright (C) 2005-2012 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 import sys from sqlalchemy.connectors import Connector class ZxJDBCConnector(Con...
webmasterraj/FogOrNot
refs/heads/master
flask/lib/python2.7/site-packages/numpy/core/tests/test_unicode.py
92
from __future__ import division, absolute_import, print_function import sys import numpy as np from numpy.compat import asbytes, unicode, sixu from numpy.testing import TestCase, run_module_suite, assert_equal # Guess the UCS length for this python interpreter if sys.version_info[:2] >= (3, 3): # Python 3.3 uses...
anaviltripathi/pgmpy
refs/heads/dev
pgmpy/models/ClusterGraph.py
1
#!/usr/bin/env python3 from collections import defaultdict import numpy as np from pgmpy.base import UndirectedGraph from pgmpy.factors import factor_product from pgmpy.extern.six.moves import filter, range, zip class ClusterGraph(UndirectedGraph): r""" Base class for representing Cluster Graph. Clust...
sixohsix/twitter
refs/heads/master
twitter/ircbot.py
19
""" twitterbot A twitter IRC bot. Twitterbot connected to an IRC server and idles in a channel, polling a twitter account and broadcasting all updates to friends. USAGE twitterbot [config_file] CONFIG_FILE The config file is an ini-style file that must contain the following: [irc] server: <irc_server> p...
kishoredbn/barrelfish
refs/heads/master
tools/harness/checkout.py
10
########################################################################## # Copyright (c) 2009, ETH Zurich. # All rights reserved. # # This file is distributed under the terms in the attached LICENSE file. # If you do not find this file, copies can be found by writing to: # ETH Zurich D-INFK, Haldeneggsteig 4, CH-8092...
danylaksono/inasafe
refs/heads/master
realtime/sftp_client.py
5
""" InaSAFE Disaster risk assessment tool developed by AusAid and World Bank - **Ftp Client for Retrieving ftp data.** Contact : ole.moller.nielsen@gmail.com .. note:: 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 th...
mrfuxi/django
refs/heads/master
tests/project_template/test_settings.py
274
import unittest from django.test import TestCase from django.utils import six @unittest.skipIf(six.PY2, 'Python 2 cannot import the project template because ' 'django/conf/project_template doesn\'t have an __init__.py file.') class TestStartProjectSettings(TestCase): def test_middleware_classes_headers(...
flx2015/ns-3-dev-git
refs/heads/master
src/lte/bindings/modulegen__gcc_ILP32.py
14
null
MattDevo/edk2
refs/heads/master
AppPkg/Applications/Python/Python-2.7.2/Lib/test/tf_inherit_check.py
14
# Helper script for test_tempfile.py. argv[2] is the number of a file # descriptor which should _not_ be open. Check this by attempting to # write to it -- if we succeed, something is wrong. import sys import os verbose = (sys.argv[1] == 'v') try: fd = int(sys.argv[2]) try: os.write(fd,...
lulandco/SickRage
refs/heads/develop
lib/babelfish/converters/name.py
88
# -*- coding: utf-8 -*- # # Copyright (c) 2013 the BabelFish authors. All rights reserved. # Use of this source code is governed by the 3-clause BSD license # that can be found in the LICENSE file. # from __future__ import unicode_literals from . import LanguageEquivalenceConverter from ..language import LANGUAGE_MATRI...
szibis/Diamond
refs/heads/master
src/collectors/ksm/ksm.py
69
# coding=utf-8 """ This class collects 'Kernel Samepage Merging' statistics. KSM is a memory de-duplication feature of the Linux Kernel (2.6.32+). It can be enabled, if compiled into your kernel, by echoing 1 to /sys/kernel/mm/ksm/run. You can find more information about KSM at [http://www.linux-kvm.org/page/KSM](htt...
MFoster/breeze
refs/heads/master
django/contrib/sessions/tests.py
28
from datetime import timedelta import os import shutil import string import tempfile import warnings from django.conf import settings from django.contrib.sessions.backends.db import SessionStore as DatabaseSession from django.contrib.sessions.backends.cache import SessionStore as CacheSession from django.contrib.sessi...
Emilgardis/falloutsnip
refs/heads/develop
Vendor/IronPython/Lib/sre_constants.py
349
# # Secret Labs' Regular Expression Engine # # various symbols used by the regular expression engine. # run this script to update the _sre include files! # # Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved. # # See the sre.py file for information on usage and redistribution. # """Internal support modul...
Sutil/netanimations
refs/heads/master
node_modules/node-gyp/gyp/PRESUBMIT.py
1369
# 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. """Top-level presubmit script for GYP. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for more details about the presubmit API built...
saydulk/horizon
refs/heads/master
openstack_dashboard/test/integration_tests/tests/test_dashboard_help_redirection.py
49
# 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...
transifex/transifex-client
refs/heads/master
tests/test_processors.py
5
# -*- coding: utf-8 -*- """ Unit tests for processor functions. """ import unittest from txclib.processors import hostname_tld_migration, hostname_ssl_migration class TestHostname(unittest.TestCase): """Test for hostname processors.""" def test_tld_migration_needed(self): """ Test the tld ...
lancezlin/ml_template_py
refs/heads/master
lib/python2.7/site-packages/IPython/core/magic.py
8
# encoding: utf-8 """Magic functions for InteractiveShell. """ from __future__ import print_function #----------------------------------------------------------------------------- # Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and # Copyright (C) 2001 Fernando Perez <fperez@colorado.edu> # Copyright (C) 2008...
sbalde/edxplatform
refs/heads/master
common/lib/xmodule/xmodule/modulestore/mongo/base.py
11
""" Modulestore backed by Mongodb. Stores individual XModules as single documents with the following structure: { '_id': <location.as_dict>, 'metadata': <dict containing all Scope.settings fields> 'definition': <dict containing all Scope.content fields> 'definition.children': <list of all child locati...
penelopy/luigi
refs/heads/master
test/contrib/bigquery_test.py
7
# -*- coding: utf-8 -*- # # Copyright 2015 Twitter 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 ...
bop/hybrid
refs/heads/master
lib/python2.6/site-packages/django/contrib/formtools/tests/wizard/namedwizardtests/tests.py
90
from __future__ import unicode_literals from django.core.urlresolvers import reverse from django.http import QueryDict from django.test import TestCase from django.contrib.auth.models import User from django.contrib.auth.tests.utils import skipIfCustomUser from django.contrib.formtools.wizard.views import (NamedUrlS...
huran2014/huran.github.io
refs/heads/master
wot_gateway/gateway/bin/gateway/register.py
1
#-*-coding:utf-8-*- import os import sys import socket import json import select import threading import logging import logging.handlers import shutil from gateway import * def dev_write_to_cfg(mac,dev): f=open("./cfg/mac_dev_map.cfg",'a') f.write(mac+"\t"+dev) f.write('\n') f.close() def mac_resID_resPlat_write_...
swyytch/supernova
refs/heads/master
setup.py
1
#!/usr/bin/python # # Copyright 2014 Major Hayden # # 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 applicabl...
DarthMaulware/EquationGroupLeaks
refs/heads/master
Leak #5 - Lost In Translation/windows/Resources/Dsz/PyScripts/DataHandlers/Mcl_Cmd_Delete_DataHandler.py
1
# uncompyle6 version 2.9.10 # Python bytecode 2.7 (62211) # Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10) # [GCC 6.2.0 20161005] # Embedded file name: Mcl_Cmd_Delete_DataHandler.py def DataHandlerMain(namespace, InputFilename, OutputFilename): import mcl.imports import mcl.data.Input i...
protatremy/buildbot
refs/heads/master
master/buildbot/test/unit/test_data_connector.py
10
# This file is part of Buildbot. Buildbot 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. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
jhawkesworth/ansible
refs/heads/devel
lib/ansible/plugins/doc_fragments/digital_ocean.py
44
# -*- coding: utf-8 -*- # Copyright: (c) 2018, Ansible Project # Copyright: (c) 2018, Abhijeet Kasurde (akasurde@redhat.com) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) class ModuleDocFragment(object): # Parameters for DigitalOcean modules DOCUMENTATION = r'''...
LeXuZZ/localway_tests
refs/heads/master
wtframework/wtf/utils/tests/__init__.py
5
########################################################################## #This file is part of WTFramework. # # WTFramework 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 L...
samdoran/ansible
refs/heads/devel
lib/ansible/modules/packaging/os/portage.py
71
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, William L Thomson Jr # (c) 2013, Yap Sok Ann # Written by Yap Sok Ann <sokann@gmail.com> # Modified by William L. Thomson Jr. <wlt@o-sinc.com> # Based on apt module written by Matthew Williams <matthew@flowroute.com> # # This module is free software: you can redist...
lancezlin/ml_template_py
refs/heads/master
lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/contrib/appengine.py
360
from __future__ import absolute_import import logging import os import warnings from ..exceptions import ( HTTPError, HTTPWarning, MaxRetryError, ProtocolError, TimeoutError, SSLError ) from ..packages.six import BytesIO from ..request import RequestMethods from ..response import HTTPResponse ...
dasmithii/Stone
refs/heads/master
setup.py
1
import os from setuptools import setup def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( name = "stone", version = "0.0.1", author = "Adam Smith", author_email = "dsmith2@wpi.edu", description = ("anonymous publishing via Tor onto the Blockchain"), ...
atulc007/sublime-github
refs/heads/master
lib/requests/api.py
637
# -*- coding: utf-8 -*- """ requests.api ~~~~~~~~~~~~ This module implements the Requests API. :copyright: (c) 2012 by Kenneth Reitz. :license: Apache2, see LICENSE for more details. """ from . import sessions def request(method, url, **kwargs): """Constructs and sends a :class:`Request <Request>`. Retur...
peterm-itr/edx-platform
refs/heads/master
common/djangoapps/user_api/tests/test_constants.py
32
"""Constants used in the test suite. """ SORTED_COUNTRIES = [ (u'AF', u'Afghanistan'), (u'AL', u'Albania'), (u'DZ', u'Algeria'), (u'AS', u'American Samoa'), (u'AD', u'Andorra'), (u'AO', u'Angola'), (u'AI', u'Anguilla'), (u'AQ', u'Antarctica'), (u'AG', u'Antigua and Barbuda'), (u...
eric8810/openwrt
refs/heads/master
tools/b43-tools/files/b43-fwsquash.py
497
#!/usr/bin/env python # # b43 firmware file squasher # Removes unnecessary firmware files # # Copyright (c) 2009 Michael Buesch <mb@bu3sch.de> # # Licensed under the GNU/GPL version 2 or (at your option) any later version. # import sys import os def usage(): print("Usage: %s PHYTYPES COREREVS /path/to/extracted/firm...
kenshay/ImageScript
refs/heads/master
ProgramData/SystemFiles/Python/Lib/json/tests/test_pass1.py
108
from json.tests import PyTest, CTest # from http://json.org/JSON_checker/test/pass1.json JSON = r''' [ "JSON Test Pattern pass1", {"object with 1 member":["array with 1 element"]}, {}, [], -42, true, false, null, { "integer": 1234567890, "real": -9876.543210, ...
darkChozo/FAbot
refs/heads/master
bot/event_manager.py
1
# -*- coding: utf-8 -*- import datetime from pytz import utc, timezone import threading class EventManager(object): def __init__(self): # TODO: Move events to config.ini self.events = ( ("The Folk ARPS Sunday Session", 6, 19, 20), ("The Folk ARPS Tuesday Session", 1, 19, 20...
mopsalarm/rep0st
refs/heads/master
rep0st/download.py
1
from __future__ import division from __future__ import unicode_literals import itertools import gevent import gevent.pool import gevent.monkey import dataset import requests import logbook import pathlib from clint.textui import progress from first import first class Post(object): def __init__(self, id, created...
dacohen/kops
refs/heads/master
vendor/k8s.io/kubernetes/examples/cluster-dns/images/frontend/client.py
504
#!/usr/bin/env python # Copyright 2015 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...
graphql-python/graphql-core
refs/heads/main
tests/validation/test_unique_variable_names.py
1
from functools import partial from graphql.validation import UniqueVariableNamesRule from .harness import assert_validation_errors assert_errors = partial(assert_validation_errors, UniqueVariableNamesRule) assert_valid = partial(assert_errors, errors=[]) def describe_validate_unique_variable_names(): def uniq...
googleapis/python-billing
refs/heads/master
google/cloud/billing_v1/services/cloud_catalog/client.py
1
# -*- coding: utf-8 -*- # Copyright 2020 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...
LandRegistry/service-frontend-alpha
refs/heads/master
application/services/ownership.py
1
import logging import requests import uuid import json import sys from requests.exceptions import ( HTTPError, ConnectionError ) from flask import session from application import app OWNERSHIP_URL = app.config['OWNERSHIP_URL'] logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) log...
shikhardb/scikit-learn
refs/heads/master
sklearn/linear_model/stochastic_gradient.py
8
# Authors: Peter Prettenhofer <peter.prettenhofer@gmail.com> (main author) # Mathieu Blondel (partial_fit support) # # License: BSD 3 clause """Classification and regression using Stochastic Gradient Descent (SGD).""" import numpy as np import scipy.sparse as sp from abc import ABCMeta, abstractmethod from ...
lsjostro/pulp_win
refs/heads/master
extensions_admin/test/unit/extensions/admin/upload/test_package.py
2
import os import shutil import tempfile import mock from pulp.bindings.responses import Task from ....testbase import PulpClientTests from pulp_win.extensions.admin.upload import package from pulp_win.common.ids import TYPE_ID_MSI, TYPE_ID_MSM class CreatePackageCommandTests(PulpClientTests): def setUp(self): ...
ganeshnalawade/ansible-modules-core
refs/heads/devel
network/nxos/nxos_hsrp.py
8
#!/usr/bin/python # # 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. # # Ansible is distribut...
MartinPyka/Parametric-Anatomical-Modeling
refs/heads/master
pam/trees/diameter.py
1
from . import mstree def add_quad_diameter(root_node, scale = 0.5, offset = 0.5, path_scale = 1.0): # For realistic dendrite thickness special quadratic coefficients are needed quad_coefficients = \ {8: (0.034881, -0.6837, 3.6564), 16: (0.013947, -0.51179, 4.9629), 24: (0.0064104, -0.39213, 6.0818), 32: (...
mobarski/sandbox
refs/heads/master
topic/test_kcv.py
2
from contrib import * if 1: db = KCV('data/text.kcv') if 0: text = KV('data/text.db',5) for k,v in text.items(): db.set('text',k,v.decode('utf8')) db.sync() db.to_col_store('data/text_col.kcv',batch=10) if 1: db = KCV('data/tokens.kcv') if 1: text = KV('data/tokens.db',5) for k,v in text.items(): ...
MalloyPower/parsing-python
refs/heads/master
front-end/testsuite-python-lib/Python-2.4.3/Lib/test/test_traceback.py
15
"""Test cases for traceback module""" import unittest from test.test_support import run_unittest, is_jython import traceback class TracebackCases(unittest.TestCase): # For now, a very minimal set of tests. I want to be sure that # formatting of SyntaxErrors works based on changes for 2.1. def get_excep...
czgu/opendataexperience
refs/heads/master
env/lib/python2.7/site-packages/django/db/models/options.py
49
from __future__ import unicode_literals from bisect import bisect from collections import OrderedDict import warnings from django.apps import apps from django.conf import settings from django.db.models.fields.related import ManyToManyRel from django.db.models.fields import AutoField, FieldDoesNotExist from django.db....
qedsoftware/commcare-hq
refs/heads/master
corehq/apps/sms/api.py
1
import logging import random import string from django.conf import settings from django.core.exceptions import ValidationError from corehq.apps.smsbillables.utils import log_smsbillables_error from corehq.apps.users.models import CommCareUser, WebUser from dimagi.utils.modules import to_function from dimagi.utils.log...
mollstam/UnrealPy
refs/heads/master
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Scrapy-1.0.1/scrapy/utils/deprecate.py
109
"""Some helpers for deprecation messages""" import warnings import inspect from scrapy.exceptions import ScrapyDeprecationWarning def attribute(obj, oldattr, newattr, version='0.12'): cname = obj.__class__.__name__ warnings.warn("%s.%s attribute is deprecated and will be no longer supported " "in Scr...
dmitry-sobolev/ansible
refs/heads/devel
lib/ansible/modules/windows/win_dotnet_ngen.py
78
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Peter Mounce <public@neverrunwithscissors.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...
fy2462/apollo
refs/heads/master
modules/e2e/online_system/car_act/scripts/main.py
1
#!/usr/bin/env python ############################################################################### # Copyright 2017 The Apollo 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 ...
charbeljc/OCB
refs/heads/8.0
openerp/api.py
32
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-2014 OpenERP (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of t...
gangadharkadam/johnerp
refs/heads/develop
erpnext/patches/v4_0/update_custom_print_formats_for_renamed_fields.py
39
# 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 import re def execute(): # NOTE: sequence is important fields_list = ( ("amount", "base_amount"), ("ref_rate", "price_list_rate"...
vladmm/intellij-community
refs/heads/master
python/lib/Lib/site-packages/django/db/models/sql/expressions.py
323
from django.core.exceptions import FieldError from django.db.models.fields import FieldDoesNotExist from django.db.models.sql.constants import LOOKUP_SEP class SQLEvaluator(object): def __init__(self, expression, query, allow_joins=True): self.expression = expression self.opts = query.get_meta() ...
tszym/ansible
refs/heads/devel
hacking/report.py
46
#!/usr/bin/env python # PYTHON_ARGCOMPLETE_OK """A tool to aggregate data about Ansible source and testing into a sqlite DB for reporting.""" from __future__ import (absolute_import, print_function) import argparse import os import requests import sqlite3 import sys DATABASE_PATH = os.path.expanduser('~/.ansible/rep...
aiguofer/bokeh
refs/heads/master
examples/compat/mpl_plot.py
11
import matplotlib.pyplot as plt import numpy as np from bokeh import mpl from bokeh.plotting import output_file, show x = np.linspace(-2 * np.pi, 2 * np.pi, 100) y = np.sin(x) z = np.cos(x) plt.plot(x, y, "r-", marker='o') plt.title("Matplotlib Figure in Bokeh") # dashed lines work plt.plot(x, z, "g-x", linestyle="...
shvets/etvnet-plex-plugin
refs/heads/master
ssh_client.py
3
#!/usr/bin/python from StringIO import StringIO import paramiko import getpass # setup logging #paramiko.util.log_to_file('demo_simple.log') class SshClient: "A wrapper of paramiko.SSHClient" TIMEOUT = 4 def __init__(self, host, port, username, password, key=None, passphrase=None): self.username...
YuriyIlyin/ansible-modules-core
refs/heads/devel
cloud/amazon/ec2_ami_find.py
32
#!/usr/bin/python # # 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. # # Ansible is distribut...
harnash/selene_drf
refs/heads/master
web/apps/core/settings/base.py
1
# Base settings file import os import sys from unipath import Path from django.core.exceptions import ImproperlyConfigured import dj_database_url PROJECT_ROOT = Path(__file__).ancestor(4) def get_env_var(varname, default=None): """Get the environment variable or raise an exception.""" try: return ...
insionng/p2pool
refs/heads/master
p2pool/work.py
42
from __future__ import division import base64 import random import re import sys import time from twisted.internet import defer from twisted.python import log import bitcoin.getwork as bitcoin_getwork, bitcoin.data as bitcoin_data from bitcoin import helper, script, worker_interface from util import forest, jsonrpc,...
eyalev/timee
refs/heads/master
timee/timee_general.py
1
from timee.timee_dt import TimeeDT class Timee(object): def __init__(self): pass @staticmethod def from_maya(maya_dt): """ :type maya_dt: maya.MayaDT """ _dt = maya_dt.datetime() timee_dt = TimeeDT(datetime_param=_dt) return timee_dt
luogangyi/bcec-nova
refs/heads/stable/icehouse
nova/scheduler/filters/pci_passthrough_filter.py
16
# Copyright (c) 2013 ISP RAS. # 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 ...
NamelessRom/android_kernel_samsung_latona
refs/heads/android-4.4
tools/perf/scripts/python/netdev-times.py
11271
# Display a process of packets and processed time. # It helps us to investigate networking or network device. # # options # tx: show only tx chart # rx: show only rx chart # dev=: show only thing related to specified device # debug: work with debug mode. It shows buffer status. import os import sys sys.path.append(os...
jomo/youtube-dl
refs/heads/master
youtube_dl/extractor/pornhub.py
3
from __future__ import unicode_literals import os import re from .common import InfoExtractor from ..compat import ( compat_urllib_parse, compat_urllib_parse_urlparse, compat_urllib_request, ) from ..utils import ( ExtractorError, str_to_int, ) from ..aes import ( aes_decrypt_text ) class Po...
Endika/c2c-rd-addons
refs/heads/8.0
sale_order_2_purchase/invoice.py
4
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2010-2012 ChriCar Beteiligungs- und Beratungs- GmbH (<http://www.camptocamp.at>) # # Thi...
mdjurfeldt/nest-simulator
refs/heads/master
pynest/nest/tests/test_onetooneconnect.py
9
# -*- coding: utf-8 -*- # # test_onetooneconnect.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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 Li...
isleei/xhtml2pdf
refs/heads/master
tests/test_parser.py
130
import unittest from xhtml2pdf.parser import pisaParser from xhtml2pdf.context import pisaContext _data = """ <!doctype html> <html> <title>TITLE</title> <body> BODY </body> </html> """ class TestCase(unittest.TestCase): def testParser(self): c = pisaContext(".") r = pisaParser(_data, c) ...
azurestandard/django
refs/heads/master
tests/regressiontests/test_client_regress/session.py
155
from django.contrib.sessions.backends.base import SessionBase class SessionStore(SessionBase): """ A simple cookie-based session storage implementation. The session key is actually the session data, pickled and encoded. This means that saving the session will change the session key. """ def __...
CZ-NIC/knot
refs/heads/master
tests-extra/tests/dnssec/nsec3_revert/test.py
1
#!/usr/bin/env python3 '''Test for unsiccessful creation of NSEC3 tree''' from dnstest.test import Test t = Test() master = t.server("knot") zone = t.zone_rnd(1, records=200) t.link(zone, master) master.journal_max_usage = 51200 # the creation of NSEC3 tree fails on ESPACE t.start() master.zone_wait(zone) maste...