code
stringlengths
6
947k
repo_name
stringlengths
5
100
path
stringlengths
4
226
language
stringclasses
1 value
license
stringclasses
15 values
size
int64
6
947k
# $Filename$ # $Authors$ # Last Changed: $Date$ $Committer$ $Revision-Id$ # # Copyright (c) 2003-2011, German Aerospace Center (DLR) # All rights reserved. # # #Redistribution and use in source and binary forms, with or without #modification, are permitted provided that the following conditions are #met: # ...
DLR-SC/DataFinder
test/unittest/datafinder_test/persistence/adapters/webdav_/search/adapter_test.py
Python
bsd-3-clause
2,478
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import traceback import os import threading import time import socket import select descriptors = list() Desc_Skel = {} _Worker_Thread = None _Lock = threading.Lock() # synchronization lock Debug = False def dprint(f, *v): if Debug: print >>sys.s...
sdgdsffdsfff/monitor-core
gmond/python_modules/memcached/memcached.py
Python
bsd-3-clause
13,648
import time def dumps(s): if not console.json: die('dumps requries lib', 'console-json') console.json(s) def out(prefix, *a): p = [prefix] for obj in a: if obj.__repr__: p.append(obj.__repr__()) else: p.append(obj) console.log.apply(console, p) de...
axiros/misc_transcrypt
doc/kendo/src/ch7/tools.py
Python
bsd-3-clause
3,203
#! /usr/bin/python class Seat: # @param index, an integer def __init__(self, index): self.index = index self.next = None class Room: # @param num_seat, an integer def __init__(self, num_seat): if num_seat < 1: raise VauleError('invalid room config') seat =...
shub0/algorithm-data-structure
python/PopSugar.py
Python
bsd-3-clause
1,436
import subprocess import pytest from ..helpers import BaseWFC3 class TestUVIS13Single(BaseWFC3): """ Test pos UVIS2 DARK images """ detector = 'uvis' def _single_raw_calib(self, rootname): raw_file = '{}_raw.fits'.format(rootname) # Prepare input file. self.get_inpu...
jhunkeler/hstcal
tests/wfc3/test_uvis_13single.py
Python
bsd-3-clause
864
# This file is part of MANTIS OS, Operating System # See http://mantis.cs.colorado.edu/ # # Copyright (C) 2003-2005 University of Colorado, Boulder # # This program is free software; you can redistribute it and/or # modify it under the terms of the mos license (see file LICENSE) import wx, thread import net_model cla...
turon/mantis
src/tools/tenodera/net_view.py
Python
bsd-3-clause
15,234
""" This module contains tasks that are executed at intervals, and is imported at the time the server is started. The intervals at which the tasks run are configurable via :py:mod:`media_nommer.conf.settings`. All functions prefixed with ``task_`` are task functions that are registered with the Twisted_ reactor. All f...
duointeractive/media-nommer
media_nommer/ec2nommerd/interval_tasks.py
Python
bsd-3-clause
3,910
#!/usr/bin/env python # # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import multiprocessing import optparse import os import sys from pylib import android_commands from pylib import test_options_pa...
junmin-zhu/chromium-rivertrail
build/android/adb_install_apk.py
Python
bsd-3-clause
1,365
""" @copyright Copyright (c) 2016 Devhres Team @author Angel Sullon (@asullom) @package utils Descripcion: serializers """ from rest_framework import serializers class RecursiveSerializer(serializers.Serializer): def to_representation(self, value): serializer = self.parent.parent.__class__(...
practian-reapps/django-backend-utils
backend_utils/serializers.py
Python
bsd-3-clause
380
class TestEntryList(object): def test_blog_page_entries(self, browser, site_url): browser.visit(site_url + '/blog/') entries = browser.find_by_css('.page-content') assert browser.status_code == 200 assert len(entries) > 0 def test_entry_page_search(self, browser, site_url): ...
APSL/puput
tests/functional/test_entry_list.py
Python
mit
2,068
import csbuild #csbuild.SetActiveToolchain("android") @csbuild.project("AndroidTest_Basic", "AndroidTest_Basic") def AndroidTest_Basic(): csbuild.Toolchain("android").SetCcCommand("gcc") csbuild.Toolchain("android").SetCxxCommand("g++") csbuild.Toolchain("android").SetPackageName("csbuild.UnitTest.AndroidBasic") ...
ShadauxCat/csbuild
UnitTests/Android/unit_test_android.py
Python
mit
622
## @package last_n_window_collector # Module caffe2.python.layers.last_n_window_collector from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from caffe2.python import core, schema from caffe2.python.layers.layers import M...
ryfeus/lambda-packs
pytorch/source/caffe2/python/layers/last_n_window_collector.py
Python
mit
2,543
#!/usr/bin/env python2 # -*- coding: utf-8 -*- import urllib2 import json from plugins.plugin import Plugin from time import time from bytebot_config import BYTEBOT_HTTP_TIMEOUT, BYTEBOT_HTTP_MAXSIZE from bytebot_config import BYTEBOT_PLUGIN_CONFIG class parking(Plugin): def __init__(self): pass d...
jurkov/Bytebot
plugins/parking.py
Python
mit
2,182
#!/usr/bin/env python # # GrovePi Example for using the Grove Light Sensor and the LED together to turn the LED On and OFF if the background light is greater than a threshold. # Modules: # http://www.seeedstudio.com/wiki/Grove_-_Light_Sensor # http://www.seeedstudio.com/wiki/Grove_-_LED_Socket_Kit # # The GrovePi con...
penoud/GrovePi
Software/Python/grove_light_sensor.py
Python
mit
2,674
from CommonServerPython import * from typing import Dict, Any, List import traceback """ STANDALONE FUNCTION """ def extract_fields(value) -> List: """ Extracts ordered ZTAP fields for use in analytics """ output = [] for event in value: fields = {} for field in event["fields"]:...
demisto/content
Packs/ZeroTrustAnalyticsPlatform/Scripts/ZTAPExtractFields/ZTAPExtractFields.py
Python
mit
1,265
#!/usr/bin/env python # -*- coding: utf-8 -*- # # catalyst-legacy.py # # Copyright © 2013-2015 DSGos # # This file is part of DSGos_Installer. # Based on code by Wayne Hartmann # # DSGos_Installer is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as pub...
DecisionSystemsGroup/DSGos
airootfs/usr/share/DSGos-Installer/DSGos_Installer/hardware/catalyst_legacy.py
Python
mit
7,766
# -*- coding: utf-8 -*- """ Base Class for InvenTree plugins """ import warnings from django.db.utils import OperationalError, ProgrammingError from django.utils.text import slugify class InvenTreePluginBase(): """ Base class for a plugin DO NOT USE THIS DIRECTLY, USE plugin.IntegrationPluginBase """...
inventree/InvenTree
InvenTree/plugin/plugin.py
Python
mit
2,145
from ..base import BaseQuery class LexiconQuery(BaseQuery): def __init__(self, corpus, to_find): super(LexiconQuery, self).__init__(corpus, to_find) def create_subset(self, label): """ Set properties of the returned tokens. """ labels_to_add = [] if self.to_fin...
samihuc/PolyglotDB
polyglotdb/query/lexicon/query.py
Python
mit
1,736
# Copyright (c) 2015-2017 Cisco Systems, Inc. # # 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...
retr0h/molecule
molecule/util.py
Python
mit
5,717
from setuptools import setup, find_packages import npm setup( name='npm', version=npm.VERSION, packages=find_packages(exclude=('tests',)), description='Python bindings and utils for npm.', long_description='Documentation at https://github.com/markfinger/python-npm', install_requires=[ '...
pombredanne/python-npm
setup.py
Python
mit
472
"""Clean Plugin for EasyEngine.""" from ee.core.shellexec import EEShellExec from ee.core.aptget import EEAptGet from ee.core.services import EEService from ee.core.logging import Log from cement.core.controller import CementBaseController, expose from cement.core import handler, hook import os import urllib.request ...
mehulsbhatt/easyengine
ee/cli/plugins/clean.py
Python
mit
4,861
# -*- encoding:utf-8 -*- from __future__ import unicode_literals MESSAGES = { "%d min remaining to read": "%d минути до прочитане", "(active)": "(активно)", "Also available in:": "Достъпно също на:", "Archive": "Архив", "Authors": "Автори", "Categories": "Категории", "Comments": "Коментари"...
andredias/nikola
nikola/data/themes/base/messages/messages_bg.py
Python
mit
2,386
#---------------------------------------------------------------------- # Copyright (c) 2011-2016 Raytheon BBN Technologies # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and/or hardware specification (the "Work") to # deal in the Work without restriction, including ...
tcmitchell/geni-tools
src/gcf/geni/am/am2.py
Python
mit
40,593
from ..testcase import BaseTestCase class OneToOneFieldTestCase(BaseTestCase): def test_model_relation(self): from django.db import models as dj_models from djangostdnet import models class ADjangoParentModel(dj_models.Model): name = dj_models.CharField(max_length=255) ...
capy-inc/django-stdnet
tests/fields/one_to_one_field.py
Python
mit
10,516
from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages from distutils import core from distutils.command.install import install import sys, os, subprocess def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() def git(*args): return subproce...
MinnowBoard/minnow-maker
setup.py
Python
mit
1,963
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Apr 3 10:31:30 2018 @author: BallBlueMeercat """ import pickle import os.path import time def save(save_path, output_name, output): # Saving results to run directory. filename = output_name+'.p' filename = os.path.join(save_path, filen...
lefthandedroo/Cosmo-models
zprev versions/Models_py_backup/results.py
Python
mit
1,187
import unittest import numpy import chainer from chainer import dataset from chainer import iterators from chainer import testing from chainer.training import extensions class DummyModel(chainer.Chain): def __init__(self, test): super(DummyModel, self).__init__() self.args = [] self.tes...
ronekko/chainer
tests/chainer_tests/training_tests/extensions_tests/test_evaluator.py
Python
mit
8,187
"""Entity for Zigbee Home Automation.""" from __future__ import annotations import asyncio from collections.abc import Awaitable import functools import logging from typing import Any from homeassistant.const import ATTR_NAME from homeassistant.core import CALLBACK_TYPE, Event, callback from homeassistant.helpers imp...
rohitranjan1991/home-assistant
homeassistant/components/zha/entity.py
Python
mit
11,331
# -*- encoding: utf-8 -*- # Module iainfgen from numpy import * def iainfgen(f, Iab): from iaunion import iaunion from iadil import iadil from ianeg import ianeg A, Bc = Iab y = iaunion( iadil(f, A), iadil( ianeg(f), Bc)) return y
mariecpereira/IA369Z
deliver/ia870/iainfgen.py
Python
mit
261
import json import jwt import logging import os logger = logging.getLogger(__name__) logging.basicConfig(level=logging.DEBUG) client_id = os.environ["SLACK_CLIENT_ID"] client_secret = os.environ["SLACK_CLIENT_SECRET"] redirect_uri = os.environ["SLACK_REDIRECT_URI"] scopes = ["openid", "email", "profile"] from slack_...
slackhq/python-slackclient
integration_tests/samples/openid_connect/sanic_example.py
Python
mit
4,583
#!/usr/bin/env python #-------------------------------------------------------------- # The functions for the lattice modifications to replace the base # RF gap nodes with # 1. The Axis Fields nodes. # The initial base RF gap nodes have zero length, and the length # of new nodes is defined by the RF fields on...
PyORBIT-Collaboration/py-orbit
py/orbit/py_linac/lattice_modifications/rf_models_modifications_lib.py
Python
mit
21,812
from __future__ import with_statement import hashlib import os import posixpath import stat import re from fnmatch import filter as fnfilter from fabric.state import output, connections, env from fabric.utils import warn from fabric.context_managers import settings def _format_local(local_path, local_is_path): ...
jessekl/flixr
venv/lib/python2.7/site-packages/fabric/sftp.py
Python
mit
12,958
#### NOTICE: THIS FILE IS AUTOGENERATED #### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY #### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/mission/quest_item/shared_slooni_jong_q1_needed.iff" result.attribu...
anhstudios/swganh
data/scripts/templates/object/tangible/mission/quest_item/shared_slooni_jong_q1_needed.py
Python
mit
477
#### NOTICE: THIS FILE IS AUTOGENERATED #### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY #### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/painting/shared_painting_leia_wanted.iff" result.attribute_template...
obi-two/Rebelion
data/scripts/templates/object/tangible/painting/shared_painting_leia_wanted.py
Python
mit
450
from math import log from random import randrange def isPrime(n): if n==2 or n==3: return True if n%2==0 or n<2: return False for i in range(3,int(n**0.5)+1,2): # only odd numbers if n%i==0: return False return True def generateLargePrime(k): #k is the desired bit length ...
manikTharaka/al-go-rithms
math/prime_sieve/python/create_large_primes.py
Python
mit
696
#### NOTICE: THIS FILE IS AUTOGENERATED #### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY #### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/wearables/armor/mandalorian/shared_armor_mandalorian_helmet.iff" re...
obi-two/Rebelion
data/scripts/templates/object/tangible/wearables/armor/mandalorian/shared_armor_mandalorian_helmet.py
Python
mit
494
from __future__ import print_function, division import matplotlib import logging from sys import stdout matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab! from neuralnilm import (Net, RealApplianceSource, BLSTMLayer, DimshuffleLayer, Bidirectio...
mmottahedi/neuralnilm_prototype
scripts/e294.py
Python
mit
8,331
from .decorators import raml_optional, raml_simple_parse, raml_tabbed from .RamlBody import RamlBody from .RamlParseable import RamlParseable class RamlResponse(RamlParseable): def __init__(self, code, yaml): self.code = code super(RamlResponse, self).__init__(yaml) @raml_optional @raml_...
SandyChapman/ramlizer
ramlizer/RamlResponse.py
Python
mit
907
#!/usr/bin/python import getpass import json from globalconfig import passwd, url, usr from vraapiclient import reservation client = reservation.ReservationClient(url, usr, passwd) with open('reservationTemplate.json') as json_data: payload = json.load(json_data) reservation = client.createReservation(payload)...
chelnak/vRAAPIClient
examples/reservation/createReservations/createReservation.py
Python
mit
379
#!/usr/bin/env python """ Setuptools bootstrapping installer. Run this script to install or upgrade setuptools. """ import os import shutil import sys import tempfile import zipfile import optparse import subprocess import platform import textwrap import contextlib import json import codecs from distutils import lo...
hubertokf/lupsEdgeServer
projects/lupsEdgeServer/EngineRules/setuptools-20.10.1/ez_setup.py
Python
mit
12,200
#!/usr/bin/env python # -*- coding: utf8 -*- """ Copyright (c) 2011 Tyler Kenendy <tk@tkte.ch> 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...
mcdevs/Burger
burger/toppings/topping.py
Python
mit
1,295
# # Test script for the curses module # # This script doesn't actually display anything very coherent. but it # does call (nearly) every method and function. # # Functions not tested: {def,reset}_{shell,prog}_mode, getch(), getstr(), # init_color() # Only called, not tested: getmouse(), ungetmouse() # import os import...
wang1352083/pythontool
python-2.7.12-lib/test/test_curses.py
Python
mit
11,284
from rlib import jit from som.primitives.integer_primitives import IntegerPrimitivesBase as _Base from som.vmobjects.double import Double from som.vmobjects.integer import Integer from som.vmobjects.primitive import Primitive, TernaryPrimitive def get_printable_location_up(block_method): from som.vmobjects.metho...
SOM-st/PySOM
src/som/primitives/bc/integer_primitives.py
Python
mit
4,603
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2015-2018 CERN. # # Invenio is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. """Record PUT tests.""" from __future__ import absolute_import, print_function impo...
tiborsimko/invenio-records-rest
tests/test_views_item_put.py
Python
mit
5,841
# -*- coding: utf-8 -*- """Communication commands package.""" # Part of Clockwork MUD Server (https://github.com/whutch/cwmud) # :copyright: (c) 2008 - 2017 Will Hutcheson # :license: MIT (https://github.com/whutch/cwmud/blob/master/LICENSE.txt)
whutch/cwmud
cwmud/core/commands/communication/__init__.py
Python
mit
246
# Copyright (c) 2011 Florian Mounier # Copyright (c) 2014 Sean Vig # Copyright (c) 2014 Tycho Andersen # # 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...
zordsdavini/qtile
test/test_config.py
Python
mit
3,631
import re import os import base64 try: # Python 3 from urllib.parse import urlencode except (ImportError): # Python 2 from urllib import urlencode from .json_api_client import JSONApiClient from ..downloaders.downloader_exception import DownloaderException # Used to map file extensions to formats _r...
koery/win-sublime
Data/Packages/Package Control/package_control/clients/readme_client.py
Python
mit
2,452
import logging import os from twisted.internet import defer, endpoints from universe import error, utils from universe.twisty import reactor from universe.vncdriver import screen, vnc_client PYGAME_INSTALLED = None def load_pygame(): global PYGAME_INSTALLED, pygame if PYGAME_INSTALLED is not None: re...
openai/universe
universe/vncdriver/libvnc_session.py
Python
mit
4,042
# Copyright 2014 Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file acc...
LockScreen/Backend
venv/lib/python2.7/site-packages/awscli/customizations/cloudsearch.py
Python
mit
4,291
# -*- coding: utf-8 -*- """ This module implements the base LaTeX object. .. :copyright: (c) 2014 by Jelte Fennema. :license: MIT, see License for more details. """ from ordered_set import OrderedSet from ..utils import dumps_list from abc import abstractmethod, ABCMeta from reprlib import recursive_repr from in...
ovaskevich/PyLaTeX
pylatex/base_classes/latex_object.py
Python
mit
5,960
# Copyright (c) 2012 The Khronos Group Inc. # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and /or associated documentation files (the "Materials "), to deal in the Materials without restriction, including without limitation the rights to use, copy, modify, merge, publ...
KhronosGroup/COLLADA-CTS
StandardDataSets/collada/library_controllers/controller/morph/morph_vertices_with_position_texture/morph_vertices_with_position_texture.py
Python
mit
3,979
import os import stat try: from pathlib import Path except ImportError: try: # Python 2 backport from pathlib2 import Path except ImportError: class Path(object): """Dummy for isinstance checks""" pass __all__ = ['assert_path_exists', 'assert_not_path_exist...
sserrot/champion_relationships
venv/Lib/site-packages/testpath/asserts.py
Python
mit
6,826
from application import app from flask import Response, request import json import logging import requests import traceback import kombu import re import uuid import getpass from datetime import datetime from jsonschema import Draft4Validator name_schema = { "type": "object", "properties": { "forename...
LandRegistry/lc-public-api
application/routes.py
Python
mit
8,175
"""Revision management for django-reversion.""" from __future__ import unicode_literals import operator, sys from functools import wraps, reduce from threading import local from weakref import WeakValueDictionary from django.contrib.contenttypes.models import ContentType from django.core import serializers from djan...
SurfasJones/djcmsrc3
venv/lib/python2.7/site-packages/reversion/revisions.py
Python
mit
23,546
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import find_packages from distutils.core import setup setup( author=u'Matt Cowger', author_email='matt@cowger.us', name='python-cloudfoundry2', description='Python interface to CloudFoundry v2 API', version="0.1", url='https://github...
mcowger/python-cloudfoundry
setup.py
Python
mit
820
"""Discover devices that implement the Spotify Connect platform.""" from . import MDNSDiscoverable class Discoverable(MDNSDiscoverable): """Add support for discovering Spotify Connect service.""" def __init__(self, nd): """Initialize the Cast discovery.""" super(Discoverable, self).__init__(n...
balloob/netdisco
netdisco/discoverables/spotify_connect.py
Python
mit
355
import social as S, percolation as P, os import importlib importlib.reload(P.rdf) importlib.reload(S.fb) importlib.reload(S.fb.gdf2rdf) importlib.reload(S.fb.gdf2rdf) c=P.utils.check fnames_=[("AdornoNaoEhEnfeite29032013.gdf","AdornoNaoEhEnfeite29032013_interacoes.gdf","265217103529531",0,"https://www.facebook.com/gro...
ttm/socialLegacy
tests/rdfFB.py
Python
mit
5,253
# -*- coding: utf-8 -*- from os import path from gluon import current from gluon.html import * from s3 import s3_represent_facilities, s3_register_validation # ============================================================================= class index(): """ Custom Home Page """ def __call__(self): ...
flavour/rgims_as_diff
private/templates/RGIMS/controllers.py
Python
mit
9,573
#!/usr/bin/env python # # Module author: # Tymofii A. Khodniev (thodnev) <thodnev@mail.ru> # # A library that provides a Python interface to the Telegram Bot API # Copyright (C) 2015-2022 # Leandro Toledo de Souza <devs@python-telegram-bot.org> # # This program is free software: you can redistribute it and/or modify # ...
tzpBingo/github-trending
codespace/python/telegram/ext/messagequeue.py
Python
mit
14,773
# Copyright (c) 2012 The Khronos Group Inc. # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and /or associated documentation files (the "Materials "), to deal in the Materials without restriction, including without limitation the rights to use, copy, modify, merge, publis...
KhronosGroup/COLLADA-CTS
StandardDataSets/collada/library_cameras/camera/optics/orthographic/optics_orthographic_zfar/optics_orthographic_zfar.py
Python
mit
4,007
#!/usr/bin/python # -*- coding: utf-8 -*- # Just Dummy class for testing class TestClassInSubModule: """Test Class from source""" pass
asmodehn/filefinder2
tests/test_filefinder2/pkg/submodule.py
Python
mit
143
import re """Rules are based on Brunot & Bruneau (1949). """ estre_replace = [('^sereient$|^fussions$|^fussiens$|^sereies$|^sereiet$|^serïens$|^seriiez$|^fussiez$|^fussent$|^ierent$|^fustes$|^furent$|^ierent$|^sereie$|^seroie$|^sereit$|^seiens$|^seient$|^fusses$|^fussez$|^estant$|^seiens$|^somes$|^estes$|^ieres$|^ier...
LBenzahia/cltk
cltk/lemmatize/french/french.py
Python
mit
2,931
# flake8: noqa # -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models from ..compat import USER_MODEL class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Review' db.create_table(u'review_review', ( ...
bitmazk/django-review
review/south_migrations/0001_initial.py
Python
mit
10,388
f = raw_input('filename: ') def make_word_dict(f): """ Read the file f and, store each word as dictionary key. Values are not important. Return the dictioonary. """ c = open(f) d = dict() i = 0 for word in c: w = word.strip('\n\r') d[w] = i i += 1 #l...
sokolowskik/Tutorials
ThinkPython/chap11/ex10.py
Python
mit
980
# -*- coding:utf-8 -*- ''' Author: Bu Kun E-mail: bukun@osgeo.cn CopyRight: http://www.yunsuan.org ''' import tornado.web import tornado.escape import json from torlite.core import tools from torlite.core.base_handler import BaseHandler from torlite.model.mwiki import MWiki from torlite.model.mcatalog import MCatalog ...
Geoion/TorCMS
torlite/handlers/reply_handler.py
Python
mit
3,236
# 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 ...
SUSE/azure-sdk-for-python
azure-mgmt-compute/azure/mgmt/compute/compute/v2015_06_15/models/virtual_machine_image.py
Python
mit
2,245
import numpy as np class Perceptron(object): """Perceptron classifier. Parameters ------------ eta : float Learning rate (between 0.0 and 1.0) n_iter : int Passes over the training dataset. Attributes ----------- w_ : 1d-array Weights after fitting. errors_...
xdnian/pyml
code/ch02/perceptron.py
Python
mit
1,571
########################################################### # # Copyright (c) 2005, Southpaw Technology # All Rights Reserved # # PROPRIETARY INFORMATION. This software is proprietary to # Southpaw Technology, and is not to be reproduced, transmitted, # or disclosed in any way without written permi...
diegocortassa/TACTIC
src/pyasm/checkin/repo.py
Python
epl-1.0
6,768
#!/usr/bin/env python3.4 # # Copyright (c) 2015 by Ron Frederick <ronf@timeheart.net>. # All rights reserved. # # This program and the accompanying materials are made available under # the terms of the Eclipse Public License v1.0 which accompanies this # distribution and is available at: # # http://www.eclipse.org/...
jonathanslenders/asyncssh
examples/sftp_client.py
Python
epl-1.0
823
#!/usr/bin/env python # # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # # Michael A.G. Aivazis # California Institute of Technology # (C) 1998-2005 All Rights Reserved # # <LicenseText> # # ~~~~~~~~~...
bmi-forum/bmi-pyre
pythia-0.8/packages/pulse/tests/signon.py
Python
gpl-2.0
867
## # Copyright 2009-2018 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), # Flemish Research Foundation (F...
bartoldeman/easybuild-easyblocks
easybuild/easyblocks/r/rosetta.py
Python
gpl-2.0
12,847
#============================================================================== # jeanstest.py # Run Noh test using initial conditions file 'noh.dat'. #============================================================================== from gandalf.analysis.facade import * import time import matplotlib.pyplot as plt import ...
gandalfcode/gandalf
tests/paper_tests/jeanstest.py
Python
gpl-2.0
9,111
## # Copyright 2009-2015 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en), # the Hercules foundation (htt...
valtandor/easybuild-easyblocks
easybuild/easyblocks/a/advisor.py
Python
gpl-2.0
2,158
import cStringIO as StringIO import pytest import time from Connection import ConnectionServer from Connection import Connection from File import FileServer @pytest.mark.usefixtures("resetSettings") @pytest.mark.usefixtures("resetTempSettings") class TestFileRequest: def testGetFile(self, file_server, site): ...
l5h5t7/ZeroNet
src/Test/TestFileRequest.py
Python
gpl-2.0
3,984
""" Run example scripts. @author J. Chiang <jchiang@slac.stanford.edu> @author Paul F. Kunz <Paul_Kunz@slac.stanford.edu> """ #$Id: run_examples.py,v 1.13 2006/10/03 20:02:20 pfkeb Exp $ import sys from load_hippo import app, canvas prompt = 1 scripts = [] scripts.append('static_vs_dynamic') scripts.append('loglo...
plasmodic/hippodraw
examples/run_examples.py
Python
gpl-2.0
1,052
#!/usr/bin/env python # -*- mode: python; coding: utf-8; -*- ##---------------------------------------------------------------------------## ## ## Copyright (C) 1998-2003 Markus Franz Xaver Johannes Oberhumer ## Copyright (C) 2003 Mt. Hood Playing Card Co. ## Copyright (C) 2005-2009 Skomoroh ## ## This program is free ...
TrevorLowing/PyGames
pysollib/games/sanibel.py
Python
gpl-2.0
2,437
import re import glob import math import logging import os from autotest.client import utils from autotest.client.shared import error # Returns total memory in kb def read_from_meminfo(key): cmd_result = utils.run('grep %s /proc/meminfo' % key, verbose=False) meminfo = cmd_result.stdout return int(re.sear...
rbian/virt-test
virttest/staging/utils_memory.py
Python
gpl-2.0
8,312
# -*- coding: utf-8 -*- # # This file is part of EventGhost. # Copyright © 2005-2020 EventGhost Project <http://www.eventghost.net/> # # EventGhost 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 versio...
EventGhost/EventGhost
eg/Classes/AddActionGroupDialog.py
Python
gpl-2.0
1,500
# # Copyright 2017-2020 Red Hat, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed ...
nirs/vdsm
tests/virt/thinp_test.py
Python
gpl-2.0
5,860
#Python Advanced Roguelike Engine (Parole) #Copyright (C) 2006-2012 Max Bane # #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 versio...
gdos/parole
src/parole/map.py
Python
gpl-2.0
96,935
# This file is part of Merlin. # Merlin is the Copyright (C)2008,2009,2010 of Robin K. Hansen, Elliot Rosemarine, Andreas Jacobsen. # Individual portions may be copyright by individual contributors, and # are included in this collective work with permission of the copyright # owners. # This program is free software; ...
ellonweb/merlin
Core/config.py
Python
gpl-2.0
1,487
# jhbuild - a tool to ease building collections of source packages # Copyright (C) 2001-2006 James Henstridge # Copyright (C) 2008 Frederic Peters # # bot.py: buildbot control commands # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as p...
bboozzoo/jhbuild
jhbuild/commands/bot.py
Python
gpl-2.0
37,964
# This file is part of the qpopplerview package. # # Copyright (c) 2010 - 2014 by Wilbert Berendsen # # 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 yo...
shimpe/frescobaldi
frescobaldi_app/qpopplerview/locking.py
Python
gpl-2.0
1,381
""" Test Setup Module -- THIS SHOULD BE REPURPOSED, TRIGGERED BY make-test.sh script """ import os import sys import time import json import inspect from configparser import ConfigParser import logging # aws imports import boto3 import moto import pytest from botocore.exceptions import ClientError, ProfileNotFound # ...
t-stark/ec2cli
scripts/pretest_setup.py
Python
gpl-2.0
6,293
import threading class CloseableThread(threading.Thread): running = false def __init__(self, group = None, target = None, name = None, args=(), kwargs={}): threading.Thread.__init__(self, group = group, target = target, name = name, args=args, kwargs=kwargs) def start(): Running = true...
zaquestion/vendttp
server/CloseableThread.py
Python
gpl-2.0
447
#!/usr/bin/python # # $Id: gen-data-queryperf.py,v 1.1.10.1 2003/05/15 05:07:21 marka Exp $ # # Contributed by Stephane Bortzmeyer <bortzmeyer@nic.fr> # # "A small tool which may be useful with contrib/queryperf. This script # can generate files of queries, both with random names (to test the # behaviour with NXdoma...
atmark-techno/atmark-dist
user/bind/contrib/queryperf/utils/gen-data-queryperf.py
Python
gpl-2.0
2,783
# -*- coding: utf-8 -*- import os.path import wx from outwiker.core.system import getImagesDir class SearchReplacePanel (wx.Panel): def __init__(self, parent): super(SearchReplacePanel, self).__init__( parent, style=wx.TAB_TRAVERSAL | wx.RAISED_BORDER) self._controller =...
unreal666/outwiker
src/outwiker/gui/searchreplacepanel.py
Python
gpl-3.0
6,309
import requests from bs4 import BeautifulSoup def getMemes(): memep1URL="http://www.quickmeme.com/page/1/" memep2URL="http://www.quickmeme.com/page/2/" memep3URL="http://www.quickmeme.com/page/3/" memep4URL="http://www.quickmeme.com/page/4/" memep5URL="http://www.quickmeme.com/page/5/" memep6UR...
Jolopy/MizzyChan
mizzychan/app/crawl/rucrawler.py
Python
gpl-3.0
67,999
# This file is part of beets. # Copyright 2016, Adrian Sampson. # # 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, ...
rembo10/headphones
lib/beets/__init__.py
Python
gpl-3.0
1,380
# neubot/utils_nt.py # # Copyright (c) 2013 # Nexa Center for Internet & Society, Politecnico di Torino (DAUIN) # and Simone Basso <bassosimone@gmail.com> # # This file is part of Neubot <http://www.neubot.org/>. # # Neubot is free software: you can redistribute it and/or modify # it under the terms of the GNU...
neubot/neubot-client
neubot/utils_nt.py
Python
gpl-3.0
2,253
try: import pkg_resources pkg_resources.declare_namespace(__name__) except ImportError: import pkgutil __path__ = pkgutil.extend_path(__path__, __name__) from ckanext.geonetwork.harvesters.geonetwork import GeoNetworkHarvester from ckanext.geonetwork.harvesters.utils import GeoNetworkClient
geosolutions-it/ckanext-geonetwork
ckanext/geonetwork/harvesters/__init__.py
Python
gpl-3.0
309
from django.conf.urls import url from carrinho.views import (CarrinhoDetalhaView, CarrinhoProdutoInsereView, CompraView, LoginView, LogoutView, ProdutoDetalhaView, ProdutoListaView) urlpatterns = [ url(r'^$', ProdutoListaView.as_view(), name...
lamenezes/django-ecom
ecom/carrinho/urls.py
Python
gpl-3.0
854
#!/usr/bin/env python import sys import PAM from getpass import getpass def pam_conv(auth, query_list, userData): resp = [] for i in range(len(query_list)): query, type = query_list[i] if type == PAM.PAM_PROMPT_ECHO_ON: val = raw_input(query) resp.append((val, 0)) elif type == PAM.PAM_PROMPT_ECHO_OFF:...
unix4you2/practico
mod/pam/pam_nativo.py
Python
gpl-3.0
891
# -*- encoding: utf-8 -*- """Implements Architecture UI""" from robottelo.constants import FILTER from robottelo.ui.base import Base from robottelo.ui.locators import common_locators, locators from robottelo.ui.navigator import Navigator class Architecture(Base): """Manipulates architecture from UI""" def n...
elyezer/robottelo
robottelo/ui/architecture.py
Python
gpl-3.0
1,561
#!/usr/bin/env python # -*- coding: utf-8 -*- import kivy from kivy.app import App from kivy.uix.gridlayout import GridLayout from kivy.uix.label import Label from kivy.uix.textinput import TextInput from kivy.uix.image import Image from kivy.uix.button import Button kivy.require('1.7.3') text ="" class ShowLogo(Im...
defm03/toraeru
test/loli_GUI.py
Python
gpl-3.0
1,353
# coding=utf-8 """Tests for medusa/test_should_process.py.""" from __future__ import unicode_literals from medusa.common import Quality from medusa.post_processor import PostProcessor import pytest @pytest.mark.parametrize('p', [ { # p0: New allowed quality higher than current allowed: yes 'cur_quality'...
pymedusa/Medusa
tests/test_should_process.py
Python
gpl-3.0
2,950
""" Project Configuration Importer Handles the importing the project configuration from a separate location and validates the version against the specified expected version. NOTE: If you update this file or any others in scripts and require a NEW variable in project_cfg, then you need to UPDATE THE EXPECTED_CFG...
Avantol13/mgen
dev/scripts/_project_cfg_importer.py
Python
gpl-3.0
1,937
# -*- encoding: utf-8 -*- """Generic base class for cli hammer commands.""" import logging import re from robottelo import ssh from robottelo.cli import hammer from robottelo.config import settings class CLIError(Exception): """Indicates that a CLI command could not be run.""" class CLIBaseError(Exception): ...
ares/robottelo
robottelo/cli/base.py
Python
gpl-3.0
16,309
# -*- coding: utf-8 -*- # # Copyright (C) Pootle contributors. # # This file is a part of the Pootle project. It is distributed under the GPL3 # or later license. See the LICENSE file for a copy of the license and the # AUTHORS file for copyright and authorship information. from django.conf import settings from django...
claudep/pootle
pootle/core/markup/filters.py
Python
gpl-3.0
5,520
import os import pandas as pd from .config import get_sch_ref_df from . import simple_cysh as cysh sch_ref_df = get_sch_ref_df() def academic_sections_to_create(): """ Gather ACM deployment docs to determine which 'Tutoring: Math' and 'Tutoring: Literacy' sections to make """ xl = pd.ExcelFile(r'Z:...
mrklees/cy-automation-library
cyautomation/cyschoolhouse/section_creation_chi.py
Python
gpl-3.0
7,625