repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
NathanW2/QGIS
tests/src/python/test_authmanager_pki_ows.py
21
7815
# -*- coding: utf-8 -*- """ Tests for auth manager WMS/WFS using QGIS Server through PKI enabled qgis_wrapped_server.py. This is an integration test for QGIS Desktop Auth Manager WFS and WMS provider and QGIS Server WFS/WMS that check if QGIS can use a stored auth manager auth configuration to access an HTTP Basic pro...
gpl-2.0
M3nin0/supreme-broccoli
Web/Flask/site_/lib/python3.5/site-packages/sqlalchemy/dialects/postgresql/base.py
3
105017
# postgresql/base.py # Copyright (C) 2005-2016 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 """ .. dialect:: postgresql :name: PostgreSQL Sequences/SERIAL ------------...
apache-2.0
noijd/.dot
i3/shell.py
2
2368
from argparse import ArgumentParser import os import re import i3ipc def window_classes(window_id): cmd = 'xprop -id '+ str(window_id) properties = os.popen(cmd).read() regex = re.compile(r'^WM_CLASS\(STRING\) = (.*)$', re.MULTILINE) match = regex.search(properties).groups() return match[0].replac...
mit
chiefspace/udemy-rest-api
udemy_rest_api_section6/resources/item.py
1
2149
from flask_restful import Resource, reqparse from flask_jwt import jwt_required from models.item import ItemModel class Item(Resource): parser = reqparse.RequestParser() parser.add_argument('price', type=float, required=True, help='This field cannot be left blank!' ) parser.add_...
gpl-2.0
liulion/mayavi
mayavi/modules/ui/surface.py
4
1631
""" Traits View definition file. The view trait of the parent class is extracted from the model definition file. This file can either be exec()ed or imported. See core/base.py:Base.trait_view() for what is currently used. Using exec() allows view changes without needing to restart Mayavi, but is slower than importi...
bsd-3-clause
dariansk/python_training
fixture/db.py
1
1487
#import pymysql.cursors import mysql.connector from model.group import Group from model.contact import Contact class Dbfixture: def __init__(self, host, name, user, password): self.host = host self.name = name self.user = user self.password = password #self.connection = py...
apache-2.0
taedla01/MissionPlanner
Lib/site-packages/numpy/core/numeric.py
53
71241
import sys import warnings __all__ = ['newaxis', 'ndarray', 'flatiter', 'ufunc', 'arange', 'array', 'zeros', 'empty', 'broadcast', 'dtype', 'fromstring', 'fromfile', 'frombuffer', 'int_asbuffer', 'where', 'argwhere', 'concatenate', 'fastCopyAndTranspose', 'lexsort', ...
gpl-3.0
jmlong1027/multiscanner
storage/file.py
1
2965
import codecs import gzip import json import storage class File(storage.Storage): DEFAULTCONF = { 'ENABLED': True, 'path': 'report.json', 'gzip': False, 'files-per-line': 1 } def setup(self): if self.config['gzip'] is True: self.file_handle = gzip.open...
mpl-2.0
kdeldycke/meta-package-manager
meta_package_manager/tests/test_cli_cleanup.py
1
1262
# Copyright Kevin Deldycke <kevin@deldycke.com> and contributors. # All Rights Reserved. # # 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 (at your option) ...
gpl-2.0
thomas-schmid-ubnt/avocado
selftests/functional/test_replay_basic.py
1
8628
import glob import os import tempfile import shutil import unittest from avocado.core import exit_codes from avocado.utils import process basedir = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', '..') basedir = os.path.abspath(basedir) AVOCADO = os.environ.get("UNITTEST_AVOCADO_CMD", "./scripts/avoc...
gpl-2.0
zhangyongfei/StudySkia
gm/rebaseline_server/compare_rendered_pictures_test.py
1
3997
#!/usr/bin/python """ Copyright 2014 Google Inc. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. Test compare_rendered_pictures.py TODO(epoger): Create a command to update the expected results (in self._output_dir_expected) when appropriate. For now, you should: 1....
bsd-3-clause
entropy1337/infernal-twin
Modules/build/pillow/PIL/XpmImagePlugin.py
52
3089
# # The Python Imaging Library. # $Id$ # # XPM File handling # # History: # 1996-12-29 fl Created # 2001-02-17 fl Use 're' instead of 'regex' (Python 2.1) (0.7) # # Copyright (c) Secret Labs AB 1997-2001. # Copyright (c) Fredrik Lundh 1996-2001. # # See the README file for information on usage and redistribution. #...
gpl-3.0
proticom/google-python-exercises
copyspecial/solution/copyspecial.py
206
2584
#!/usr/bin/python # Copyright 2010 Google Inc. # Licensed under the Apache License, Version 2.0 # http://www.apache.org/licenses/LICENSE-2.0 # Google's Python Class # http://code.google.com/edu/languages/google-python-class/ import sys import re import os import shutil import commands """Copy Special exercise """ #...
apache-2.0
varunnaganathan/django
django/conf/locale/it/formats.py
504
2079
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'd F Y' # 25 Ottobre 2006 TIME_FO...
bsd-3-clause
glyph/imaginary
imaginary/test/test_look.py
1
8911
""" Tests for L{imaginary.action.LookAt} and L{imaginary.action.LookAround}. """ from __future__ import print_function from textwrap import dedent from twisted.trial.unittest import TestCase from zope.interface import implementer from characteristic import attributes as has_attributes from axiom import store, item, ...
mit
alexanderturner/ansible
lib/ansible/modules/database/vertica/vertica_user.py
19
14854
#!/usr/bin/python # -*- coding: utf-8 -*- # 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. #...
gpl-3.0
wengole/nasman
nasman/snapshots/utils/base.py
1
2714
import pathlib import abc import chardet from django.utils.timezone import get_default_timezone_name, now def decode_from_filesystem(path): """ Decode a given Path object to unicode by detecting its encoding :param path: The Path object to decode :type path: pathlib.Path :return: Tuple of the str...
bsd-3-clause
DoWhileGeek/slice
setup.py
1
1915
import contextlib import json import os import re import subprocess from setuptools import setup VERSION_FILE = os.path.join(os.path.dirname(__file__), "version.json") def _get_git_description(): try: return subprocess.check_output(["git", "describe"]).decode("utf-8").strip() except subprocess.Calle...
mit
nwjs/chromium.src
third_party/google_appengine_cloudstorage/cloudstorage/common.py
120
11732
# Copyright 2012 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
bsd-3-clause
johndpope/tensorflow
tensorflow/python/lib/io/tf_record.py
45
3787
# 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...
apache-2.0
maciekcc/tensorflow
tensorflow/contrib/testing/python/framework/util_test.py
198
4128
# 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...
apache-2.0
aioworkers/aioworkers
aioworkers/core/context.py
1
17806
import asyncio import contextlib import inspect import logging.config import os from collections import OrderedDict from functools import wraps from typing import ( Awaitable, Callable, FrozenSet, Iterable, List, Mapping, MutableMapping, Optional, Sequence, Set, Tuple, Ty...
apache-2.0
aESeguridad/GERE
venv/local/lib/python2.7/codecs.py
62
35172
""" codecs -- Python Codec Registry, API and helpers. Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. """#" import __builtin__, sys ### Registry and builtin stateless codec functions try: from _codecs import * except ImportError, why: raise SystemErr...
gpl-3.0
dreyou/ebstarter
reciever.py
1
3846
#!/usr/bin/env python import pika import sys import signal import json import logging from optparse import OptionParser import eblocal def createApplication(command): res = eblocal.createApp(command["name"], command["source"]) if res is None: logging.error("Can't create application") return ...
mit
nirmeshk/oh-mainline
vendor/packages/gdata/tests/gdata_tests/blogger_test.py
128
3855
#!/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 ...
agpl-3.0
carltongibson/django-redis-cache
redis_cache/utils.py
2
5747
import warnings from django.core.exceptions import ImproperlyConfigured from django.utils.importlib import import_module from redis.connection import SSLConnection from redis_cache.compat import ( smart_text, python_2_unicode_compatible, parse_qs, urlparse ) try: basestring except NameError: basestring =...
bsd-3-clause
EdgarSun/Django-Demo
django/template/context.py
97
6298
from copy import copy from django.core.exceptions import ImproperlyConfigured from django.utils.importlib import import_module from django.http import HttpRequest # Cache of actual callables. _standard_context_processors = None # We need the CSRF processor no matter what the user has in their settings, # because other...
mit
tudorvio/nova
nova/virt/xenapi/image/bittorrent.py
23
4771
# Copyright 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 requ...
apache-2.0
heynemann/generator-python-package
app/templates/_setup.py
1
2004
#!/usr/bin/env python # -*- coding: utf-8 -*- # This file is part of <%= package.name %>. # <%= package.url %> # Licensed under the <%= package.license %> license: # http://www.opensource.org/licenses/<%= package.license%>-license # Copyright (c) <%= package.created.year %>, <%= package.author.name %> <<%= package.au...
mit
turbomanage/training-data-analyst
courses/developingapps/python/pubsub-languageapi-spanner/end/quiz/api/api.py
21
2607
# Copyright 2017 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, ...
apache-2.0
heladio/my-blog
pelica-env/lib/python2.7/site-packages/pip/wheel.py
34
22339
""" Support for installing and building the "wheel" binary package format. """ from __future__ import absolute_import import compileall import csv import functools import hashlib import logging import os import re import shutil import stat import sys import warnings from base64 import urlsafe_b64encode from email.par...
mit
csgxy123/Dato-Core
src/unity/python/doc/source/conf.py
13
9941
# -*- coding: utf-8 -*- # # GraphLab Create documentation build configuration file, created by # sphinx-quickstart on Mon Feb 24 17:26:36 2014. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file....
agpl-3.0
fran-penedo/dreal
benchmarks/network/airplane/gen.py
55
1248
flow_var = {} flow_dec = {} state_dec = {} state_val = {} cont_cond = {} jump_cond = {} def getHdr(n): res = [] for i in range(n): getHdr.counter += 1 res.append(getHdr.counter) return res getHdr.counter = 0 ###################### # Formula generation # ###################### def pri...
gpl-3.0
bckwltn/SickRage
tornado/stack_context.py
248
13174
#!/usr/bin/env python # # Copyright 2010 Facebook # # 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 a...
gpl-3.0
ddelemeny/calligra
devtools/scripts/ircbuildbot.py
6
2607
#!/usr/bin/python -Qwarnall # -*- coding: utf-8 -*- # This is a simple irc bot that reports progress to the Calligra irc channel import time, lxml.etree, urllib2, re, sys, socket, string HOST='irc.freenode.org' #The server we want to connect to PORT=6667 #The connection port which is usually 6667 NICK='buildbot_py' ...
gpl-2.0
yury-s/v8-inspector
Source/chrome/tools/perf/measurements/thread_times_unittest.py
2
2450
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry.core import wpr_modes from telemetry import decorators from telemetry.page import page from telemetry.unittest_util import options_for_unittes...
bsd-3-clause
FlorentChamault/My_sickbeard
lib/hachoir_parser/program/elf.py
90
7120
""" ELF (Unix/BSD executable file format) parser. Author: Victor Stinner Creation date: 08 may 2006 """ from lib.hachoir_parser import Parser from lib.hachoir_core.field import (FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, String, Bytes) from lib.hachoir_core.text_handler import textHandler, hexadecima...
gpl-3.0
grupoprog3/proyecto_final
proyecto/flask/Lib/site-packages/sqlalchemy/orm/events.py
17
84907
# orm/events.py # Copyright (C) 2005-2016 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 """ORM event interfaces. """ from .. import event, exc, util from .base import _mappe...
apache-2.0
clstl/servo
tests/wpt/web-platform-tests/tools/pytest/testing/test_argcomplete.py
179
3582
from __future__ import with_statement import py, pytest # test for _argcomplete but not specific for any application def equal_with_bash(prefix, ffc, fc, out=None): res = ffc(prefix) res_bash = set(fc(prefix)) retval = set(res) == res_bash if out: out.write('equal_with_bash %s %s\n' % (retval,...
mpl-2.0
alanbowman/home-assistant
homeassistant/components/notify/xmpp.py
9
3648
""" homeassistant.components.notify.xmpp ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Jabber (XMPP) notification service. Configuration: To use the Jabber notifier you will need to add something like the following to your configuration.yaml file. notify: platform: xmpp sender: YOUR_JID password: YOUR_JABBER_ACCOUNT_PA...
mit
wolverine2k/Secure-Deluge
deluge/plugins/blocklist/setup.py
5
2311
# setup.py # # Copyright (C) 2008 Andrew Resch <andrewresch@gmail.com> # # 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, or (at your option) # any later version. # # This progr...
gpl-3.0
chaluemwut/smcdemo
demo_filter.py
1
2602
import pickle from feature_process import FeatureMapping import feature_process from text_processing import TextProcessing from sklearn.cross_validation import train_test_split is_not_important = {9:0, 13:0, 18:0, 19:0, 23:0, 28:0, 29:0, 33:0, 34:0, 37:0, 40:0, 44:0, 46:0, 50:0, 55:0, 59:0, 61:0, 62:0, 63:0, 72:0, 73:...
apache-2.0
ychen820/microblog
y/google-cloud-sdk/.install/.backup/lib/requests/exceptions.py
341
1877
# -*- coding: utf-8 -*- """ requests.exceptions ~~~~~~~~~~~~~~~~~~~ This module contains the set of Requests' exceptions. """ from .packages.urllib3.exceptions import HTTPError as BaseHTTPError class RequestException(IOError): """There was an ambiguous exception that occurred while handling your request.""...
bsd-3-clause
ChanChiChoi/scikit-learn
examples/exercises/plot_iris_exercise.py
323
1602
""" ================================ SVM Exercise ================================ A tutorial exercise for using different SVM kernels. This exercise is used in the :ref:`using_kernels_tut` part of the :ref:`supervised_learning_tut` section of the :ref:`stat_learn_tut_index`. """ print(__doc__) import numpy as np i...
bsd-3-clause
SPACEDAC7/TrabajoFinalGrado
StaticAnalyzer/views/android/java.py
5
2279
# -*- coding: utf_8 -*- """List all java files.""" import re import shutil import os from django.shortcuts import render from django.http import HttpResponseRedirect from django.conf import settings from django.utils.html import escape from MobSF.utils import ( PrintException ) def run(request): """Show the...
gpl-3.0
vlachoudis/sl4a
python/src/Lib/test/test_os.py
48
23971
# As a test suite for the os module, this is woefully inadequate, but this # does add tests for a few functions which have been determined to be more # portable than they had been thought to be. import os import unittest import warnings import sys from test import test_support warnings.filterwarnings("ignore", "tempn...
apache-2.0
savoca/h811
tools/perf/scripts/python/netdev-times.py
11271
15048
# 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...
gpl-2.0
briancurtin/pyrax
samples/cloudfiles/temporary_url.py
13
2203
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c)2012 Rackspace US, 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.ap...
apache-2.0
mdenker/elephant
elephant/neo_tools.py
4
6088
# -*- coding: utf-8 -*- """ Tools to manipulate Neo objects. :copyright: Copyright 2014-2016 by the Elephant team, see AUTHORS.txt. :license: Modified BSD, see LICENSE.txt for details. """ from __future__ import division, print_function from itertools import chain from neo.core.container import unique_objs def ex...
bsd-3-clause
philanthropy-u/edx-platform
common/djangoapps/philu_commands/management/commands/sync_users_with_mailchimp.py
1
5558
""" A command to collect users data and sync with mailchimp learner's list """ from logging import getLogger from django.conf import settings from django.contrib.auth.models import User from django.core.management.base import BaseCommand from django.db import connection from lms.djangoapps.certificates import api as ...
agpl-3.0
jabesq/home-assistant
tests/components/uptime/test_sensor.py
8
4256
"""The tests for the uptime sensor platform.""" import unittest from unittest.mock import patch from datetime import timedelta from homeassistant.util.async_ import run_coroutine_threadsafe from homeassistant.setup import setup_component from homeassistant.components.uptime.sensor import UptimeSensor from tests.common...
apache-2.0
ribeiro-ucl/viewflow
tests/unit/flows.py
2
2501
from viewflow import flow, lock from viewflow.base import Flow, this from viewflow.contrib import celery from . import tasks from .models import TestProcess from .signals import test_start_flow, test_done_flow_task @flow.flow_view() def perform_task(request, activation): raise NotImplementedError class Single...
agpl-3.0
Jionglun/w17test_2
static/Brython3.1.1-20150328-091302/Lib/logging/__init__.py
733
66279
# Copyright 2001-2013 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright notice and this permissio...
gpl-3.0
ZephyrSurfer/dolphin
Tools/check-includes.py
148
3063
#! /usr/bin/env python """ check-includes.py <file...> Checks if the includes are sorted properly and following the "system headers before local headers" rule. Ignores what is in #if blocks to avoid false negatives. """ import re import sys def exclude_if_blocks(lines): '''Removes lines from #if ... #endif blo...
gpl-2.0
kevaughan/project3
server/lib/werkzeug/debug/tbtools.py
311
16785
# -*- coding: utf-8 -*- """ werkzeug.debug.tbtools ~~~~~~~~~~~~~~~~~~~~~~ This module provides various traceback related utility functions. :copyright: (c) 2013 by the Werkzeug Team, see AUTHORS for more details. :license: BSD. """ import re import os import sys import json import inspect import ...
apache-2.0
TNosredna/CouchPotatoServer
couchpotato/core/notifications/notifymywp/__init__.py
16
1303
from .main import NotifyMyWP def start(): return NotifyMyWP() config = [{ 'name': 'notifymywp', 'groups': [ { 'tab': 'notifications', 'list': 'notification_providers', 'name': 'notifymywp', 'label': 'Windows Phone', 'options': [ ...
gpl-3.0
ianatpn/nupictest
external/linux32/lib/python2.6/site-packages/matplotlib/pylab.py
70
10245
""" This is a procedural interface to the matplotlib object-oriented plotting library. The following plotting commands are provided; the majority have Matlab(TM) analogs and similar argument. _Plotting commands acorr - plot the autocorrelation function annotate - annotate something in the figure arrow ...
gpl-3.0
TribeMedia/sky_engine
tools/android/mempressure.py
36
3713
#!/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. import collections import logging import optparse import os import sys BUILD_ANDROID_DIR = os.path.join(os.path.dirname(__file__), ...
bsd-3-clause
alexbelyeu/three.js
utils/converters/obj/convert_obj_three.py
160
48659
"""Convert Wavefront OBJ / MTL files into Three.js (JSON model version, to be used with ascii / binary loader) ------------------------- How to use this converter ------------------------- python convert_obj_three.py -i infile.obj -o outfile.js [-m "morphfiles*.obj"] [-c "morphcolors*.obj"] [-a center|centerxz|top|bo...
mit
jtackaberry/stagehand
external/metadata/video/ogm.py
1
11299
# -*- coding: iso-8859-1 -*- # ----------------------------------------------------------------------------- # ogm.py - ogm/ogg file parser # ----------------------------------------------------------------------------- # $Id$ # # ----------------------------------------------------------------------------- # kaa-Metad...
mit
amenonsen/ansible
lib/ansible/modules/network/f5/bigip_profile_tcp.py
5
21521
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2017, F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
uw-it-aca/myuw
myuw/test/views/lti/test_photo_list.py
1
2563
# Copyright 2021 UW-IT, University of Washington # SPDX-License-Identifier: Apache-2.0 from unittest import skipIf from django.urls import reverse from django.test.utils import override_settings from django.test import RequestFactory from myuw.views.lti.photo_list import LTIPhotoList from myuw.test.api import missing_...
apache-2.0
lucciano/bigcouch
couchjs/scons/scons-local-2.0.1/SCons/Scanner/__init__.py
61
14716
"""SCons.Scanner The Scanner package for the SCons software construction utility. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation file...
apache-2.0
KMK-ONLINE/ansible
lib/ansible/playbook/handler_task_include.py
97
1346
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
gpl-3.0
rsheftel/pandas_market_calendars
pandas_market_calendars/exchange_calendars_mirror.py
1
1912
""" Imported calendars from the exchange_calendars project GitHub: https://github.com/gerrymanoim/exchange_calendars """ from datetime import time from .market_calendar import MarketCalendar import exchange_calendars class TradingCalendar(MarketCalendar): def __init__(self, open_time=None, close_time=None): ...
mit
leppa/home-assistant
homeassistant/components/ebusd/__init__.py
3
3931
"""Support for Ebusd daemon for communication with eBUS heating systems.""" from datetime import timedelta import logging import socket import ebusdpy import voluptuous as vol from homeassistant.const import ( CONF_HOST, CONF_MONITORED_CONDITIONS, CONF_NAME, CONF_PORT, ) import homeassistant.helpers.c...
apache-2.0
yakovenkodenis/rethinkdb
drivers/python/rethinkdb/net_asyncio.py
3
10221
# Copyright 2015 RethinkDB, all rights reserved. import asyncio import contextlib import socket import struct from . import ql2_pb2 as p from .ast import ReQLDecoder from .net import decodeUTF, Query, Response, Cursor, maybe_profile from .net import Connection as ConnectionBase from .errors import * __all__ = ['Conn...
agpl-3.0
vitan/django
tests/migrations/test_state.py
3
34875
from django.apps.registry import Apps from django.db import models from django.db.migrations.operations import DeleteModel, RemoveField from django.db.migrations.state import ( InvalidBasesError, ModelState, ProjectState, get_related_models_recursive, ) from django.test import SimpleTestCase, TestCase, override_set...
bsd-3-clause
particl/particl-core
test/functional/feature_includeconf.py
2
4066
#!/usr/bin/env python3 # Copyright (c) 2018-2019 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Tests the includeconf argument Verify that: 1. adding includeconf to the configuration file causes th...
mit
algorhythms/LeetCode
917 Reverse Only Letters.py
1
1071
#!/usr/bin/python3 """ Given a string S, return the "reversed" string where all characters that are not a letter stay in the same place, and all letters reverse their positions. Example 1: Input: "ab-cd" Output: "dc-ba" Example 2: Input: "a-bC-dEf-ghIj" Output: "j-Ih-gfE-dCba" Example 3: Input: "Test1ng-Leet=code-Q...
mit
Phil-LiDAR2-Geonode/pl2-geonode
geonode/base/translation.py
35
1147
from modeltranslation.translator import translator, TranslationOptions from geonode.base.models import (TopicCategory, SpatialRepresentationType, Region, RestrictionCodeType, License, ResourceBase) class TopicCategoryTranslationOptions(TranslationOptions): fields = ('description',...
gpl-3.0
NeovaHealth/odoo
addons/report_intrastat/__init__.py
377
1079
# -*- 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...
agpl-3.0
arifsetiawan/configuration
playbooks/edx-east/lifecycle_inventory.py
47
2776
#!/usr/bin/env python """ Build an ansible inventory based on autoscaling group instance lifecycle state. Outputs JSON to stdout with keys for each state and combination of autoscaling group and state. { "InService": [ "10.0.47.127", "10.0.46.174" ], "Terminating:Wait": [ "10.0.48.104" ], "e-d-...
agpl-3.0
Yong-Lee/django
tests/template_tests/filter_tests/test_timeuntil.py
207
4426
from __future__ import unicode_literals from datetime import datetime, timedelta from django.template.defaultfilters import timeuntil_filter from django.test import SimpleTestCase from django.test.utils import requires_tz_support from ..utils import setup from .timezone_utils import TimezoneTestCase class Timeunti...
bsd-3-clause
josyb/myhdl
myhdl/_block.py
4
12779
# This file is part of the myhdl library, a Python package for using # Python as a Hardware Description Language. # # Copyright (C) 2003-2016 Jan Decaluwe # # The myhdl library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public License as # published by t...
lgpl-2.1
mattbierbaum/tmper
tmper/progress.py
2
5026
from __future__ import print_function import sys import time import math class ProgressBar: def __init__(self, num, label='Progress', value=0, screen=79, time_remaining=False, bar=True, bar_symbol='=', bar_caps='[]', bar_decimals=2, display=True): """ ProgressBar class whic...
mit
e-mission/e-mission-server
emission/tests/coreTests/TestBase.py
2
6423
from __future__ import print_function from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import # Test the base class enhancements over AttrDict # Since the base class should not really contain any properties, we create a # dummy subclass here and use it for testing....
bsd-3-clause
raj454raj/eden
languages/ar.py
7
143913
# -*- coding: utf-8 -*- { '* Required Fields': 'الحقول المطلوبة *', '# selected': '# selected', '%(GRN)s Number': 'رقم مستند الادخال %(GRN)s', '%(GRN)s Status': 'حالة %(GRN)s', '%(PO)s Number': 'رقم طلبيه الشراء %(PO)s', '%(REQ)s Number': 'رقم الطلبيات %(REQ)s', '1 Assessment': 'التقييم1', '2 different options...
mit
zpincus/celltool
celltool/numerics/pca.py
1
5436
# Copyright 2007 Zachary Pincus # This file is part of CellTool. # # CellTool is free software; you can redistribute it and/or modify # it under the terms of version 2 of the GNU General Public License as # published by the Free Software Foundation. import bisect, numpy from . import utility_tools def pca(data): ...
gpl-2.0
Vagab0nd/SiCKRAGE
lib3/feedparser/__init__.py
1
2256
# Copyright 2010-2020 Kurt McKee <contactme@kurtmckee.org> # Copyright 2002-2008 Mark Pilgrim # All rights reserved. # # This file is part of feedparser. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # * Redistribut...
gpl-3.0
yacklebeam/corpus-crawler
extra/gen_list.py
2
1786
# generate image from csv word list import sys import pydot import ConfigParser def is_grandparent(parent, child_dict): for child in child_dict[parent]: if len(child_dict[child]) > 0: return True return False def draw_node_recursive(parent, child_dict, config): config.set('TREE', parent, (" ".join(child_dict...
mit
weety/rt-thread
tools/file_check.py
4
9678
# # Copyright (c) 2006-2021, RT-Thread Development Team # # SPDX-License-Identifier: Apache-2.0 # # Change Logs: # Date Author Notes # 2021-04-01 LiuKang the first version # import os import re import sys import click import yaml import chardet import logging import datetime def init_logger(...
apache-2.0
HeikeHoffm2/Heike
py/openage/convert/hardcoded/langcodes.py
46
8618
# language codes, as used in PE file ressources # this file is used by pefile.py langcodes = { 1: 'ar', 2: 'bg', 3: 'ca', 4: 'zh_Hans', 5: 'cs', 6: 'da', 7: 'de', 8: 'el', 9: 'en', 10: 'es', 11: 'fi', 12: 'fr', 13: 'he', 14: 'hu', 15: 'is', 16: 'it', ...
gpl-3.0
chris-statzer/knuckle-python
contrib/knuckle/window.py
1
3176
import logging import time import sdl2 logging.basicConfig(level=logging.INFO) class Window(sdl2.Window): def __init__(self, width, height, title): super(Window, self).__init__(width, height, title) self.log = logging.getLogger('Windw') self.log.info('++ Creating new window object ({},{...
mit
iuliat/nova
nova/scheduler/filters/utils.py
41
3282
# All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
apache-2.0
emilk/sproxel
distro/common/lib/UserDict.py
83
5991
"""A more or less complete user-defined wrapper around dictionary objects.""" class UserDict: def __init__(self, dict=None, **kwargs): self.data = {} if dict is not None: self.update(dict) if len(kwargs): self.update(kwargs) def __repr__(self): return re...
bsd-3-clause
ufal/neuralmonkey
neuralmonkey/tf_utils.py
1
7163
"""A set of helper functions for TensorFlow.""" from typing import Callable, Iterable, List, Optional, Tuple, Union import numpy as np import tensorflow as tf from neuralmonkey.logging import debug, debug_enabled # pylint: disable=invalid-name ShapeSpec = List[int] # pylint: enable=invalid-name def _get_current_exp...
bsd-3-clause
ShujiaHuang/AsmVar
src/AsmvarGenotype/GMM/GMM2D.py
2
18363
""" ================================================ My own Gaussion Mixture Model for SV genotyping. Learn form scikit-learn ================================================ Author : Shujia Huang Date : 2014-01-06 14:33:45 """ import sys import numpy as np from scipy import linalg from sklearn import cluster from ...
mit
marcua/qurk_experiments
qurkexp/estimation/models.py
1
3728
from django.db import models # The kind of item we are estimating properties of class Kind(models.Model): name = models.TextField(unique=True) def __str__(self): return self.name # Items whose properties we are estimating class Item(models.Model): kind = models.ForeignKey(Kind, related_name="item...
bsd-3-clause
synth3tk/the-blue-alliance
tests/test_event_get_timezone_id.py
4
3832
import unittest2 from google.appengine.ext import testbed from datafeeds.usfirst_event_details_parser import UsfirstEventDetailsParser from helpers.event_helper import EventHelper class TestEventGetTimezoneId(unittest2.TestCase): def setUp(self): self.testbed = testbed.Testbed() self.testbed.act...
mit
bohlian/erpnext
erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.py
32
3377
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.utils import flt, cint, getdate def execute(filters=None): if not filters: filters = {} float_precisi...
gpl-3.0
yousafsyed/casperjs
bin/Lib/idlelib/ColorDelegator.py
12
10467
import time import re import keyword import builtins from tkinter import * from idlelib.Delegator import Delegator from idlelib.configHandler import idleConf DEBUG = False def any(name, alternates): "Return a named group pattern matching list of alternates." return "(?P<%s>" % name + "|".join(alternates) + ")...
mit
latinproject/booktype-latin
lib/booki/editor/management/commands/reportweekly.py
1
9125
# This file is part of Booktype. # Copyright (c) 2012 Aleksandar Erkalovic <aleksandar.erkalovic@sourcefabric.org> # # Booktype is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the Li...
agpl-3.0
bluemini/kuma
vendor/packages/translate/storage/test_ts2.py
24
8528
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2008-2009 Zuza Software Foundation # # This file is part of the Translate Toolkit. # # 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; e...
mpl-2.0
mgogoulos/libcloud
libcloud/common/gogrid.py
28
6395
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
apache-2.0
gdsfactory/gdsfactory
pp/components/spiral_inner_io.py
1
10100
""" bends with grating couplers inside the spiral maybe: need to add grating coupler loopback as well """ from typing import Optional, Tuple import numpy as np import pp from pp.component import Component from pp.components.bend_circular import bend_circular, bend_circular180 from pp.components.bend_euler import bend...
mit
Varriount/Colliberation
libs/construct/lib/container.py
5
6148
""" Various containers. """ def recursion_lock(retval, lock_name = "__recursion_lock__"): def decorator(func): def wrapper(self, *args, **kw): if getattr(self, lock_name, False): return retval setattr(self, lock_name, True) try: return fun...
mit
alexryndin/ambari
ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/ECS/package/scripts/ecs_client.py
3
3758
""" Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this ...
apache-2.0
Revanth47/addons-server
src/olympia/api/tests/test_commands.py
5
4643
import os.path from StringIO import StringIO from django.core.management import call_command from django.conf import settings from olympia.amo.tests import TestCase, user_factory from olympia.api.models import APIKey class TestRevokeAPIKeys(TestCase): def setUp(self): self.csv_path = os.path.join( ...
bsd-3-clause
edx/ecommerce
ecommerce/extensions/analytics/migrations/0001_initial.py
1
3904
# -*- coding: utf-8 -*- from decimal import Decimal from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.CreateModel( ...
agpl-3.0