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
# Rain_Water_Trapping def trappedWater(a, size) : # left[i] stores height of tallest bar to the to left of it including itself left = [0] * size # Right [i] stores height of tallest bar to the to right of it including itself right = [0] * size # Initialize result waterVol...
jainaman224/Algo_Ds_Notes
Rain_Water_Trapping/Rain_Water_Trapping.py
Python
gpl-3.0
1,208
#!/usr/bin/env python # -*- coding: utf-8 -*- import datetime from dateutil import relativedelta from django.contrib.auth.decorators import login_required from django.shortcuts import render, redirect from django.db.models import Q, Count from django_tables2 import RequestConfig from osnovni.forms import PredmetForm,...
mbranko/kartonpmv
osnovni/views.py
Python
mit
9,507
#!/usr/bin/python # # main.py # Reads sensor values and sends them to a server through LoRa # Requires LoPy with DHT11 Temperature and Humidity sensor attached # The data pin is set to G7 (expansion board numbering) # Version 1.0 # Author R. Puthli, Itude Mobile # # import sys sys.path.append("/..") import ...
puthli/meet-de-klas
micropython/demo-kit/main.py
Python
mit
1,538
# -*- coding: utf-8 -*- """ ################################################ Plataforma ActivUFRJ ################################################ :Author: *Núcleo de Computação Eletrônica (NCE/UFRJ)* :Contact: carlo@nce.ufrj.br :Date: $Date: 2009-2010 $ :Status: This is a "work in progress" :Revision: $Revision: 0.0...
labase/activnce
main/studio/model.py
Python
gpl-2.0
9,919
import fnmatch import os pattern = 'FNMATCH_*.PY' print('Pattern :', pattern) print() files = os.listdir('.') for name in sorted(files): print('Filename: {:<25} {}'.format( name, fnmatch.fnmatchcase(name, pattern)))
jasonwee/asus-rt-n14uhp-mrtg
src/lesson_file_system/fnmatch_fnmatchcase.py
Python
apache-2.0
232
""" Copyright (c) 2014-2015-2015, The University of Texas at Austin. All rights reserved. This file is part of BLASpy and is available under the 3-Clause BSD License, which can be found in the LICENSE file at the top-level directory or at http://opensource.org/licenses/BSD-3-Clause """ from ..he...
nicholas-moreles/blaspy
blaspy/level_3/syr2k.py
Python
bsd-3-clause
5,321
#!/usr/bin/env python import urllib import requests as requests from urlparse import urlparse from bs4 import BeautifulSoup import os import time import re import headphones from headphones import logger class Rutracker(object): def __init__(self): self.session = requests.session() self.timeout...
WebSpider/headphones
headphones/rutracker.py
Python
gpl-3.0
7,695
#!/usr/bin/env python from tastypie import fields from tastypie.authorization import DjangoAuthorization from tastypie.exceptions import ImmediateHttpResponse from tastypie.http import HttpConflict from panda.api.utils import PandaAuthentication, PandaModelResource, PandaSerializer from django.db import IntegrityErro...
newsapps/panda
panda/api/activity_log.py
Python
mit
1,477
from django.conf.urls.defaults import * urlpatterns = patterns('kikola.contrib.basicsearch.views', url(r'^$', 'search', name='basicsearch'), )
playpauseandstop/kikola
kikola/contrib/basicsearch/urls.py
Python
bsd-3-clause
149
#!/usr/bin/env python # -*- encoding: utf-8 -*- # vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: # Author: Binux<i@binux.me> # http://binux.me # Created on 2014-02-23 00:19:06 import re import sys import time import socket import inspect import datetime import traceback from flask import render_template, requ...
pangyemeng/myjob
pyspider/pyspider_mysql/pyspider/webui/debug.py
Python
gpl-2.0
6,401
__author__ = 'Leonardo De Macedo' from selenium.webdriver import Firefox class BasePage(Firefox): WEB_DRIVER_TIMEOUT = 15 def __init__(self, web_driver): self.driver = web_driver.driver() self.driver.implicitly_wait(self.WEB_DRIVER_TIMEOUT) self.driver.maximize_window() ...
macedoleonardo/WebTesting-Python-Behave
common/selenium_base_page.py
Python
gpl-2.0
443
from __future__ import print_function import zmq import ujson as json from oct.results.models import db, Turret class TurretsManager(object): """Turrets management while runing test. This class is in charge to send message to turrets and to store informations about active turrets :param int publish_por...
karec/oct
oct/core/turrets_manager.py
Python
mit
3,582
#!/usr/bin/env python # ********************************************************************** # # Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. # # *************************************...
sbesson/zeroc-ice
py/demo/IceStorm/clock/Publisher.py
Python
gpl-2.0
2,807
from django.utils.translation import ugettext_lazy as _ import horizon from openstack_dashboard.dashboards.nikolaboard import dashboard class Workflowpanel(horizon.Panel): name = _("Workflow") slug = "workflowpanel" dashboard.Nikolaboard.register(Workflowpanel)
AlexOugh/horizon
openstack_dashboard/dashboards/nikolaboard/workflowpanel/panel.py
Python
apache-2.0
274
#!/usr/bin/python # -*- coding: utf-8 -*- ClusterCapsule = { "CacheMissRatio" : { "CacheMissRate" : 3, "ActiveResidentItemsRatio" : 25, "recurrence": 10, }, "ActiveReplicaResidentRatio" : { "activeReplicaResidentRatio" : 4, "activeResidentRatio" : 30, "repli...
couchbase/healthchecker
threshold.py
Python
apache-2.0
2,655
# -*- coding: utf-8 -*- # Generated by Django 1.10.4 on 2017-01-19 13:23 from __future__ import unicode_literals from django.db import migrations, models SECTOR_MAPPING = { 'Agriculture': 'Agriculture', 'Energy': 'Energy', 'Water (global)': 'WaterGlobal', 'Water (regional)': 'WaterRegional', 'Bio...
bruecksen/isimip
isi_mip/climatemodels/migrations/0057_sector_class_name.py
Python
mit
2,105
# -*- coding: utf-8 -*- """Base module for unittesting.""" from plone.app.testing import applyProfile from plone.app.testing import FunctionalTesting from plone.app.testing import IntegrationTesting from plone.app.testing import login from plone.app.testing import PLONE_FIXTURE from plone.app.testing import PloneSandb...
a25kk/diako
src/diako.sitecontent/diako/sitecontent/testing.py
Python
mit
1,978
""" Export models from each Python module in this package. """ # pylint: disable=W0401 from .base import * from .peer import * from .training import * from .student_training import * from .staff import *
miptliot/edx-ora2
openassessment/assessment/models/__init__.py
Python
agpl-3.0
205
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import absolute_import import hashlib import logging import os from pex import pex_warnings from pex.common import Chroot, chmod_plus_x, open_zip, safe_mkdtemp, safe_open...
jsirois/pex
pex/pex_builder.py
Python
apache-2.0
25,689
from __future__ import unicode_literals from django import forms from django.db.models import Q from symposion.proposals.models import SupportingDocument from django.utils.translation import ugettext_lazy as _ from selectable import forms as selectable from .lookups import UserLookup # @@@ generic proposal form cla...
miurahr/symposion
symposion/proposals/forms.py
Python
bsd-3-clause
1,629
#!/usr/bin/env python # -*- encoding: utf-8 -*- """ Topic: Vector2d类定义 """ import math from array import array class Vector2d: typecode = 'd' def __init__(self, x, y): self.x = float(x) self.y = float(y) def __iter__(self): return (i for i in (self.x, self.y)) def __repr__(...
yidao620c/core-python
ch09objectpython/my_vector2d.py
Python
apache-2.0
1,112
from string import ascii_uppercase from typing import List from ... import BaseProvider class Provider(BaseProvider): """Implement automotive provider for ``en_PH`` locale. Vehicle registration in the Philippines has many controversies and is full of quirks. On top of that, some terms are highly subject...
joke2k/faker
faker/providers/automotive/en_PH/__init__.py
Python
mit
2,476
# Copyright (c) 2016 Lee Cannon # Licensed under the MIT License, see included LICENSE File import click import os import re from datetime import datetime def _is_file_modnet(file_name: str) -> bool: """Returns True if the filename contains Modnet. :param file_name: The filename to check. :type file_nam...
leecannon/trending
trending/command_line.py
Python
mit
5,764
#!/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/dmrgscf/p_dmrg.py
Python
apache-2.0
7,893
# # Copyright (C) 2007, Mark Lee # #http://rl-glue-ext.googlecode.com/ # # 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...
steckdenis/rlglue-py3
rlglue/environment/EnvironmentLoader.py
Python
apache-2.0
2,252
""" CIE L*u*v* Colourspace ====================== Defines the *CIE L\\*u\\*v\\** colourspace transformations: - :func:`colour.XYZ_to_Luv` - :func:`colour.Luv_to_XYZ` - :func:`colour.Luv_to_uv` - :func:`colour.uv_to_Luv` - :func:`colour.Luv_uv_to_xy` - :func:`colour.xy_to_Luv_uv` - :func:`colour.Luv_to_L...
colour-science/colour
colour/models/cie_luv.py
Python
bsd-3-clause
15,660
# furry booru plugin by ararouge (2020) from util import hook from utilities import request import random cache = [] lastsearch = '' def refresh_cache(inp): print "[+] refreshing furry cache" global cache global lastsearch cache = [] search = inp # these are special search queries in the bo...
FrozenPigs/Taigabot
plugins/furry.py
Python
gpl-3.0
1,670
# -*- coding: utf-8 -*- # Generated by Django 1.9.8 on 2016-10-12 22:07 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('tasks', '0005_auto_20161009_0026'), ('results', '000...
davismathew/netbot-django
bootcamp/results/migrations/0002_result_task.py
Python
mit
573
#!/usr/bin/env python # *-* coding: UTF-8 *-* """ Docstring """ from __future__ import print_function import os import config class Grep(object): """ Clasa principala ce evalueaza comenzile si cauta in fisiere """ def __init__(self, options): self.file_list = [] self.pattern = opti...
c-square/python-lab
python/solutii/bogdan_carpusor/grep/grep.py
Python
mit
6,469
# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
google/fedjax
fedjax/core/sqlite_federated_data.py
Python
apache-2.0
12,122
import inspect import operator import re from django.http import HttpResponse class Action: def __init__(self, identifier, method, doc=None): self.identifier = identifier if doc is not None: self.doc = doc.strip() else: self.doc = "" self.method = method ...
pinax/pinax-api
pinax/api/docs.py
Python
mit
5,162
def extractElementalCobalt(item): """ """ vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol or frag) or 'preview' in item['title'].lower(): return None if item['title'].lower().startswith('arifureta chapter') or 'Arifureta Translation' in item['tags']: return buildRe...
fake-name/ReadableWebProxy
WebMirror/management/rss_parser_funcs/feed_parse_extractElementalCobalt.py
Python
bsd-3-clause
1,316
# Copyright 2018 The TensorFlow Probability 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 applicable law o...
tensorflow/probability
tensorflow_probability/python/distributions/autoregressive_test.py
Python
apache-2.0
12,812
# -*- coding: utf-8 -*- # pylint: disable= """ File system helpers. """ # Copyright ⓒ 2015 Jürgen Hermann # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # # This program is distrib...
jhermann/rituals
src/rituals/util/filesys.py
Python
gpl-2.0
3,360
# -*- coding: utf-8 -*- """ Created on Thu Apr 28 09:24:54 2016 @author: feras """ #with open('categoryIndex_places205.csv', 'r') as f: # txt_data = f.readlines() # #for l in txt_data: # label_tree = l.split(" ")[0] # label = label_tree.split("/")[-1] # Cid = l.split(" ")[1] # print "%s:'%s...
fdayoub/ros-semantic-mapper
semantic_label_publisher/nodes/read_cat.py
Python
mit
3,960
# This implements the "diagnose-unwind" command, usually installed # in the debug session like # command script import lldb.diagnose # it is used when lldb's backtrace fails -- it collects and prints # information about the stack frames, and tries an alternate unwind # algorithm, that will help to understand why lldb...
youtube/cobalt
third_party/llvm-project/lldb/examples/python/diagnose_unwind.py
Python
bsd-3-clause
14,039
# -*- coding: utf-8 -*- # Copyright 2015 Rackspace US, 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...
rackerlabs/fastfood
fastfood/shell.py
Python
apache-2.0
8,707
# encoding: utf-8 from cStringIO import StringIO """ Now you are given a string S, which represents a software license key which we would like to format. The string S is composed of alphanumerical characters and dashes. The dashes split the alphanumerical characters within the string into groups. (i.e. if there are ...
alfredleo/leetCode.com
482.license_key_formatting.py
Python
gpl-2.0
5,570
# -*- coding: utf-8 -*- #from __future__ import print_function, division, absolute_import # #from .pointerobject import Pointer, address #from .typeobject import Type, Constructor #from .boolobject import Bool #from .intobject import Int #from .floatobject import Float #from .complexobject import Complex #from .tupleob...
flypy/flypy
flypy/runtime/obj/__init__.py
Python
bsd-2-clause
818
#!/usr/bin/env python # (c) 2012, Jan-Piet Mens <jpmens () 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...
tjanez/ansible
lib/ansible/utils/module_docs.py
Python
gpl-3.0
6,599
# Libraries for drone control from dronekit import * from dronedirect import DroneDirect # Libraries for UDS socket import socket import sys import math import json # Create a UDS socket sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) # Connect the socket to the port where the server is listening server_add...
Frijol/Drone-BCI
drone-control.py
Python
apache-2.0
3,608
#!/usr/bin/env python # # Copyright (C) 2009 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 ...
boxed/CMi
web_frontend/atom/data.py
Python
mit
8,134
import math def is_prime(x): if x < 2: return False if x == 2: return True elif x == 3: return True else: # x > 3: if x % 2 == 0: return False if x % 3 == 0: return False # We can now avoid multiples of 2 and 3 # Starting at 5 and incrementing by 2 and 4 # e.g. 5, 7, 11, 13, 17, 19, 23, 25,...
ehouarn-perret/EhouarnPerret.Python.HackerRank
HackerRank/3 - Mathematics/Fundamentals/4 - Leonardos Prime Factors.py
Python
mit
1,182
from django.test import TestCase from django.test import Client from social.models import * from django.contrib.auth.models import User from datetime import datetime from markdown2 import markdown class PostTestCase(TestCase): def setUp(self): global c c = Client() c.post('/register/', {'user...
tpolasek/cmput410-project
BenHoboCo/social/tests.py
Python
gpl-2.0
3,235
import os import sys import subprocess from flask.ext.script import Manager from alembic import command from alembic.config import Config from flask.ext.assets import ManageAssets from call_server.app import create_app from call_server.extensions import assets, db, cache from call_server.political_data import countri...
poppingtonic/call-power
manager.py
Python
agpl-3.0
4,937
# Download the Python helper library from twilio.com/docs/python/install import os from twilio.rest import Client import json # Your Account Sid and Auth Token from twilio.com/user/account # To set up environmental variables, see http://twil.io/secure account_sid = os.environ['TWILIO_ACCOUNT_SID'] auth_token = os.envi...
TwilioDevEd/api-snippets
rest/taskrouter/workflows/list/post/example-1/example-1.7.x.py
Python
mit
1,664
import unittest import transaction from pyramid import testing from .models import DBSession class TestMyViewSuccessCondition(unittest.TestCase): def setUp(self): self.config = testing.setUp() from sqlalchemy import create_engine engine = create_engine('sqlite://') from .models i...
aarongreenwald/bling-bling
src/app/tests.py
Python
mit
1,495
from __future__ import print_function import inspect import sys import os HEADER = '\033[95m' OKBLUE = '\033[94m' OKGREEN = '\033[92m' WARNING = '\033[93m' ERR = '\033[31m' ENDC = '\033[0m' RED = ERR WARN = WARNING INFO = OKBLUE TODO = OKGREEN DEBUG = HEADER ERROR = ERR prefix = dict( ERR = ERR , ERROR = ERR ...
dilawar/pywordpress
pyblog/colored_print.py
Python
mit
1,846
from __future__ import absolute_import from __future__ import unicode_literals import os import mock import pytest from compose.config.interpolation import interpolate_environment_variables @pytest.yield_fixture def mock_env(): with mock.patch.dict(os.environ): os.environ['USER'] = 'jenny' os.e...
KalleDK/compose
tests/unit/config/interpolation_test.py
Python
apache-2.0
1,639
# Copyright (c) 2003-2005 Maxim Sobolev. All rights reserved. # Copyright (c) 2006-2007 Sippy Software, Inc. All rights reserved. # # This file is part of SIPPY, a free RFC3261 SIP stack and B2BUA. # # SIPPY is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License a...
hgascon/pulsar
pulsar/core/sippy/MsgBody.py
Python
bsd-3-clause
2,374
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.utils.translation import ugettext as _ from misago.conf.migrationutils import migrate_settings_group def create_legal_settings_group(apps, schema_editor): migrate_settings_group( apps, ...
390910131/Misago
misago/legal/migrations/0001_initial.py
Python
gpl-2.0
4,870
"""""" import importlib import os import traceback from collections import defaultdict from pathlib import Path from typing import Dict, List, Set, Tuple, Type, Any, Callable from datetime import datetime, timedelta from concurrent.futures import ThreadPoolExecutor from tzlocal import get_localzone from vnpy.event im...
bigdig/vnpy
vnpy/app/portfolio_strategy/engine.py
Python
mit
20,379
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.utils.timezone import model_utils.fields class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Organization', ...
devs1991/test_edx_docmode
venv/lib/python2.7/site-packages/organizations/migrations/0001_initial.py
Python
agpl-3.0
2,363
import tempfile import re from blog import app, db, install def get_token(data): res = re.search(r'\<input type="hidden" name="token" value="((\w|\d)+)"\>', data) assert res is not None return res.group(1) def pytest_funcarg__dbsetup(request): return DbSetup() def pytest_funcarg__apps...
FelixLoether/blog-project
tests/conftest.py
Python
mit
1,075
#!/usr/bin/env python # -*- encoding: utf-8 -*- # vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: # Author: Binux<i@binux.me> # http://binux.me # Created on 2014-02-09 12:05:52 import os import re import time from sqlitebase import SQLiteMixin from pyspider.database.base.projectdb import ProjectDB as BaseProje...
jorik041/pyspider
pyspider/database/sqlite/projectdb.py
Python
apache-2.0
1,855
# Copyright 2015 PerfKitBenchmarker 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 appli...
akshara775/PerfKitBenchmarker-master-2
perfkitbenchmarker/linux_benchmarks/cassandra_ycsb_benchmark.py
Python
apache-2.0
6,556
#!/usr/bin/env python # -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014, 2015 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/sup...
akintolga/superdesk-core
superdesk/ws.py
Python
agpl-3.0
1,088
from .responses import SecretsManagerResponse url_bases = [r"https?://secretsmanager\.(.+)\.amazonaws\.com"] url_paths = {"{0}/$": SecretsManagerResponse.dispatch}
spulec/moto
moto/secretsmanager/urls.py
Python
apache-2.0
166
import publicfunction as PF def resolve(args): return PF.normal_info('Logout successfully')
neveralso/WebShell
bin/logout.py
Python
gpl-2.0
95
from __future__ import print_function, absolute_import import cv2, os import numpy as np LL_red = (0, 50, 100) LU_red = (10, 255, 255) LL_red2 = (170, 50, 100) LU_red2 = (180, 255, 255) LL_blue = (100, 50, 50) LU_blue = (130, 255, 255) def countRois(binary): rois = [0, 0, 0] rois[0] = cv2.countNonZero(binar...
ibarbech/learnbot
learnbot_dsl/functions/perceptual/camera/visual_auxiliary.py
Python
gpl-3.0
2,069
# -*- coding: utf-8 -*- # import logging import logging.handlers import socket """ A module for centralized remote application logging """ def init(logger, host = "localhost", port = 5005, level = logging.INFO, appName = None, subSystem = None): remoteLogFormatter = logging.Formatter('%(asctime)s %(ip)s %(app)s %(s...
kanflo/ADS-B-funhouse
remotelogger.py
Python
mit
1,114
#===----------------------------------------------------------------------===## # # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. # See https://llvm.org/LICENSE.txt for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception # #===----------------------------------...
llvm-mirror/libunwind
test/libunwind/test/config.py
Python
apache-2.0
2,937
# -*- coding: utf-8 -*- """Module where all interfaces, events and exceptions live.""" from plone.theme.interfaces import IDefaultPloneLayer class IDskSiteThemeLayer(IDefaultPloneLayer): """Marker interface that defines a Zope 3 browser layer."""
a25kk/dsk
src/dsk.sitetheme/dsk/sitetheme/interfaces.py
Python
mit
254
# gizela # # Copyright (C) 2010 Michal Seidl, Tomas Kubin # Author: Tomas Kubin <tomas.kubin@fsv.cvut.cz> # URL: <http://slon.fsv.cvut.cz/gizela> # # $Id$ """ module with functions for gama-data-obs.py and gama-data-adj.py scripts """ import sys def read_configuration_file(configFile, localSystem2D, localSyst...
gizela/gizela
gizela/util/gama_data_fun.py
Python
gpl-3.0
1,739
# Before you make fun of this code, it was a direct line=by-line port from a PHP version. # The goal was to make it perform exactly as the PHP without changing the logic; so called 'port refactoring'. import re inputFileName = '_disambiguator_input.csv' outf1 = open('_attribute_line','wt') outf2 = open('_attribute_m...
CSSIP-AIR/InventorDisambiguator
Initialize_ID.py
Python
bsd-2-clause
2,835
import random import sqlalchemy as sa from sqlalchemy import Column from sqlalchemy import func from sqlalchemy import inspect from sqlalchemy import Integer from sqlalchemy import null from sqlalchemy import select from sqlalchemy import Table from sqlalchemy import testing from sqlalchemy import text from sqlalchemy...
zzzeek/sqlalchemy
test/orm/test_cache_key.py
Python
mit
30,504
from ..util import InputPatterns class Command: def __init__(self, command, help, sub_commands=None, examples=[]): self.command = command self.help = help self.sub_commands = sub_commands self.examples = examples class SubCommand: def __init__(self, name, commands): s...
hidat/audio_pipeline
audio_pipeline/tb_ui/view/Settings.py
Python
mit
3,439
import re from util import hook, http, web gateway = 'https://play.spotify.com/{}/{}' spuri = 'spotify:{}:{}' spotify_re = (r'(spotify:(track|album|artist|user):([a-zA-Z0-9:]+))', re.I) http_re = (r'((open|play)\.spotify\.com\/(track|album|artist|user)\/' '([a-zA-Z0-9\/]+))', re.I) def format_track(i...
cybojenix/SlimBot
plugins/spotify.py
Python
gpl-3.0
4,859
import tkinter as tk from tkinter.simpledialog import * import math class build(Dialog): class _Spinbox(tk.Frame): def __init__(self, master, limit, callback): tk.Frame.__init__(self, master) self.limit = limit self.callback = callback def _grid(self, row=0, c...
ahwmrklas/warpWarp
build.py
Python
gpl-3.0
9,315
''' Perform the polarization calibration for the continuum SPWs ''' import re import os import copy import numpy as np from tasks import applycal, gaincal, setjy, plotms, plotcal, polcal def pol_fit(coeff_type='angle', reffreq=1.0, order=1): ''' Fit a line to the Perley-Butler pol fractions and angles in L...
e-koch/VLA_Lband
16B/pipeline4.7.1_custom/EVLA_pipe_polcal_continuum.py
Python
mit
13,480
from mpl_toolkits.basemap import Basemap import matplotlib.pyplot as plt map = Basemap(resolution='l', satellite_height=3000000., projection='nsper', lat_0 = 30., lon_0 = -27., llcrnrx=500000.,llcrnry=500000.,urcrnrx=2700000.,urcrnry=2700000. ) ma...
krischer/BasemapTutorial
code_examples/projections/regionbboxmc.py
Python
cc0-1.0
441
# encoding: utf-8 # Copyright 2011 Tree.io Limited # This file is part of maker. # License www.tree.io/license """ Services: test suites """ from django.test import TestCase from django.test.client import Client from django.core.urlresolvers import reverse from django.contrib.auth.models import User as DjangoUser...
alejo8591/maker
services/tests.py
Python
mit
26,916
import django import json import sys import os fp = os.path.realpath(__file__) path, filename = os.path.split(fp) webedit_path = os.path.split(path)[0] sys.path.append(webedit_path) os.environ.setdefault("DJANGO_SETTINGS_MODULE", "WebEdit.settings") from django.conf import settings django.setup() from django.core...
illinois-dres-aitg/a11yWebEdit
populate/populate_users.py
Python
gpl-3.0
1,700
# 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, softwa...
google/vulkan_test_applications
gapid_tests/resource_creation_tests/AllocateResetFreeCommandBuffer/AllocateResetFreeCommandBuffer.py
Python
apache-2.0
4,714
#****************************************************************************** # Copyright (C) 2013 Kenneth L. Ho # 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...
WarrenWeckesser/scipy
scipy/linalg/tests/test_interpolative.py
Python
bsd-3-clause
10,953
from urllib.parse import urlunparse, urlparse from django.contrib.auth import REDIRECT_FIELD_NAME from django.http import QueryDict from django.http.response import Http404 from django.views.generic.base import TemplateView from django.utils.translation import ugettext_lazy as _ from django.urls import reverse from b...
matllubos/django-is-core
is_core/generic_views/base.py
Python
bsd-3-clause
6,586
import numpy as np import inspect import os def get_planck(restricted=True): """ Priors from COM_CosmoParams_fullGrid_R2.00\base_w\plikHM_TT_lowTEB\base_w_plikHM_TT_lowTEB""" file = os.path.abspath(inspect.stack()[0][1]) dir_name = os.path.dirname(file) results = np.load(dir_name + "/planck.npy") ...
dessn/sn-bhm
dessn/planck/planck.py
Python
mit
1,173
import os.path as path from io import open # PY2 from setuptools import setup ENCODING = "UTF-8" HERE = path.abspath(path.dirname(__file__)) def read(*relative_path_parts): with open(path.join(HERE, *relative_path_parts), encoding=ENCODING) as f: return f.read() VERSION = "0.4" README = "README.rst" URL = "http...
sp3t3rs/changetrack
windows/win_unicode_console/setup.py
Python
gpl-2.0
1,214
# This file is part of wger Workout Manager. # # wger Workout Manager 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 License, or # (at your option) any later version. # # wger W...
petervanderdoes/wger
wger/email/tests/test_gym_emails.py
Python
agpl-3.0
1,319
# coding=utf-8 ######################################################################################################################## ### Do not forget to adjust the following variables to your own plugin. # The plugin's identifier, has to be unique plugin_identifier = "lcd" # The plugin's python package, should b...
chickenchuck040/OctoPrint-Lcd
setup.py
Python
gpl-2.0
4,024
# -*- coding: utf-8 -*- ### ### This file is generated automatically by SALOME v8.3.0 with dump python functionality ###### Run with DPS_lead_position_V9.py import sys import salome salome.salome_init() theStudy = salome.myStudy import salome_notebook notebook = salome_notebook.NoteBook(theStudy) ### ### GEOM comp...
andreashorn/lead_dbs
ext_libs/OSS-DBS/OSS_platform/Electrode_files/St_Jude6148_floating_profile.py
Python
gpl-3.0
31,062
from unittest import TestCase from ebird.api.checklists import CHECKLIST_URL, get_checklist from tests.mixins import HeaderTestsMixin class GetChecklistTests(TestCase, HeaderTestsMixin): """Tests for the get_checklist() API call.""" def get_callable(self): return get_checklist def get_params(se...
ProjectBabbler/ebird-api
tests/checklists/test_get_checklist.py
Python
mit
606
#!/usr/bin/env python3 """ Script to preprocess OCR output for Tesseract Usage: python3 preprocess.py /path/to/input/dir \ /path/to/output/dir """ from glob import glob import os import shutil import sys import cv2 import numpy as np def preprocess(img): """Takes a given image and retu...
alexcu/hermes-bib-detect
preprocess.py
Python
apache-2.0
2,348
#!/usr/bin/env python2 # Author: David Manouchehri <manouchehri@protonmail.com> # Google 2016 CTF # Challenge: Unbreakable Enterprise Product Activation # Team: hack.carleton (http://hack.carleton.team/) # Runtime: ~4.5 seconds (single threaded E5-2666 v3 @ 2.90GHz on AWS/EC2) import angr import claripy def main():...
Ruide/angr-dev
angr-doc/examples/google2016_unbreakable_0/solve.py
Python
bsd-2-clause
2,631
# 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 ...
yaqiyang/autorest
src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDuration/autorestdurationtestservice/auto_rest_duration_test_service.py
Python
mit
2,204
from .ssh_db import SpaceSshDb
pebble/spacel-provision
src/spacel/user/__init__.py
Python
mit
31
#Track time import gspread import time import datetime from oauth2client.service_account import ServiceAccountCredentials # Delete this after testing # buchungstext = "" # use creds to create a client to interact with the Google Drive API scope = ['https://spreadsheets.google.com/feeds'] creds = ServiceAccountCredent...
peterhuerlimann/python-adventures
spreadsheet_hb.py
Python
mit
883
# -*- coding: utf-8 -*- ############################################################################### # # ZipFile # Creates a zipped version of the specified Box file and returns a link to the new compressed file. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the Apache License...
jordanemedlock/psychtruths
temboo/core/Library/Box/Files/ZipFile.py
Python
apache-2.0
4,646
"Test the functionality of Python classes implementing operators." import unittest from test import test_support testmeths = [ # Binary operations "add", "radd", "sub", "rsub", "mul", "rmul", "div", "rdiv", "mod", "rmod", "divmod", "rdivmod", "pow", "rpow", ...
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-2.7/Lib/test/test_class.py
Python
mit
17,777
#! /usr/bin/env python3 # encoding: utf-8 ''' http://projecteuler.net/problem=1 If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below 1000. ''' # Since May 22 2012 from projecteuler import c...
fossilet/project-euler
pe1.py
Python
mit
1,110
from optparse import OptionParser from default import VERSION, USAGE, DEFAULT_CONF_PATH def get_parser(): """ Get command line arguments parser """ parser = OptionParser(version=VERSION, usage=USAGE) parser.add_option( '--config', dest='config_path', default=DEFAULT_CONF_PATH, type='strin...
mogproject/easy-alert
src/easy_alert/setting/arg_parser.py
Python
apache-2.0
552
#!/usr/bin/env python # # Copyright 2017 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 require...
frlen/simian
src/tests/simian/mac/admin/groups_test.py
Python
apache-2.0
6,292
SECRET_KEY = 'test' INSTALLED_APPS = [ 'django.contrib.auth', 'django.contrib.sites', 'django.contrib.contenttypes', 'treebeard', 'cms', 'post_office', 'filer', 'shop', ] TEMPLATE_CONTEXT_PROCESSORS = ( 'django.core.context_processors.request', ) SHOP_APP_LABEL = 'testshop' DATAB...
schacki/django-shop
shop/testsettings.py
Python
bsd-3-clause
430
# -*- coding: utf-8 -*- """ Role ==== Defines plugin managers that can handle configuration files similar to the ini files manipulated by Python's ConfigParser module. API === """ from telex.plugin.IPlugin import IPlugin from telex.plugin.PluginManagerDecorator import PluginManagerDecorator from telex.plugin.Plug...
Thom7/telex
telex/plugin/ConfigurablePluginManager.py
Python
mit
12,598
import numpy as np import h5py def load_dataset(): train_dataset = h5py.File('./datasets/train_catvnoncat.h5', "r") train_set_x_orig = np.array(train_dataset["train_set_x"][:]) train_set_y_orig = np.array(train_dataset["train_set_y"][:]) test_dataset = h5py.File('datasets/test_catv...
imamol555/Machine-Learning
log_regex_utils.py
Python
mit
806
import os # header # filename, model_number, uncompressed_size, jpeg_size, current_size, jpeg_compression, current_compression, # (JPEG) PSNR SSIM MSSSIM VIFP PSNRHVS PSNRHVSM # (model) PSNR SSIM MSSSIM VIFP PSNRHVS PSNRHVSM def get_metrics(original, compressed, out_name, size): metrics = "PSNR SSIM MSSSIM VI...
iamaaditya/image-compression-cnn
get_metrics.py
Python
mit
1,639
from django.contrib.staticfiles.storage import staticfiles_storage from django.contrib.contenttypes.models import ContentType from django.core.urlresolvers import reverse from jinja2 import Environment from albums.models import Album, Artist, RecordLabel def get_spotify_search_url(term): return 'https://open.spot...
chrisbay/library.kdhx.org
library/jinja2.py
Python
gpl-3.0
1,663
#!/usr/bin/env python import luigi import dynamic_range_simulation import darknoise_simulation import pde_simulation import relative_pde_simulation import n_pe_simulation import crosstalk_neighbour_simulation class All(luigi.WrapperTask): def requires(self): yield crosstalk_neighbour_simulation.All() yie...
ntim/g4sipm
sample/run/luigi/all.py
Python
gpl-3.0
561
# -*- coding: utf-8 -*- from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('contenttypes', '0002_remove_content_type_name'), ('base', '__first__'), ] operations = [ migrations.CreateModel( name='Document', f...
tomkralidis/geonode
geonode/documents/migrations/24_initial.py
Python
gpl-3.0
2,562
from SCons.Script import * import os from os.path import join def exists(env): return 1 def generate(env): original_env = env def read_boards_file(f): """Read board info from an arduino config file.""" boards = {} for line in f: if line.strip() and line.st...
tomjnixon/arduino-scons-alt
arduino.py
Python
mit
6,127