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 |
|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
# Copyright(C) 2009-2012 Romain Bignon
#
# This file is part of weboob.
#
# weboob 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 you... | eirmag/weboob | weboob/tools/capabilities/bank/transactions.py | Python | agpl-3.0 | 5,196 |
#!/usr/bin/env python
"""
Created on 1 Feb 2018
@author: loay
"""
import os
import sys
import time
from subprocess import *
import sigploit
import ss7main
simsi_path = os.path.join(os.getcwd(), 'ss7/attacks/fraud/simsi')
mtsms_path = os.path.join(os.getcwd(), 'ss7/attacks/fraud/mtsms')
cl_path = os.path.join(os.ge... | SigPloiter/SigPloit | ss7/fraud.py | Python | mit | 5,988 |
# this is a default profile
import profile
class d_profile(profile):
def __init__(self):
# super(profile.__init__(self))
self.name = "default"
def get(self):
# self.name = "default"
return self | Ganben/parrot | pyrrot/chatserver/models/d_profile.py | Python | apache-2.0 | 236 |
from django import forms
from django.utils.translation import ugettext_lazy as _
class GroundtruthRecordFormMixin(forms.ModelForm):
def clean(self):
cleaned_data = super(GroundtruthRecordFormMixin, self).clean()
contact_email = cleaned_data.get('contact_email', None)
contact_phone = clean... | 596acres/django-livinglots-groundtruth | livinglots_groundtruth/forms.py | Python | bsd-3-clause | 569 |
#!/usr/bin/python
"""
this is the code to accompany the Lesson 1 (Naive Bayes) mini-project
use a Naive Bayes Classifier to identify emails by their authors
authors and labels:
Sara has label 0
Chris has label 1
"""
import sys
import time
sys.path.append("../tools/")
from email_preproces... | filipenevola/learning-ml | naive_bayes/nb_author_id.py | Python | mit | 1,086 |
from datetime import datetime
from typing import Optional, Union
import orjson
from django.contrib.auth.models import UserManager
from django.utils.timezone import now as timezone_now
from zerver.lib.hotspots import copy_hotspots
from zerver.lib.timezone import canonicalize_timezone
from zerver.lib.upload import copy... | zulip/zulip | zerver/lib/create_user.py | Python | apache-2.0 | 7,676 |
# Generated by Django 2.0.2 on 2018-09-06 09:43
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('contenttypes', '0002_remove_content_type_name'),
('activity', '0011_add_new_event_type'),
]
operations = [
... | OpenTechFund/WebApp | opentech/apply/activity/migrations/0012_add_generic_relation_to_activity.py | Python | gpl-2.0 | 745 |
from codecs import open
from os import path
import re
from setuptools import setup, find_packages
def read(*paths):
filename = path.join(path.abspath(path.dirname(__file__)), *paths)
with open(filename, encoding='utf-8') as f:
return f.read()
def find_version(*paths):
contents = read(*paths)
m... | blockstack/packaging | imported/mixpanel/setup.py | Python | gpl-3.0 | 1,154 |
import nengo
import numpy as np
import redis
import struct
r = redis.StrictRedis('127.0.0.1')
model = nengo.Network()
with model:
def receive_spikes(t):
msg = r.get('spikes')
v = np.zeros(10)
if len(msg) > 0:
ii = struct.unpack('%dI' % (len(msg)/4), msg)
v[[ii]] =... | tcstewar/testing_notebooks | show_remote_spikes/sink.py | Python | gpl-2.0 | 399 |
# -*- coding: utf-8 -*-
from . import load_table
from ddbmock.utils import push_write_throughput
@load_table
def delete_item(post, table):
item = table.delete_item(post[u'Key'], post[u'Expected'])
capacity = item.get_size().as_units()
push_write_throughput(table.name, capacity)
if post[u'ReturnValue... | dekked/dynamodb-mock | ddbmock/operations/delete_item.py | Python | lgpl-3.0 | 528 |
import numpy as np
__all__ = ['BoundingBox']
class BoundingBox(np.ndarray):
"""Bounding box assuming RAS coordinate system"""
def __new__(cls, input_array, info=None):
try:
if len(input_array) == 6 and np.isscalar(input_array[0]):
pass
elif len(input_array) >=... | oesteban/tract_querier | tract_querier/aabb.py | Python | bsd-3-clause | 9,958 |
# Задача 5. Вариант 6.
# Напишите программу, которая бы при запуске случайным образом отображала название одного из двух спутников Марса.
# Velyan A. S.
# 27.05.2016
print("\nназвание одного из двух спутников Марса:")
import random
satellite=["Фобос", "Деймос"]
s=random.choice(satellite)
print(s)
input("Нажмите Enter... | Mariaanisimova/pythonintask | PMIa/2015/Velyan_A_S/task_5_6.py | Python | apache-2.0 | 503 |
__author__ = "Laura Martinez Sanchez"
__license__ = "GPL"
__version__ = "1.0"
__email__ = "lmartisa@gmail.com"
from osgeo import gdal, gdalnumeric, ogr, osr
import numpy as np
from PIL import Image, ImageDraw
from collections import defaultdict
import pickle
import time
from texture_common import *
#Uses a gdal ge... | madi/DeadTrees-BDEOSS | clipshape.py | Python | gpl-3.0 | 4,289 |
###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... | jvrsantacruz/XlsxWriter | xlsxwriter/test/comparison/test_set_column08.py | Python | bsd-2-clause | 1,662 |
# IronPython Pad. Write code snippets here and F5 to run.
import ctypes
#Load CoolProp shared library
CP = ctypes.cdll.LoadLibrary(r"E:\Cyril\Dropbox\CVC\BIM_Revit\ScriptsPython\dll\CoolProp.dll")
#making PropsSI function call shorter
PropsSI = CP.PropsSI
#Convert python data type entered in PropsSI function call to ... | Nahouhak/pythoncvc.net | RevitPyCVC/Fluides/coolprop_ironpython_example.py | Python | mit | 727 |
'''
Created on 2013-01-22
@author: levi
'''
from util.parser import load_parser
from util.test_script_base import Test
class MBEddr(Test):
def __init__(self):
Test.__init__(self)
# ============TRANSFORMATION=================
r0 = 'Hlayer0rule0'
r1 = 'Hlayer0rule1'
r2 =... | levilucio/SyVOLT | test_mbeddr.py | Python | mit | 4,286 |
from requests import request, ConnectionError
from social.utils import module_member, parse_qs
from social.exceptions import AuthFailed
class BaseAuth(object):
"""A django.contrib.auth backend that authenticates the user based on
a authentication provider response"""
name = '' # provider name, it's stor... | HackerEcology/SuggestU | suggestu/social/backends/base.py | Python | gpl-3.0 | 8,286 |
#!/usr/bin/env python
__author__ = 'Ian Katz, Michael Meisinger'
import re
from ooi import logging
from ooi.logging import log
from pyon.util.containers import get_ion_ts, DotDict
from pyon.core.exception import BadRequest, Inconsistent, NotFound
from pyon.core.registry import getextends
from pyon.ion.resource impor... | ooici/coi-services | ion/util/enhanced_resource_registry_client.py | Python | bsd-2-clause | 50,232 |
# coding=utf-8
import re
import csv
# with open('index.html', 'r', encoding='utf-8') as f:
with open('index.html') as f:
str_html = f.read()
# 1. 先抓大后抓小: 先获得所有包含一层楼的所有内容
all_floors = \
re.findall('j_l_post clearfix "(.*?)p_props_tail', str_html, re.S)
# re.findall('l_post l_post_bright j_l_post clearfix... | littlecarson/web-scraping | 01-Regular-Expression/tieba_scrap.py | Python | mit | 1,124 |
"""
Tests for Calendar Sync views.
"""
import ddt
from django.test import TestCase
from django.urls import reverse
from openedx.features.calendar_sync.api import SUBSCRIBE, UNSUBSCRIBE
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import Course... | msegado/edx-platform | openedx/features/calendar_sync/tests/test_views.py | Python | agpl-3.0 | 2,012 |
#!/usr/bin/env python
''' Unit test for the quantization module
File: test_optim.py
'''
__author__ = "Hauke Holtkamp"
__credits__ = "Hauke Holtkamp"
__license__ = "unknown"
__version__ = "unknown"
__maintainer__ = "Hauke Holtkamp"
__email__ = "h.holtkamp@gmail.com"
__status__ = "Development"
from quantmap import... | ryklith/pyltesim | quantmap/test_quantmap.py | Python | gpl-2.0 | 1,495 |
# coding=utf-8
# Copyright 2020 The PI-SAC Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | google-research/pisac | pisac/tanh_normal_projection_network.py | Python | apache-2.0 | 5,102 |
def multiples_of_three_or_five(num):
if ((num % 3) == 0 or (num % 5) == 0):
return True
else:
return False
def cumulative_sum(num):
cum_sum = 0
for i in range(1, num):
if multiples_of_three_or_five(i):
cum_sum += i
return cum_sum | paulliwali/projecteuler-python | euler/problem_1.py | Python | mit | 286 |
# -*- coding: utf-8 -*-
# Copyright 2015-TODAY LasLabs Inc.
# License MIT (https://opensource.org/licenses/MIT).
from mixer.backend.sqlalchemy import mixer
from datetime import datetime
dt_now = datetime.now()
__model__ = 'carepoint.models.cph.store.Store'
store_default = mixer.blend(
__model__,
store_id=1... | laslabs/Python-Carepoint | carepoint/tests/models/cph/fixtures/store.py | Python | mit | 903 |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.words.protocols.jabber.component}
"""
from hashlib import sha1
from twisted.python import failure
from twisted.trial import unittest
from twisted.words.protocols.jabber import component, xmlstream
from twisted.words.protoc... | Architektor/PySnip | venv/lib/python2.7/site-packages/twisted/words/test/test_jabbercomponent.py | Python | gpl-3.0 | 13,801 |
#!/usr/bin/env python
# Copyright 2018 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.
"""usage: makecab.py [options] source [destination]
Makes cab archives of single files, using zip compression.
Acts like Microsoft make... | endlessm/chromium-browser | chrome/tools/build/win/makecab.py | Python | bsd-3-clause | 8,817 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
class Migration(migrations.Migration):
dependencies = [
('autodeploy', '0006_auto_20150510_1427'),
]
operations = [
migrations.AlterField(
model_name='pro... | mkalioby/AutoDeploy | webapp/autoDeploy/autodeploy/migrations/0007_auto_20150510_1427.py | Python | gpl-2.0 | 487 |
import yaku.utils
def setup(ctx):
env = ctx.env
ctx.env["CC"] = ["clang"]
ctx.env["CC_TGT_F"] = ["-c", "-o"]
ctx.env["CC_SRC_F"] = []
ctx.env["CFLAGS"] = []
ctx.env["DEFINES"] = []
ctx.env["LINK"] = ["clang"]
ctx.env["LINKFLAGS"] = []
ctx.env["LINK_TGT_F"] = ["-o"]
ctx.env["LIN... | esc/Bento | bento/private/_yaku/yaku/tools/clang.py | Python | bsd-3-clause | 1,777 |
# =============================================================================
# COPYRIGHT 2013 Brain Corporation.
# License under MIT license (see LICENSE file)
# =============================================================================
import os
from requirement import RequirementException
import logging
from u... | braincorp/robustus | robustus/detail/install_pygtk.py | Python | mit | 1,403 |
from AppKit import *
import os
import vanilla.dialogs as dialogs
import vanilla
from mojo.events import addObserver
from mojo.UI import OpenGlyphWindow, OpenSpaceCenter, CurrentSpaceCenterWindow, OutputWindow
from lib.scripting.scriptTools import ScriptRunner
from lib.scripting.codeEditor import CodeEditor
from moj... | typemytype/projectRoboFontExtension | RoboFontProject.roboFontExt/lib/main.py | Python | mit | 8,553 |
#!/usr/bin/python
# file: flask_server.py
# Eilidh Southren - 1513195
#------------------------------------------
#
# This script creates a flask server
# that allows the user to view the pictures
# taken by the security system online.
#
from flask import Flask, render_template
app = Flask(__nam... | esouthren/Rasprotect-System | flask_server.py | Python | gpl-3.0 | 900 |
# This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | eunchong/build | third_party/buildbot_slave_8_4/buildslave/commands/repo.py | Python | bsd-3-clause | 7,218 |
# 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-sql/azure/mgmt/sql/models/elastic_pool_per_database_min_dtu_capability.py | Python | mit | 1,345 |
import random
import pygame
from pygame.locals import *
import viewport
import tiles
import characters
import group
import tree
import mapgen
MIN_CHARACTERS = 150
class WorldView(viewport.Viewport):
def __init__(self, parent, viewport_rect, canvas_w, canvas_h):
super(WorldView, self).__init__(parent, vi... | flexo/evolutron | evolutron/worldview.py | Python | mit | 4,012 |
#The recipe gives simple implementation of a Discrete Proportional-Integral-Derivative (PID) controller. PID controller gives output value for error between desired reference input and measurement feedback to minimize error value.
#More information: http://en.wikipedia.org/wiki/PID_controller
#
#cnr437@gmail.com
#
####... | Miceuz/pidgenetics | pid.py | Python | bsd-3-clause | 2,139 |
# Imports from Django
from django.contrib.sitemaps import Sitemap
from django.contrib.sites.models import Site
# Imports from brubeck
from brubeck.blogs.models import Blog, Entry
site = Site.objects.get_current()
class BlogSitemap(Sitemap):
def items(self):
return Blog.objects.filter(section__publication... | albatrossandco/brubeck_cms | brubeck/blogs/sitemap.py | Python | bsd-3-clause | 741 |
#!/usr/bin/python
'''
Basic example script talking to a VManager using the Python library.
Prints out network settings, changes and updates a config value, and
subscribes to data notifications and prints packets that are received.
'''
#============================ adjust path =====================================
imp... | realms-team/basestation-fw | libs/smartmeshsdk-REL-1.3.0.1/vmanager_apps/VMgr_BasicExample.py | Python | bsd-3-clause | 3,403 |
"""Extensions to the 'distutils' for large or complex distributions"""
import os
import functools
import distutils.core
import distutils.filelist
from distutils.core import Command as _Command
from distutils.util import convert_path
from fnmatch import fnmatchcase
from setuptools.extern.six.moves import filterfalse, ... | ohduran/CrowdFinanceInfographic | virtualenv/lib/python3.5/site-packages/setuptools/__init__.py | Python | mit | 5,440 |
from flask import current_app, redirect, Response, request, session, url_for
from flask.views import MethodView
from requests_oauthlib import OAuth2Session
from sqlalchemy.exc import IntegrityError
from oauthlib.oauth2.rfc6749.errors import OAuth2Error
from zeus import auth
from zeus.config import celery, db
from zeus... | getsentry/zeus | zeus/web/views/auth_github.py | Python | apache-2.0 | 6,319 |
"""Configuration file for the Sphinx documentation builder.
This file does only contain a selection of the most common options. For a
full list see the documentation:
http://www.sphinx-doc.org/en/master/config
-- Path setup ---------------------------------------------------------------
If extensions (or modules to... | cathywu/flow | docs/source/conf.py | Python | mit | 6,043 |
#!/usr/bin/env python
# _*_ coding: utf-8 _*_
'''
@Author : Soner
@version :
@Time : 2017/11/3/0003 16:32
@license : Copyright(C), Your Company
'''
from selenium import webdriver
from time import sleep
import os
driver = webdriver.Chrome()
file_path = "file://" + os.path.abspath("Checkbox.html")
driver.get(file_... | lsp84ch83/PyText | Selenium/Web元素定位及操作/Checkbox定位一组元素.py | Python | gpl-3.0 | 1,156 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... | valentin-krasontovitsch/ansible | lib/ansible/modules/cloud/google/gcp_resourcemanager_project.py | Python | gpl-3.0 | 11,435 |
class Solution(object):
def uniquePathsWithObstacles(self, obstacleGrid):
"""
:type obstacleGrid: List[List[int]]
:rtype: int
"""
if len(obstacleGrid) == 0:
return 0
if len(obstacleGrid[0]) == 0:
return 0
def __uniq_paths(x, y, d, obs... | benquike/cheatsheets | algo/leetcode/dp/uniq_paths2.py | Python | cc0-1.0 | 1,199 |
"""Sensor for checking the battery level of Roomba."""
from homeassistant.components.sensor import SensorEntity
from homeassistant.components.vacuum import STATE_DOCKED
from homeassistant.const import DEVICE_CLASS_BATTERY, PERCENTAGE
from homeassistant.helpers.icon import icon_for_battery_level
from .const import BLID... | w1ll1am23/home-assistant | homeassistant/components/roomba/sensor.py | Python | apache-2.0 | 1,712 |
# import Image
import sys
def average_colour(image):
colour_tuple = [None, None, None]
for channel in range(3):
# Get data for one channel at a time
pixels = image.getdata(band=channel)
values = []
for pixel in pixels:
values.append(pixel)
colour_tuple[... | frodo4fingers/swico | dominant_colour.py | Python | mit | 1,649 |
from django.contrib import admin
from django.contrib.sites.models import RequestSite
from django.contrib.sites.models import Site
from django.utils.translation import ugettext_lazy as _
from registration.models import RegistrationProfile
class RegistrationAdmin(admin.ModelAdmin):
actions = ['activate_users', 're... | Apreche/Turnflict | utils/registration/admin.py | Python | mit | 1,605 |
import datetime as dt
import numpy as np
import math
def simulate(na_price_nodate, dt_start, dt_end, symbols, portf_allocation):
''' Simulate a Portfolio Allocation Function
Returns sharpe ratio and cumulative returns
na_price_nodate = np.array of data without column 0 of dates
symbols = if any of the... | melrcm/Optimizepy | simulate_portfolio_allocation.py | Python | lgpl-2.1 | 3,352 |
from __future__ import absolute_import
from celery import task
from streamer.models import Streamer
from twitchapp.settings import TWITCH_CLIENT_ID
import json
import urllib
import requests
@task(name='tasks.populate')
def populate():
Streamer.objects.all().delete()
games_req = requests.get('https://api.twitc... | froxio/who2host | twitchapp/tasks.py | Python | mpl-2.0 | 1,706 |
# -*- coding: utf-8 -*-
from nltk import word_tokenize
import general
import numpy as np
#mappt alle aktuellen NW-Ressorts auf die 5 Ressorts aus dem Experiment
def ressort_mapping(ressort):
result = ''
print(ressort)
if ressort in ['Gütersloh','Bünde','Warburg','Herford','Löhne','Lübbecke','Höxter','Pader... | swalter2/PersonalizationService | Service/feature_extraction.py | Python | mit | 11,275 |
# Copyright 2012 New Dream Network, LLC (DreamHost)
#
# 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 a... | suneeth51/neutron | neutron/agent/linux/external_process.py | Python | apache-2.0 | 9,806 |
from django.db import models
# Create your models here.
#MVC MODEL VIEW CONTROLLER
#
class Post(models.Model):
title=models.CharField(max_length=120)
content=models.TextField()
updated=models.DateTimeField(auto_now=True,auto_now_add=False)
timestamp=models.DateTimeField(auto_now=False,auto_now_add=True)
def __u... | onurstats/myBlog | posts/models.py | Python | gpl-3.0 | 396 |
import doto.model
import doto.model.task
CREATE_CMD = """
CREATE TABLE IF NOT EXISTS
timerecords (
id INTEGER NOT NULL,
task_id INTEGER,
start TIMESTAMP,
end TIMESTAMP,
PRIMARY KEY (id)... | tantSinnister/doto | doto/model/timerecord.py | Python | bsd-3-clause | 2,998 |
# Copyright 2018 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... | jbedorf/tensorflow | tensorflow/contrib/opt/python/training/shampoo.py | Python | apache-2.0 | 18,532 |
# Copyright (c) 2018 PaddlePaddle 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 app... | luotao1/Paddle | python/paddle/fluid/tests/unittests/test_cuda_random_seed.py | Python | apache-2.0 | 5,777 |
"""
Tests for assetstore using any of the modulestores for metadata. May extend to testing the storage options
too.
"""
import unittest
from datetime import datetime, timedelta
import pytest
import ddt
import pytz
from django.test import TestCase
from opaque_keys.edx.keys import CourseKey
from opaque_keys.edx.locato... | eduNEXT/edunext-platform | common/lib/xmodule/xmodule/modulestore/tests/test_assetstore.py | Python | agpl-3.0 | 34,098 |
def create_iterator(func, n):
def f(x):
x = func(x)
for _ in range(n-1):
x = func(x)
return x
return f
| VladKha/CodeWars | 6 kyu/Function iteration/solve.py | Python | gpl-3.0 | 147 |
# coding=utf-8
import random
from copy import deepcopy, copy
from itertools import product
from utils import argmin
MOST_CONSTRAINED_VARIABLE = 'mcv'
HIGHEST_DEGREE_VARIABLE = 'degree'
LEAST_CONSTRAINING_VALUE = 'lvc'
def backtrack(problem, variable_heuristic='', value_heuristic='', inference=True):
'''
Back... | emoron/simpleai | simpleai/search/csp.py | Python | mit | 8,094 |
"""
This package contains some 3rd party modules:
- githubpy: https://github.com/michaelliao/githubpy
"""
| ColinDuquesnoy/QCrash | qcrash/_extlibs/__init__.py | Python | mit | 108 |
###############################################################################
##
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## "Redistribution and use in source and binary for... | Nikea/VisTrails | vistrails/stop_vistrails_server.py | Python | bsd-3-clause | 2,443 |
from preset_schema import PresetSchema
class TeletypePresetSchema(PresetSchema):
def firmware_name(self):
return 'teletype'
def check(self, nvram_data):
if nvram_data.fresh != 0x22:
print("this firmware image hasn't ever been run (or is corrupt)")
return False
... | monome/ansible | tools/flash_tools/schemata/teletype/teletype_preset_schema.py | Python | gpl-2.0 | 442 |
"""This file sets up a command line manager.
Use "python manage.py" for a list of available commands.
Use "python manage.py runserver" to start the development web server on localhost:5000.
Use "python manage.py runserver --help" for a list of runserver options.
"""
from flask_migrate import MigrateCommand
from flask... | lingthio/Flask-User-starter-app | manage.py | Python | bsd-2-clause | 774 |
from django import forms
from .models import CustomEvent, Schedule
class ScheduleCreationForm(forms.ModelForm):
class Meta:
model = Schedule
fields = ['html']
class CustomEventForm(forms.ModelForm):
class Meta:
model = CustomEvent
fields = [
'conference', 'titl... | pycontw/pycontw2016 | src/events/forms.py | Python | mit | 554 |
# -*- coding: utf-8 -*-
"""
Base module for loading and running the main SasView application.
"""
################################################################################
# This software was developed by the University of Tennessee as part of the
# Distributed Data Analysis of Neutron Scattering Experiments (DA... | lewisodriscoll/sasview | sasview/sasview.py | Python | bsd-3-clause | 6,749 |
"""
OEML - REST API
This section will provide necessary information about the `CoinAPI OEML REST API` protocol. <br/> This API is also available in the Postman application: <a href=\"https://postman.coinapi.io/\" target=\"_blank\">https://postman.coinapi.io/</a> <br/><br/> Implemented Standards: * [HTT... | coinapi/coinapi-sdk | oeml-sdk/python/openapi_client/model/ord_side.py | Python | mit | 11,969 |
# $Id$
# (C) Timothy Corbett-Clark, 2004
"""Midge is a bug tracking system.
Midge is a system for tracking bugs found during the commercial
development of a software product. It is particularly suited to a
process for which the filing, managing, fixing, and testing are all
undertaken by different roles in a trusted ... | p/midge | midge/__init__.py | Python | gpl-2.0 | 546 |
"""
Objects for dealing with Hermite_e series.
This module provides a number of objects (mostly functions) useful for
dealing with Hermite_e series, including a `HermiteE` class that
encapsulates the usual arithmetic operations. (General information
on how this module represents and works with such polynomials is in ... | lthurlow/Network-Grapher | proj/external/numpy-1.7.0/numpy/polynomial/hermite_e.py | Python | mit | 54,747 |
from obj_model import (Model, BooleanAttribute, EnumAttribute, FloatAttribute, IntegerAttribute,
PositiveIntegerAttribute, RegexAttribute, SlugAttribute, StringAttribute, LongStringAttribute,
UrlAttribute, OneToOneAttribute, ManyToOneAttribute, ManyToManyAttribute, OneToManyAttribute,
TabularOrientation)
... | KarrLab/obj_model | tests/fixtures/migrate/small_bad_related.py | Python | mit | 1,630 |
# -*- Mode: Python -*-
# vi:si:et:sw=4:sts=4:ts=4
#
# Flumotion - a streaming media server
# Copyright (C) 2004,2005,2006 Fluendo, S.L. (www.fluendo.com).
# All rights reserved.
# Licensees having purchased or holding a valid Flumotion Advanced
# Streaming Server license may use this file in accordance with the
# Flum... | flumotion-mirror/flumotion-windowsmedia | flumotion/component/common/wms/mmsproducer.py | Python | lgpl-2.1 | 3,590 |
import os
from mock import patch, MagicMock
from unittest2 import TestCase
from py_selenium_server.selenium_server import SeleniumServerHandler
from util import test_data_dir, mock_latest_version, mock_data
class TestSeleniumServer(TestCase):
@patch(
"py_selenium_server.selenium_server.SELENIUM_JAR_STOR... | MideO/py-selenium-server | tests/test_selenium_server_commands.py | Python | gpl-3.0 | 1,343 |
import opensfm.reconstruction as orec
from opensfm.dataset import DataSetBase
def run_dataset(dataset: DataSetBase, input, output):
"""Bundle a reconstructions.
Args:
input: input reconstruction JSON in the dataset
output: input reconstruction JSON in the dataset
"""
reconstructions... | oscarlorentzon/OpenSfM | opensfm/actions/bundle.py | Python | bsd-2-clause | 980 |
# Copyright 2014: Mirantis Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | ytsarev/rally | tests/verification/verifiers/test_tempest.py | Python | apache-2.0 | 10,366 |
#Code by Jennifer Atkins
#Created Tuesday July 25, 2017 13:20:16
#Python file that graphs multiple air quality test result CSV files
import matplotlib.pyplot as plt
import csv
import dateutil
import numpy as np
import time
import datetime
def correlation_coefficient(xdata,ydata):
xmean = np.mean(xdata)
ymean = np.m... | bearing/dosenet-raspberrypi | aq_comparison_graph.py | Python | mit | 3,364 |
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | google-research/understanding-transfer-learning | libutil/__init__.py | Python | apache-2.0 | 634 |
from django import template
import randomcolor
register = template.Library()
CATEGORY_NAMES = {
'cs.AI': 'Artificial Intelligence',
'cs.CL': 'Computation and Language',
'cs.CC': 'Computational Complexity',
'cs.CE': 'Computational Engineering',
'cs.CG': 'Computational Geometry',
'cs.GT': 'Game ... | arxiv-vanity/arxiv-vanity | arxiv_vanity/papers/templatetags/papers.py | Python | apache-2.0 | 1,851 |
#!/usr/bin/env python
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software... | appium/python-client | test/unit/webdriver/device/remote_fs_test.py | Python | apache-2.0 | 3,434 |
"""
The :mod:`sklearn.model_selection._validation` module includes classes and
functions to validate the model.
"""
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>,
# Gael Varoquaux <gael.varoquaux@normalesup.org>,
# Olivier Grisel <olivier.grisel@ensta.org>
# License: BSD 3 clause
from __... | asnorkin/sentiment_analysis | site/lib/python2.7/site-packages/sklearn/model_selection/_validation.py | Python | mit | 36,967 |
from __future__ import unicode_literals
from math import atan, exp, log, pi, sin
from django.contrib.gis.geos import GEOSGeometry, LinearRing, Point, Polygon
from django.contrib.gis.maps.google.gmap import GoogleMapException
from django.utils.six.moves import range
# Constants used for degree to radian conversion, a... | BitWriters/Zenith_project | zango/lib/python3.5/site-packages/django/contrib/gis/maps/google/zoom.py | Python | mit | 6,676 |
from django import forms
from taggit.forms import *
class CommentForm(forms.Form):
content_type = forms.CharField(widget=forms.HiddenInput)
object_id = forms.IntegerField(widget=forms.HiddenInput)
#parent_id = forms.IntegerField(widget=forms.HiddenInput, required=False)
content = forms.CharField(labe... | isabernardes/Heriga | comments/forms.py | Python | mit | 348 |
# -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2014 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <http://weblate.org/>
#
# 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, eithe... | paour/weblate | weblate/trans/formats.py | Python | gpl-3.0 | 22,503 |
#!/usr/bin/python2.5
#encoding=utf-8
'''
DONT TOUCH THIS FILE, UNLESS YOU KNOW WHAT YOU ARE DOING !!!
Modify the release.cfg under the project module in config folder instead.
'''
import os
release_file = None
for root, dirs, files in os.walk(u'.'):
if u'release.py' in files:
release_file = os.pat... | rsgemignani/my-fortunes | setup.py | Python | gpl-2.0 | 1,387 |
ELECTRUM_VERSION = '2.9.0' # version of the client package
PROTOCOL_VERSION = '0.10' # protocol version requested
# The hash of the mnemonic seed must begin with this
SEED_PREFIX = '01' # Electrum standard wallet
SEED_PREFIX_SW = '02' # Electrum segwit wallet
SEED_PREFIX_2FA = '101' # extended... | dashpay/electrum-dash | lib/version.py | Python | mit | 567 |
'''
Odnoklassniki.ru OAuth2 and IFRAME application support
If you are using OAuth2 authentication,
* Take a look to:
http://dev.odnoklassniki.ru/wiki/display/ok/The+OAuth+2.0+Protocol
* You need to register OAuth application here:
http://dev.odnoklassniki.ru/wiki/pages/viewpage.action?pageId=139... | 1st/django-social-auth | social_auth/backends/contrib/odnoklassniki.py | Python | bsd-3-clause | 10,369 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License, Ver... | sparkslabs/kamaelia | Sketches/MPS/HTTP/michael.py | Python | apache-2.0 | 4,406 |
# -*- coding: utf-8 -*-
from django import forms
from django.contrib.auth.models import User
class FormAcceso(forms.Form):
usuario = forms.CharField(label="Usuario",
widget=forms.TextInput(attrs={"size": "15", "class": "small",
... | roldandvg/incidencias | incidencias/apps/autenticar/forms.py | Python | gpl-2.0 | 1,408 |
"""A module which implements the time frequency estimation.
Morlet code inspired by Matlab code from Sheraz Khan & Brainstorm & SPM
"""
# Authors : Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Hari Bharadwaj <hari@nmr.mgh.harvard.edu>
#
# License : BSD (3-clause)
import warnings
from math ... | cmoutard/mne-python | mne/time_frequency/tfr.py | Python | bsd-3-clause | 54,818 |
# 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 ... | AutorestCI/azure-sdk-for-python | azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/operations/deployments_operations.py | Python | mit | 32,532 |
""" License
MIT License
Copyright (c) 2017 OpenAdaptronik
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,... | IT-PM-OpenAdaptronik/Webapp | apps/register/urls.py | Python | mit | 1,410 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#This file is part of pypository.
#
#pypository is free software: you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation, either version 3 of the License, or
#(at your option) any later version.
... | nesaro/pypository | tests/test_Immutable.py | Python | gpl-3.0 | 1,254 |
from django.shortcuts import render, HttpResponseRedirect
from django.db.models import Q
from contas.models import Caixa, Cheque
from empresas.models import Sistema
from datetime import datetime
#d = datetime.strptime('2007-07-18 10:03:19', '%Y-%m-%d %H:%M:%S')
#day_string = d.strftime('%Y-%m-%d')
#Trabalhando com data... | mateusportal/portalconta | contas/views.py | Python | gpl-2.0 | 4,783 |
#!/usr/bin/env python
#coding: utf-8
#### FUNCTIONS ####
def header(string):
"""
Display header
"""
timeInfo = time.strftime("%Y-%m-%d %H:%M")
print '\n', timeInfo, "****", string, "****"
def subHeader(string):
"""
Display subheader
"""
timeInfo = time.strftime("%Y-%m-%... | brguez/TEIBA | src/python/germlineTopSrcElements_plotVaf.py | Python | gpl-3.0 | 3,152 |
# !/usr/bin/env python
from setuptools import setup, find_packages
requires = ["scrapy"]
setup(
name="dwarf-scraper",
version="0.1",
description="dwarf-scraper",
author="Jose Guilherme Vanz",
author_email="guilherme.sft@gmail.com",
url="https://github.com/jvanz/dwarf",
packages=find_packa... | jvanz/dwarf | scraper/setup.py | Python | gpl-2.0 | 359 |
##!/usr/bin/python
import numpy as np
import pylab as plt
import seaborn as sns
sns.set_context('poster')
plt.subplot(1,1,1)
data = np.genfromtxt(fname='cor.dat')
#for x in range(1,data.shape[-1]):
plt.plot(data[:,0],data[:,1],lw=2,label='Re')
plt.plot(data[:,0],data[:,2],lw=2,label='Im')
#plt.plot(data[:,0]... | binghongcha08/pyQMD | GWP/2D/1.0.7/cor.py | Python | gpl-3.0 | 1,054 |
# Copyright (c) 2013 Mirantis 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 writ... | henaras/sahara | sahara/tests/unit/service/validation/test_ng_template_validation_create.py | Python | apache-2.0 | 10,575 |
# -*- encoding: utf-8 -*-
import random
from pilasengine.escenas import normal
from pilasengine.fondos import fondo
class FondoEscenaJuego(fondo.Fondo):
def iniciar(self):
self.imagen = './data/fondo.png'
class EscenaJuego(normal.Normal):
def iniciar(self):
self.fondo = FondoEscenaJuego(s... | fsalamero/pilas | pilasengine/ejemplos/ejemplos_a_revisar/tres_en_raya/escena_juego.py | Python | lgpl-3.0 | 5,757 |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
#
# emailIdx - Synchronizes emails from IMAP to Elasticsearch
# Copyright (C) 2015 Paul Hofmann
#
# 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 Softwar... | p-ho/emailIdx | emailidx/ImapAdapter.py | Python | gpl-3.0 | 9,186 |
from django.views.generic import ListView
from models import Media
class CatalogListView(ListView):
model = Media
template_name = 'media_list.html'
| zenweasel/pybuilder-djangoexample | pyb_django/catalog/views.py | Python | bsd-3-clause | 158 |
# Copyright (c) 2013 Mirantis, 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... | sasukeh/cinder | cinder/volume/drivers/block_device.py | Python | apache-2.0 | 8,384 |
import asyncio
import json
from discord import Member, Role
from discord.ext import commands as c
from accounts import level
from helpers import update_db
with open("plugins/settings/admin.json") as cfg:
config = json.load(cfg)
with open("db/admin.json") as admn:
admin = json.load(admn)
class Admin:
"""... | Ispira/Ispyra | plugins/admin.py | Python | mit | 6,041 |
# -*- coding: utf-8 -*-
#
# 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
#... | owlabs/incubator-airflow | airflow/www_rbac/widgets.py | Python | apache-2.0 | 1,660 |
"""
Functions for creating stretched coordinate PMLs.
"""
import copy
import itertools
from typing import Callable, List, Optional, Tuple, Union
import numpy as np
from spins import fdfd_tools
s_function_type = Callable[[float], float]
def prepare_s_function(ln_R: float = -16, m: float = 4) -> s_function_type:
... | stanfordnqp/spins-b | spins/fdfd_tools/grid.py | Python | gpl-3.0 | 11,145 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.