code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
# Test just the SSL support in the socket module, in a moderately bogus way.
from test import test_support
import socket
import time
# Optionally test SSL support. This requires the 'network' resource as given
# on the regrtest command line.
skip_expected = not (test_support.is_resource_enabled('network') and
... | trivoldus28/pulsarch-verilog | tools/local/bas-release/bas,3.9/lib/python/lib/python2.3/test/test_socket_ssl.py | Python | gpl-2.0 | 1,680 |
#!/usr/bin/env python3
# Copyright (c) 2016-2021 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test Wallet commands for signing and verifying messages."""
from test_framework.test_framework import ... | particl/particl-core | test/functional/wallet_signmessagewithaddress.py | Python | mit | 1,904 |
#!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, 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 3 of the Lic... | aperigault/ansible | lib/ansible/modules/network/fortios/fortios_system_admin.py | Python | gpl-3.0 | 41,930 |
VERSION = "0.12rc3"
VERSION_NAME = "Anderssen"
| Karlon/pychess | lib/pychess/__init__.py | Python | gpl-3.0 | 47 |
"""Ask tankerkoenig.de for petrol price information."""
from datetime import timedelta
import logging
from math import ceil
import pytankerkoenig
import voluptuous as vol
from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN
from homeassistant.const import (
CONF_API_KEY,
CONF_LATITUDE,
CONF... | sander76/home-assistant | homeassistant/components/tankerkoenig/__init__.py | Python | apache-2.0 | 7,623 |
#!/usr/bin/env python
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import argparse
import re
import sys
from collections import defaultdict
import git_common as git
FOOTER_PATTERN = re.compile(r'^\s... | Teamxrtc/webrtc-streaming-node | third_party/depot_tools/git_footers.py | Python | mit | 4,798 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
class HrEmployee(models.Model):
_name = 'hr.employee'
_inherit = ['hr.employee', 'website.published.mixin']
public_info = fields.Char(string='Public Info')
@api.mul... | chienlieu2017/it_management | odoo/addons/website_hr/models/hr_employee.py | Python | gpl-3.0 | 508 |
########
# Copyright (c) 2014 GigaSpaces Technologies Ltd. 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... | cloudify-cosmo/cloudify-cli | cloudify_cli/config/__init__.py | Python | apache-2.0 | 641 |
"""
Provides various throttling policies.
"""
from __future__ import unicode_literals
import time
from django.core.cache import cache as default_cache
from django.core.exceptions import ImproperlyConfigured
from rest_framework.compat import is_authenticated
from rest_framework.settings import api_settings
class Ba... | OpenWinCon/OpenWinNet | web-gui/myvenv/lib/python3.4/site-packages/rest_framework/throttling.py | Python | apache-2.0 | 8,143 |
# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
from .initialise import init, deinit, reinit, colorama_text
from .ansi import Fore, Back, Style, Cursor
from .ansitowin32 import AnsiToWin32
__version__ = '0.4.4'
| google/material-design-icons | update/venv/lib/python3.9/site-packages/pip/_vendor/colorama/__init__.py | Python | apache-2.0 | 239 |
from __future__ import unicode_literals
from django.contrib import auth
from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
from django.contrib.auth.signals import user_logged_in
from django.contrib.contenttypes.models import ContentType
from django.core import validators
from django.core.excep... | MounirMesselmeni/django | django/contrib/auth/models.py | Python | bsd-3-clause | 14,881 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import survey
| richard-willowit/odoo | addons/survey_crm/models/__init__.py | Python | gpl-3.0 | 121 |
from typing import List, <warning descr="Unused import statement">Optional</warning>
def f(x, y):
# type: (int, List[int]) -> str
y.append(x)
return 'foo' | asedunov/intellij-community | python/testData/inspections/PyUnresolvedReferencesInspection/functionTypeCommentUsesImportsFromTyping.py | Python | apache-2.0 | 168 |
from couchpotato.core.providers.userscript.base import UserscriptBase
class Trakt(UserscriptBase):
includes = ['http://trakt.tv/movie/*', 'http://*.trakt.tv/movie/*']
excludes = ['http://trakt.tv/movie/*/*', 'http://*.trakt.tv/movie/*/*']
| coolbombom/CouchPotatoServer | couchpotato/core/providers/userscript/trakt/main.py | Python | gpl-3.0 | 250 |
#!/usr/bin/python
# coding=utf-8
##########################################################################
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from mock import Mock
from mock import patch
from diamond.collector import Collector
from apcupsd import Apcups... | EzyInsights/Diamond | src/collectors/apcupsd/test/testapcupsd.py | Python | mit | 3,682 |
# Package init for fixes.numpy.testing
| JohnGriffiths/nipype | nipype/fixes/numpy/testing/__init__.py | Python | bsd-3-clause | 39 |
from statsmodels.stats.descriptivestats import sign_test
from numpy.testing import assert_almost_equal, assert_equal
def test_sign_test():
x = [7.8, 6.6, 6.5, 7.4, 7.3, 7., 6.4, 7.1, 6.7, 7.6, 6.8]
M, p = sign_test(x, mu0=6.5)
# from R SIGN.test(x, md=6.5)
# from R
assert_almost_equal(p, 0.02148, 5... | hlin117/statsmodels | statsmodels/stats/tests/test_descriptivestats.py | Python | bsd-3-clause | 393 |
import warnings
from django.contrib.gis.db.models.fields import (
GeometryField, LineStringField, PointField, get_srid_info,
)
from django.contrib.gis.db.models.lookups import GISLookup
from django.contrib.gis.db.models.sql import (
AreaField, DistanceField, GeomField, GMLField,
)
from django.contrib.gis.geome... | jylaxp/django | django/contrib/gis/db/models/query.py | Python | bsd-3-clause | 32,348 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2011, Code Aurora Forum. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above ... | jdheiner/SGH-T769_Kernel | scripts/gcc-wrapper.py | Python | gpl-2.0 | 3,735 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2015 Savoir-faire Linux
# (<http://www.savoirfairelinux.com>).
#
# This program is free software: you can redistribute it and/or m... | MackZxh/OCA-Choice | server-tools/qweb_usertime/__init__.py | Python | lgpl-3.0 | 1,067 |
import numpy as np
from .base import Plugin
from ..widgets import ComboBox, Slider
from ..canvastools import PaintTool
__all__ = ['LabelPainter']
rad2deg = 180 / np.pi
class LabelPainter(Plugin):
name = 'LabelPainter'
def __init__(self, max_radius=20, **kwargs):
super(LabelPainter, self).__init_... | pratapvardhan/scikit-image | skimage/viewer/plugins/labelplugin.py | Python | bsd-3-clause | 1,876 |
# Copyright (C) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | weolar/miniblink49 | third_party/WebKit/Tools/Scripts/webkitpy/style/checkers/test_expectations.py | Python | apache-2.0 | 3,482 |
#!/usr/bin/python
#
# Copyright 2011 Software Freedom Conservancy.
#
# 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 ap... | ktan2020/legacy-automation | win/Lib/site-packages/selenium/webdriver/support/ui.py | Python | mit | 674 |
#
# 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... | YinYanfei/CadalWorkspace | thrift/src/thrift-0.8.0/lib/py/src/protocol/TCompactProtocol.py | Python | gpl-3.0 | 10,926 |
"""
This middleware is used for adjusting the headers in a response before it is sent to the end user.
This middleware is intended to sit as close as possible to the top of the middleare list as possible,
so that it is one of the last pieces of middleware to touch the response, and thus can most accurately
adjust/cont... | ahmedaljazzar/edx-platform | openedx/core/djangoapps/header_control/__init__.py | Python | agpl-3.0 | 885 |
# -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... | jamesmcm/luigi | luigi/contrib/__init__.py | Python | apache-2.0 | 661 |
#!/usr/bin/env python
# Copyright (c) 2011 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.
"""Issue a series of GetHash requests to the SafeBrowsing servers and measure
the response times.
Usage:
$ ./gethash_timer.py -... | goddino/libjingle | trunk/tools/python/google/gethash_timer.py | Python | bsd-3-clause | 4,366 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the G... | diogocs1/comps | web/addons/account_asset/account_asset_invoice.py | Python | apache-2.0 | 3,070 |
import warnings
from django.utils.deprecation import RemovedInDjango110Warning
from . import engines
from .backends.django import DjangoTemplates
from .engine import (
_context_instance_undefined, _dictionary_undefined, _dirs_undefined,
)
from .exceptions import TemplateDoesNotExist
from .loaders import base
de... | DONIKAN/django | django/template/loader.py | Python | bsd-3-clause | 6,232 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Matching functions"""
import numpy as np
import numba
from .exceptions import ParameterError
from .utils import valid_intervals
__all__ = ["match_intervals", "match_events"]
@numba.jit(nopython=True, cache=True)
def __jaccard(int_a, int_b): # pragma: no cover
"... | bmcfee/librosa | librosa/util/matching.py | Python | isc | 12,055 |
#!/usr/bin/python
"""Hamaker's analytic antenna pattern model."""
# TobiaC 2015-11-29 (2015-07-31)
import sys
import math
import re
import pickle
import numpy
import antpat
from antpat import dualpolelem, radfarfield
from antpat.reps.sphgridfun import tvecfun, pntsonsphere
HA_LBAfile_default = ''
PICKLE_PROTO = pickle... | 2baOrNot2ba/AntPat | antpat/reps/hamaker.py | Python | isc | 18,149 |
"""
Django and project specific settings for usage during development.
Everything should be ready-to-go for a common development environment, but you may of course tweak some
options.
"""
# pylint: disable=wildcard-import, unused-wildcard-import
from .base_settings import *
CSP_POLICIES = {
# The debug error pag... | fausecteam/ctf-gameserver | src/ctf_gameserver/web/dev_settings.py | Python | isc | 1,175 |
# -*- coding: utf-8 -*-
"""
controlbeast.ssh.shell
~~~~~~~~~~~~~~~~~~~~~~
:copyright: Copyright 2014 by the ControlBeast team, see AUTHORS.
:license: ISC, see LICENSE for details.
"""
import time
from controlbeast.ssh.exception import CbSSHConnectionError
from controlbeast.ssh.session import CbSSHSes... | daemotron/controlbeast | controlbeast/ssh/shell.py | Python | isc | 6,307 |
import hashlib
import json
import os
import StringIO
import mock
import pytest
import confu
@pytest.fixture(scope='function')
def locations(request):
paths = {
os.path.expanduser('~/.confu.cfg'): """\
[cfn]
parameters[KeyName] = ai-gazelle
""",
os.path.abspath('.confu.cfg'): """\
[default]
profi... | bninja/confu | tests/test_settings.py | Python | isc | 3,386 |
from distutils.core import setup
DISTNAME='ts_charting'
FULLVERSION='0.1' ... | dalejung/ts-charting | setup.py | Python | mit | 726 |
#
# File: scripts/lipsync_test.nut
# Author: Astrofra
#
import gs
import os
from globals import *
from compat import *
# Include(g_viseme_set + "phoneme_to_viseme.nut")
# !
# @short lipsync_test
# @author Astrofra
#
class LipSyncTrack:
def __init__(self):
self.ui = None # SceneGetUI(g_scene)
self.external_ma... | astrofra/amiga-memories | app/tracker_lip_sync.py | Python | mit | 4,345 |
def create_middleware(app, log_filename='repozeprofile.log',
discard_first_request=True, flush_at_shutdown=True,
path='/__profile__'):
from repoze.profile.profiler import AccumulatingProfileMiddleware
return AccumulatingProfileMiddleware(app,
log_filename=log_filename,
discar... | passy/glashammer-rdrei | glashammer/bundles/contrib/dev/repozeprofile.py | Python | mit | 503 |
"""
Written by Nathan Fritz and Lance Stout. Copyright 2011 by &yet, LLC.
Released under the terms of the MIT License
"""
import uuid
from thoonk.exceptions import Empty
from thoonk.feeds import Feed
class Queue(Feed):
"""
A Thoonk queue is a typical FIFO structure, but with an
optional priority... | andyet/thoonk.py | thoonk/feeds/queue.py | Python | mit | 2,574 |
# 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 may ... | Azure/azure-sdk-for-python | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/operations/_images_operations.py | Python | mit | 26,662 |
from setuptools import setup, find_packages
from os.path import join, dirname
import re
with open('hikvisionapi/__init__.py', 'r') as fd:
version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]',
fd.read(), re.MULTILINE).group(1)
setup(name='hikvisionapi',
version=version,
... | MissiaL/hikvision-client | setup.py | Python | mit | 911 |
#codeskulptor url: http://www.codeskulptor.org/#user40_rXnVfx7qI2_0.py
# Rock-paper-scissors-lizard-Spock template
import random
# The key idea of this program is to equate the strings
# "rock", "paper", "scissors", "lizard", "Spock" to numbers
# as follows:
#
# 0 - rock
# 1 - Spock
# 2 - paper
# 3 - lizard
# 4 - scis... | Ustabil/Python-part-one | mini_projects/rpsls/rpsls.py | Python | mit | 2,712 |
from .BaseTerminal import BaseTerminal
from eventlet.queue import Queue
class EchoTerminal(BaseTerminal):
def __init__(self):
super().__init__()
self._queue = Queue()
def send(self, data):
self._queue.put(data)
def recv(self, count=None):
return self._queue.get()
| sorgloomer/websocket_terminal | server-python3/wspty/EchoTerminal.py | Python | mit | 312 |
from default_object import Objects
class Wall(Objects):
def set_hierarchy(self):
self.hierarchy_level = 10
def __str__(self):
return '#'
def __repr__(self):
return '#'
def interact(self, obj):
return False | TRBaldim/Q-Learning | elements/wall.py | Python | mit | 259 |
"""
Django settings for lister project.
Generated by 'django-admin startproject' using Django 1.9.5.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import os, se... | bolecki/lister | lister/lister/settings.py | Python | mit | 4,193 |
"""
add rxnorm and ndfrt ids on things
"""
import os
from collections import defaultdict, Counter
from functools import lru_cache
from itertools import chain
import requests
import json
import time
from tqdm import tqdm
from wikidataintegrator import wdi_helpers, wdi_core, wdi_login
from scheduled_bots.local import... | SuLab/scheduled-bots | scheduled_bots/drugs/pharma/3-ndfrt-rxnorm.py | Python | mit | 3,151 |
from codecs import open
from os import path
from setuptools import setup
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='aws_list_all',
version='0.8.0',
... | JohannesEbke/aws_list_all | setup.py | Python | mit | 1,352 |
import numpy as np
import os, fnmatch
from sys import argv
from scipy import ndimage
from skimage import measure, morphology, segmentation
from skimage.feature import peak_local_max
from tocmfastpy import *
from h_transform_globalsync import *
import pylab as plt
import seaborn as sns
import ws3d_gpu, edt_cuda
from job... | yunfanz/ReionBub | watershed.py | Python | mit | 10,091 |
from django.conf.urls import url
from matches.views.matches import MatchView, ControlView, CreateMatchView, ListMatchView
urlpatterns = [
url(r'^create/$', CreateMatchView.as_view(), name='create'),
url(r'^list/$', ListMatchView.as_view(), name='list'),
url(r'^(?P<pk>\d+)/$', MatchView.as_view(), name='o... | sheepeatingtaz/xwingoverlayer | matches/urls/matches.py | Python | mit | 406 |
#!/usr/bin/env python3
"""Client for ETNA's APIs"""
# TODO: Implement a Session upon instantiation?
# TODO: Cli ? :o
# TODO: CLI.
from datetime import datetime
from typing import Union, List
from io import BytesIO
import requests
from .constants import (
AUTH_URL,
IDENTITY_URL,
USER_INFO_URL,
PROMOTIO... | massard-t/etnawrapper | etnawrapper/etna.py | Python | mit | 9,890 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from django.core.management.base import BaseCommand
from lxml import etree
class Command(BaseCommand):
help = 'Validates given XML file with RELAX NG schema... | lev-veshnyakov/django-import-data | import_data/management/commands/validate_xml.py | Python | mit | 938 |
from rcat import RCAT
from scipy import stats, odr
import numpy as np
import matplotlib.pyplot as plt
import math
def plot_kcat_rmaxn_correlation(x, y, fig, ax, color='#9E7E5E', edge='none',
yerr='none', labels={}, scatter_size=30, hide_overlap=True,
fit=F... | dandanvidi/catalytic-rates | scripts/figure_correlation_plot.py | Python | mit | 4,051 |
# -*- encoding: utf-8 -*-
'''
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.
For example:
Given the below binary tree and sum = 22,
5
/ \
4 8
/ / \
11 1... | weixsong/algorithm | leetcode/112.py | Python | mit | 1,385 |
#!/usr/bin/python
# Copyright (c) 2014 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Run this script from the root of the repository to update all translations from
transifex.
It will do the following... | mainconceptx/DAS | contrib/devtools/update-translations.py | Python | mit | 7,657 |
#!/usr/bin/env python
# -*- coding: utf8 -*-
import argparse
import signal
from rtrlib import RTRManager
def pfx_callback(pfx_record, added):
if added:
c = '+'
else:
c = '-'
print("{sign} {prefix:40} {max:3} - {min:3} {asn:10}".format(
sign=c,
pref... | rtrlib/python-binding | tools/rtrclient.py | Python | mit | 1,810 |
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
from __future__ import absolute_import
import copy
import json
import re
from svtplay_dl.error import ServiceError
from svtplay_dl.fetcher.hds import hdsparse
from svtplay_dl.fetcher.hls import hlsparse
from svtplay_dl.fetcher.ht... | olof/svtplay-dl | lib/svtplay_dl/service/bigbrother.py | Python | mit | 2,929 |
from django import forms
import models
class SearchForm(forms.ModelForm):
class Meta:
model = models.Search
'''
Display searches, allow edits
'''
class warningForm(forms.Form):
message = forms.CharField()
action = forms.CharField()
searchid = forms.CharField()
redirect = forms.CharField()
... | pbarton666/buzz_bot | djangoproj/djangoapp/forms.py | Python | mit | 733 |
#this algorithm finds one factor of a given number
from gcd import *
def f(x,n):
return (pow(x,2,n)+1)%n
def Rho(n):
factors = {}
i = 1
x = 1
d = 1
while d == 1:
#Calculate x[i]
factors[i] = f(x,n)
#Calculate x[i+1]
factors[i+1] = f(factors[i],n)
#find the gcd
d = gcd(abs(factors[(i+1)/2] - fact... | Bedrock02/General-Coding | Math/pollardRho.py | Python | mit | 452 |
#/usr/bin/env python
from PyQt4 import QtGui, QtCore
from PyQt4.QtGui import QMenu, QCursor
from PyQt4.QtCore import QPoint, QString, Qt
from contextMenu import ContextMenu
class DraggableNode(object):
def __init__(self, parent, name, node_num = None):
self.parent = parent
self.frame = self.paren... | fdesjardins/nara-stepbrowser | src/draggableNode.py | Python | mit | 3,714 |
# coding = utf-8
__all__ = ['aside', 'footer', 'header'] | owlsn/h_crawl | display/display/ui_modules/__init__.py | Python | mit | 56 |
# Copyright (c) 2014 Universidade Federal Fluminense (UFF)
# Copyright (c) 2014 Polytechnic Institute of New York University.
# This file is part of noWorkflow.
# Please, consult the license terms in the LICENSE file.
from __future__ import (absolute_import, print_function,
division, unicode_li... | paopao74cn/noworkflow | capture/noworkflow/now/cmd/cmd_export.py | Python | mit | 5,168 |
# 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-batch/azure/batch/models/start_task_information.py | Python | mit | 5,037 |
#!/bin/python
"""
This is a small script to fetch as much metadata about team members as one can, and then update the team.yml data file
"""
import yaml
team_file = open('_data/team.yml')
team = yaml.load(team_file)
print team
| AAROC/hackfest-site | assets/update-team.py | Python | mit | 231 |
################################################################################
# Copyright (c) 2006-2017 Franz Inc.
# All rights reserved. This program and the accompanying materials are
# made available under the terms of the MIT License which accompanies
# this distribution, and is available at http://opensource.... | franzinc/agraph-python | src/franz/miniclient/agjson.py | Python | mit | 953 |
import logging
from gym_mupen64plus.envs.MarioKart64.mario_kart_env import MarioKartEnv
logger = logging.getLogger(__name__)
| emomicrowave/gym-mupen64plus | gym_mupen64plus/__init__.py | Python | mit | 126 |
from __future__ import print_function, division
import util
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
class Autoencoder:
def __init__(self, D, M):
# training data
self.X = tf.placeholder(tf.float32, shape=(None, D))
# input -> hidden
self.W = tf.Va... | mohsaad/Algorithms | machine_learning/autoencoders/autoencoder_tf.py | Python | mit | 2,559 |
# Generated by Django 3.1.7 on 2021-03-28 20:23
import api_v3.models.profile
import datetime
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django_bleach.models
class Migration(migrations.Migration):
dependencies = [
('api_v3', '0013_add... | occrp/id-backend | api_v3/migrations/0014_change_ticket_column_limits.py | Python | mit | 1,107 |
# -*- coding: utf-8 -*-
"""
webapp2
=======
Taking Google App Engine's webapp to the next level!
:copyright: 2010 by tipfy.org.
:license: Apache Sotware License, see LICENSE for details.
"""
import logging
import re
import urllib
import urlparse
from google.appengine.ext.webapp import Request
fro... | melmothx/jsonbot | jsb/upload/webapp2/__init__.py | Python | mit | 43,235 |
from django.test import TestCase
from django.conf import settings
from django.utils.html import escape
from django.template import Context, Template
from bongo.apps.bongo.tests import factories
def render_template(string, context=None):
context = Context(context) if context else None
return Template(string).r... | BowdoinOrient/bongo | bongo/apps/frontend/tests/templatetags_tests.py | Python | mit | 1,164 |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as 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 'Entry.description'
db.add_column('challenge_entry', 'desc... | mavroskardia/codechallenge | cc/apps/challenge/migrations/0017_auto__add_field_entry_description.py | Python | mit | 8,193 |
"""Author: Michal Zmuda
Copyright (C) 2015 ACK CYFRONET AGH
This software is released under the MIT license cited in 'LICENSE.txt'
Brings up a set of cluster-worker nodes. They can create separate clusters.
"""
import os
from . import docker, common, worker, gui, panel, location_service_bootstrap
def up(image, bindi... | onedata/web-client | bamboos/docker/environment/zone_worker.py | Python | mit | 4,712 |
# Bryan Barrows
# CSC 110 - Winter 17
# suess.py
# As I was exploring the chapter on graphics, there was an excellent example of "Red Fish, Blue Fish",
# which I took the liberty of playing with and exploring.
# I found it really cool how by definining so many variables within our drawFish method, it is possible
# to... | bbarrows89/CSC110_Projects | suess.py | Python | mit | 1,314 |
import pygame, random
from pygame.locals import *
CONST_WIDTH = 640 #* 2
CONST_HEIGHT = 480 #* 2
CONST_BOX_WIDTH = 8
CONST_BOX_HEIGHT = 8
#Colors
BackgroundBarva = (0,0,0,0)
BARVE = []
Bela = (255,255,255,255)
BARVE.append(Bela)
Crna = (0,0,0,255)
BARVE.append(Crna)
Rdeca = (255,0,0,255)
BARVE.append(Rdeca)
Modra =... | RokKos/Maze | PyMaze.py | Python | mit | 9,739 |
###########################################################################################
# Author: Josh Joseph joshmd@bu.edu
# 4/29/16
# This is the main server file for PCR hero....
from bottle import route, run, template, get, post, request, response, redirect, static_file
import m3
import os
pcrDB = m3.get_db("... | jwjoseph/PCRHero | hello4.py | Python | mit | 25,735 |
"""
A drop in replacment for the Adafruit_DotStar module.
It allows me to to visualize what the LED strip may look like, without actually having one.
"""
from __future__ import print_function
import graphics
class Adafruit_DotStar(object):
"A mock implementation of the Adafruit_DotStart that simulates LEDs in the... | dodgyrabbit/midi-light-py | Mock_DotStar.py | Python | mit | 2,955 |
"Docstring parsing example"
from gpkit import Model, parse_variables
class Cube(Model):
"""Demonstration of nomenclature syntax
Lines that end in "Variables" will be parsed as a scalar variable table
until the next blank line.
Variables
---------
A [m^2] surface area
V 100 [L] ... | convexopt/gpkit | docs/source/examples/docstringparsing.py | Python | mit | 1,187 |
# -*- coding: utf-8 -*-
"""
This is part of WebScout software
Docs EN: http://hack4sec.pro/wiki/index.php/WebScout_en
Docs RU: http://hack4sec.pro/wiki/index.php/WebScout
License: MIT
Copyright (c) Anton Kuzmin <http://anton-kuzmin.ru> (ru) <http://anton-kuzmin.pro> (en)
Job class for Fuzzer urls module
"""
from clas... | hack4sec/ws-cli | classes/jobs/FuzzerUrlsJob.py | Python | mit | 454 |
#!/usr/bin/env
"""
wave_sig.py
References:
-----------
See "http://paos.colorado.edu/research/wavelets/"
Written January 1998 by C. Torrence
Translated to Python 2014
Using Anaconda packaged Python
from wave_matlab
"""
import numpy as np
def wave_signif(Y,dt,scale1,lag1=0.0,sigtest=0, dof=0, sigl... | jeepsterboy/waveletanalysis | wave_sig.py | Python | mit | 3,974 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import jsonfield.fields
import django.utils.timezone
import model_utils.fields
class Migration(migrations.Migration):
dependencies = [
('libraries', '0003_libraryimport'),
('books', '0004_aut... | phildini/bockus | books/migrations/0005_auto_20150817_2146.py | Python | mit | 1,958 |
'''
https://pythonprogramming.net/svm-in-python-machine-learning-tutorial/?completed=/svm-constraint-optimization-machine-learning-tutorial/
SVM Training - Practical Machine Learning Tutorial with Python p.26
https://youtu.be/QAs2olt7pJ4?list=PLQVvvaa0QuDfKTOs3Keq_kaG2P55YRn5v
'''
import matplotlib.pyplot as plt
fr... | aspiringguru/sentexTuts | PracMachLrng/sentex_ML_demo18_SVM Training_p26.py | Python | mit | 2,461 |
from blocks.initialization import Constant
from cuboid.bricks.inception import ConcatBricks
from cuboid.bricks import Convolutional
from numpy.testing import assert_allclose
import theano
import theano.tensor as T
import numpy as np
def test_concat_bricks_conv():
i1 = Convolutional(input_dim=(4, 16, 16), num_filt... | lukemetz/cuboid | tests/bricks/test_inception.py | Python | mit | 945 |
#!/usr/bin/env python
"""
Copyright (C) 2016 Anthony Briggs <anthony.briggs@gmail.com>
This file is part of Chat-thing.
Chat-thing 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 vers... | AnthonyBriggs/Python-101 | chat2/chat.py | Python | mit | 5,770 |
from django.db import models
from django.contrib.auth.models import User
# Create your models here.
def user_return(self):
return self.username+" "+self.first_name
User.add_to_class("__str__", user_return)
class Department(models.Model):
dept = models.CharField(max_length=100)
def __str__(self):
... | avinash795k/leaveProject | userpanel/models.py | Python | mit | 3,453 |
# -*- encoding: utf-8 -*-
"""
Комплексные числа
"""
#Complex numbers with a nonzero real component are written as "(real+imagj)",
#or can be created with the "complex(real, imag)" function.
print 1j * 1J
print 1j * complex(0,1)
print 3+1j*3
print (3+1j)*3
print (1+2j)/(1+1j)
| h4/fuit-webdev | examples/lesson2/1.2/1.2.3.py | Python | mit | 299 |
"""Common settings and globals."""
from os.path import abspath, basename, dirname, join, normpath
from sys import path
########## PATH CONFIGURATION
# Absolute filesystem path to the Django project directory:
DJANGO_ROOT = dirname(dirname(abspath(__file__)))
# Absolute filesystem path to the top-level project fold... | abelthf/layout_template | project_name/project_name/settings/base.py | Python | mit | 6,616 |
from __future__ import print_function
import sys
from nose.core import run
from nose.core import unittest
from pprint import pprint
from stdplus._sshConfig import parseSshConfig
from stdplus import *
def test_isIp_InvalidSamples():
assert(not isIp( "Obviously not an ip" )) # obvious
assert(not isIp( "16" ))... | earlye/python-stdplus | tests/stdplus/testIsIp.py | Python | mit | 1,253 |
from unittest import TestCase
from iota import Address
from iota.crypto.types import Digest
from iota.multisig.crypto.addresses import MultisigAddressBuilder
from iota.multisig.types import MultisigAddress
class MultisigAddressBuilderTestCase(TestCase):
"""
Generating values for this test case using the JS lib:
... | iotaledger/iota.lib.py | test/multisig/crypto/addresses_test.py | Python | mit | 4,973 |
# local imports
from .client import ClientError
from .client import DryRun
from .client import MarathonClient
from .deployment import DeploymentFailed
from .deployment import DeploymentNotFound
from .deployment import MarathonDeployment
__all__ = [
'ClientError',
'DeploymentFailed',
'DeploymentNotFound',
... | shopkeep/shpkpr | shpkpr/marathon/__init__.py | Python | mit | 384 |
# -*- coding:utf-8 -*-
from gensim import corpora
import nltk
import myLogger
import numpy as np
__author__ = "JOHNKYON"
def raw_initializer(dataset):
"""
Read input and output information from json object
:param dataset:
:return:
"""
logger = myLogger.myLogger("initializer")
logger.info(... | JOHNKYON/DSTC | DSTC2/traindev/scripts/initializer.py | Python | mit | 4,974 |
import re
import argparse
class Link(object):
def __init__(self, src, dst, label):
self._src = 'bb%i' % (src,)
self._dst = dst if isinstance(dst, str) else 'bb%i' % (dst,)
self._label = label
def main():
#cratename,pat = 'rustc_lint','fn .*expr_refers_to_this_method.*'
cratename,p... | thepowersgang/mrustc | scripts/mir_to_dot.py | Python | mit | 4,736 |
"""
Amazon Web Services version 4 authentication for the Python `Requests`_
library.
.. _Requests: https://github.com/kennethreitz/requests
Features
--------
* Requests authentication for all AWS services that support AWS auth v4
* Independent signing key objects
* Automatic regeneration of keys when scope date bound... | sam-washington/requests-aws4auth | requests_aws4auth/__init__.py | Python | mit | 8,452 |
"""LCM type definitions
This file automatically generated by lcm.
DO NOT MODIFY BY HAND!!!!
"""
import cStringIO as StringIO
import struct
import kinect_joint_t
class kinect_bodyframe_update_t(object):
__slots__ = ["bodyjoints"]
SpineBase = 0
SpineMid = 1
Neck = 2
Head = 3
ShoulderLeft = 4
... | GearsAD/semisorted_arnerve | lcm_types/user_types/semisorted_arnerve/kinect_bodyframe_update_t.py | Python | mit | 2,701 |
#Andrew Tan, 4/12, Section 010, Part 3
import random
#Define possible cards and associated values
cards = ['10 of Hearts', '9 of Hearts', '8 of Hearts', '7 of Hearts', '6 of Hearts', '5 of Hearts', '4 of Hearts', '3 of Hearts', '2 of Hearts', 'Ace of Hearts', 'King of Hearts', 'Queen of Hearts', 'Jack of Hearts... | sojournexx/python | Assignments/TanAndrew_assign8_part3.py | Python | mit | 2,988 |
#!/usr/bin/env python3
import os
from setuptools import setup, find_packages
from homeassistant.const import __version__
PACKAGE_NAME = 'homeassistant'
HERE = os.path.abspath(os.path.dirname(__file__))
DOWNLOAD_URL = ('https://github.com/home-assistant/home-assistant/archive/'
'{}.zip'.format(__version... | devdelay/home-assistant | setup.py | Python | mit | 1,479 |
# Return a Collatz chain for a given integer input
# Output returned as a list
# Created by Joel Pozin on March 7, 2017
import sys
def collatz(num):
"""
if n is even, n/2
if n is odd, 3n+1
"""
newlist = [num]
while num != 1:
if num%2 == 0:
num //= 2
... | jpozin/Math-Projects | CollatzChain.py | Python | mit | 579 |
import amity
import socket
import logging
import tornado.ioloop
if __name__ == "__main__":
import sys
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG,
format='%(asctime)s %(process)d %(filename)s %(lineno)d %(levelname)s #| %(message)s',
datefmt='%H:%M:%S')
ioloop = tornado.i... | whardier/AMIty | test/poll.py | Python | mit | 674 |
# -*- coding: utf-8 -*-
"""
Display current conditions from openweathermap.org.
As of 2015-10-09, you need to signup for a free API key via
http://openweathermap.org/register
Once you signup, use the API key generated at signup to either:
1. set the `apikey` parameter directly
2. place the API key (and nothing els... | justinludwig/j3status | j3_weather.py | Python | mit | 7,547 |
#!/usr/bin/env python
from __future__ import division, print_function, absolute_import
import numpy as np
from numpy.testing import (assert_raises, run_module_suite,
assert_equal, assert_allclose)
import pywt
def test_available_modes():
modes = ['zpd', 'cpd', 'sym', 'ppd', 'sp1', 'per... | ThomasA/pywt | pywt/tests/test_modes.py | Python | mit | 2,725 |
import hypergan as hg
import tensorflow as tf
from hypergan.gan_component import ValidationException
from hypergan.inputs.image_loader import ImageLoader
import os
def fixture_path(subpath=""):
return os.path.dirname(os.path.realpath(__file__)) + '/fixtures/' + subpath
class TestImageLoader:
def test_construc... | 255BITS/HyperGAN | tests/inputs/test_image_loader.py | Python | mit | 2,599 |
##
## File: macros.py
##
## Author: Schuyler Martin <sam8050@rit.edu>
##
## Description: Python file that contains C-like macros for the project
##
#### GLOBALS ####
# Enables extended debug printing
DEBUG_MACRO = False
# Debug flag for database debugging; uses a different SQLite file
DEBUG_DB = True
# Host n... | RIT-CS-Mentoring-Center-Queueing/mmcga_project | server/utils/macros.py | Python | mit | 2,356 |
"""
This file taken from https://github.com/icecreammatt/flask-empty
and modified for this project.
"""
import os
_basedir = os.path.abspath(os.path.dirname(__file__))
DEBUG = True
TESTING = True
ADMINS = frozenset(['scott.dillon@gmail.com'])
SECRET_KEY = 'WillWorkForJob'
THREADS_PER_PAGE = 8
CSRF_ENABLED = True
C... | scottdillon/rti_exercise | rti_app/config.py | Python | mit | 366 |