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
class Arco(): def __init__(self, origem, destino, valor): self.valor = valor self.vertices = (origem, destino) def __hash__(self): return hash(self.vertices + (self.valor,)) def __eq__(self, arco): return (self.valor,) + self.vertices == (arco.valor,) + arco.vertic...
walelite/ES
grafo.py
Python
mit
13,713
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2016 Eugene Frolov <[email protected]> # # 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 # # ...
phantomii/restalchemy
examples/restapi_foo_bar_client.py
Python
apache-2.0
3,833
# -*- coding: utf-8 -*- from module.plugins.internal.XFSAccount import XFSAccount class UploadcCom(XFSAccount): __name__ = "UploadcCom" __type__ = "account" __version__ = "0.05" __status__ = "testing" __description__ = """Uploadc.com account plugin""" __license__ = "GPLv3" __a...
fzimmermann89/pyload
module/plugins/accounts/UploadcCom.py
Python
gpl-3.0
413
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-03-06 21:13 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_depende...
mastizada/pontoon
pontoon/base/migrations/0087_auto_20170306_2113.py
Python
bsd-3-clause
2,698
# 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 u...
airbnb/superset
superset/models/user_attributes.py
Python
apache-2.0
1,690
"""Invoice details""" # :license: MIT, see LICENSE for more details. import click from SoftLayer.CLI import environment from SoftLayer.CLI import formatting from SoftLayer.managers.account import AccountManager as AccountManager from SoftLayer import utils @click.command() @click.argument('identifier') @click.optio...
kyubifire/softlayer-python
SoftLayer/CLI/account/invoice_detail.py
Python
mit
2,334
#!/usr/bin/env python3 """ 2018 AOC Day 07 """ import argparse from collections import defaultdict import heapq import re import typing import unittest def parse(puzzle: str) -> typing.List[typing.Tuple[str, str]]: ''' Parse the input into a list of (step, requirement) tuples ''' line_re = re.compile(r'Step ...
devonhollowood/adventofcode
2018/day07.py
Python
mit
4,416
""" WSGI config for smarthumidor 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.7/howto/deployment/wsgi/ """ import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "smarthumidor.settings") from dja...
bkillenit/smarthumidor
django/smarthumidor/smarthumidor/wsgi.py
Python
mit
399
# -*- coding: utf-8 -*- # vi:si:et:sw=4:sts=4:ts=4 ## ## Copyright (C) 2005, 2007 Async Open Source <http://www.async.com.br> ## All rights reserved ## ## This program 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 Soft...
andrebellafronte/stoq
stoqlib/reporting/salereturn.py
Python
gpl-2.0
2,327
# -*- coding: utf-8 -*- import sys import os # Import the common config file # Note that paths in the common config are interpreted as if they were # in the location of this file # Setup the config sys.path.insert(0, os.path.abspath('../../_common')) from common_conf import * html_short_title_toc, html_short_titl...
mpouttuclarke/cdap
cdap-docs/reference-manual/source/conf.py
Python
apache-2.0
360
# -*- coding: utf-8 -*- """ sphinx.roles ~~~~~~~~~~~~ Handlers for additional ReST roles. :copyright: 2007-2008 by Georg Brandl. :license: BSD. """ import re from docutils import nodes, utils from docutils.parsers.rst import roles from sphinx import addnodes ws_re = re.compile(r'\s+') caption_...
creasyw/IMTAphy
documentation/doctools/tags/0.4.3/sphinx/roles.py
Python
gpl-2.0
8,698
#!/usr/bin/env python # -*- coding: utf-8 -*- # This file is part of PRIMO2 -- Probabilistic Inference Modules. # Copyright (C) 2013-2017 Social Cognitive Systems Group, # Faculty of Technology, Bielefeld University # # This program is free software: you can redistribute it and/or modify # it ...
SocialCognitiveSystems/PRIMO
primo2/tests/IO_test.py
Python
lgpl-3.0
13,732
# -*- coding: utf-8 -*- """ Framework for code to synthesise a library of spectra. """ import argparse import hashlib import json import logging import os import re import sqlite3 import time from os import path as os_path from fourgp_speclib import SpectrumLibrarySqlite, Spectrum from fourgp_specsynth import TurboS...
dcf21/4most-4gp-scripts
src/helper_code/base_synthesizer.py
Python
mit
14,736
# -*- coding:utf-8 -*- # # This file is part of OpenFisca. # OpenFisca is a socio-fiscal microsimulation software # Copyright © 2011 Clément Schaff, Mahdi Ben Jelloul # Licensed under the terms of the GVPLv3 or later license # (see openfisca/__init__.py for details) from __future__ import division import codecs imp...
openfisca/openfisca-qt
openfisca_qt/plugins/scenario/table.py
Python
agpl-3.0
12,500
from gettext import gettext as _ import glob import gzip import logging import os import shutil import traceback from xml.sax.saxutils import XMLGenerator from pulp.common import error_codes from pulp.server.exceptions import PulpCodedValidationException, PulpCodedException from verification import CHECKSUM_FUNCTION...
credativ/pulp
server/pulp/plugins/util/metadata_writer.py
Python
gpl-2.0
16,777
# -*- coding: utf-8 -*- from __future__ import unicode_literals from spikeval.module import ModMetricFranke, ModuleExecutionError from .models.result import ResultFranke __author__ = "pmeier82" __all__ = ["ModuleFranke"] def toint(val): # if type(val) == type(""): res = int(float(val)) return res clas...
pmeier82/django-spikeval-franke
djspikeval_franke/module.py
Python
bsd-3-clause
2,076
# coding=utf-8 """ This is example to attach file with mimetype """ import logging # https://pypi.org/project/python-magic/ import magic from atlassian import Confluence logging.basicConfig(level=logging.DEBUG) confluence = Confluence( url="http://localhost:8090", username="admin", password="admin", ) ...
MattAgile/atlassian-python-api
examples/confluence/confluence_attach_file.py
Python
apache-2.0
1,107
from __future__ import absolute_import from django.core.urlresolvers import reverse import six from sentry.models import ( Commit, GroupLink, GroupResolution, ReleaseCommit, Repository, ) from sentry.testutils import APITestCase class IssuesResolvedInReleaseEndpointTest(APITestCase): def se...
gencer/sentry
tests/sentry/api/endpoints/test_issues_resolved_in_release.py
Python
bsd-3-clause
6,561
from django.contrib import admin from .models import Applications class ApplicationsModelAdmin(admin.ModelAdmin): list_display = ['name', 'tags', 'url_name', 'visible'] list_editable = ['url_name'] admin.site.register(Applications, ApplicationsModelAdmin)
JacekKarnasiewicz/HomePage
apps/search_app/admin.py
Python
mit
261
# # 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...
bolkedebruin/airflow
tests/dag_processing/test_manager.py
Python
apache-2.0
29,613
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function __all__ = [ "__title__", "__summary__", "__uri__", "__version__", "__...
kimvais/cryptography
src/cryptography/__about__.py
Python
bsd-3-clause
820
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
unnikrishnankgs/va
venv/lib/python3.5/site-packages/tensorflow/contrib/learn/python/learn/utils/gc.py
Python
bsd-2-clause
5,986
# -*- coding: utf-8 -*- """ Display NVIDIA properties currently exhibiting in the NVIDIA GPUs. nvidia-smi, short for NVIDIA System Management Interface program, is a cross platform tool that supports all standard NVIDIA driver-supported Linux distros. Configuration parameters: cache_timeout: refresh interval for ...
Andrwe/py3status
py3status/modules/nvidia_smi.py
Python
bsd-3-clause
7,243
from mycli.packages.completion_engine import suggest_type import pytest def sorted_dicts(dicts): """input is a list of dicts""" return sorted(tuple(x.items()) for x in dicts) def test_select_suggests_cols_with_visible_table_scope(): suggestions = suggest_type('SELECT FROM tabl', 'SELECT ') assert sor...
mdsrosa/mycli
tests/test_completion_engine.py
Python
bsd-3-clause
17,138
mes = int (raw_input()) if mes == 1: print("enero") elif mes ==2: print("febrero") elif mes == 3: print("marzo") else: print("otro mes")
garciparedes/python-examples
miscellaneous/hello_worlds/control1.py
Python
mpl-2.0
143
#!/router/bin/python import outer_packages #from trex_stl_lib.trex_stl_hltapi import CTRexHltApi, CStreamsPerPort from trex_stl_lib.trex_stl_hltapi import * import traceback import sys, time from pprint import pprint import argparse def error(err = None): if not err: raise Exception('Unknown exception, lo...
kisel/trex-core
scripts/automation/regression/hltapi_playground.py
Python
apache-2.0
10,579
#!/usr/bin/env python """The main entry point. Invoke as `http' or `python -m httpie'. """ import sys def main(): try: from .core import main sys.exit(main()) except KeyboardInterrupt: from . import ExitStatus sys.exit(ExitStatus.ERROR_CTRL_C) if __name__ == '__main__': ...
Widiot/simpleblog
venv/lib/python3.5/site-packages/httpie/__main__.py
Python
mit
327
def Call2(): print('Call2') def Call1(a): print('Call1') if __name__ == '__main__': Call1(Call2()) print('TEST SUCEEDED!')
roscoeZA/GeoGigSync
pydev/tests_python/_debugger_case56.py
Python
cc0-1.0
154
#!/usr/bin/env python # # Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
Aloomaio/googleads-python-lib
examples/ad_manager/v201805/workflow_request_service/get_workflow_approval_requests.py
Python
apache-2.0
2,213
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals # budgetdatapackage - Load and manage Budget data packages # Copyright (C) 2013 Tryggvi Björgvinsson # # This program is free software: you can re...
trickvi/budgetdatapackage
budgetdatapackage/resource.py
Python
gpl-3.0
5,314
# pylint: skip-file def get_cert_data(path, content): '''get the data for a particular value''' if not path and not content: return None rval = None if path and os.path.exists(path) and os.access(path, os.R_OK): rval = open(path, 'rU').read() elif content: rval = content ...
appuio/ansible-role-openshift-zabbix-monitoring
vendor/openshift-tools/ansible/roles/lib_openshift_3.2/build/ansible/oc_route.py
Python
apache-2.0
5,836
# -*- test-case-name: twisted.conch.test.test_filetransfer -*- # # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. from __future__ import division, absolute_import import errno import struct from zope.interface import implementer from twisted.conch.interfaces import ISFTPServer, ISFTPFile from...
whitehorse-io/encarnia
pyenv/lib/python2.7/site-packages/twisted/conch/ssh/filetransfer.py
Python
mit
34,339
""" addons.xml generator """ import os import md5 class Generator: """ Generates a new addons.xml file from each addons addon.xml file and a new addons.xml.md5 hash file. Must be run from the root of the checked-out repo. Only handles single depth folder structure. """ ...
overflow-msgs/smartconnect
tools/addons_xml_generator.py
Python
gpl-2.0
2,748
""" @file poi.py @author Jakob Erdmann @author Laura Bieker @date 2014-02-13 @version $Id: poi.py 19649 2015-12-17 21:05:20Z behrisch $ This module includes functions for converting SUMO's fcd-output into pois (useful for showing synthetic GPS disturtbances) SUMO, Simulation of Urban MObility; see http://sumo...
702nADOS/sumo
tools/sumolib/output/convert/poi.py
Python
gpl-3.0
1,293
#!/usr/bin/env python3 from __future__ import print_function import sys, os, re, subprocess as sp from setuptools import setup if not sys.version_info[0] == 3: sys.exit("Python 2.x is not supported; Python 3.x is required.") ######################################## # Based on this recipe, adapted for Python 3, ...
dlenski/smxlogin
setup.py
Python
gpl-3.0
1,944
import os from setuptools import setup def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( name = "PyTimer", version = "0.0.1", author = "Gertjan van den Burg", author_email = "[email protected]", description = ("A command l...
GjjvdBurg/PyTimer
setup.py
Python
gpl-2.0
583
# encoding: utf-8 # # 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/. # # Contact: Kyle Lahnakoski ([email protected]) # from __future__ import unicode_literals import ...
klahnakoski/SpotManager
vendor/jx_elasticsearch/rollover_index.py
Python
mpl-2.0
13,558
import asyncio import time import aiohttp from . import utils from . import static_data DAY = static_data.DAY REGIONS = static_data.LEAGUE_REGIONS CACHE_UPDATE_TIMEOUT = static_data.LEAGUE_CACHE_UPDATE_TIMEOUT REDIS_URL = static_data.REDIS_URL class AsyncRateLeagueAPI: def __init__(self, api_key): sel...
festinuz/cmcb
cmcb/league.py
Python
mit
2,319
from twistedbot.plugins.base import PluginChatBase class Help(PluginChatBase): @property def command_verb(self): return "help" @property def help(self): return "without argument shows aviable commands or help for specfic command" def command(self, sender, command, args): ...
lukleh/TwistedBot
twistedbot/plugins/core/chat_help.py
Python
mit
801
import wx from wx import xrc from .base import ModuleBase, bind class AntennaModule(ModuleBase): def __init__(self, name, pos, antenna_controller): self._antenna_controller = antenna_controller self._panel = None self.title = 'Antenna ({})'.format(name) self.grid_pos = ...
PW-Sat2/PWSat2OBC
integration_tests/emulator/antenna.py
Python
agpl-3.0
3,567
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe.utils import cstr, flt, cint, nowdate, add_days, comma_and from frappe import msgprint, _ from frappe.model.document import ...
mbauskar/alec_frappe5_erpnext
erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py
Python
agpl-3.0
14,964
# 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/. """events.py: event management""" import pygame class EventError(Exception): pass class EventManager(object): ...
nyrocron/pathdemo
game/events.py
Python
mpl-2.0
2,172
from app import db import datetime from passlib.apps import custom_app_context as pwd_context from itsdangerous import (TimedJSONWebSignatureSerializer as Serializer, BadSignature, SignatureExpired) class User(db.Model): id = db.Column(db.Integer, primary_key=True) username = db.Colu...
ibrahimGhailani/TodoFlask
app/models.py
Python
mit
2,952
# !/usr/bin/env python from setuptools import setup setup( name='shamir_bip39_2039', version='0.0.1', test_suite='nose2.collector.collector', packages=['shamir_bip39_2039'], package_data={'shamir_bip39_2039': ['english.txt']})
klingebj/shamir_bip39_2039
setup.py
Python
apache-2.0
248
from scipy import misc from skimage import color import numpy as np import os as os if __name__ == "__main__": path = "USPSdata/Numerals/" count = 0 for i in range(10): new_path = path new_path = new_path + str(i) + "/" for name in os.listdir(new_path): final_pat...
JruvikaBhimani/CSE-547---Introduction-to-Machine-Learning
Project 3 - Neural Network and Tensor Flow/usps.py
Python
apache-2.0
1,100
import os import sys sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__)))) #print sys.path import math import bld_geometry from stat_corr import * def evaluate_building(population_density, area='NULL', perimeter='NULL', height='N...
UdK-VPT/Open_eQuarter
mole/stat_util/energy_demand.py
Python
gpl-2.0
4,636
#!/usr/bin/env python # This script does a deep dive into the data collected previously, and performs # an analysis of the errors. from __future__ import print_function import sys import subprocess import json import argparse import hashlib import requests from sqlalchemy import create_engine from sqlalchemy.orm impo...
criswell/circle-stats
error-stats.py
Python
gpl-2.0
3,420
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file '/home/procamora/Documents/Gestor-Series/app/utils/../../app/views/ui/descarga_automatica.ui' # # Created by: PyQt5 UI code generator 5.12.1 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets ...
procamora/Gestor-Series
app/views/ui/descarga_automatica_ui.py
Python
gpl-3.0
3,116
from ngo.urls import url from . import views app_name = 'app2' urlpatterns = [ url(r'^$', views.home, name='home'), url(r'^hello/(?P<name>\w+)/$', views.hello, name='hello'), ]
naritotakizawa/ngo
tests/project2/app2/urls.py
Python
mit
196
from collections import OrderedDict, namedtuple from conans.errors import NotFoundException, ConanException from conans.search.search import (filter_outdated, search_packages, search_recipes, filter_by_revision) class Search(object): def __init__(self, cache, remote_manager, rem...
conan-io/conan
conans/client/cmd/search.py
Python
mit
5,320
from django.core.urlresolvers import reverse from livinglots_friendlyowners.views import (BaseAddFriendlyOwnerView, BaseAddFriendlyOwnerSuccessView) from .forms import FriendlyOwnerForm from .models import FriendlyOwner class AddFriendlyOwnerView(BaseAddFriendlyOwnerView...
596acres/livinglots-la
livinglotsla/friendlyowners/views.py
Python
gpl-3.0
548
#!/usr/bin/python -tt # Copyright 2010 Google Inc. # Licensed under the Apache License, Version 2.0 # http://www.apache.org/licenses/LICENSE-2.0 # Google's Python Class # http://code.google.com/edu/languages/google-python-class/ # Additional basic list exercises # D. Given a list of numbers, return a list where # al...
pshanks01/learn_python
google-python-exercises/basic/list2.py
Python
gpl-3.0
2,300
#!/usr/bin/env python3 """Home Assistant setup script.""" from datetime import datetime as dt from setuptools import find_packages, setup import homeassistant.const as hass_const PROJECT_NAME = "Home Assistant" PROJECT_PACKAGE_NAME = "homeassistant" PROJECT_LICENSE = "Apache License 2.0" PROJECT_AUTHOR = "The Home A...
w1ll1am23/home-assistant
setup.py
Python
apache-2.0
2,234
# requirements from lib.request_handlers import * from collections import Counter from termcolor import * import SocketServer import logging import json import time # logging configuration LOG_DIRECTORY = "log/" LOG_FILE = LOG_DIRECTORY + str(time.strftime("%Y%m%d-%H%M-")) + "manager_server.log" logging.basicConfig(fi...
desmovalvo/virtualsib
manager/manager_server.py
Python
lgpl-3.0
6,754
#!/usr/bin/env python # This file defines features used by PiGaugeOBD, such as turbo timer and rev matcher. import time import sys # Feature class is the base class which is used to run feature logic in a loop. # bEnabled sets wether the feature should be enabled or not class Feature: def __init__(self, bEnabled)...
seanchapman/PiGaugeOBD
pigauge_features.py
Python
gpl-2.0
2,918
from rpitc.section import BareEntranceSection, BaseEntranceSection, BaseExitSection class Entrance(BaseEntranceSection): pass class BareEntrance(BareEntranceSection): pass class Exit(BaseExitSection): pass
stefan-walluhn/RPi.TC
rpitc/station/gateway.py
Python
gpl-3.0
224
from PyQt5 import QtWidgets as qtw from PyQt5 import QtCore as qtc from PyQt5 import QtGui as qtg from . import utils class LaunchButton(qtw.QPushButton): """ This is the actual button you push to launch the program. """ def __init__(self, parent, config): """Construct a LaunchButton""" ...
alandmoore/KiLauncher
kilauncher/button.py
Python
gpl-3.0
4,425
#!/usr/bin/python # # sg-check.py - Performs various consistency checks against a running # Sync Gateway's public REST API. It will also provide # some useful summary statics, including channel counts # for those using the `channel(doc.channels)` style. # # Author: # Zachar...
tophatch/sync_gateway
tools/sg-check.py
Python
apache-2.0
5,003
# $Id$ # # Copyright (C) 2008 Greg Landrum # # @@ All Rights Reserved @@ # This file is part of the RDKit. # The contents are covered by the terms of the BSD license # which is included in the file license.txt, found at the root # of the RDKit source tree. # """piddleQt This module implements the PIDDLE/Sping A...
soerendip42/rdkit
rdkit/sping/Qt/pidQt4.py
Python
bsd-3-clause
10,601
# -*- coding: utf-8 -*- import re from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class EdiskCz(SimpleHoster): __name__ = "EdiskCz" __type__ = "hoster" __version__ = "0.22" __pattern__ = r'http://(?:www\.)?edisk\.(cz|sk|eu)/(stahni|sk/stahni|en/download)/.+' ...
mariusbaumann/pyload
module/plugins/hoster/EdiskCz.py
Python
gpl-3.0
1,565
#!/usr/bin/env python # -*- encoding: utf-8 -*- """Tests for the registry flows.""" import os from absl import app from grr_response_client.client_actions import file_fingerprint from grr_response_client.client_actions import searching from grr_response_client.client_actions import standard from grr_response_core.li...
google/grr
grr/server/grr_response_server/flows/general/registry_test.py
Python
apache-2.0
12,992
""" kombu.syn ========= """ from __future__ import absolute_import import sys __all__ = ['detect_environment'] _environment = None def blocking(fun, *args, **kwargs): return fun(*args, **kwargs) def select_blocking_method(type): pass def _detect_environment(): ## -eventlet- if 'eventlet' in sy...
mozilla/firefox-flicks
vendor-local/lib/python/kombu/syn.py
Python
bsd-3-clause
996
#!/usr/bin/env python import msshcopyid.cli if __name__ == '__main__': msshcopyid.cli.main()
samuel-phan/mssh-copy-id
msshcopyid/bin/mssh-copy-id.py
Python
mit
100
""" Only works for 'basic type' properties (bool, int and float)! Multi-dimensional arrays (like array of vectors) will be flattened into seq. """ collection.foreach_get(attr, some_seq) # Python equivalent for i in range(len(seq)): some_seq[i] = getattr(collection[i], attr)
Passtechsoft/TPEAlpGen
blender/doc/python_api/examples/bpy.types.bpy_prop_collection.foreach_get.py
Python
gpl-3.0
281
print ("project euler problem 5 find the smallest number divisible by each number smaller than twenty") print 16*9*5*7*11*13*17*19
Greh/Project-Euler
euler5.py
Python
mit
132
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
ghchinoy/tensorflow
tensorflow/python/ops/state_ops.py
Python
apache-2.0
35,124
#!/usr/bin/env python # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2011 OpenStack LLC. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "Lice...
rcbops/keystone-buildpackage
keystone/manage/__init__.py
Python
apache-2.0
10,543
# Copyright 2017 Mycroft AI 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 writin...
Dark5ide/mycroft-core
mycroft/tts/mimic2_tts.py
Python
apache-2.0
9,665
import json from collections import OrderedDict from MoviesTemplateCJ import * class MoviesCollectionTemplateCJ: """simple template to represent Collection+JSON Responses""" def __init__(self, root): self.container = dict() self.href = root + 'movies' self.version = '1.0' self...
bryanbarnard/RESTfulMoviesinPython
src/python/server/templates/MoviesCollectionTemplateCJ.py
Python
mit
1,890
#! /usr/bin/python import sys,socket from threading import Thread PORT=50607 USAGE="\n \t usage: tcpchat.py server|client <ip address of server>" if len(sys.argv)==1: print USAGE else: s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) def ClientRecv(sock): while True: data = sock.recv(1024) if not dat...
ghoshbishakh/filedrop
tests/tcpchat.py
Python
gpl-2.0
1,725
import github3 from tests.utils import BaseCase, load class TestThread(BaseCase): def __init__(self, methodName='runTest'): super(TestThread, self).__init__(methodName) self.thread = github3.notifications.Thread(load('notification')) self.api = ("https://api.github.com/notifications/thread...
h4ck3rm1k3/github3.py
tests/test_notifications.py
Python
bsd-3-clause
1,197
# -*- coding: utf-8 -*- # # application.py # # Copyright © 2016-2017 Antergos # # This file is part of whither. # # whither 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 #...
Antergos/whither
whither/toolkits/qt/application.py
Python
gpl-3.0
1,921
# -*- coding: utf-8 -*- # Copyright 2010 Jaap Karssenberg <[email protected]> '''This module contains code for defining and managing custom commands. ''' import gtk import logging from zim.gui.applications import CustomToolManager from zim.gui.widgets import Dialog, IconButton, IconChooserButton from zim....
Osndok/zim-desktop-wiki
zim/gui/customtools.py
Python
gpl-2.0
6,194
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import wagtail.wagtailcore.fields import modelcluster.fields class Migration(migrations.Migration): dependencies = [ ('wagtaildocs', '0002_initial_data'), ('wagtailcore', '0010_change_page_ow...
linuxsoftware/blue-wagtail-site
events/migrations/0002_eventindexpage_eventindexpagerelatedlink_eventpage_eventpagerelatedlink.py
Python
mit
4,072
## \file ## \ingroup tutorial_pyroot ## This macro is an example of graphs in log scales with annotations. ## ## The presented results ## are predictions of invariant cross-section of Direct Photons produced ## at RHIC energies, based on the universality of scaling function H(z). ## ## ## These Figures were publishe...
krafczyk/root
tutorials/pyroot/zdemo.py
Python
lgpl-2.1
8,180
# Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the...
BiznetGIO/horizon
openstack_dashboard/api/swift.py
Python
apache-2.0
13,395
CFNoQuitButton=256 CFPageButton=16 CFQuicktalker=4 CFQuitButton=32 CFReversed=64 CFSndOpenchat=128 CFSpeech=1 CFThought=2 CFTimeout=8 CCNormal = 0 CCNoChat = 1 CCNonPlayer = 2 CCSuit = 3 CCToonBuilding = 4 CCSuitBuilding = 5 CCHouseBuilding = 6 CCSpeedChat = 7 CCFreeChat = 8 NAMETAG_COLORS = { CCNormal: ( ...
silly-wacky-3-town-toon/SOURCE-COD
otp/nametag/NametagConstants.py
Python
apache-2.0
8,694
from office365.sharepoint.fields.field import Field class FieldCalculated(Field): """ Specifies a calculated field in a list. To set properties, call the Update method (section 3.2.5.38.2.1.5). The NoCrawl and SchemaXmlWithResourceTokens properties are not included in the default scalar property set ...
vgrem/Office365-REST-Python-Client
office365/sharepoint/fields/field_calculated.py
Python
mit
831
AuthorizedException = ( BufferError, ArithmeticError, AssertionError, AttributeError, EnvironmentError, EOFError, LookupError, MemoryError, ReferenceError, RuntimeError, SystemError, TypeError, ValueError )
ainafp/nilearn
nilearn/_utils/exceptions.py
Python
bsd-3-clause
311
#!/usr/bin/env python import sys first = [ line.rstrip() for line in open(sys.argv[1],"r") ] second = [ line.rstrip() for line in open(sys.argv[2],"r") ] for f in first: if f in second: pass else: print f
mclarke-icr/scripts
subtractLists.py
Python
gpl-3.0
242
# Generated by Django 2.0.13 on 2020-04-02 23:15 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('myuw', '0016_myuw_notice_group'), ] operations = [ migrations.AddField( model_name='myuwnotice', name='is_critical'...
uw-it-aca/myuw
myuw/migrations/0017_critical_notice.py
Python
apache-2.0
393
import random import math import numpy as np import pygame from pygame.color import THECOLORS import pymunk from pymunk.vec2d import Vec2d from pymunk.pygame_util import draw # PyGame init width = 1000 height = 700 pygame.init() screen = pygame.display.set_mode((width, height)) clock = pygame.time.Clock() # Turn of...
coreknowledge2016/multi-agent-hrl
carmunk.py
Python
mit
13,313
# coding: utf-8 # # This file is part of Progdupeupl. # # Progdupeupl is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Progdu...
progdupeupl/pdp_website
pdp/forum/__init__.py
Python
agpl-3.0
768
# # usage: python k44.py {file name} {number} # import sys import pydot from k41 import * from k42 import get_relation_pairs if __name__ == '__main__': fn, nos = sys.argv[1], int(sys.argv[2]) sl = load_cabocha(fn) pl = get_relation_pairs([sl[nos-1]]) g = pydot.graph_from_edges(pl) g.write_png('re...
WatsonDNA/nlp100
chap05/k44.py
Python
unlicense
343
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe from frappe import msgprint, throw, _ from frappe.utils import scrub_urls import email.utils import inlinestyler.utils def get_email(recipients, sender='', msg='...
cadencewatches/frappe
frappe/utils/email_lib/email_body.py
Python
mit
7,076
#!/usr/bin/env python import os, sys import json from collections import namedtuple Key = namedtuple("Key", ["name","version"]) class InstrumentationBase(object): """ Pre-computed patterns """ def __init__(self, name, version, description, supported=[]): self.enable = 'y' self.name = ...
pingali/dgit
dgitcore/plugins/instrumentation.py
Python
isc
568
def main(request, response): response.headers.set("Content-Security-Policy", "default-src 'none'") response.headers.set("X-Content-Security-Policy", "default-src 'none'") response.headers.set("X-WebKit-CSP", "default-src 'none'") return """<!DOCTYPE html> <!-- Copyright (c) 2013 Intel Corporation. Redi...
kaixinjxq/web-testing-service
wts/tests/csp/csp_default-src_none_script-manual.py
Python
bsd-3-clause
2,381
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source # & Institut Laue - Langevin # SPDX - License - Identifier: GPL - 3.0 + """ Test script for running python commands w...
mganeva/mantid
MantidPlot/test/MantidPlotSliceViewerTest.py
Python
gpl-3.0
8,849
bl_info = { "name": "MSG", "author": "jameswilddev", "version": (0, 0, 0), "blender": (2, 7, 0), "location": "File > Export > MasSplat Geometry (.msg)", "description": "Export triangles as MasSplat Geometry (.msg)", "category": "Import-Export" } import bpy, struct, math, random class ExportMSG(bpy.types...
jameswilddev/WalkingSimulator
tools/blenderMSG.py
Python
mit
2,526
# -*- coding: utf-8 -*- ''' Using the state crime dataset separately plot the effect of the each variable on the on the outcome, murder rate while accounting for the effect of all other variables in the model visualized with a grid of partial regression plots. ''' from statsmodels.graphics.regressionplots import plot...
statsmodels/statsmodels.github.io
v0.11.1/plots/graphics_regression_partregress_grid.py
Python
bsd-3-clause
683
# Code Coverage # --------------- # Achieve full statement coverage and parameter value coverage for # strings, integers, and booleans on this enhanced Queue class. # # You will need to: # 1) Write your test code in the test function. # 2) Press submit. The grader will tell you if you # fail to cover any specific p...
Quexint/Assignment-Driven-Learning
OCW/[Udacity]Software_Testing/src/6.CodeCoverage.py
Python
mit
3,205
import os from core.unknownSubstance import UnknownSubstance class Languages(UnknownSubstance): def __init__(self): self.Neutral = 'Neutral' self.Arabic = 'Arabic' self.Chinese_Simplified = 'Chinese (Simplified)' self.Chinese_Traditional = 'Chinese (Traditional)' self.Cze...
TheVice/WinUpdatesManager
Python/core/languages.py
Python
apache-2.0
9,869
import itertools import json import os import zipfile from collections import defaultdict from cStringIO import StringIO from datetime import datetime from slyd.projecttemplates import templates REQUIRED_FILES = {'setup.py', 'scrapy.cfg', 'extractors.json', 'items.json', 'project.json', 'spiders/__...
nju520/portia
slyd/slyd/utils/download.py
Python
bsd-3-clause
10,547
# -*- coding: utf-8 -*- """ Created on Mon Jun 22 15:32:58 2015 @author: hanbre """ from __future__ import print_function import sys import numpy as np import pandas as pd import xray import datetime import netCDF4 from mpl_toolkits.basemap import Basemap import matplotlib from matplotlib.pylab import * import matplo...
hansbrenna/NetCDF_postprocessor
plotter3.py
Python
gpl-3.0
4,021
#!/usr/bin/env python # coding: utf-8 import os import re from setuptools import setup path = os.path.dirname(__file__) desc_fd = os.path.join(path, 'README.rst') hist_fd = os.path.join(path, 'HISTORY.rst') long_desc = '' short_desc = 'A Kerberos authentication handler for python-requests' if os.path.isfile(desc_fd)...
rbcarson/requests-kerberos
setup.py
Python
isc
1,640
""" `SQLite`_ database specific implementations of changeset classes. .. _`SQLite`: http://www.sqlite.org/ """ try: # Python 3 from collections import MutableMapping as DictMixin except ImportError: # Python 2 from UserDict import DictMixin from copy import copy import re from sqlalchemy.databases imp...
odubno/microblog
venv/lib/python2.7/site-packages/migrate/changeset/databases/sqlite.py
Python
bsd-3-clause
7,967
"""Simple App configuration for hs_core module.""" from django.apps import AppConfig class HSCoreAppConfig(AppConfig): """Configures options for hs_core app.""" name = "hs_core" def ready(self): """On application ready, import receivers for Django signals.""" from . import receivers # ...
hydroshare/hydroshare
hs_core/apps.py
Python
bsd-3-clause
325
# # # Copyright (C) 2006, 2007, 2008, 2013 Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of source code must retain the above copyright notice, # this list ...
leshchevds/ganeti
lib/hypervisor/hv_fake.py
Python
bsd-2-clause
11,785
#! /usr/bin/env python # -*- coding: utf-8 -*- """ Mock batch system interface, reading submitted jobs from a history file. """ # Copyright (C) 2011, 2012 ETH Zurich and University of Zurich. All rights reserved. # # Authors: # Riccardo Murri <[email protected]> # # Licensed under the Apache License, Version 2...
uzh/vm-mad
vmmad/batchsys/replay.py
Python
apache-2.0
5,584
# # Copyright 2009-2011 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 ...
kvaps/vdsm
vdsm/storage/fileSD.py
Python
gpl-2.0
28,044