code
stringlengths
3
1.05M
repo_name
stringlengths
5
104
path
stringlengths
4
251
language
stringclasses
1 value
license
stringclasses
15 values
size
int64
3
1.05M
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Chromium presubmit script for src/net. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for more details on the presubmit ...
7kbird/chrome
net/PRESUBMIT.py
Python
bsd-3-clause
1,034
""" same as viewer_thumbs, but uses the grid geometry manager to try to achieve a more uniform layout; can generally achieve the same with frames and pack if buttons are all fixed and uniform in size; """ import sys, math from tkinter import * from PIL.ImageTk import PhotoImage from viewer_thumbs import mak...
simontakite/sysadmin
pythonscripts/programmingpython/Gui/PIL/viewer-thumbs-grid.py
Python
gpl-2.0
1,411
# coding: utf-8 from django.core.urlresolvers import reverse from modoboa.lib.tests import ModoTestCase from .. import factories from ..models import Domain, DomainAlias, Alias class DomainAliasTestCase(ModoTestCase): @classmethod def setUpTestData(cls): """Create test data.""" super(Domai...
carragom/modoboa
modoboa/admin/tests/test_domain_alias.py
Python
isc
1,687
"""Functions for Plotting the dF states. To assess the quality of the free energy estimation, The dF between adjacent lambda states can be ploted to assess the quality of the estimation. The code for producing the dF states plot is modified based on `Alchemical Analysis <https://github.com/MobleyLab/alchemical-analys...
alchemistry/alchemlyb
src/alchemlyb/visualisation/dF_state.py
Python
bsd-3-clause
7,613
# 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 ...
v-iam/azure-sdk-for-python
azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/error.py
Python
mit
1,252
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Apr 30 01:14:12 2017 @author: colm """ from alchemy_server import app if __name__ == "__main__": app.run()
colmcoughlan/alchemy-server
wsgi.py
Python
mit
179
########################################################################## # # Copyright (c) 2011, Image Engine Design 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: # # * Redistribu...
appleseedhq/cortex
test/IECore/ConfigLoaderTest.py
Python
bsd-3-clause
6,281
# -*- coding: utf-8 -*- # # Configuration file for the Sphinx documentation builder. # # This file does only contain a selection of the most common options. For a # full list see the documentation: # http://www.sphinx-doc.org/en/master/config # -- Path setup ------------------------------------------------------------...
miguelgrinberg/python-socketio
docs/conf.py
Python
mit
5,500
from .vminute import main import sys def main_main(): main(sys.argv[1:])
SatelliteQE/5minute
vminute/__init__.py
Python
gpl-2.0
79
from django import forms from django.core import validators def must_be_empty(value): if value: raise forms.ValidationError('is not empty') class SuggestionForm(forms.Form): name = forms.CharField() email = forms.EmailField() verify_email = forms.EmailField(label="Please verify your email addr...
davejlin/treehouse
python/django/learning_site_forms/learning_site/forms.py
Python
unlicense
924
""" Cron tasks ========== This module provides tools to manage periodic tasks using cron. """ from future.utils import iteritems def add_task(name, timespec, user, command, environment=None): """ Add a cron task. The *command* will be run as *user* periodically. You can use any valid `crontab(5)`_...
wagigi/fabtools-python
fabtools/cron.py
Python
bsd-2-clause
1,825
# Copyright (c) 2001, Stanford University # All rights reserved. # # See the file LICENSE.txt for information on redistributing this software. """Chromium mothership functions These functions are used in configuration files to direct the mothership. Use these functions to describe your SPU network. The SPU network i...
alown/chromium
mothership/server/mothership.py
Python
bsd-3-clause
89,999
# Copyright 2014 Mirantis, 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...
koder-ua/nailgun-fcert
fuel_agent_ci/fuel_agent_ci/objects/ssh.py
Python
apache-2.0
2,369
'''Moa ======= Adapter for moa classes. ''' from cplcom import config_name
matham/cplcom
cplcom/moa/__init__.py
Python
mit
84
#!/usr/bin/env python #-*- coding: utf-8 -*- from session import Session from cookie import Cookie from general import General from dbconnection import dbConnection from loghelper import Logging from json import JsonBuilder class SciNameBuilder(object): g = General() def __init__(self, cookie_value, dbconne...
cria/microSICol
py/modules/sciname.py
Python
gpl-2.0
13,168
""" Contains a class to evaluate python code and return True or False """ __author__ = "Stephen Henrie" __date__ = "04/13/2013" from ndg.xacml.core.context.exceptions import XacmlContextTypeError from ndg.xacml.core.functions import (AbstractFunction, FunctionClassFactoryInterface) from ndg.xacml.core.attributevalue ...
ooici/pyon
pyon/core/governance/policy/evaluate.py
Python
bsd-2-clause
6,287
import subprocess def exists(env): return True def generate(env): env.Tool('python') env['NUMPYINCLUDES'] = env.Dir( subprocess.check_output([ env.subst('$PYTHON'), '-c', "import numpy; print(numpy.get_include())" ]) .decode() .strip()...
ricotabor/opendrop
site_scons/site_tools/numpy.py
Python
gpl-2.0
327
#!/usr/bin/env python import os import sys if __name__ == '__main__': os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings.local') try: from django.core.management import execute_from_command_line except ImportError: # The above import may fail for some other reason. Ensure tha...
Landver/netmon
manage.py
Python
mit
1,026
#!/usr/bin/env python # Copyright (c) 2012 Cloudera, 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 requir...
scalingdata/Impala
tests/query_test/test_insert_behaviour.py
Python
apache-2.0
22,376
""" created 09/05/17 For executation of the kallisto quantification step To be run with three arguements * basedir - top level output directory * input directory - contains folders with .fastq.gz files * max_threads - how many threads to allocate to kallisto Returns kallisto quantifications and associated l...
samleenz/rnaseq_pipe
kallisto_quant.py
Python
mit
1,936
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "lunchy.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
chlab/lunchy
manage.py
Python
mit
249
#!/usr/bin/env python2.7 import os import pickle import numpy as np import matplotlib.pyplot as plt from matplotlib.cm import get_cmap from matplotlib.colors import SymLogNorm #PowerNorm from shapely.geometry import Polygon, MultiPolygon, Point #import seaborn as sns # ---------------------------------------------...
rhyswhitley/spatial_plots
src/climate_space.py
Python
cc0-1.0
5,036
import json from os.path import join, dirname, exists, relpath import os import traceback import logging from werkzeug.utils import secure_filename from flask import request, abort, jsonify from datashape import Mono, discover from datashape.predicates import iscollection from blaze.utils import json_dumps from blaze....
ContinuumIO/multiuserblazeserver
mbs/views.py
Python
bsd-3-clause
3,284
#!/usr/bin/python # coding: utf-8 class Solution(object): def networkDelayTime(self, times, N, K): """ :type times: List[List[int]] :type N: int :type K: int :rtype: int """ graph = collections.defaultdict(list) for u, v, w in times: graph...
Lanceolata/code-problems
python/leetcode_easy/Question_743_Network_Delay_Time.py
Python
mit
1,483
# Copyright 2009-2012, Peter A. Bigot # # 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...
jonfoster/pyxb1
pyxb/utils/domutils.py
Python
apache-2.0
28,251
# test_utils.py -- Tests for git compatibility utilities # Copyright (C) 2010 Google, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your optio...
seewindcn/tortoisehg
src/ext/dulwich/tests/compat/test_utils.py
Python
gpl-2.0
3,422
""" Prepends a list of files with text. """ import os import sys def prepend(prefix, ext): cwd = os.getcwd() for filename in os.listdir(cwd): if os.path.splitext(filename)[1] != ext: continue newname = prefix + filename try: os.rename(filename, newname) ...
joeyespo/prepend
prepend.py
Python
mit
641
""" These settings are used by the ``manage.py`` command. With normal tests we want to use the fastest possible way which is an in-memory sqlite database but if you want to create South south_migrations you need a persistant database. Unfortunately there seems to be an issue with either South or syncdb so that definin...
bitmazk/django-booking
booking/tests/settings.py
Python
mit
725
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion import awx.main.fields from awx.main.migrations import _migration_utils as migration_utils from awx.main.migrations._multi_cred import migrate_workflow_cred, migrate_workflow_cred_...
GoogleCloudPlatform/sap-deployment-automation
third_party/github.com/ansible/awx/awx/main/migrations/0014_v330_saved_launchtime_configs.py
Python
apache-2.0
6,144
from django.core.exceptions import ImproperlyConfigured from django.utils.importlib import import_module from .settings import URL_ALIAS_MODULES def get_url_alias_modules(collect=None): if collect is None: collect = URL_ALIAS_MODULES alias_modules = [] for path in collect: i = path.rfind('...
ddanier/django_url_alias
django_url_alias/aliases.py
Python
bsd-3-clause
861
"""Integration project URL Configuration""" from django.contrib import admin from django.urls import re_path from django.views.generic import TemplateView urlpatterns = [ re_path(r"^admin/", admin.site.urls), re_path( r"^$", TemplateView.as_view(template_name="home.html"), name="home" ), ]
jambonsw/django-improved-user
example_integration_project/config/urls.py
Python
bsd-2-clause
312
#!/usr/bin/env python ''' Validate conversion between quaternions and euler angles. Usage: testEuler.py rxyz 10 See: http://matthew-brett.github.io/transforms3d/reference/transforms3d.euler.html ''' import sys import numpy as np from euclid import Quaternion, Vector3 from transforms3d.euler import quat2euler, euler2...
stoqs/stoqs
stoqs/loaders/CCE/bed2netcdf/testEuler.py
Python
gpl-3.0
2,837
# -*- coding: utf-8 -*- """ In the 20×20 grid below, four numbers along a diagonal line have been marked in red. 08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08 49 49 99 40 17 81 18 57 60 87 17 40 98 43 69 48 04 56 62 00 81 49 31 73 55 79 14 29 93 71 40 67 53 88 30 03 49 13 36 65 52 70 95 23 04 60 1...
sunwukong123/projectE
11 - Largest product in a grid.py
Python
gpl-3.0
3,921
# -*- coding: utf-8 -*- # # Eta documentation build configuration file, created by # sphinx-quickstart on Thu Dec 8 12:36:06 2016. # # 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. # # All c...
pparkkin/eta
docs/source/conf.py
Python
bsd-3-clause
9,885
import random import json import pyimgur import traceback import datetime import re import math from typing import Callable from typing import List from PIL import Image, ImageFont, ImageDraw, ImageSequence from os import path from os import listdir from os import makedirs from io import BytesIO from textwrap import ...
Drowrin/Weeabot
cogs/images.py
Python
mit
24,498
class config_eval_range(config_base): mutable = 3 def eval_range(param): if len(param) < 2: return '' step = 1.0 if len(param) > 2: try: step = float(param[2]) except ValueError: return '' try: start = float(param[0]) except ValueError: ...
plepe/pgmapcss
pgmapcss/eval/eval_range.py
Python
agpl-3.0
907
from conans import python_requires import os common = python_requires('llvm-common/0.0.0@orbitdeps/stable') class LLVMDebugInfoCodeView(common.LLVMModulePackage): version = common.LLVMModulePackage.version name = 'llvm_debuginfo_codeview' llvm_component = 'llvm' llvm_module = 'DebugInfoCodeView' l...
pierricgimmig/orbitprofiler
contrib/conan/recipes/llvm_debuginfo_codeview/conanfile.py
Python
bsd-2-clause
390
"""A module exposing the search backends registry.""" from __future__ import unicode_literals from djblets.registries.importer import lazy_import_registry #: The search backend registry. search_backend_registry = \ lazy_import_registry('reviewboard.search.search_backends.registry', 'Sea...
chipx86/reviewboard
reviewboard/search/__init__.py
Python
mit
341
from os.path import join import bzt from bzt.modules.aggregator import DataPoint, KPISet from bzt.modules.k6 import K6Executor, K6LogReader from bzt.utils import EXE_SUFFIX from tests.unit import BZTestCase, ExecutorTestCase, RESOURCES_DIR, ROOT_LOGGER TOOL_NAME = join(RESOURCES_DIR, "k6", "k6_mock" + EXE_SUFFIX) K6...
Blazemeter/taurus
tests/unit/modules/test_k6.py
Python
apache-2.0
3,575
# 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 may ...
Azure/azure-sdk-for-python
sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/operations/_disk_encryption_sets_operations.py
Python
mit
35,129
# Copyright (C) 2010-2011 Richard Lincoln # # 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, modify, merge, publish...
rwl/PyCIM
CIM15/CDPSM/Balanced/IEC61970/Generation/Production/GeneratingUnit.py
Python
mit
4,966
""" Django settings for allauthdemo project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ......
infoclock/OlympicTracker
allauthdemo/settings_generated.py
Python
mit
4,742
from geosquizzy.fsm.fsm import GeojsonFiniteStateMachine from geosquizzy.structure.outcome import GeoSquizzyResults from geosquizzy.optimum.network import Optimum from geosquizzy.gs_socket.gs_client import GsSocketClient from socket import AF_INET, SOCK_STREAM import threading import queue class Tree: def __ini...
LowerSilesians/geo-squizzy
geosquizzy/structure/structure.py
Python
mit
3,495
from __future__ import with_statement from decimal import Decimal, InvalidOperation import time from django.core import serializers from django.db import models from django.db.models import Q from django.db.models.signals import post_save from django.db.utils import DatabaseError from django.dispatch.dispatcher import...
luxnovalabs/enjigo_door
web_interface/djangotoolbox/tests.py
Python
unlicense
30,967
import Sofa import numpy import numpy.linalg from SofaPython import Quaternion import warnings def decomposeInertia(inertia): """ Decompose an inertia matrix into - a diagonal inertia - the rotation (quaternion) to get to the frame in wich the inertia is diagonal """ assert not numpy.isnan(inertia...
Anatoscope/sofa
applications/plugins/SofaPython/python/SofaPython/mass.py
Python
lgpl-2.1
3,920
#!/usr/bin/env python3 class UniqueIndexViolationCheck: unique_indexes_query = """ select table_oid, index_name, table_name, array_agg(attname) as column_names from pg_attribute, ( select pg_index.indrelid as table_oid, index_class.relname as index_name, table_class.relname as table_nam...
50wu/gpdb
gpMgmt/bin/gpcheckcat_modules/unique_index_violation_check.py
Python
apache-2.0
2,547
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2014, 2015, 2016 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your optio...
inveniosoftware/invenio-groups
invenio_groups/forms.py
Python
gpl-2.0
2,700
# -*- coding: utf-8 -*- # # Copyright (c) 2019 SUNET # All rights reserved. # # Redistribution and use in source and binary forms, with or # without modification, are permitted provided that the following # conditions are met: # # 1. Redistributions of source code must retain the above copyright # noti...
SUNET/eduid-webapp
src/eduid_webapp/reset_password/app.py
Python
bsd-3-clause
3,677
import pytest import doctest from insights.core import ContentException from insights.parsers import postconf, SkipException from insights.parsers.postconf import PostconfBuiltin, Postconf, _Postconf from insights.tests import context_wrap V_OUT1 = """ """.strip() V_OUT2 = """ smtpd_tls_loglevel = 0 smtpd_tls_mandat...
RedHatInsights/insights-core
insights/parsers/tests/test_postconf.py
Python
apache-2.0
2,247
x = [] d = 0 for _ in range(4): x.append(int(raw_input())) for i in range(input()): if any(((i + 1) % j == 0) for j in x): d += 1 print d
yamstudio/Codeforces
100/148A - Insomnia cure.py
Python
gpl-3.0
146
import functools import os import random import shutil import subprocess import tempfile from datetime import datetime class OpenSSL(object): def __init__(self, logger, binary, base_path, conf_path, hosts, duration, base_conf_path=None): """Context manager for interacting with OpenSSL. ...
wldcordeiro/servo
tests/wpt/web-platform-tests/tools/sslutils/openssl.py
Python
mpl-2.0
13,164
""" This script investigates how calculating phasic currents from voltage clamp recordings may benefit from subtracting-out the "noise" determined from a subset of the quietest pieces of the recording, rather than using smoothing or curve fitting to guess a guassian-like RMS noise function. """ import os import sys s...
swharden/SWHLab
doc/uses/EPSCs-and-IPSCs/variance method/2016-12-16 tryout2.py
Python
mit
4,500
""" Utilities for getting WIP limit data about a team """ class WIPLimits(object): """ Stores data about a team's wip limit rules """ def __init__(self, columns=None, conwip=None, name=None): if columns is None: columns = {} self.name = name self._conwip = conwip ...
cmheisel/kardboard
kardboard/services/wiplimits.py
Python
mit
889
# Copyright 2010 OpenStack Foundation # Copyright 2012 University Of Minho # # 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....
double12gzh/nova
nova/tests/unit/virt/libvirt/test_driver.py
Python
apache-2.0
606,600
"""Extract, format and print information about Python stack traces.""" import linecache import sys import types __all__ = ['extract_stack', 'extract_tb', 'format_exception', 'format_exception_only', 'format_list', 'format_stack', 'format_tb', 'print_exc', 'format_exc', 'print_exception',...
jt6562/XX-Net
python27/1.0/lib/traceback.py
Python
bsd-2-clause
11,573
from urllib import quote from urlparse import urlparse import glob import inspect import os.path import re import time import traceback from couchpotato.core.event import fireEvent, addEvent from couchpotato.core.helpers.encoding import ss, toSafeString, \ toUnicode, sp from couchpotato.core.helpers.variable impor...
adaxi/couchpotato
couchpotato/core/plugins/base.py
Python
gpl-3.0
13,577
#!/usr/local/bin/python import argparse import sys import os import time import datetime import tempfile import commands from jira.client import JIRA def get_jira_config(): # read the config file home=jira_home=os.getenv('HOME') home=home.rstrip('/') jira_config = dict(line.strip().split('=') for line in open...
dlanza1/parquet-mr
sqoop-patch-review.py
Python
apache-2.0
5,767
# -*- coding: utf-8 -*- from __future__ import unicode_literals import json import logging import re from babelfish import Language, language_converters from guessit import guessit from requests import Session from subliminal.cache import EPISODE_EXPIRATION_TIME, region from subliminal.exceptions import ProviderEr...
pymedusa/Medusa
medusa/subtitle_providers/subtitulamos.py
Python
gpl-3.0
8,471
# -*- coding: utf-8 -*- # Copyright 2022 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...
googleapis/python-service-directory
google/cloud/servicedirectory_v1beta1/services/registration_service/transports/grpc_asyncio.py
Python
apache-2.0
33,087
# -*- coding: utf-8 -*- from django import template from ..models.news import News from ..models.news import Author register = template.Library() @register.inclusion_tag("django_newspaper/sidebar/authors.html") def show_authors(): context_dict = dict() authors_list = [] for author in Author.objects.all(...
PaulWebbster/django-newspaper
newspaper/templatetags/django_newspaper_extras.py
Python
mit
461
class MyMetaClass(type): def __new__(cls, name, bases, ns): ns['kw_created_by_metaclass'] = lambda self, arg: arg.upper() return type.__new__(cls, name, bases, ns) def method_in_metaclass(cls): pass class MetaClassLibrary(metaclass=MyMetaClass): def greet(self, name): re...
moto-timo/robotframework
atest/testresources/testlibs/newstyleclasses3.py
Python
apache-2.0
344
# copied from http://www.roguebasin.com/index.php?title=Bresenham%27s_Line_Algorithm#Python def get_line(x1, y1, x2, y2): points = [] issteep = abs(y2-y1) > abs(x2-x1) if issteep: x1, y1 = y1, x1 x2, y2 = y2, x2 rev = False if x1 > x2: x1, x2 = x2, x1 y1, y2 = y2, y1 rev = True deltax = x2 - x1 deltay ...
Endres/piboard
draw.py
Python
gpl-2.0
1,676
# -*- coding: utf-8 -*- try: from setuptools import setup, find_packages except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages setup( name='crdppf', version='3.1.0', description='SITN, public law restriction portal ...
voisardf/crdppf_core
setup.py
Python
gpl-3.0
923
import sys from mmse15project.views.Administration import Administration from mmse15project.views.CustomerService import CustomerService from mmse15project.views.Financial import Financial from mmse15project.views.HR import HR from mmse15project.views.Marketing import Marketing from mmse15project.views.Production impor...
rssalessio/MMSE15Project-RussoJohansson
mmse15project/ctrls/MainController.py
Python
gpl-2.0
11,737
""" TESTS is a dict with all you tests. Keys for this will be categories' names. Each test is dict with "input" -- input data for user function "answer" -- your right answer "explanation" -- not necessary key, it's using for additional info in animation. """ TESTS = { "Basics": [ {"input": [[0,...
Bryukh-Checkio-Tasks/checkio-task-mono-captcha
verification/tests.py
Python
gpl-2.0
8,473
# -*- coding: utf-8 -*- ############################################################################ # # Copyright (C) 2012-2015 # Xavier Izard # # This file is part of DXF2GCODE. # # DXF2GCODE is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as ...
hehongyu1995/Dxf2GCode
core/customgcode.py
Python
gpl-3.0
2,598
#!/usr/bin/env python3 import argparse import json from copy import deepcopy def main(input_file, output_file, plz_range=range(40210,40721)): geodata = read_jsonfile(input_file) output = {"type": "FeatureCollection", "crs": None, "features": []} for f in range(len(geodata["features"])): try: ...
ffrl/ff-tools
tunneldigger/geojson-plz-filter.py
Python
gpl-2.0
1,806
import os basedir = os.path.abspath(os.path.dirname(__file__)) class Config: SECRET_KEY = os.environ.get('SECRET_KEY') SQLALCHEMY_COMMIT_ON_TEARDOWN = True SQLALCHEMY_TRACK_MODIFICATIONS = True SQLALCHEMY_RECORD_QUERIES = True INFOGRAPHICS_DIR = '/static/img/infographics/' @staticmethod ...
marcoagner/bitcoinfographics
config.py
Python
mit
1,107
import time import gobject import gtk import pango from bot_procman.printf_t import printf_t DEFAULT_MAX_KB_PER_SECOND = 500 ANSI_CODES_TO_TEXT_TAG_PROPERTIES = { \ "1" : ("weight", pango.WEIGHT_BOLD), "2" : ("weight", pango.WEIGHT_LIGHT), "4" : ("underline", pango.UNDERLINE_SINGLE), ...
Morbotic/pronto-distro
externals/libbot-drc/bot2-procman/python/src/bot_procman/sheriff_gtk/command_console.py
Python
lgpl-2.1
10,381
__author__ = 'lorcat' import re import imp from PyQt4 import QtGui, QtCore from app.gui.ui.ui_profiledialog import Ui_ProfileDialog from app.common import Tester from app.config.keys import * from app.config import configuration as config # class enabling profile selection class ProfileDialog(QtGui.QDialog, Tester...
lorcat/GEPACE5000
app/gui/gui_profiledialog.py
Python
gpl-2.0
5,746
from __future__ import unicode_literals, print_function import io from decimal import Decimal import simplejson BS4_PARSER = 'html5lib' def read_json(path): with open(path, 'r') as f: return simplejson.loads(f.read(), use_decimal=True) def write_json(path, data, dumps_params): value = simplejson.d...
karamanolev/mtb-index
mtbbg/utils.py
Python
apache-2.0
1,119
##################################################################### # -*- coding: utf-8 -*- # # # # Frets on Fire # # Copyright (C) 2006 Sami Kyöstilä ...
wrzwicky/fofix
fofix/core/Data.py
Python
gpl-2.0
27,183
<<<<<<< HEAD <<<<<<< HEAD """This module tests SyntaxErrors. Here's an example of the sort of thing that is tested. >>> def f(x): ... global x Traceback (most recent call last): SyntaxError: name 'x' is parameter and global The tests are all raise SyntaxErrors. They were created by checking each C call that rai...
ArcherSys/ArcherSys
Lib/test/test_syntax.py
Python
mit
54,344
#!/usr/bin/env python2 # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:fdm=marker:ai from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>' __docformat__ = 'restructuredtext en' ...
jelly/calibre
setup/vcvars.py
Python
gpl-3.0
2,481
""" Manage AWS ElastiCache ElastiCache provides Memcached and Redis as a service """ import getpass import logging from ConfigParser import ConfigParser import boto3 import botocore from semantic_version import Spec, Version from . import normalize_path from .disco_route53 import DiscoRoute53 from .exceptions import ...
Angakkuit/asiaq-aws
disco_aws_automation/disco_elasticache.py
Python
bsd-2-clause
13,511
import unittest import numpy from templevel import TempLevel __author__ = 'Rio' class TestPocket(unittest.TestCase): def setUp(self): # self.alphaLevel = TempLevel("Dojo_64_64_128.dat") self.level = TempLevel("PocketWorld") self.alphalevel = TempLevel("AnvilWorld") def testPocket(self...
arruda/pymclevel
test/pocket_test.py
Python
isc
880
""" W0711 Exception to catch is the result of a binary operation """
landscape-test/all-messages
messages/pylint/W0711.py
Python
unlicense
70
#!/usr/bin/env python # Copyright 2014-2018 The PySCF Developers. 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 # # U...
gkc1000/pyscf
pyscf/pbc/lib/kpts_helper.py
Python
apache-2.0
13,133
"""Home Assistant command line scripts.""" from __future__ import annotations import argparse import asyncio import importlib import logging import os import sys from typing import Sequence from homeassistant import runner from homeassistant.bootstrap import async_mount_local_lib_path from homeassistant.config import...
w1ll1am23/home-assistant
homeassistant/scripts/__init__.py
Python
apache-2.0
2,358
from __future__ import unicode_literals def test_textx_issue155(): import textx METAMODEL = textx.metamodel_from_str(""" Model: expression=Expr ; ParenExpr: '(' Expr ')'; Expr: ParenExpr | BaseExpr; BaseExpr: left=Condition operations*=Operation; Operation: op=BoolOperator remaining=Con...
igordejanovic/textX
tests/functional/regressions/test_issue155.py
Python
mit
1,857
#!/usr/bin/env python # # Copyright 2015 BMC Software, 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 applicab...
boundary/pulse-api-cli
tests/unit/boundary/hostgroup_delete_test.py
Python
apache-2.0
1,940
from django.shortcuts import render_to_response, get_object_or_404 from django.template import Context, loader from stories.models import Story, Sprint from django.http import HttpResponse from django.views.generic import DetailView, ListView class SprintView(DetailView): days = ["", "","Mon", "", "", "", "Tue", "...
alexsiri7/RoboScrum
stories/views.py
Python
gpl-3.0
2,140
######## # Copyright (c) 2015 GigaSpaces Technologies Ltd. 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...
EarthmanT/cloudify-logstash-plugin
logstash_plugin/tasks.py
Python
apache-2.0
4,699
# -*- coding: utf-8 -*- # # This file is part of INSPIRE. # Copyright (C) 2014, 2015 CERN. # # INSPIRE is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any...
ioannistsanaktsidis/inspire-next
inspire/testsuite/test_robotupload.py
Python
gpl-2.0
4,251
import logging import requests import dateutil.parser from datetime import datetime, timedelta from django.conf import settings from django.db.models import Max from treeherder.model.models import Bugscache, BugJobMap from treeherder.utils.github import fetch_json from treeherder.utils.http import make_request logge...
jmaher/treeherder
treeherder/etl/bugzilla.py
Python
mpl-2.0
13,803
# Copyright 2020 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...
annarev/tensorflow
tensorflow/compiler/mlir/tfr/define_op_template.py
Python
apache-2.0
2,013
#!/usr/bin/python # Copyright (c) 2016-2021 Julien Peloton, Giulio Fabbian. # # This file is part of s4cmb # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or #...
JulienPeloton/s4cmb
s4cmb/input_sky.py
Python
gpl-3.0
26,317
# # Copyright (c) SAS Institute 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 w...
sassoftware/conary
conary_test/repositorytest/changesettest.py
Python
apache-2.0
11,409
#!/usr/bin/env python # -*- coding: UTF-8 -*- import os import re import webapp2 import jinja2 import logging import StringIO from markupsafe import Markup, escape # https://pypi.python.org/pypi/MarkupSafe import parsers from google.appengine.ext import ndb from google.appengine.ext import blobstore from google.ap...
pwz3n0/schemaorg
sdoapp.py
Python
apache-2.0
78,319
"""Version information for Review Board dependencies. This contains constants that other parts of Review Board (primarily packaging) can use to look up information on major dependencies of Review Board. The contents in this file might change substantially between releases. If you're going to make use of data from thi...
reviewboard/reviewboard
reviewboard/dependencies.py
Python
mit
8,444
# Definition for a binary tree node. # class TreeNode(object): # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution(object): def sumOfLeftLeaves(self, root): """ :type root: TreeNode :rtype: int """ ans = 0...
ckclark/leetcode
py/sum-of-left-leaves.py
Python
apache-2.0
628
### # Copyright (c) 2005, Jeremiah Fincher # Copyright (c) 2009, James Vega # 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 n...
tecan/xchat-rt
plugins/scripts/Supybot-0.83.4.1-bitcoinotc-bot/plugins/ShrinkUrl/config.py
Python
gpl-2.0
3,906
import aquests def test_postgres (): dbo = aquests.postgresql ("127.0.0.1:5432", "mydb", ("test", "1111")) for i in range (100): dbo.do ("SELECT * FROM weather;") aquests.fetchall ()
hansroh/aquests
tests/test_postgres.py
Python
mit
192
#!/usr/bin/env python ''' Command to send dynamic filesystem information to Zagg ''' # vim: expandtab:tabstop=4:shiftwidth=4 # # Copyright 2015 Red Hat 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...
blrm/openshift-tools
scripts/monitoring/cron-send-filesystem-metrics.py
Python
apache-2.0
5,045
#!/usr/bin/env python3 ''' Command line wallpaper selection for an arbitrary number of screens. Settings contained in ~/.wallpaper.json ''' import json, os, subprocess, sys def load_data(): try: with open( os.path.join(os.path.expanduser('~'), '.wallpaper.json'), 'r') \ as jfile: return json.load(jfile) ...
PrincessTeruko/wallpaper.py
wallpaper.py
Python
mit
2,946
from __future__ import unicode_literals from django.contrib.contenttypes.models import ContentType from django.core.exceptions import ObjectDoesNotExist from django.db import connection from django.db.models import Prefetch from django.db.models.query import get_prefetcher from django.test import TestCase, override_se...
52ai/django-ccsds
tests/prefetch_related/tests.py
Python
bsd-3-clause
51,773
import contextlib from django.core.exceptions import ValidationError as DjangoValidationError # Remants from MODM days # TODO: Remove usages of aliased Exceptions ValidationError = DjangoValidationError ValidationValueError = DjangoValidationError ValidationTypeError = DjangoValidationError class TokenError(Excepti...
Johnetordoff/osf.io
osf/exceptions.py
Python
apache-2.0
7,309
""" Wrapper functions for printing to a log. The log may be the console, or a text file, or the screen. NOTE: Logger does not yet write to a file. """ # TODO: Investigate how we can put loggers into 'AssetInstance' objects, to # collect information per-instance - rather than some global log that all # methods write i...
david-cattermole/assetQC
python/assetQC/api/logger.py
Python
lgpl-3.0
2,078
#!/usr/local/bin/python # encoding: utf-8 """ *Convert a python list of dictionaries to pretty csv output* :Author: David Young """ import sys import os import io import csv from decimal import Decimal from datetime import datetime os.environ['TERM'] = 'vt100' from fundamentals import tools from fundamentals.mysql...
thespacedoctor/fundamentals
fundamentals/files/list_of_dictionaries_to_mysql_inserts.py
Python
gpl-3.0
2,121
import os from distutils import log from distutils.core import setup, Command, Extension from distutils.dist import Distribution from distutils.command.build import build from distutils.command.build_ext import build_ext from distutils.command.build_py import build_py from distutils.command.install_lib import install_l...
pgavazzi/gitxxl
setup.py
Python
gpl-3.0
3,580