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
import os.path from flask import Blueprint, render_template, request, redirect, url_for, current_app, jsonify from flask_menu import register_menu from flask_wtf import Form from wtforms import StringField, TextAreaField, HiddenField from wtforms.validators import DataRequired from lesimo.common import Module, Simpl...
VascoVisser/lesimo
lesimo/backend/lesimo/pages/admin.py
Python
mit
3,604
# Copyright (c) 2013 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 writ...
esikachev/scenario
sahara/utils/xmlutils.py
Python
apache-2.0
5,656
# -*- coding:utf-8 -*- # # # Copyright (C) 2015 Clear ICT Solutions <info@clearict.com>. # All Rights Reserved. # # This program 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 ver...
Clear-ICT/odoo-addons
stock_team_location/__init__.py
Python
agpl-3.0
831
import asyncio __version__ = '1.3.0' class timeout: """timeout context manager. Useful in cases when you want to apply timeout logic around block of code or in cases when asyncio.wait_for is not suitable. For example: >>> with timeout(0.001): ... async with aiohttp.get('https://github.com'...
vjmac15/Lyilis
lib/async_timeout/__init__.py
Python
gpl-3.0
2,300
from __future__ import print_function, division import numpy as np from astropy import units as u from astropy.table import Table from ..utils.validator import validate_array __all__ = ['Extinction'] class Extinction(object): def __init__(self): self.wav = None self.chi = None @property ...
astrofrog/sedfitter
sedfitter/extinction/extinction.py
Python
bsd-2-clause
3,289
import json import socket import calendar import time import random # generate N clients def generate_clients(N): List = [] for i in range(1, N+1): List.append("website" + str(i) + ".com") return List def main(): N = 2 Clients = generate_clients(N) sock = socket.socket(socket...
processone/grapherl
grapherl/tests/data_feed.py
Python
mit
759
############################ # # # JetHT Run 2016B # # # ############################ from CRABClient.UserUtilities import config, getUsernameFromSiteDB config = config() name = 'bbtoDijetAnalyzer_test' # will be part of the work area name and the storage sub...
avkhadiev/bbtoDijet
bbtoDijetAnalyzer/test/crab_config_bTagDijetV11.py
Python
mit
1,729
## ants ## # # This program simulates an ants colony. # Copyright (C) 2008,2009 Philippe Chretien # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License Version 2 # # This program is distributed in the hope that it will be useful, # but WITHOUT A...
pchretien/ants
python/Position.py
Python
gpl-2.0
1,508
dogum=list() Dogum_Tarihi=int(input ("Bir Doğum Tarihi Giriniz :")) if Dogum_Tarihi < 100: print("Evet!") else: print("Yanlış!")
boraklavun/python-
dogum.py
Python
gpl-3.0
146
from Tkinter import * # This program shows how to use the "after" function to make animation. class Test(Frame): def printit(self): print "hi" def createWidgets(self): self.QUIT = Button(self, text='QUIT', foreground='red', command=self.quit) self.QUIT.pack(side=LEFT, fill=BOTH) self.draw = Canva...
atmark-techno/atmark-dist
user/python/Demo/tkinter/matt/animation-simple.py
Python
gpl-2.0
821
import pytest from pytz import timezone from logging import Logger from datetime import datetime from minette import ( DialogService, SQLiteConnectionProvider, SQLiteContextStore, SQLiteUserStore, SQLiteMessageLogStore, Tagger, Message ) from minette.testing.helper import MinetteForTest from minette.utils ...
uezo/minette-python
tests/test_testing.py
Python
apache-2.0
2,498
# # Copyright (C) 2019 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # the GNU General Public License v.2, or (at your option) any later version. # This program is distributed in the hope that it will be...
atodorov/anaconda
tests/nosetests/pyanaconda_tests/module_network_nm_client_test.py
Python
gpl-2.0
20,985
# -*- coding: utf-8 -*- # Generated by Django 1.9.11 on 2017-03-18 11:08 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='TestDe...
jberci/resolwe
resolwe/elastic/tests/test_app/migrations/0001_initial.py
Python
apache-2.0
1,983
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # ex: set expandtab softtabstop=4 shiftwidth=4: # # Copyright (C) 2014,2015,2016,2017 Contributor # # 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 Li...
quattor/aquilon
lib/aquilon/worker/commands/grant_root_access.py
Python
apache-2.0
2,384
# (c) 2016 Douglas Roark # Licensed under the MIT License. See LICENSE for the details. from __future__ import print_function, division # Valid as of 2.6 import sys sys.path.insert(0, '/home/droark/Projects/BitcoinArmory') import binascii, hashlib, string, os from collections import namedtuple from math import ceil, l...
droark/Misc-Blockchain-Parse-Tools
Blockchain-Stats.py
Python
mit
25,073
from __future__ import absolute_import import logging import shlex import subprocess import time import urlparse from thecache.cache import Cache from gruf.exc import * # NOQA from gruf.models import * # NOQA from . import git LOG = logging.getLogger(__name__) DEFAULT_REMOTE = 'gerrit' DEFAULT_GERRIT_PORT = 2941...
larsks/gruf
gruf/gerrit.py
Python
gpl-3.0
7,525
import pytest from pluggy import HookimplMarker, HookspecMarker from pluggy.hooks import HookImpl hookspec = HookspecMarker("example") hookimpl = HookimplMarker("example") @pytest.fixture def hc(pm): class Hooks(object): @hookspec def he_method1(self, arg): pass pm.add_hookspecs...
KiChjang/servo
tests/wpt/web-platform-tests/tools/third_party/pluggy/testing/test_hookcaller.py
Python
mpl-2.0
4,607
# Copyright 2013 OpenStack Foundation # All Rights Reserved. # Copyright 2013 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LIC...
openstack/tempest
tempest/api/image/v2/test_images_negative.py
Python
apache-2.0
9,231
#!/usr/bin/env python # -*- coding: utf-8 -*- from flask import Flask from flask_restful import reqparse, abort, Api, Resource app = Flask(__name__) api = Api(app) TODOS = { 'todo1': {'task': 'build an API'}, 'todo2': {'task': '?????'}, 'todo3': {'task': 'profit!'}, } def abort_if_todo_doesnt_exist(to...
liaochihung/LearnPython
web_flask/api-2.py
Python
mit
1,529
# Copyright 2015, Kay Hayen, mailto:kay.hayen@gmail.com # # Python test originally created or extracted from other peoples work. The # parts from me are licensed as below. It is at least Free Softwar where # it's copied from other people. In these cases, that will normally be # indicated. # # Li...
tempbottle/Nuitka
tests/benchmarks/constructs/TupleCreation.py
Python
apache-2.0
1,314
#!/usr/bin/env vpython # Copyright 2014 The LUCI Authors. All rights reserved. # Use of this source code is governed under the Apache License, Version 2.0 # that can be found in the LICENSE file. import logging import sys import unittest from test_support import test_env test_env.setup_test_env() from components.con...
luci/luci-py
appengine/components/components/config/common_test.py
Python
apache-2.0
1,441
# # 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 us...
SnappyDataInc/spark
python/pyspark/sql/streaming.py
Python
apache-2.0
37,147
import random from hashlib import sha512 from hmac import compare_digest from datetime import timedelta from django.core.signing import TimestampSigner, SignatureExpired, BadSignature def dice_captcha(): dice = [4, 6, 8, 10, 12, 20] d1, d2 = random.choice(dice), random.choice(dice) question = ["What is "...
ashbc/tgrsite
users/captcha.py
Python
isc
2,553
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Getting Things GNOME! - a personal organizer for the GNOME desktop # Copyright (c) 2008-2013 - Lionel Dricot & Bertrand Rousseau # # This program is free software: you can redistribute it and/or modify it under # t...
shtrom/gtg
GTG/gtk/__init__.py
Python
gpl-3.0
1,311
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2017-18 Richard Hull and contributors # See LICENSE.rst for details. import time import argparse from luma.led_matrix.device import max7219 from luma.core.interface.serial import spi, noop from luma.core.render import canvas from luma.core.legacy import te...
rm-hull/max7219
examples/box_demo.py
Python
mit
1,625
from django.conf.urls import patterns, include, url from django.contrib import admin import views from django.views.generic import ListView from models import TaskList admin.autodiscover() urlpatterns = patterns('', # Examples: url(r'^$', views.IndexView.as_view(), name='index'), # url(r'^blog/', include(...
mpetyx/gorilist
gorilist/gorilist/urls.py
Python
mit
627
#*************************************************************************** #* * #* Copyright (c) 2012 Sebastian Hoogen <github@sebastianhoogen.de> * #* * #* This pr...
yantrabuddhi/FreeCAD
src/Mod/OpenSCAD/replaceobj.py
Python
lgpl-2.1
3,887
# -*- coding: utf-8 -*- ############################################################################## # # Authors: Laurent Mignon # Copyright (c) 2015 Acsone SA/NV (http://www.acsone.eu) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General ...
incaser/website
website_blog_mgmt/__openerp__.py
Python
agpl-3.0
1,471
# 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 ...
lmazuel/azure-sdk-for-python
azure-mgmt-msi/azure/mgmt/msi/operations/operations.py
Python
mit
3,781
#!/usr/bin/env python3 """ Python 3 script which converts simple RetroArch Cg shaders to modern GLSL (ES) format. Author: Hans-Kristian Arntzen (Themaister) License: Public domain N.b.: This script works on some shader files from https://github.com/libretro/common-shaders Other directly converted shaders can be found ...
drodin/Stratagus
src/video/shaders/cg2glsl.py
Python
gpl-2.0
26,562
from django.shortcuts import render,get_object_or_404 from django.http import Http404 # Create your views here. from django.http import HttpResponse def home(request): return render(request,'index.html');
iscarecrow/sb
server/views.py
Python
mit
208
from __future__ import print_function, division from .sympify import sympify, _sympify, SympifyError from .basic import Basic, Atom from .singleton import S from .evalf import EvalfMixin, pure_complex from .decorators import _sympifyit, call_highest_priority from .cache import cacheit from .compatibility import reduce...
wxgeo/geophar
wxgeometrie/sympy/core/expr.py
Python
gpl-2.0
119,698
# -*- coding: utf-8 -*- import requests from lxml import etree #使用requests库的get方法发起请求 headers = {"X-Requested-With" : "XMLHttpRequest"} url = 'http://www.newsmth.net/nForum/board/HouseRent' r = requests.get(url,headers=headers) #网页文本内容 htmlContent = r.text #建立HTML DOM tree page = etree.HTML(htmlContent) #用于解析的一些东西...
RioDream/learning-data-structure
python stuff/rent.py
Python
gpl-2.0
950
import pytest from api.base.settings.defaults import API_BASE from osf_tests.factories import InstitutionFactory @pytest.mark.django_db class TestInstitutionDetail: def test_detail_response(self, app): institution = InstitutionFactory() # return_wrong_id url = '/{}institutions/{}/'.form...
erinspace/osf.io
api_tests/institutions/views/test_institution_detail.py
Python
apache-2.0
665
import unittest from nose.config import Config from nose.plugins.skip import Skip, SkipTest from nose.result import TextTestResult from StringIO import StringIO from nose.result import _TextTestResult from optparse import OptionParser try: # 2.7+ from unittest.runner import _WritelnDecorator except ImportError:...
DESHRAJ/fjord
vendor/packages/nose/unit_tests/test_skip_plugin.py
Python
bsd-3-clause
3,696
''' This file is part of FF1DS_PK which is released under the MIT License. See LICENSE for full license details. ''' import sys,os,getopt BACKREF_DIST = 2**11-1 MAXCODELEN = 2**5-1+2 #============================================================================= def readFile(fil...
geekbozu/DPK_PCKTools
WP16/tools/WP16.py
Python
mit
8,988
#!/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 string """Baby Names exercise Define the extract_names() functi...
brebory/google-python-exercises
babynames/babynames.py
Python
apache-2.0
2,968
# -*- coding: UTF-8 -*- # This file is part of Beppo. # # Beppo 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 later version. # # Beppo is distribute...
mgaitan/beppo
beppo/client/WBQuestions.py
Python
gpl-2.0
4,572
# # # Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of source code must retain the above copyri...
apyrgio/ganeti
lib/rpc/node.py
Python
bsd-2-clause
33,323
from direct.showbase.DirectObject import DirectObject #from direct.directnotify.DirectNotifyGlobal import directNotify class DistributedObjectBase(DirectObject): """ The Distributed Object class is the base class for all network based (i.e. distributed) objects. These will usually (always?) have a dc...
hj3938/panda3d
direct/src/distributed/DistributedObjectBase.py
Python
bsd-3-clause
3,341
""" Copyright (C) 2015 Quinn D Granfor <spootdev@gmail.com> 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 distributed in the hope that it will be useful...
MediaKraken/MediaKraken_Deployment
source/database/db_base_cron.py
Python
gpl-3.0
4,580
""" * library is implicitly named * ename is derived from Python function name * Call by value using numerical built-in types * Inline Chapel code * Multiple Python functions are mapped to the same explicitly named librarie """ from pych.extern import Chapel @Chapel(lib="libfancy0.so") def add_doub...
chapel-lang/pychapel
module/testing/test_cbv_n_expl_same_inline.py
Python
apache-2.0
639
# Using `find_MAP` on models with discrete variables # Maximum a posterior(MAP) estimation, can be difficult in models which have # discrete stochastic variables. Here we demonstrate the problem with a simple # model, and present a few possible work arounds. import pymc3 as mc # We define a simple model of a survey ...
MCGallaspy/pymc3
pymc3/examples/discrete_find_MAP.py
Python
apache-2.0
5,268
MARV 2 21 7710 36 0 70 MARV 5 01 x 0 0 0 MARV 5 02 7710 66 420 40 MARV 5 14 5710 33 315 70 MARV 5 67 7710 66 500 70 MARV 6 09 + 0 5 x 20 MARV 6 16 + 310 0 0 0 MARV 6 46 + 0 66 660 70 MARV 6 49 + x 66 0 70 MARV 6 82a 7710 66 x x MARV 6 82b 0 0 x 70 MARV 7 27 x x 600 0 MARV 7 63 x 7 70 x MARV 9 01 x x 0 MARV 9 06 x 0 0 ...
PaulEG/Various-Projects
Sudu.py
Python
artistic-2.0
347
# Copyright 2019 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/python/keras/mixed_precision/autocast_variable.py
Python
apache-2.0
20,579
# encoding: utf-8 """ Test suite for pptx.presentation module. """ from __future__ import ( absolute_import, division, print_function, unicode_literals ) import pytest from pptx.parts.coreprops import CorePropertiesPart from pptx.parts.presentation import PresentationPart from pptx.parts.slide import NotesMaste...
biggihs/python-pptx
tests/test_presentation.py
Python
mit
8,885
# 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. import os IGNORED_DIRECTORIES = ['resources'] TEST_EXTENSIONS = ['sky'] def find_tests(directory): for root, dirs, files in os.walk(directory): ...
xunmengfeng/engine
sky/tools/skypy/find_tests.py
Python
bsd-3-clause
654
#!/usr/bin/python # # Copyright 2009 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 b...
dekom/threepress-bookworm-read-only
bookworm/gdata/tests/gdata_tests/docs/live_client_test.py
Python
bsd-3-clause
9,696
import os import time import random from lockfile.linklockfile import LinkLockFile class ExpiringLinkLockFile(LinkLockFile): def __init__(self, *args, **kwargs): LinkLockFile.__init__(self, *args, **kwargs) dirname = os.path.dirname(self.path) if not os.path.exists(dirname): os...
globocom/hlsclient
hlsclient/lock.py
Python
mit
904
# encoding: utf-8 from django import forms from django.views import generic from django.utils.translation import ugettext_lazy as _ from django.contrib import auth, messages from django.contrib.auth import get_user_model from django.contrib.sites.models import get_current_site from django.contrib.auth.tokens import de...
dalou/django-extended
django_extended/views/password_reset.py
Python
bsd-3-clause
2,452
#!/usr/bin/env python2 # # Copyright (c) 2015, Anders Steen Christensen # 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 notic...
andersx/dftbfit
dftbfit/__init__.py
Python
bsd-2-clause
1,530
from .people import IDPersonScraper from .bills import IDBillScraper from utils import url_xpath, State # from .committees import IDCommitteeScraper class Idaho(State): scrapers = { "people": IDPersonScraper, # 'committees': IDCommitteeScraper, "bills": IDBillScraper, } legislativ...
sunlightlabs/openstates
scrapers/id/__init__.py
Python
gpl-3.0
4,859
from model.group import Group class GroupHelper: def __init__(self, app): self.app = app def return_to_groups_page(self): wd = self.app.wd # return to groups page wd.find_element_by_link_text("group page").click() def create(self, group): wd = self.app.wd ...
PaulRumyantsev/python_QA
fixture/group.py
Python
apache-2.0
3,962
#!/usr/bin/python # # Copyright 2015 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 b...
wubr2000/googleads-python-lib
examples/dfp/v201505/creative_set_service/get_all_creative_sets.py
Python
apache-2.0
1,955
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Accuracy tests for GCRS coordinate transformations, primarily to/from AltAz. """ import pytest import numpy as np from ... import units as u from ...tests.helper import (quantity_allclose as allclose, assert_quantity_allc...
funbaker/astropy
astropy/coordinates/tests/test_intermediate_transformations.py
Python
bsd-3-clause
20,378
#!/usr/bin/env python import os import gtk import dbus import gobject POPUP_TIMEOUT_MILLIS = 3000 POLL_MILLIS = 5000 class Popup (gtk.Window): def __init__ (self, status, widget): gtk.Window.__init__ (self) self.set_decorated (False) self.set_skip_taskbar_hint (True) self.set_skip_pager_hint (True) self.s...
community-ssu/tracker
python/applet/applet.py
Python
gpl-2.0
4,290
#!/usr/bin/env python # coding: utf-8 """ Copyright 2015 SmartBear Software Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unle...
ambitioninc/ambition-python
ambition/models/serializer.py
Python
mit
1,464
# -*- coding: utf-8 -*- # # Copyright (C) 2013-2014 Germain Z. <germanosz@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 of the License, or # (at your option) any ...
bfrg/dotfiles
weechat/python/vimode.py
Python
mit
51,606
""" Windows/OS2 Bitmap (BMP) this could have been a perfect show-case file format, but they had to make it ugly (all sorts of alignment or """ from construct import * # =============================================================================== # pixels: uncompressed # ============================================...
mosquito/construct
construct/formats/graphics/bmp.py
Python
mit
4,553
from __future__ import unicode_literals from mongoengine.errors import ValidationError as me_ValidationError from mongoengine import fields as me_fields from django.db import models from django.forms import widgets from django.core.exceptions import ImproperlyConfigured from collections import OrderedDict from rest...
tweiand-10m2/django-rest-framework-mongoengine
rest_framework_mongoengine/serializers.py
Python
mit
20,767
from __future__ import absolute_import from typing import Any, List, Dict, Optional, Callable, Tuple from django.utils.translation import ugettext as _ from django.conf import settings from django.contrib.auth import authenticate, login, get_backends from django.core.urlresolvers import reverse from django.http import...
Vallher/zulip
zerver/views/__init__.py
Python
apache-2.0
60,405
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Sydney Technical High School Calendar to iCalendar Crawler Application to create an iCalendar file based of calender information from http://sths.nsw.edu.au/about-sths/calendar Author: Andrew Wong (e) featherbear@navhaxs.au.eu.org Version 1.0 """ #################...
bearbear12345/sgghs.com.au-calendar-crawler
sthsCalendar.py
Python
mit
3,728
# -*- coding: utf-8 -*- # untouched # Copyright (C) 2012 Tommy Winther # http://tommy.winther.nu # # Modified for FTV Guide (09/2014 onwards) # by Thomas Geppert [bluezed] - bluezed.apps@gmail.com # # This Program is free software; you can redistribute it and/or modify # it under the term...
odicraig/kodi2odi
addons/plugin.program.echotvguide/strings.py
Python
gpl-3.0
2,289
''' Created on Jul 22, 2011 @author: Stephen O'Hara This demonstration will play the streaming video from a compliant IP (network) video camera. Getting the url correct for your make/model camera is critical, and you'll also need to have OpenCV built with ffmpeg support. If the dependencies are met, you can see that t...
tigerking/pyvision
src/samples/play_IP_camera_video_stream.py
Python
bsd-3-clause
1,042
# -*- coding: utf-8 -*- # Copyright 2013 Red Hat, 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 ...
saeki-masaki/glance
glance/tests/unit/common/test_rpc.py
Python
apache-2.0
12,414
# coding=utf-8 import unittest """468. Validate IP Address https://leetcode.com/problems/validate-ip-address/description/ Write a function to check whether an input string is a valid IPv4 address or IPv6 address or neither. **IPv4** addresses are canonically represented in dot-decimal notation, which consists of fou...
openqt/algorithms
leetcode/python/ac/lc468-validate-ip-address.py
Python
gpl-3.0
3,919
from ..utils import Utils from mopidy.core import PlaybackState from mopidy.models import Track from ..witai import ai import traceback import time from ..audio import sounds from ..audio import voices from mopidy_rstation.config.settings import Config from mopidy_rstation.config.settings import Settings LIRC_PROG_NAM...
araczkowski/mopidy-rstation
mopidy_rstation/input/command_dispatcher.py
Python
apache-2.0
12,112
from cmislib.exceptions import UpdateConflictException, ObjectNotFoundException from os import path from urllib.parse import quote from uuid import uuid4 def get_or_create_folder(repo, folder): """Get a folder object from cmis, or create it if it doesn't exist. Similar to the unix command `mkdir -p`.""" ...
concordusapps/python-cmis
cmis/utils.py
Python
mit
1,756
import argparse import numpy as np import theano.tensor as t from time import time from numpy.random import RandomState from nn.net import TrainerNetwork as Net from nn.contiguousLayer import ContiguousLayer from nn.convolutionalLayer import ConvolutionalLayer from dataset.ingest.labeled import ingestImagery from bui...
mbojrab/playbox
trunk/projects/supervised/leNet5Trainer.py
Python
mit
5,687
# The following comment should be removed at some point in the future. # mypy: disallow-untyped-defs=False from pip._vendor import pkg_resources from pip._internal.distributions.base import AbstractDistribution class WheelDistribution(AbstractDistribution): """Represents a wheel distribution. This does not...
rouge8/pip
src/pip/_internal/distributions/wheel.py
Python
mit
616
# -*- coding:utf-8 -*- # Created by xupingmao on 2017/06/11 # @modified 2021/07/18 19:13:02 """英汉、汉英词典 dictDTB结构 _id integer primary key autoincrement, en text,cn text, symbol text 指音标 """ import re import os import xutils import xmanager import xconfig import xtables from xutils import u, Storage, Sea...
xupingmao/xnote
handlers/search/dictionary.py
Python
gpl-3.0
3,142
""" WSGI config for django_http_api project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLIC...
kuldeepfouzdar/django-basic
django_http_api/django_http_api/wsgi.py
Python
gpl-2.0
1,446
""" Micro Python driver for SD cards using SPI bus. Requires an SPI bus and a CS pin. Provides readblocks and writeblocks methods so the device can be mounted as a filesystem. Example usage on pyboard: import pyb, sdcard, os sd = sdcard.SDCard(pyb.SPI(1), pyb.Pin.board.X5) pyb.mount(sd, '/sd2') os.l...
jmarcelino/pycom-micropython
drivers/sdcard/sdcard.py
Python
mit
7,999
"""The module for the Memory Management Unit used in this project""" import shelve MAX_FRAMES = 20 class MMU: def __init__(self): self.frames = [] self.max_frames = MAX_FRAMES def retrieve_block(self,my_btree,btree_ptr):#my_btree is a shelve. """returns a tuple of Node object and the num...
codebuff95/disk_datastructures
mmu.py
Python
gpl-3.0
903
# -*- coding: utf-8 -*- #Copyright (C) 2012 Riccardo Apolloni ''' 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 (at your option) any later version. This ...
j3b4/PySail-426
legacy/ModuloBarca02.py
Python
gpl-3.0
17,019
#!/usr/bin/env python3 from mathbind.types import BasicType class BasicValueType(BasicType): """ Represents a basic pure type that can be passed by value, thus excluding arrays and pointers. Attributes: - typename (str): basic C typename (int, long long, unsigned, bool, etc) - c_math_name (str): ...
diogenes1oliveira/mathbind
mathbind/types/basicvaluetype.py
Python
mit
3,498
#!/Users/coursehero/Repos/slack-christmas-bot/christmasbot/bin/python2.7 # $Id: rst2s5.py 4564 2006-05-21 20:44:42Z wiemann $ # Author: Chris Liechti <cliechti@gmx.net> # Copyright: This module has been placed in the public domain. """ A minimal front end to the Docutils Publisher, producing HTML slides using the S5 ...
Mechdriver/slack-christmas-bot
christmasbot/bin/rst2s5.py
Python
mit
691
#! /usr/bin/python #-*- coding:utf-8 -* __author__ = "Cedric Bonhomme" __version__ = "$Revision: 0.3 $" __date__ = "$Date: 2015/08/31$" __revision__ = "$Date: 2015/10/26 $" __copyright__ = "" __license__ = "" import sys import requests import json import pickle import clusters import list_clusters def recommend(use...
cedricbonhomme/k-means-clustering
recommend.py
Python
mit
2,926
import unittest from empty import Empty class LinkedQueue: class _Node: __slots__ = '_element', '_link' def __init__(self, e, l): self._element = e self._link = l def __init__(self): self._head = self._Node(None, None) self._tail = self._head ...
jward6/academics-python
datastructures/linkedQueue.py
Python
mit
3,266
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-02-24 07:16 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('stats', '0005_remove_event_metric'), ] operations = [ migrations.RenameField( ...
jabber-at/hp
hp/stats/migrations/0006_auto_20170224_0716.py
Python
gpl-3.0
430
"""Error in MPF or MPF-MC.""" from mpf._version import log_url class BaseError(AssertionError): """Error in a config file found.""" # pylint: disable-msg=too-many-arguments def __init__(self, message, error_no, logger_name, context=None, url_name=None): """Initialise exception.""" self._...
missionpinball/mpf
mpf/exceptions/base_error.py
Python
mit
1,901
import pygame import sys from pygame.locals import * import random import math from settings import * # initialize pygame pygame.init() pygame.font.init() # Colors black = (0, 0, 0) white = (255, 255, 255) red = (200, 0, 0) green = (0, 255, 0) blue = (0, 0, 200) aqua = (0, 255, 255) silver = (192, 192, 192) dark...
goru47/INF1L-PRJ-2
how to play button incomplete.py
Python
mit
13,693
""" Django settings for mysite 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, ...) import...
dresl/python_web_grayscale_bootstrap_theme
mysite/settings.py
Python
apache-2.0
3,753
r""" Laplace equation using the long syntax of keywords. See the tutorial section :ref:`poisson-example-tutorial` for a detailed explanation. See :ref:`diffusion-poisson_short_syntax` for the short syntax version. Find :math:`t` such that: .. math:: \int_{\Omega} c \nabla s \cdot \nabla t = 0 \;, \quad \...
RexFuzzle/sfepy
examples/diffusion/poisson.py
Python
bsd-3-clause
2,019
#!/usr/bin/env python # # Copyright 2010 Google Inc. All Rights Reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, th...
2coding/Codec
thirdparty/gtest-1.6.0/test/gtest_catch_exceptions_test.py
Python
bsd-3-clause
9,532
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from django.conf.urls import patterns, url from bedrock.mozorg.util import page from bedrock.legal import views from b...
Jobava/bedrock
bedrock/legal/urls.py
Python
mpl-2.0
2,122
from __future__ import print_function from __future__ import division from __future__ import absolute_import from flask import Flask, render_template, request, redirect, url_for, jsonify from moca.helpers import ConfigurationParser from celery import Celery import sys import requests app = Flask(__name__) def init_pa...
saketkc/moca
moca/webservice/client/client.py
Python
isc
1,427
# This file is part of the bapsflib package, a Python toolkit for the # BaPSF group at UCLA. # # http://plasma.physics.ucla.edu/ # # Copyright 2017-2018 Erik T. Everson and contributors # # License: Standard 3-clause BSD; see "LICENSES/LICENSE.txt" for full # license terms and contributor agreement. # """Module for d...
rocco8773/bapsflib
bapsflib/_hdf/maps/digitizers/map_digis.py
Python
bsd-3-clause
3,518
"""Convert reStructuredText into HTML.""" from docutils import nodes from docutils.core import publish_parts from docutils.writers import html5_polyglot from ._misc import parameters @parameters( jsonschema={ "type": "object", "properties": {"settings": {"type": "object"}}, } ) def process(a...
ikalnytskyi/holocron
src/holocron/_processors/restructuredtext.py
Python
bsd-3-clause
3,253
""" ``revscoring cv_train -h`` :: Performs a cross-validation of a scorer model strategy across folds of a dataset and then trains a final model on the entire set of data. Usage: cv_train -h | --help cv_train <scorer-model> <features> <label> [-p=<kv>]... [-s=<kv>]... ...
yafeunteun/wikipedia-spam-classifier
revscoring/revscoring/utilities/cv_train.py
Python
mit
4,940
from __future__ import unicode_literals import os import sys from django.contrib.sites.models import Site from mezzanine.conf import settings from mezzanine.core.request import current_request def current_site_id(): """ Responsible for determining the current ``Site`` instance to use when retrieving da...
Kniyl/mezzanine
mezzanine/utils/sites.py
Python
bsd-2-clause
4,256
# -*- coding: utf-8 -*- # Copyright (c) 2015-2022, Exa Analytics Development Team # Distributed under the terms of the Apache License 2.0 """ A unified data anlaysis and visualization platform for computational and theoretical chemists, physicists, etc. Support for molecular geometry and orbital visualization is provid...
exa-analytics/exatomic
exatomic/__init__.py
Python
apache-2.0
2,551
import requests import json import random import uuid login="test" password="P@ssword" with open("dict", 'r', encoding="latin-1") as words : a = words.readlines() headers = { 'Content-type': 'application/json', 'Accept': 'application/json' } def gen_ip(): a = random.randint(1, 254) b = rando...
H0neyBadger/cmdb
extra/create_rand_host.py
Python
mit
2,026
""" Storage wrapper for Errors found by KLEE """ from collections import OrderedDict from functools import total_ordering from os import path from .StackTrace import StackTrace @total_ordering class Error: program_functions = [] def set_program_functions(program_functions): Error.program_functions = ...
tum-i22/macke
macke/Error.py
Python
apache-2.0
6,689
#!/usr/bin/python import time from ops_i2cbase import I2CBase # =========================================================================== # HMC6352 Class # =========================================================================== class HMC6352 : i2c = None # HMC6352 Address address = 0x42 >> 1 # Command...
randymxj/OpenPythonSensor
lib_hmc6352/lib_hmc6352.py
Python
mit
1,086
#from entitysystem import EntitySystem
rocktavious/PyGLEngine
PyGLEngine/core/systems/__init__.py
Python
mit
38
""" Selectors for list view """ from selenium.webdriver.common.by import By LIST_VIEW_CONTAINER = ( By.CSS_SELECTOR, '.oe_webclient .oe_application .oe_view_manager_body .oe_list_content' ) LIST_VIEW_ROW = ( By.CSS_SELECTOR, '.oe_webclient .oe_application .oe_view_manager_body ' '.oe_list_content ...
bjss/BJSS_liveobs_automation
liveobs_ui/selectors/desktop/list_selectors.py
Python
gpl-3.0
1,257
from deep_learning_layers import ConvolutionOver2DAxisLayer, MaxPoolOverAxisLayer, MaxPoolOver2DAxisLayer, \ MaxPoolOver3DAxisLayer, ConvolutionOver3DAxisLayer, ConvolutionOverAxisLayer from default import * import theano.tensor as T from layers import MuLogSigmaErfLayer, CumSumLayer import objectives from lasagn...
317070/kaggle-heart
configurations/j0_dense9.py
Python
mit
6,506
#!/usr/bin/env python3.6 import errno import os import sys from sigma.core.sigma import ApexSigma try: assert sys.version_info >= (3, 6) except AssertionError: print('Fatal Error: Wrong Python Version! Sigma supports Python 3.6+!') exit(errno.EINVAL) if __name__ == '__main__': ci_token = os.getenv('C...
AXAz0r/apex-sigma-core
run.py
Python
gpl-3.0
419
if __name__ == '__main__': l = [10, 20, 30, 40, 50, 60] print(l[:2]) print(l[2:]) print(l[:3]) print(l[3:]) s = 'bicycle' print(s[::3]) print(s[::-1]) print(s[::-2]) print(s[::1]) invoice = """ 0 6 40 52 55 1909 Pimoroni PiBr...
ordinary-developer/lin_education
books/techno/python/fluent_python_l_ramalho/code/ch_2-an_array_of_sequences/10_slicing/main.py
Python
mit
1,013