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
"""Test praw.models.subreddit.""" from os.path import abspath, dirname, join from json import dumps import sys from praw.exceptions import APIException, ClientException from praw.models import ( Comment, ModAction, ModmailAction, ModmailConversation, ModmailMessage, Redditor, Submission, ...
leviroth/praw
tests/integration/models/reddit/test_subreddit.py
Python
bsd-2-clause
69,999
""" Module "Screen" : Wrapper for the ncurses screen All screen related functions such as displaying text, colors, background, saving/restoring context etc. go here. """ # Standard Library Imports import curses import tempfile import math import threading # Custom Module Imports import config as C import debu...
rbavishi/Habitican-Curse
habitican_curse/screen.py
Python
mit
8,738
# -*- coding: utf-8 -*- # # PIDSIM documentation build configuration file, created by # sphinx-quickstart on Fri Oct 29 16:46:33 2010. # # 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 ...
rafaelmartins/pidsim
doc/conf.py
Python
gpl-2.0
7,320
#!/usr/bin/env python # # GrovePi Python library # v1.2.2 # # This file provides the basic functions for using the GrovePi # # The GrovePi connects the Raspberry Pi and Grove sensors. You can learn more about GrovePi here: http://www.dexterindustries.com/GrovePi # # Have a question about this example? Ask on the for...
lupyuen/RaspberryPiImage
home/pi/GrovePi/Software/Python/grovepi.py
Python
apache-2.0
16,137
"""Support for the Transmission BitTorrent client API.""" from datetime import timedelta import logging import voluptuous as vol from homeassistant.const import ( CONF_HOST, CONF_MONITORED_CONDITIONS, CONF_NAME, CONF_PASSWORD, CONF_PORT, CONF_SCAN_INTERVAL, CONF_USERNAME, ) from homeassist...
fbradyirl/home-assistant
homeassistant/components/transmission/__init__.py
Python
apache-2.0
7,192
import unittest import os import time import contextlib import shlex import os import funconf import virtualbox from virtualbox import library config = funconf.Config(["tests/test_vm.conf", "test_vm.conf"]) username = config.machine.username password = config.machine.password class TestTestVM(unittest.TestCase): ...
mjdorma/pyvbox
tests/test_test_vm.py
Python
apache-2.0
3,710
from cogs.cog import Cog class Admin(Cog): def __init__(self, bot): super().__init__(bot) def setup(bot): bot.add_cog(Admin(bot))
s0hvaperuna/Not-a-bot
cogs/admin.py
Python
mit
150
# Plus One # https://leetcode.com/problems/plus-one/ class Solution(object): def plusOne(self, digits): """ :type digits: List[int] :rtype: List[int] """ return map(int, list( str(1 + int(''.join( map(str, digits) ) ) ) ) )
ranji2612/leetCode
plusOne.py
Python
gpl-2.0
268
from __future__ import unicode_literals import time import unittest from django.core.exceptions import ImproperlyConfigured from django.core.urlresolvers import resolve from django.http import HttpResponse from django.test import RequestFactory, SimpleTestCase, override_settings from django.test.utils import require_...
dydek/django
tests/generic_views/test_base.py
Python
bsd-3-clause
19,802
boolA = True boolB = True boolC = False print(True or True and False) # True print((True or True) and False) # False print(True or (True and False)) # True 说明 and 优先级 > or print(not True and False) # False print(not False and True) # True 说明 not 优先级 > and
z727354123/pyCharmTest
2017/10_Oct/17/02-优先级.py
Python
apache-2.0
296
import numpy import theano import theano.tensor as T #just some code while playing around with softmax - see rbm_softmax.py for the real thing initial_W = numpy.asarray( [[0.1,0.2,0.3], \ [0.1,0.2,0.3], \ [0.1,0.2,0.3]], \ dtype = the...
utunga/hashmapd
test/test_softmax.py
Python
agpl-3.0
1,348
import DeepFried2 as df def net(): model = df.Sequential() model.add(df.Linear(28*28, 100)) model.add(df.ReLU()) model.add(df.Linear(100, 100)) model.add(df.ReLU()) model.add(df.Linear(100, 100)) model.add(df.ReLU()) model.add(df.Linear(100, 10)) model.add(df.SoftMax()) retu...
yobibyte/DeepFried2
examples/Optimizers/model.py
Python
mit
1,782
# -*- coding: utf-8 -*- # # Copyright (C) 2012 Benjamin Bertrand # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # T...
beenje/plugin.video.m6groupe
addon.py
Python
gpl-2.0
3,229
from __future__ import unicode_literals import logging import traceback from django.conf import settings from django.core.paginator import InvalidPage, Paginator from django.http import (HttpResponse, HttpResponseNotModified, HttpResponseServerError, Http404) from django.shortcuts import get_...
KnowNo/reviewboard
reviewboard/diffviewer/views.py
Python
mit
16,931
#!/usr/bin/env python3 from http.server import BaseHTTPRequestHandler, HTTPServer from socketserver import ThreadingMixIn from types import SimpleNamespace from collections import OrderedDict import cgi import datetime import json import time PORT_NUMBER = 3000 TIMEOUT = 120 clients_data = OrderedDict() class HTTP...
ustclug/liimstrap
monitor/server.py
Python
mit
4,553
from time import localtime class Date: def __init__(self, year, month, day): self.year = year self.month = month self.day = day # Class method that bypasses __init__ @classmethod def today(cls): d = cls.__new__(cls) t = localtime() d.year = t.tm_year ...
tuanavu/python-cookbook-3rd
src/8/creating_an_instance_without_invoking_init/example.py
Python
mit
612
# Copyright (c) 2006-2007 The Regents of The University of Michigan # Copyright (c) 2009 Advanced Micro Devices, 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 co...
rallylee/gem5
configs/ruby/MOESI_hammer.py
Python
bsd-3-clause
11,273
#! /usr/bin/env python from __future__ import print_function import lib class ErrorHandler(object): def __enter__(self): pass def __exit__(self, error_type, error_args, traceback): if error_type is None: return if error_type is lib.gui.tk.TclError: print("WARNI...
jPhy/Gomoku
game.py
Python
mit
872
#!/usr/bin/env python from distutils.core import setup with open('README.rst') as file: long_description = file.read() setup( name = "sifter", version = "0.1", author = "Gary Peck", author_email = "gary@realify.com", url = "https://github.com/garyp/sifter", license...
garyp/sifter
setup.py
Python
bsd-2-clause
1,494
from se34euca.lib.EucaUITestLib_Base import * class EucaUITestLib_Snapshot(EucaUITestLib_Base): def test_ui_delete_snapshot(self): print print "Started Test: Delete Snapshot" self.verify_element_by_link_text("Launch new instance") print print "Test: Go to the Page Snapshot"...
eucalyptus/se34euca
3.3.1/se34euca/se34euca/lib/EucaUITestLib_Snapshot.py
Python
bsd-2-clause
2,274
"""Package with general repository related functions""" from gitdb.exc import BadObject from git.refs import SymbolicReference from git.objects import Object from gitdb.util import ( join, isdir, isfile, hex_to_bin, bin_to_hex ) from string import digits __all__ = ('rev_pars...
OpenInkpot-archive/iplinux-python-git
lib/git/repo/fun.py
Python
bsd-3-clause
6,027
# coding: utf-8 # # ROMS layer velocity plot # In[1]: get_ipython().magic(u'matplotlib inline') import matplotlib.pyplot as plt import numpy as np import netCDF4 # In[2]: tidx = -1 # just get the final frame, for now. scale = 0.03 isub = 3 url = 'http://geoport.whoi.edu/thredds/dodsC/examples/bora_feb.nc' ...
rsignell-usgs/notebook
ROMS/ROMS Adriatic Velocity.py
Python
mit
3,434
# -*- coding: UTF-8 -*- ''' magento.api Generic API for magento :copyright: (c) 2010 by Sharoon Thomas. :copyright: (c) 2010 by Openlabs Technologies & Consulting (P) LTD :license: AGPLv3, see LICENSE for more details ''' PROTOCOLS = [] try: from xmlrpclib import ServerProxy except ImportErro...
Mohitsahu123/magento-1
magento/api.py
Python
agpl-3.0
5,606
#!/usr/bin/env python from setuptools import setup, find_packages setup(name="python-instagram", version="2.0.0", description="Instagram API client", license="MIT", install_requires=["simplejson","httplib2","six"], author="Instagram, Inc", author_email="apidevelopers@instagram.com",...
ccstolley/python-instagram
setup.py
Python
bsd-3-clause
465
## # Copyright (c) 2012-2014 Apple Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
trevor/calendarserver
calendarserver/tools/test/test_calverify.py
Python
apache-2.0
97,818
# -*- coding: utf-8 -*- # try something like @auth.requires_login() def index(): user_info = db().select(db.auth_user.first_name, db.auth_user.last_name, db.auth_user.orientation_attended, db.auth_user.phone, db.auth_user.zip, db.auth_user.skills, db.auth_user.email) return dict(message="he...
jeremydonahue/kittenrescue
controllers/admin.py
Python
mit
368
# Define all possible relations between words HYPERNYM = 'is_a' MEMBER_HOLONYM = 'member_of' PART_MERONYM = 'is_part_of'
lusilva/word-galaxy
data/classes/relations.py
Python
mit
120
import numpy as np from keras.layers import Embedding, Input, Flatten, Dense from keras.layers.merge import Concatenate, Dot, Add from keras.models import Model from keras.regularizers import l2 from util.layers_custom import BiasLayer from hybrid_model.models.abstract import AbstractModelCF, bias_init class Sigmoid...
sbremer/hybrid_rs
hybrid_model/models/sigmoid_item_asymfactoring.py
Python
apache-2.0
3,419
from __future__ import unicode_literals from django.db import models from django.core.paginator import Paginator, PageNotAnInteger from wagtail.wagtailcore.models import Page from wagtail.wagtailcore.fields import RichTextField from wagtail.wagtailadmin.edit_handlers import FieldPanel from wagtail.wagtailimages.edit_...
samuelleeuwenburg/Samplate
product/models.py
Python
mit
1,781
from django.core.serializers.json import DjangoJSONEncoder from django.utils.encoding import force_text from django.utils.functional import Promise class LazyEncoder(DjangoJSONEncoder): """ Force the conversion of lazy translations so that they can be serialized to JSON. via https://docs.djangoproject.com...
edx/edx-analytics-dashboard
analytics_dashboard/courses/serializers.py
Python
agpl-3.0
531
# Copyright 2012 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
HybridF5/tempest_debug
tempest/api/compute/servers/test_server_metadata_negative.py
Python
apache-2.0
7,663
# Copyright 2015 IBM Corp. 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed...
ecliu110/SpotifyApp
welcome.py
Python
apache-2.0
8,683
# prodcons.py # # Example of a producer/consumer setup with queues import curio async def producer(queue): for n in range(10): await queue.put(n) await queue.join() print('Producer done') async def consumer(queue): while True: item = await queue.get() print('Consumer got', it...
ABaldwinHunter/curio-clone
examples/prodcons.py
Python
bsd-3-clause
632
from images2gif import writeGif from PIL import Image, ImageDraw import random ''' In images2gif.py change line 200: for im in images: palettes.append( getheader(im)[1] ) to for im in images: palettes.append(im.palette.getdata()[1]) ''' class SortAlgorithm: def set_print(self, value):...
JiYouMCC/python-practice
sort_algorithm/root.py
Python
mit
1,125
from django_learn.models import Book from rest_framework import serializers class BookSerializer(serializers.Serializer): class Meta: model = Book field = ('name','title','author') # name = serializers.CharField(max_length=100) # title = serializers.CharField(max_length=100) # author = serializers...
xiang12835/python_web
py2_django/learning/serializers.py
Python
apache-2.0
566
import errno import logging import os import shutil import stat import sys from contextlib import contextmanager, suppress from typing import TYPE_CHECKING from dvc.exceptions import DvcException from dvc.system import System from dvc.utils import dict_md5 if TYPE_CHECKING: from dvc.types import StrPath logger =...
dmpetrov/dataversioncontrol
dvc/utils/fs.py
Python
apache-2.0
6,837
import ctypes import os import re import time def wait_until(predicate, timeout, poll_interval=1, exception=None): mustend = time.time() + timeout while time.time() < mustend: if predicate(): return True time.sleep(poll_interval) if exception is not None: raise exceptio...
gg/tf2idle
tf2idle/util.py
Python
mit
3,234
# -*- coding: utf-8 -*- from __future__ import unicode_literals from unittest import TestCase from django.template import Template, Context from django.template.base import TemplateEncodingError from django.utils.safestring import SafeData from django.utils import six class UnicodeTests(TestCase): def test_temp...
iambibhas/django
tests/template_tests/test_unicode.py
Python
bsd-3-clause
1,374
import string text_characters = "".join(map(chr, range(32, 127)) + list("\n\r\t\b")) _null_trans = string.maketrans("", "") def is_text (s): if "\0" in s: return 0 if not s: # Empty files are considered text return 1 # Get the non-text characters (maps a character to itself then # use the '...
pizzapanther/Super-Neutron-Drive
neutron-beam/nbeam/utils.py
Python
mit
562
# -*- 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-resource-manager
samples/generated_samples/cloudresourcemanager_v3_generated_folders_delete_folder_async.py
Python
apache-2.0
1,580
#!/usr/bin/env python from setuptools import setup, find_packages setup( name = "pyopenpgp", version = "0.1.0", packages = find_packages() )
ewindisch/pyopenpgp
setup.py
Python
apache-2.0
160
# -*- coding: utf-8 -*- # Copyright (C) 2012, Almar Klein, Ant1, Marius van Voorden # # This code is subject to the (new) BSD license: # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of s...
scorphus/thumbor
thumbor/engines/extensions/pil.py
Python
mit
20,233
#!/usr/bin/env python3 -tt """ File: simpio.h -------------- This file exports a set of functions that simplify input/output operations in Python and provide some error-checking on console input. Modified from Marty Stepp's CPP libraries. @author sredmond """ GETINTEGER_DEFAULT_PROMPT = "Enter an integer: "; GETINTE...
SarahPythonista/acmpy
spgl/util/simpio.py
Python
mit
2,513
import json from django.utils.encoding import smart_str from jinja2 import Template import commonregex parser = commonregex.CommonRegex() def fixnewlines(message): return message.replace('\n', ' <br> ') # def shortify_string(message): # message = message.split(" ") # new_message = "" # for...
metakgp/naarad
frontend.py
Python
agpl-3.0
2,295
# -*- coding: utf-8 -*- # Copyright 2008 Matt Harrison # Licensed under MIT __version__ = "0.3.2" __author__ = "matt harrison" __email__ = "matthewharrison@gmail.com"
mattharrison/rst2odp
odplib/meta.py
Python
mit
168
# Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved. from __future__ import absolute_import import os import re import tempfile import flask import numpy as np import werkzeug.exceptions from .forms import ImageClassificationModelForm from .job import ImageClassificationModelJob from digits import fr...
ethantang95/DIGITS
digits/model/images/classification/views.py
Python
bsd-3-clause
29,877
# 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/. import mock from nose.tools import * import os from time import sleep import tlscanary.firefox_downloader as fd import ...
mwobensmith/tls-canary
tests/firefox_downloader_test.py
Python
mpl-2.0
4,329
"""Sensor for checking the air quality forecast around Norway.""" import logging from datetime import timedelta import voluptuous as vol import homeassistant.helpers.config_validation as cv from homeassistant.components.air_quality import ( PLATFORM_SCHEMA, AirQualityEntity) from homeassistant.const import (CONF_...
MartinHjelmare/home-assistant
homeassistant/components/norway_air/air_quality.py
Python
apache-2.0
4,012
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ ('calendars', '0009_merge'), ] operations = [ migrations.AlterField( model_name='...
hackerspace-silesia/calendar-oswiecim
webapp/calendars/migrations/0010_auto_20150718_2023.py
Python
agpl-3.0
696
for filename in folder myfolder... f = open(filename,'r'); g = open(filename+'bar.csv','w'); y = random... # [[ calculateBMI # the following is for tracing every read and write: # @trace in:f(r) out:g(r,w) # alternatively, you could do coarse: # @trace in:f() out:g() # these variables are to be in...
DataONEorg/sem-prov-design
docs/YesWorkflow/syntax-ideas/foobar.py
Python
apache-2.0
495
# Copyright 2014 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
gotostack/neutron-lbaas
neutron_lbaas/tests/unit/services/loadbalancer/drivers/haproxy/test_jinja_cfg.py
Python
apache-2.0
23,642
# PyVision License # # Copyright (c) 2006-2008 David S. Bolme # 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 # notice, thi...
tigerking/pyvision
src/pyvision/analysis/FaceAnalysis/BEE.py
Python
bsd-3-clause
1,755
""" Utility module for command line script select_images """ # Author: Ilya Patrushev ilya.patrushev@gmail.com # License: GPL v2.0 import os import numpy as np import scipy.linalg as la from cPickle import load import cv2 def image_colour_distribution(img): """ Extract colour distribution parameters. ...
ilyapatrushev/isimage
isimage/select_images/check_cleared.py
Python
gpl-2.0
1,563
from numpy.testing import assert_equal from mhcflurry.class1_neural_network import Class1NeuralNetwork def test_all_combinations_of_hyperparameters(): combinations_dict = dict( activation=["tanh", "sigmoid"], random_negative_constant=[0, 20]) results = ( Class1NeuralNetwork .h...
hammerlab/mhcflurry
test/test_hyperparameters.py
Python
apache-2.0
495
from __future__ import print_function import copy import itertools import math import random import sys import numpy as np from numba.compiler import compile_isolated, Flags from numba import jit, types, utils, njit import numba.unittest_support as unittest from numba import testing from .support import TestCase, Me...
jriehl/numba
numba/tests/test_sort.py
Python
bsd-2-clause
29,909
"""Write a decorator called debug that prints its functions inputs and outputs""" def debug(f): def wrapper(*args, **kwargs): print "[] Debug: args=%s; kwargs=%s" % (args, kwargs) res = f(*args, **kwargs) print "[] Done: %s" % res return res return wrapper def sum_dig...
ynonp/python-examples
16_decorators_lab/05-debug.py
Python
mit
463
def calcular_frequencias(s): dicionario = {} if len(s) < 1: return {} else: for n in s: if n in dicionario.keys(): dicionario[n] += 1 else: dicionario[n] = 1 return dicionario def gerar_arvore_de_huffman(s): folhas = [] ...
andrevictor17/aulasRenzoEd
huffman.py
Python
mit
6,416
#!/usr/bin/env python # # Copyright 2013, 2014 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your opti...
hamgravy/volk-fft
python/volk_fft_modtool/cfg.py
Python
gpl-3.0
3,621
# -*- coding: utf-8 -*- # #################################################################### # Copyright (C) 2005-2013 by the FIFE team # http://www.fifengine.net # This file is part of FIFE. # # FIFE is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public #...
drolando/SoftDev
tools/editor/scripts/__init__.py
Python
lgpl-2.1
1,070
import csv import os import copy import shutil from scrapy.spider import BaseSpider from scrapy.selector import HtmlXPathSelector from scrapy.http import Request, HtmlResponse, FormRequest from scrapy.utils.response import get_base_url from scrapy.utils.url import urljoin_rfc from scrapy.http.cookies import CookieJar ...
0--key/lib
portfolio/Python/scrapy/hof_tech/amazon_spider.py
Python
apache-2.0
2,722
from mailpile.tests.gui import MailpileSeleniumTest class MailGuiTest(MailpileSeleniumTest): def test_read_mail(self): return # FIXME: Test disabled self.go_to_mailpile_home() self.wait_until_element_is_visible('pile-message-8') self.click_element_with_link_text('Bjarni R. Einar...
laborautonomo/Mailpile
mailpile/tests/gui/test_mail.py
Python
apache-2.0
658
# -*- coding: utf-8 -*- #!/usr/bin/env python # # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2000-2007 Donald N. Allingham # Copyright (C) 2007 Johan Gonqvist <johan.gronqvist@gmail.com> # Copyright (C) 2007-2009 Gary Burton <gary.burton@zen.co.uk> # Copyright (C) 2007-2009 Stephane Charet...
SNoiraud/gramps
gramps/plugins/webreport/statistics.py
Python
gpl-2.0
11,399
# -*- coding: utf-8 -*- # Generated by Kirito Feng on shrooms from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('judge', '0056_ticket_is_open'), ] operations = [ migrations.AddField( mode...
Minkov/site
judge/migrations/0057_blue_pretests.py
Python
agpl-3.0
474
from base64 import b85encode from functools import wraps from os import urandom from flask_login import current_user from flask_login import login_required from scrypt import hash as shash from sqlalchemy.exc import IntegrityError from config import TRACKER_PASSWORD_LENGTH_MIN from tracker import db from tracker impo...
archlinux/arch-security-tracker
tracker/user.py
Python
mit
3,283
# 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, ...
HubSpot/vitess
py/util/static_auth_client.py
Python
apache-2.0
992
# -*- coding: utf-8 -*- """ Generate movies from pictures with FFMPEG. Created on Wed Jun 6 14:54:06 2018 @author: Fabio Kasper """ import glob import os import re import shutil _FMT_PICS = 'pic%08d.png' def _rename_pictures(folder): pwd = os.getcwd() os.chdir(folder) files = sorted(glob.glob("*"), k...
frkasper/MacroUtils
tests/test/movie.py
Python
bsd-3-clause
1,614
from django.db import models from django.conf import settings from django.core.validators import MinValueValidator from django.utils.translation import ugettext_lazy as _ import uuid class Box(models.Model): OPEN = 10 EXPIRED = 20 DONE = 30 CLOSED = 40 STATUSES = ( (OPEN, _('Open')), ...
whitesmith/hawkpost
boxes/models.py
Python
mit
4,264
#! /usr/bin/env python # -*- coding: utf-8 -*- import sys from PyQt4.QtGui import QApplication from mainwindow import MainWindow def main(args): app = QApplication(args) win = MainWindow() win.show() return app.exec_() if __name__ == "__main__": sys.exit(main(sys.argv))
mugwort-rc/py2cpp
astviewer/main.py
Python
gpl-3.0
300
# ## python --version -> Python 2.7.10 # import difflib, re amount = 0 records = [] def appender(item): if len(records) == 0: records.append(item) return idx = len(records) - 1 while idx >= 0: if item in records[idx]: return elif records[idx] in item: records[idx] = item ret...
leonard-sxy/practice-and-accumulation
algorithm/www.codeforces.com/Python_2.7.10/VK_Cup_2016_Qualification_Round_2/making_genome_in_berland.py
Python
mit
2,036
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "nestedgroupedlists.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
Fulla/django-nestedgroupedlists
manage.py
Python
mit
261
""" XVM (c) www.modxvm.com 2013-2017 """ ##################################################################### # MOD INFO XFW_MOD_INFO = { # mandatory 'VERSION': '0.9.19.0.1', 'URL': 'http://www.modxvm.com/', 'UPDATE_URL': 'http://www.modxvm.com/en/download-xvm/', 'GAME_VERSION...
peterbartha/ImmunoMod
res_mods/mods/packages/xvm_hangar/python/__init__.py
Python
mit
5,652
"""Map the raw columns names to fiscal fields where indicated.""" import re from datapackage_pipelines.wrapper import ingest, spew parameters_, datapackage_, resources_ = ingest() column_order = parameters_['column-order'] target_column = parameters_['target-column'] kind_column = parameters_['kind-column'] from_on...
Victordeleon/os-data-importers
eu-structural-funds/common/processors/handle_amounts.py
Python
mit
1,571
#!/usr/bin/env python import random import logging import datetime import cPickle from time import time class GeneticAlgorithm(object): """Runs genetic algorithm, contains chromosomes and applies fitness, selection, recombination and mutation methods to them.""" def __init__(self, popula...
fergaljd/pep_ga
ga.py
Python
gpl-2.0
7,279
# encoding: utf-8 """ network.py Created by Thomas Mangin on 2009-09-06. Copyright (c) 2009-2015 Exa Networks. All rights reserved. """ import random import socket import select from struct import unpack from exabgp.configuration.environment import environment from exabgp.util.errstr import errstr from exabgp.logg...
dneiter/exabgp
lib/exabgp/reactor/network/connection.py
Python
bsd-3-clause
7,426
""" Computational Neurodynamics Exercise 3 (C) Murray Shanahan et al, 2015 """ import numpy as np from bct import breadthdist, charpath, clustering_coef_bu def SmallWorldIndex(CIJ): """ Computes the small-world index of the graph with connection matrix CIJ. Self-connections are ignored, as they are cycl...
lawrencejones/neuro
Exercise_3/SmallWorldIndex.py
Python
gpl-3.0
988
import logging logger = logging.getLogger('app.ingredients') class Ingredients: """Hold information about the liquid sources The Ingredients class is intended to be instatiated into an ingredients object whose primary function (currently) is to keep track of reagent volumes as they are used up....
Opentrons/otone_frontend
backend/backend/ingredients.py
Python
apache-2.0
1,436
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Score screen. Score list and button to navigate to main menu. """ from kivy.core.audio import SoundLoader from kivy.graphics import Rectangle from kivy.uix.label import Label from kivy.uix.screenmanager import Screen from kivy.uix.stacklayout import StackLayout from ...
victor-rene/bisector
scorescreen.py
Python
mit
2,873
# coding=utf-8 # Copyright 2018 The Tensor2Tensor 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...
rsepassi/tensor2tensor
tensor2tensor/models/xception.py
Python
apache-2.0
5,805
import os import gobject import gtk import gtk.glade import clutter.cluttergtk import talk from talk.core.SlideCollection import SlideCollection from talk.core.TalkLayout import TalkLayout from talk.core.TalkSlide import TalkSlide from talk.core.TitleSlide import TitleSlide from talk.core.BulletSlide import BulletSli...
ebassi/talk
talk/ui/MainWindow.py
Python
gpl-2.0
4,657
# -*- coding: utf-8 -*- from app.mod_shared.models.db import db class MeasurementUnit(db.Model): # Attributes id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String(50), unique=True) symbol = db.Column(db.String(10)) suffix = db.Column(db.Boolean) def __init__(self, na...
adamantike/salud-api
app/mod_profiles/models/MeasurementUnit.py
Python
gpl-2.0
516
# -*- coding: utf-8 -*- """ Tests used to check whether assigned actions really do what they're supposed to do. Events are not supported by gc and scvmm providers. Tests are uncollected for these providers. When the support will be implemented these tests can enabled for them. Required YAML keys: * Provider must h...
jkandasa/integration_tests
cfme/tests/control/test_actions.py
Python
gpl-2.0
30,780
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2016-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser 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 S...
kmarius/qutebrowser
qutebrowser/browser/webengine/webenginetab.py
Python
gpl-3.0
37,530
"""Toc2 Exporter class""" #----------------------------------------------------------------------------- # Copyright (c) 2016, the IPython IPython-Contrib Development Team. # # Distributed under the terms of the Modified BSD License. # #----------------------------------------------------------------------------- #--...
andyneff/IPython-notebook-extensions
extensions/toc2.py
Python
bsd-3-clause
1,583
#! /usr/bin/env python # -*- encoding: utf-8 -*- # vim:fenc=utf-8: """The dir core submodule provide a useful way to create, delete and manage directories in the remote host.""" import mico.output def dir_attribs(location, mode=None, owner=None, group=None, recursive=False): """Updates the mode/owner/group for ...
ajdiaz/mico
mico/lib/core/dir.py
Python
gpl-2.0
1,777
from six.moves.urllib.parse import parse_qs from wptserve.utils import isomorphic_encode def main(req, res): qs_cookie_val = parse_qs(req.url_parts.query).get(u'set-cookie-notification') if qs_cookie_val: res.set_cookie(b'notification', isomorphic_encode(qs_cookie_val[0])) return b'not really an icon'
asajeffrey/servo
tests/wpt/web-platform-tests/service-workers/service-worker/resources/notification_icon.py
Python
mpl-2.0
317
# coding: utf-8 """Tests for gjtk.extract""" from __future__ import absolute_import import collections import gjtk.example import gjtk.extract import gjtk.validate def normalized(mutable): """Make mutable types comparable.""" return collections.Counter(map(tuple, mutable)) # POSITIONS def test_positio...
dmtucker/gjtk-py
gjtk/test/test_extract.py
Python
lgpl-2.1
7,591
""" 1Channel XBMC Addon Copyright (C) 2014 tknorris 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. ...
azumimuo/family-xbmc-addon
plugin.video.1channel/pw_scraper.py
Python
gpl-2.0
31,881
from sqlalchemy.orm import subqueryload_all from zeus.config import db from zeus.models import Job, Build, Bundle from .base_build import BaseBuildResource from ..schemas import BundleSchema bundle_schema = BundleSchema(many=True) class BuildBundleStatsResource(BaseBuildResource): def get(self, build: Build): ...
getsentry/zeus
zeus/api/resources/build_bundlestats.py
Python
apache-2.0
726
from django import forms class DrugTrialForm(forms.ModelForm): """Form for Drug Trials""" class Meta(object): widgets = { 'description': forms.Textarea(attrs={'cols': 70, 'rows': 10}), 'condition': forms.Textarea(attrs={'cols': 70, 'rows': 10}), } class TestRe...
UPDDI/mps-database-server
drugtrials/forms.py
Python
mit
1,397
from Crypto.Cipher import DES3 def decrypt_file(in_filename, out_filename, chunk_size, key, iv): des3 = DES3.new(key, DES3.MODE_CFB, iv) with open(in_filename, 'rb') as in_file: with open(out_filename, 'wb') as out_file: while True: chunk = in_file.read(chunk_size) ...
mgstigler/cs3240-s15-team19
standalone/decrypt.py
Python
mit
681
# -*- coding: utf8 -*-# # Copyright (c) 2015 NORDUnet A/S # 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 # ...
SUNET/eduid-webapp
src/eduid_webapp/actions/tests/test_tou.py
Python
bsd-3-clause
10,899
"""Process `site.json` and bower package tools.""" import os import json import subprocess from functools import partial import importlib import sys from flask import Flask, render_template, g, redirect, current_app from gitloader import git_show from import_code import import_code try: from app import app exce...
cacahootie/deckmaster
deckmaster/app/process_site.py
Python
mit
4,475
#!/usr/bin/python # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that ...
emonty/ola
python/ClientWrapper.py
Python
lgpl-2.1
3,058
from __future__ import unicode_literals # -*- coding: utf-8 -*- # This package and all its sub-packages are part of django-wiki, # except where otherwise stated. # # django-wiki 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 Soft...
NablaWebkom/django-wiki
wiki/__init__.py
Python
gpl-3.0
905
#!/usr/bin/env python # -*- coding: utf-8 -*- # -*- coding: utf-8 -*- # # This file is based upon the file generated by sphinx-quickstart. However, # where sphinx-quickstart hardcodes values in this file that you input, this # file has been changed to pull from your module's metadata module. # # This file is execfile(...
echevemaster/fedora-college
docs/source/conf.py
Python
bsd-3-clause
8,753
#!/usr/bin/python ############################################################################# ## ## Copyright (C) 2013 Canonical Ltd. ## Contact: http://www.qt-project.org/legal ## ## This file is part of the test suite of the Qt Toolkit. ## ## $QT_BEGIN_LICENSE:LGPL$ ## Commercial License Usage ## Licensees holding ...
CodeDJ/qt5-hidpi
qt/qtbase/tests/manual/xembed-raster/gtk-embedder.py
Python
lgpl-2.1
2,647
#!/usr/bin/env python # encoding: utf-8 import pkgutil import sys from base_solver import BaseSolver import tasks class NoSuchTaskException(KeyError): pass def run_solver(solver_class, task): """ Run solver for given task """ solver = solver_class(task) solver.run() solver.save_solution(cursor...
Cosiek/KombiVojager
runner.py
Python
mit
1,596
from __future__ import absolute_import from __future__ import print_function import datetime from boto.s3.key import Key from boto.s3.connection import S3Connection from django.conf import settings from django.db import connection from django.forms.models import model_to_dict from django.utils import timezone from djan...
samatdav/zulip
zerver/lib/export.py
Python
apache-2.0
61,249
# Let's examine a simple imperative script def imperative_style(xs): results = [] for x in xs: if x >= 7: break if x < 2: result = 4 * x results.append(result) return results # Let's add a sanity check, since we're going # to refactor this version asser...
joshbohde/functional_python
pipes.py
Python
bsd-3-clause
3,940
from CreatureRogue.data_layer.species import Species class Encounter: def __init__(self, species: Species, min_level: int, max_level: int, rarity): self.species = species self.min_level = min_level self.max_level = max_level self.rarity = rarity def __str__(self): retu...
DaveTCode/CreatureRogue
CreatureRogue/data_layer/encounter.py
Python
mit
403