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
from model.connectivity import Connectivity from model.sparse import load, save from model.word2vec import Word2Vec from model.doc2vec import Doc2Vec from model.distance import Distance from model.cluster import Cluster __all__ = ['Connectivity', 'load', 'save', 'Word2Vec', 'Distance', 'Cluster']
AndreasMadsen/bachelor-code
model/__init__.py
Python
mit
300
# -*- coding: utf-8 -*- # Generated by Django 1.10.6 on 2017-03-31 03:28 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('councilman', '0009_auto_20170331_0326'), ] operations = [ migrations.AlterF...
flaviodrt/atlas_site
atlas/councilman/migrations/0010_auto_20170331_0328.py
Python
mit
495
# This file is part of RiakKit. # # RiakKit is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # RiakKit is distributed in the ho...
shuhaowu/riakkit
riakkit/simple/__init__.py
Python
gpl-3.0
729
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014 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/superdesk/license import json...
hlmnrmr/superdesk-core
apps/saved_searches/saved_searches.py
Python
agpl-3.0
7,567
from __future__ import print_function import invariant_finder import pddl import timers DEBUG = False def expand_group(group, task, reachable_facts): result = [] for fact in group: try: pos = list(fact.args).index("?X") except ValueError: result.append(fact) ...
fawcettc/planning-features
torchlight/GENERATE-VARS/translate/fact_groups.py
Python
agpl-3.0
4,898
#!/usr/bin/python ############################################# # show_block_details.py # # # # A simple python program that retrieves # # btier block placement metadata # # And optionally stores the data in sqlite # # EXAMPLE CODE ...
jjhuo/btier2
tools/show_block_details.py
Python
gpl-2.0
7,532
import os, logging from autotest.client.shared import error from virttest import aexpect, virt_vm, virsh, remote from virttest.libvirt_xml import vm_xml def run_virsh_attach_detach_disk(test, params, env): """ Test virsh {at|de}tach-disk command. The command can attach new disk/detach disk. 1.Prepare ...
sathnaga/virt-test
libvirt/tests/src/virsh_cmd/domain/virsh_attach_detach_disk.py
Python
gpl-2.0
10,666
names = [ { "GivenName":"Phillip", "Surname":"Hilbert", "EmailAddress":"PhillipNHilbert@rhyta.com", "TelephoneNumber":"484-536-1315", "StreetAddress":"1672 Franklee Lane", "City":"Philadelphia", "State":"PA", "ZipCode":19108 }, { "GivenName":"Donald", "Surname":"Lewis", ...
rhefner1/ghidonations
sandbox/contact_names.py
Python
apache-2.0
622,263
from threading import RLock, Thread from conf import merge_conf import UserDict import UserList import time class ReadOnlyList(UserList.UserList): def __setitem__(self, i, item): raise TypeError def update(self, array=None): if array is None: pass elif isinstance(array, U...
fotonauts/fwissr-python
fwissr/registry.py
Python
mit
5,990
from datetime import datetime from django.core.urlresolvers import reverse from django.db import models from django.utils.translation import ugettext_lazy as _ from django.contrib.auth.models import User from groups.base import Group class Project(Group): member_users = models.ManyToManyField(User, ...
amarandon/pinax
pinax/apps/projects/models.py
Python
mit
1,362
from idiokit import threado,timer from abusehelper.core import bot import re from abusehelper.core import utils, events import hashlib # Note, create_id already in several places. def create_id(event, *keys, **extra): digest = hashlib.md5() for key in sorted(extra.keys()): digest.update(extra[key].enco...
softcert/vsroom
vsroom/common/tallinnairport.py
Python
mit
2,030
from MESH import SimulationGrating s = SimulationGrating() s.SetLattice(0.5e-6) s.SetNumOfG(101) s.OptPrintIntermediate() s.AddMaterial("Au", "fullGold.txt") s.AddMaterial("Vacuum", "fullVacuum.txt") s.AddLayer("GoldBottomSubstrate", 0, "Au") s.AddLayer("GoldBottomGrating", 4.7e-6,"Au") s.SetLayerPatternGrating("Gol...
kfrancischen/MESH
examples/PRB_95_125404_2017/main.py
Python
gpl-3.0
749
from django.contrib import admin from ..models import MaternalOffStudy from ..forms import MaternalOffStudyForm from .base_maternal_model_admin import BaseMaternalModelAdmin class MaternalOffStudyAdmin(BaseMaternalModelAdmin): form = MaternalOffStudyForm fields = ( 'maternal_visit', 'report...
botswana-harvard/tshilo-dikotla
td_maternal/admin/maternal_off_study_admin.py
Python
gpl-2.0
480
# URI Online Judge | 1010 # Cálculo Simples # # Adaptado por Neilor Tonin, URI Brasil # Timelimit: 1 # # Neste problema, deve-se ler o código de uma peça 1, o número de peças 1, o valor unitário de cada peça 1, o código de # uma peça 2, o número de peças 2 e o valor unitário de cada peça 2. Após, calcule e mostre o val...
Sephyros/URI-Python
01 - Iniciante/1010.py
Python
gpl-3.0
1,305
import scipy.stats as estad from tikon.ecs.aprioris import APrioriDist from tikon.ecs.árb_mód import Parám from tikon.móds.rae.orgs.ecs.repr._plntll_ec import EcuaciónReprCoh class N(Parám): nombre = 'n' líms = (0, None) unids = None apriori = APrioriDist(estad.expon(scale=500)) class U(Parám): ...
julienmalard/Tikon
tikon/móds/rae/orgs/ecs/repr/logística.py
Python
agpl-3.0
773
from django.conf.urls.defaults import patterns urlpatterns = patterns('metashare.sync.views', (r'^$', 'inventory'), (r'^(?P<resource_uuid>[0-9a-fA-F]{64})/metadata/$', 'full_metadata'), )
JuliBakagianni/CEF-ELRC
metashare/sync/urls.py
Python
bsd-3-clause
194
#!/usr/bin/python """ Validators of phone numbers. """ from db_utils.validators.exceptions import ValidationError from db_utils.validators.phone_codes import COUNTRIES_PHONE_CODES_BY_CODE from db_utils.validators.phone_codes import COUNTRIES_PHONE_CODES from db_utils.decorators.unicode import UnicodeArguments def...
vakaras/db-utils
src/db_utils/validators/phone_number.py
Python
lgpl-3.0
5,663
from pyrake.spider import Spider class Spider0(Spider): allowed_domains = ["pyrake1.org", "pyrake3.org"]
elkingtowa/pyrake
tests/test_spidermanager/test_spiders/spider0.py
Python
mit
110
import os import sys import urllib2 import urllib from koemei.utils.encode import multipart_encode, MultipartParam from koemei.utils import log, settings, read_file, check_file_extension from koemei.utils.streaminghttp import register_openers import json from base_object import BaseObject from koemei.model.process imp...
koemei/koemei-api-client-python
koemei/model/user.py
Python
apache-2.0
812
"""Test Websocket API messages module.""" from homeassistant.components.websocket_api.messages import ( _cached_event_message as lru_event_cache, cached_event_message, message_to_json, ) from homeassistant.const import EVENT_STATE_CHANGED from homeassistant.core import callback async def test_cached_even...
aronsky/home-assistant
tests/components/websocket_api/test_messages.py
Python
apache-2.0
2,679
from feedgen.feed import FeedGenerator def format_itunes_duration(td): return "{hours:02d}:{minutes:02d}:{seconds:02d}".format( hours=td.seconds//3600, minutes=(td.seconds//60)%60, seconds=int(td.seconds%60) ) def add_entry(fg, md): fe = fg.add_entry() fe.id(md.id) fe.title...
calpaterson/dircast
dircast/feed.py
Python
gpl-3.0
848
# Copyright 2012 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/LICENSE-2.0 # # Unless required by applicable law or agreed t...
sridevikoushik31/openstack
nova/tests/api/openstack/compute/contrib/test_fixed_ips.py
Python
apache-2.0
5,645
"""pymodel config""" import Stack def Depth3(): return len(Stack.stack) < 4 Stack.StateFilter = Depth3
jon-jacky/PyModel
samples/StackResult/Filter3.py
Python
bsd-3-clause
110
# -*- coding: utf-8 -*- from koalixcrm.crm.contact.contact import * from koalixcrm.crm.contact.customer_group import * from koalixcrm.crm.contact.customer import * from koalixcrm.crm.contact.postal_address import * from koalixcrm.crm.contact.customer_billing_cycle import * from koalixcrm.crm.contact.email_address impo...
dario61081/koalixcrm
koalixcrm/crm/models.py
Python
bsd-3-clause
2,885
# image
shadowmint/nwidget
lib/cocos2d-0.5.5/utest/pyglet_mockup1/pyglet/image/__init__.py
Python
apache-2.0
9
__author__ = 'bromix' import xbmcgui from ..abstract_progress_dialog import AbstractProgressDialog class XbmcProgressDialog(AbstractProgressDialog): def __init__(self, heading, text): AbstractProgressDialog.__init__(self, 100) self._dialog = xbmcgui.DialogProgress() self._dialog.create(he...
repotvsupertuga/tvsupertuga.repository
plugin.video.youtube/resources/lib/youtube_plugin/kodion/impl/xbmc/xbmc_progress_dialog.py
Python
gpl-2.0
911
import os def check_existance( name ): a = os.popen( '%s --version' % name ) output = a.read() rc = a.close() if rc is not None: raise Exception( '"%s" is required' % name )
NixaSoftware/CVis
venv/bin/tools/regression/xsl_reports/utils/check_existance.py
Python
apache-2.0
200
def omp_task_private(): sum = 0 result = 0 LOOPCOUNT = 1000 NUM_TASKS = 25 known_sum = (LOOPCOUNT * (LOOPCOUNT + 1)) / 2 if 'omp parallel': if 'omp single': for i in xrange(0, NUM_TASKS): if 'omp task private(sum) shared(result, known_sum)': ...
hainm/pythran
pythran/tests/openmp.legacy/omp_task_private.py
Python
bsd-3-clause
603
from __future__ import print_function """ Created on September 31, 2014 @author: sbobovyc """ """ Copyright (C) 2014 Stanislav Bobovych 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...
sbobovyc/GameTools
JaggedAllianceFlashback/createmap.py
Python
gpl-3.0
2,233
# Copyright (c) 2014, Hubert Kario # # See the LICENSE file for legal information regarding use of this file. # compatibility with Python 2.6, for that we need unittest2 package, # which is not available on 3.3 or 3.4 try: import unittest2 as unittest except ImportError: import unittest from tlslite.utils.ec...
ioef/tlslite-ng
unit_tests/test_tlslite_utils_ecc.py
Python
lgpl-2.1
8,381
# -*- coding: utf-8 -*- # Generated by Django 1.10.6 on 2017-04-07 15:09 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.Crea...
williezh/hotelbooksystem
DJangoHotel/migrations/0001_initial.py
Python
mit
2,467
import numpy as np import scipy as sp import argparse import evaluate_explanations import sys import xgboost sys.path.append('..') from sklearn import ensemble from sklearn import neighbors import embedding_forest def get_classifier(name, vectorizer): if name == 'logreg': return linear_model.LogisticRegression(fi...
marcotcr/lime-experiments
parzen_windows.py
Python
bsd-2-clause
4,687
#!/usr/bin/env python from gnuradio import gr,usrp,packetradio,blks import gnuradio.gr.gr_threading as _threading from optparse import OptionParser from gnuradio.eng_option import eng_option from math import pi import time from ax25 import * # # 64e6 (250) 256000 (3/5) 153600 (128) 1200 # class queue_watcher_...
barisdinc/QB50
1200rx.py
Python
gpl-3.0
5,261
import wx class Example(wx.Frame): def __init__(self, parent, title): wx.Frame.__init__(self, parent, title = title, size = (250, 200)) self.Centre() self.Move((300,300)) self.Show() if __name__ == '__main__': app = wx.App() Example(None, title='Size') app.MainLoop()
Duality4Y/wxPythonLearning
wxLearning2.py
Python
unlicense
282
import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "saleor.settings") from django.core.wsgi import get_wsgi_application from whitenoise.django import DjangoWhiteNoise application = get_wsgi_application() application = DjangoWhiteNoise(application)
hongquan/saleor
saleor/wsgi/static.py
Python
bsd-3-clause
258
# Copyright 2014 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...
meteorfox/PerfKitBenchmarker
perfkitbenchmarker/linux_packages/pip.py
Python
apache-2.0
1,760
# # 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...
WindCanDie/spark
python/pyspark/ml/tests/test_pipeline.py
Python
apache-2.0
3,042
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Pugixml(CMakePackage): """Light-weight, simple, and fast XML parser for C++ with XPath su...
iulian787/spack
var/spack/repos/builtin/packages/pugixml/package.py
Python
lgpl-2.1
1,208
from citrination_client.views.descriptors import CategoricalDescriptor from citrination_client.views.descriptors import RealDescriptor import re class BaseDataViewBuilder(object): """ A base class not intended to be instantiated directly. """ def __init__(self, additional_config): self.config...
CitrineInformatics/python-citrination-client
citrination_client/views/base_data_view_builder.py
Python
apache-2.0
3,874
""" WSGI config for hellodjango project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_S...
cuixiongyi/my_django_heroku
hellodjango/wsgi.py
Python
mit
523
""" Copyright 2013 Steven Diamond This file is part of CVXPY. CVXPY 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. CVXPY is distributed i...
halwai/cvxpy
cvxpy/atoms/atom.py
Python
gpl-3.0
7,450
import unittest from queue import Queue from bears.yaml.YAMLLintBear import YAMLLintBear from coala_utils.ContextManagers import prepare_file from coalib.testing.LocalBearTestHelper import verify_local_bear, execute_bear from coalib.testing.BearTestHelper import generate_skip_decorator from coalib.results.RESULT_SEVER...
coala/coala-bears
tests/yaml/YAMLLintBearTest.py
Python
agpl-3.0
4,879
import pyrapi import itertools as it class HiRapiOpts(object): def __init__(self, plugin): self._rapi_opts = plugin.opts() @property def mapq_min(self): return self._rapi_opts.mapq_min @mapq_min.setter def mapq_min(self, v): self._rapi_opts.mapq_min = v @property ...
crs4/seal
seal/lib/aligner/hirapi.py
Python
gpl-3.0
5,451
def collatz(n, counter): while n > 1: if (n % 2 == 0): n = n / 2; else: n = 3*n + 1; counter = counter + 1 return counter; limit = 1000000 max_seq = [0, 0] for i in range(0, limit): col = collatz(i, 0) if col > max_seq[1]: max_seq[0] = i; max_seq[1] = col; ...
Vaibhav/InterviewPrep
Project Euler/Problem14.py
Python
mit
339
""" This __init__ file holds some centralised information for the display_adapter library. """ # Database information db_name = "internal_db.sqlite" test_db_name = "test_internal_db.sqlite" db_receiver_url = "http://127.0.0.1:6543/run_transmitter.json" db_receiver_polling_period = 1 # minutes # Serial information ser...
CO600GOL/Game_of_life
DisplayAdapter/display_adapter/__init__.py
Python
mit
897
from paste.auth import grantip from paste.fixture import * def test_make_app(): def application(environ, start_response): start_response('200 OK', [('content-type', 'text/plain')]) return [ str(environ.get('REMOTE_USER')), ':', str(environ.get('REMOTE_USER_TOKENS...
yongshengwang/builthue
desktop/core/ext-py/Paste-1.7.2/tests/test_grantip.py
Python
apache-2.0
1,162
import os from config import * from copy import deepcopy class Min3pChem: """A class that gathers thhe actions for min3p chemistry, except writing that is left to min3pwriter""" def __init__(self, core): self.core = core self.initBase() def initBase(self): self.Base= {}...
ORTI3D/ORTI3D_code
iliblast/min3pChem.py
Python
gpl-3.0
11,101
# # 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, software # distributed under ...
crashlytics/aurora
src/main/python/apache/aurora/client/cli/update.py
Python
apache-2.0
21,827
from alluvialflow import *
dekstop/alluvialflow
alluvialflow/__init__.py
Python
agpl-3.0
26
import json import os import socket import threading import time import traceback from .base import (Protocol, RefTestExecutor, RefTestImplementation, TestharnessExecutor, strip_server) from ..testrunner import Stop webdriver = None here = o...
mattnenterprise/servo
tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/executors/executorservodriver.py
Python
mpl-2.0
8,157
# encoding: utf-8 from __future__ import unicode_literals from django.utils.translation import ugettext_lazy as _ from event_log import registry registry.register( name='shoottikala.photographer.created', message=_('Photographer signed up: {entry.photographer.display_name}'), ) registry.register( name...
conikuvat/shoottikala
shoottikala/event_log_entry_types.py
Python
mit
426
#----------------------------------------------------------- # Threaded, Gevent and Prefork Servers #----------------------------------------------------------- import datetime import errno import logging import os import os.path import platform import random import select import signal import socket import subprocess ...
tvtsoft/odoo8
openerp/service/server.py
Python
agpl-3.0
35,763
from __future__ import print_function import numpy as np verbose = False with open('inputs/input03.txt') as f: directions = f.read().strip() index_delta = { '^': (0, 1), 'v': (0, -1), '>': (1, 0), '<': (-1, 0), } grid = np.zeros((1000, 1000), dtype='int32') x = 500 y = 500 grid[x, y] = 1 for ...
jjhelmus/adventofcode
day03a.py
Python
mit
620
#!bin/usr/python # -*- coding: utf-8 -*-. # Adrian Garcia Moreno import io import re as re import os import subprocess import sys from input_checker import input_checker def gene_extractor(input_dir_file, col_of_score = 0): counter = 1 genes_counter = 0 paths, input_files = input_checker(input_dir_file) ...
EidrianGM/FromBed2NetPipeLine
gene_extractor.py
Python
gpl-3.0
2,246
import os import sys import glob import re import livereload import multiprocessing import logging import shutil import MooseDocs import build log = logging.getLogger(__name__) def serve_options(parser, subparser): """ Command-line options for serve command. """ serve_parser = subparser.add_parser('serve', he...
paulthulstrup/moose
python/MooseDocs/commands/serve.py
Python
lgpl-2.1
2,580
# -*- coding: utf-8 -*- # # Copyright © 2013 Red Hat, Inc. # # This software is licensed to you under the GNU General Public # License as published by the Free Software Foundation; either version # 2 of the License (GPLv2) or (at your option) any later version. # There is NO WARRANTY for this software, express or impli...
ipanova/pulp_puppet
pulp_puppet_handlers/test/unit/test_module_handler.py
Python
gpl-2.0
26,993
#!/usr/bin/env python2.7 # _*_ coding: utf-8 _*_ scope = ['device1','device2','...'] artimonVar = 'lb.mem' labels = '{class=lb,name=Host,@HOST@}' bulk = { 'sysHostMemoryUsed': { 'regex':'^F5-BIGIP-SYSTEM-MIB::sysHostMemoryUsed.(0)\s=\sCounter64:\s([0-9]+)', 'suffix':'.used' }, 'sysHostMemoryTotal': { ...
StevenLeRoux/Artimon_generic_snmp_poller
m/f5_sysHostMemory.py
Python
gpl-2.0
432
"""linux.unknown.archive.Tools Module""" import cairn import cairn.sysdefs.templates.unix.archive.Tools as tmpl def getClass(): return Tools() class Tools(tmpl.Tools): def getArchiveMethod(self, sysdef): return sysdef.info.get("env/archive-tool-user") def setArchiveCmd(self, sysdef): method = self.ge...
redshodan/cairn
src/python/cairn/sysdefs/linux/unknown/archive/Tools.py
Python
gpl-2.0
1,692
#!/bin/env python # mainly for sys.argv[], sys.argv[0] is the name of the program import sys # mainly for arrays import numpy as np if __name__ == '__main__': print 'hello'
ketancmaheshwari/hello-goog
src/python/trie.py
Python
apache-2.0
179
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2000-2007 Donald N. Allingham # Copyright (C) 2002 Gary Shao # Copyright (C) 2007 Brian G. Matherly # Copyright (C) 2009 Benny Malengier # Copyright (C) 2009 Gary Burton # Copyright (C) 2010 Jakim Friant # # This program ...
pmghalvorsen/gramps_branch
gramps/gen/plug/docgen/graphicstyle.py
Python
gpl-2.0
4,925
#!BPY # -*- coding: UTF-8 -*- # MoveKeys By Name # # 2016.02.11 Natukikazemizo import bpy import math import re print("### START ###") #targetNames = ["0300_01_Ryujo_Tall_T.002", "RJ_Armature", "0300_SD_RJ_T.002", "0300_SD_RJ_Bone", "EB0010_Nothern_T", "EB0010_Nothern_Armature"] targetNames = ["RJ_Armature","0300_01_...
natukikazemizo/sedna
Sedna/src/python/recasting/MoveKeys.py
Python
mit
1,819
# 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-eventhub/azure/mgmt/eventhub/models/resource.py
Python
mit
1,271
""" Google Cloud Messaging Previously known as C2DM Documentation is available on the Android Developer website: https://developer.android.com/google/gcm/index.html """ from django.core.exceptions import ImproperlyConfigured from push_notifications import NotificationError from push_notifications.settings import PUSH_N...
ArabellaTech/universal_notifications
universal_notifications/backends/push/gcm.py
Python
mit
2,652
# -*- coding: utf-8 -*- # Copyright 2016 OpenMarket Ltd # # 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 la...
TribeMedia/synapse
tests/config/test_load.py
Python
apache-2.0
4,466
# -*- coding: utf-8 -*- from flask import Flask,redirect,url_for,render_template,session,request import os import threading import subprocess import sys from datetime import timedelta app = Flask(__name__) app.secret_key = os.urandom(24) #session.permanent = True app.permanent_session_lifetime = timedelta(minutes=30) ...
arition/RemoteMCServer
server_flask.py
Python
mit
4,011
import json from status.util import SafeHandler, UnsafeHandler def get_clean_application_keys(handler): categories_v=handler.application.application_categories_db.view("general/app_cat") clean_keys={} category=None for row in categories_v: clean_keys[row.key]=row.value return clean_keys ...
Galithil/status
status/statistics.py
Python
mit
6,900
import numpy as np import nengo class PID(object): def __init__(self, Kp, Kd=0, Ki=0, J=None, tau_d=0.1, dt=0.001): self.Kp = Kp self.Kd = Kd self.Ki = Ki if J is not None: x = np.dot(J.T, J) scale = np.linalg.det(x) ** (1.0 / x.shape[0]) self.JT...
tcstewar/embodied_benchmarks
embodied_benchmarks/pid.py
Python
gpl-2.0
3,005
# ########################################################################### # # Copyright (C) 2019 The Qt Company Ltd. # Contact: https://www.qt.io/licensing/ # # This file is part of the Quality Assurance module of the Qt Toolkit. # # $QT_BEGIN_LICENSE:GPL-EXCEPT$ # Commercial License Usage # Licensees holding valid...
qtproject/qtqa
scripts/lancebot/lancebot.py
Python
gpl-3.0
32,623
add = lambda x, y: x + y print(add(3, 5)) print((lambda x, y: x + y)(3, 9)) a = [(1, 2), (4, 1), (9, 10), (13, -3)] a.sort(key=lambda x: x[1]) print(a) one = [2, 4, 1, 3] two = [5, 7, 8, 3] data = list(zip(one, two)) data.sort() print(data) one, two = map(lambda t: list(t), zip(*data)) print(one, two)
CajetanP/code-learning
Python/Learning/Tips/lambdas.py
Python
mit
305
#!/usr/bin/env python #_*_ coding:utf-8 _*_ import sys; import numpy as np; from matplotlib import pyplot as plt import matplotlib from nltk import word_tokenize; from dircache import listdir if __name__ == "__main__": nomes_dirs_anos = sys.argv[1:]; if len(nomes_dirs_anos) == 0: print "\nSintaxe: <nome_script...
felipebuzatti/analiseLetras
calcula_riqueza.py
Python
gpl-2.0
1,862
#!/usr/bin/env python # Jonas Schnelli, 2013 # make sure the Nichts-Qt.app contains the right plist (including the right version) # fix made because of serval bugs in Qt mac deployment (https://bugreports.qt-project.org/browse/QTBUG-21267) from string import Template from datetime import date bitcoinDir = "./...
eysho/BestKnownGame-Coins---Source
share/qt/clean_mac_info_plist.py
Python
mit
922
import os import struct import glob class ParseError(RuntimeError): pass _get_channels_results = {} def get_channels(xml_path, memoize=True): """Get a list of channel names and their point counts from a Maya MCC cache. :param str xml_path: The XML file for the given cache. :param bool memoize:...
westernx/mayatools
mayatools/mcc.py
Python
bsd-3-clause
3,188
#!/usr/bin/env python # # __COPYRIGHT__ # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, ...
azverkan/scons
test/QT/moc-from-cpp.py
Python
mit
2,889
# -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html class ExambbcnewsPipeline(object): def process_item(self, item, spider): return item
trujunzhang/djzhang-targets
examBBCNews/examBBCNews/pipelines.py
Python
mit
291
"""Tests related to hammer command and its options and subcommands. :Requirement: Hammer :CaseAutomation: Automated :CaseLevel: Component :CaseComponent: Hammer :TestType: Functional :CaseImportance: High :Upstream: No """ import json import re from robottelo import ssh from robottelo.cli import hammer from rob...
omaciel/robottelo
tests/foreman/cli/test_hammer.py
Python
gpl-3.0
6,219
# -*- coding: utf-8 -*- ############################ Copyrights and license ############################ # # # Copyright 2016 Matthew Neal <meneal@matthews-mbp.raleigh.ibm.com> # # Copyright 2018 sfdye <tsfdye@gmail.com> ...
fernandog/Medusa
ext/github/tests/OrganizationHasInMembers.py
Python
gpl-3.0
2,192
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Generated from FHIR 3.0.0.11832 on 2017-03-22. # 2017, SMART Health IT. import io import json import os import unittest from . import testreport from .fhirdate import FHIRDate class TestReportTests(unittest.TestCase): def instantiate_from(self, filename): ...
all-of-us/raw-data-repository
rdr_service/lib_fhir/fhirclient_3_0_0/models/testreport_tests.py
Python
bsd-3-clause
6,596
# -*- coding: utf-8 -*- # # Copyright 2013 Joel Baxter # # This file is part of quakesounds. # # quakesounds 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 optio...
neogeographica/quakesounds
quakesounds_src/__main__.py
Python
gpl-3.0
15,168
# -*- coding: utf-8 -*- # Generated by Django 1.10.4 on 2017-01-22 07:16 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('faver_app', '0009_auto_20170122_0141'), ] operations = [ migrations.AddFiel...
Zylphrex/faver
faver_site/faver_app/migrations/0010_favercontract_complete.py
Python
mit
463
#! env python3 # This regression analysis file implements regression analysis for # GCC buildbot. # # Most of the features come from the use of jamais-vu by David Malcolm # Available command line: # Options: # --lang <name> # Name of language to analyse regressions for. # --data-dir <path> # Specifies which director...
LinkiTools/gcc-buildbot
scripts/regression-analysis.py
Python
gpl-3.0
3,652
# Copyright (c) 2016 Gabriel Casarin da Silva, All Rights Reserved. import os import sys import string from comum.configuracoes import * from comum.compilador import decompoe_texto_fonte, analisador_lexico from comum.compilador import analisador_sintatico from Barber_Lang.analise_semantica import gerar_codigo_assemb...
GabrielCasarin/Allegri
compilador.py
Python
gpl-3.0
2,785
# -*- coding: utf-8 -*- # Generated by Django 1.11.6 on 2017-11-17 19:24 from __future__ import unicode_literals import c3nav.mapdata.fields from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('mapdata', '0047_remove_mapupdat...
c3nav/c3nav
src/c3nav/mapdata/migrations/0048_ramp.py
Python
apache-2.0
1,532
# -*- coding: utf-8 -*- # # # TheVirtualBrain-Framework Package. This package holds all Data Management, and # Web-UI helpful to run brain-simulations. To use it, you also need do download # TheVirtualBrain-Scientific Package (for simulators). See content of the # documentation-folder for more details. See also http:/...
stuart-knock/tvb-framework
tvb/interfaces/web/controllers/spatial/noise_configuration_controller.py
Python
gpl-2.0
7,374
""" pyexcel_io.manager ~~~~~~~~~~~~~~~~~~~ factory for getting readers and writers :copyright: (c) 2014-2017 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details """ import pkgutil import logging from itertools import chain from pyexcel_io._compact import StringIO, BytesI...
fuhrysteve/pyexcel-io
pyexcel_io/manager.py
Python
bsd-3-clause
8,394
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "FundCenter.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
ZimDeveloper/FundCenter
FundCenter/manage.py
Python
mit
253
from typing import Callable def f() -> Callable[..., int]: pass c = f() print(c(<arg1>))
asedunov/intellij-community
python/testData/paramInfo/TypingCallableWithUnknownParameters.py
Python
apache-2.0
97
from toontown.coghq.SpecImports import * GlobalEntities = { 1000: { 'type': 'levelMgr', 'name': 'LevelMgr', 'comment': '', 'parentEntId': 0, 'cogLevel': 0, 'farPlaneDistance': 1500, 'modelFilename': 'phase_10/models/lawbotHQ/LawbotCourtroom3', 'wantD...
Spiderlover/Toontown
toontown/coghq/LawOffice_Spec_Tier0_a.py
Python
mit
1,147
from tests.support.asserts import assert_error, assert_success def fullscreen(session): return session.transport.send( "POST", "session/{session_id}/window/fullscreen".format(**vars(session))) def is_fullscreen(session): # At the time of writing, WebKit does not conform to the Fullscreen API specifi...
dati91/servo
tests/wpt/web-platform-tests/webdriver/tests/fullscreen_window/fullscreen.py
Python
mpl-2.0
2,787
#! /usr/bin/python """ test_fake.py By Paul Malmsten, 2010 pmalmsten@gmail.com Tests fake device objects for proper functionality. """ import unittest from xbee.tests.Fake import Serial class TestFakeSerialRead(unittest.TestCase): """ Fake Serial class should work as intended to emluate reading...
nioinnovation/python-xbee
xbee/tests/test_fake.py
Python
mit
1,321
# Note: broker_url is loaded from a separate file that broker updates when it starts. CELERY_ACCEPT_CONTENT = ['pickle'] #CELERY_SEND_EVENTS = True #CELERYD_PREFETCH_MULTIPLIER = 4 CELERYD_PREFETCH_MULTIPLIER = 1 CELERYD_LOG_LEVEL = 'INFO' # Queues & Routes # Note: default queue is "celery" # Note: anything not ex...
ncsa/psync
config/celeryconfig.py
Python
bsd-3-clause
569
# -*- coding: utf-8 -*- class WTError(Exception): """Base WT exception""" class UrlNotFoundError(WTError): """Url not found error""" class BadPaginatorUrlError(WTError): """Bad paginator url error""" class BadPaginatorPageError(WTError): """Bad paginator page error""" class InvalidLocalLinkErr...
ysegorov/wt
wt/exceptions.py
Python
mit
368
class TweetCriteria: def __init__(self): self.maxTweets = 0 def setUsername(self, username): self.username = username return self def setSince(self, since): self.since = since return self def setUntil(self, until): self.until = until return self def setQuerySearch(self, querySearch): self.quer...
gbuenoandrade/MC855-2S2017-group4
p1/twitter/got3/manager/TweetCriteria.py
Python
mit
733
# Copyright (c) 2010-2012 OpenStack, 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 ...
victorlin/swiftsense
ring.py
Python
mit
2,709
from __future__ import absolute_import from .ofxparse import (OfxParser, OfxParserException, AccountType, Account, Statement, Transaction) from .ofxprinter import OfxPrinter __version__ = '0.19' __all__ = [ 'OfxParser', 'OfxParserException', 'AccountType', 'Account', 'Statem...
udibr/ofxparse
ofxparse/__init__.py
Python
mit
364
#!/usr/bin/env python3 """ Lightweight QC analysis and reporting for daily phantom scans Authors ---- Mike Tyszka, Caltech Brain Imaging Center MIT License Copyright (c) 2019 Mike Tyszka Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files ...
jmtyszka/CBICQA
cbicqc/__main__.py
Python
mit
3,055
from setuptools import setup, find_packages import os version = '0.1' long_description = ( open('README.rst').read() + '\n' + 'Contributors\n' '============\n' + '\n' + open('CONTRIBUTORS.txt').read() + '\n' + open('CHANGES.txt').read() + '\n') setup(name='fabtools.recipes.pystats...
ronnix/fabtools.recipes.pystatsd
setup.py
Python
bsd-2-clause
1,441
# Copyright (c) 2014, MapR Technologies # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
xme1226/sahara
sahara/plugins/mapr/versions/v4_0_1_mrv2/version_handler.py
Python
apache-2.0
4,433
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'UserProfileDetail.ftp' db.add_column('profiles_userprofiledetail', 'ftp', self.gf('django....
Turan-no/Turan
apps/profiles/migrations/0002_auto__add_field_userprofiledetail_ftp__add_field_profile_ftp.py
Python
agpl-3.0
6,276
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2017-06-21 04:41 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('users', '0002_auto_20170621_0130'), ]...
Lucasfeelix/ong-joao-de-barro
donations/migrations/0001_initial.py
Python
mit
1,559
from copy import deepcopy from netjsonconfig import OpenVpn as BaseOpenVpn # adapt OpenVPN schema in order to limit it to 1 item only limited_schema = deepcopy(BaseOpenVpn.schema) limited_schema['properties']['openvpn'].update( {"additionalItems": False, "minItems": 1, "maxItems": 1} ) # server mode only limited_...
openwisp/django-netjsonconfig
django_netjsonconfig/vpn_backends.py
Python
gpl-3.0
1,539