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 |
|---|---|---|---|---|---|
#Kunal Gautam
#Codewars : @Kunalpod
#Problem name: Multiples of 3 and 5
#Problem level: 6 kyu
def solution(number):
return sum([x for x in range(3,number) if x%3==0 or x%5==0])
| Kunalpod/codewars | multiples_of_3_and_5.py | Python | mit | 182 |
from RULEngine.Communication.sender.grsim_command_sender import GrSimCommandSender
from RULEngine.Communication.sender.serial_command_sender import SerialCommandSender, SerialType, SERIAL_DISABLED
from RULEngine.Communication.util.serial_protocol import MCUVersion
class RobotCommandSenderFactory(object):
@static... | RoboCupULaval/RULEngine | Communication/util/robot_command_sender_factory.py | Python | mit | 792 |
# -*- coding: utf-8 -*-
#
# 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/stable/config
# -- Path setup ------------------------------------------------------------... | mmaelicke/scikit-gstat | docs/conf.py | Python | mit | 7,252 |
from django.contrib import admin
from django.core.urlresolvers import reverse
from .models import PrefectDeviceParameterConfiguration
__author__ = 'mitchell'
class PrefectDeviceParameterConfigurationAdmin(admin.ModelAdmin):
search_fields = ['=device__external_id', '=id', '=line', '=power_consumption']
# Ad... | dschien/energy-aggregator | prefect/admin.py | Python | mit | 973 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "sfotipy.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| ronsuez/sfotipy-mejorando.la | manage.py | Python | apache-2.0 | 250 |
from datetime import date
from datetime import datetime
from os import linesep
from django.test import TestCase
from django.test.client import RequestFactory
import icalendar
import pytz
from django_ical import utils
from django_ical.feedgenerator import ICal20Feed
from django_ical.views import ICalFeed
class Test... | Pinkerton/django-ical | django_ical/tests/test_feed.py | Python | mit | 15,645 |
from .bases import _StandardStemmer
from whoosh.compat import u
class RomanianStemmer(_StandardStemmer):
"""
The Romanian Snowball stemmer.
:cvar __vowels: The Romanian vowels.
:type __vowels: unicode
:cvar __step0_suffixes: Suffixes to be deleted in step 0 of the algorithm.
:type __step0_s... | Spoken-tutorial/spoken-website | cron/spoken_search/whoosh/lang/snowball/romanian.py | Python | gpl-3.0 | 11,886 |
# -*- coding: utf-8 -*-
from __future__ import division
import math
# Krey's lateral earth pressure under concentrated load.
#
# Pressure distribution:
#
# a
# +-----------+ <----- p_max # Maximum pressure.
# | | <----
# b | | <---
# | | <--
... | lcpt/xc | python_modules/rough_calculations/nb_poussee_terres.py | Python | gpl-3.0 | 1,755 |
from textwrap import dedent
def get_definition_and_inference_state(Script, source):
first, = Script(dedent(source)).infer()
return first._name._value, first._inference_state
def test_function_execution(Script):
"""
We've been having an issue of a mutable list that was changed inside the
function... | snakeleon/YouCompleteMe-x64 | third_party/ycmd/third_party/jedi_deps/jedi/test/test_inference/test_representation.py | Python | gpl-3.0 | 1,014 |
#! /usr/bin/env python
"""
Verifies if an e-mail address exists locally in AXIGEN
Copyright (c) since 2006, GECAD Technologies. All rights reserved.
For feedback and/or bugs in this script, please send an e-mail to:
"AXIGEN Team" <team@axigen.com>
"""
_CVSID='$Id: verify-email.py,v 1.2 2016/10/04 17:06:29 nini@qa1 E... | axigen/automation-tools | verify-email.py | Python | mit | 3,120 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import os
import re
import sys
from setuptools import setup, find_packages
ROOT = os.path.dirname(os.path.abspath(__file__))
README_PATH = os.path.join(ROOT, 'README')
try:
with open(README_PATH, 'rb') as fp:
long_desc = fp.read().decode('utf8')
except:
... | TakesxiSximada/jumon | setup.py | Python | apache-2.0 | 2,403 |
""" Key module """
from pygame._error import SDLError
from pygame._sdl import ffi, sdl
from pygame.display import check_video
def get_focused():
""" get_focused() -> bool
true if the display is receiving keyboard input from the system
"""
check_video()
return (sdl.SDL_GetAppState() & sdl.SDL_APPI... | GertBurger/pygame_cffi | pygame/key.py | Python | lgpl-2.1 | 1,673 |
myA = 5.2
myB = 5.3 | Delosari/dazer | working_examples/testing_constants.py | Python | mit | 19 |
#
# Script to update and run an existing SVC volume restore job
# Scirpt detects job type defined
# --restore is always required (existing restore job name)
# --vols is optional, job will run as-is without it, use commas to seperate list of volumes
# --start and --end determine time window of copy to use, latest will ... | catalogicsoftware/ecxclient | samples/svcrestore.py | Python | apache-2.0 | 10,483 |
from flask import Flask, render_template, request
from flask_socketio import SocketIO
import json
from base64 import decodestring
import knn
import numpy as np
from PIL import Image
from io import BytesIO
import os.path
app = Flask(__name__)
socketio = SocketIO(app)
k = 1
training = False
label = "+/-"
def load_data... | cutamar/handwriting-calculator | server.py | Python | mit | 1,983 |
import functools
from django.contrib.auth.models import Permission
from django.db import models
from incidents.authorization import AuthorizationManager
class AuthorizationModelMixin(models.Model):
_permissions_cache = {}
authorization = AuthorizationManager()
class Meta:
abstract = True
@... | gcrahay/FIR | incidents/authorization/mixin.py | Python | gpl-3.0 | 3,251 |
########################################################################
# Copyright (c) 2018
# Daniel Plohmann <daniel.plohmann<at>mailbox<dot>org>
# Steffen Enders <steffen<at>enders<dot>nrw>
# All rights reserved.
########################################################################
#
# This file is part of apis... | danielplohmann/apiscout | apiscout/ApiScout.py | Python | bsd-2-clause | 17,124 |
from flask import Flask
from flask.ext.bootstrap import Bootstrap
from flask.ext.mail import Mail
from flask.ext.moment import Moment
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.login import LoginManager
from flask.ext.pagedown import PageDown
from flask.ext.socketio import SocketIO
from config import co... | KolevDarko/flasky-extended | app/__init__.py | Python | mit | 1,373 |
import RTIMU
import logging
from state.pressure_temp_state import PressureTemperatureState
# Represents a sensor that measures air pressure and temperature
class PressureTemperatureSensor:
def __init__(self, rt_imu_settings):
self.log = logging.Logger("PressureSensor")
self.pressure = R... | timdelbruegger/freecopter | src/python3/sensors/pressure_sensor.py | Python | mit | 1,004 |
from __future__ import print_function
import webbrowser
import time
from .api import Twitter
from .oauth import OAuth, write_token_file
try:
_input = raw_input
except NameError:
_input = input
def oauth_dance(app_name, consumer_key, consumer_secret, token_filename=None):
"""
Perform the OAuth dan... | shepdl/stream-daemon | twitter_local/oauth_dance.py | Python | mit | 2,615 |
from peewee import *
# remind me to change my password after this project is finished ^_^
mysql_db = MySQLDatabase('ipvtech', user='root',passwd='', host="localhost")
class MySQLModel(Model):
"""base model to mysql database"""
class Meta:
database = mysql_db
class PoliceLog(MySQLModel):
id = IntegerField()
rep... | IPVTech/IPVTechDVData | db.py | Python | cc0-1.0 | 1,426 |
# (C) British Crown Copyright 2010 - 2014, Met Office
#
# This file is part of Iris.
#
# Iris is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) any l... | Jozhogg/iris | lib/iris/tests/experimental/__init__.py | Python | lgpl-3.0 | 840 |
# ==================================================================================================
# Copyright 2014 Twitter, Inc.
# --------------------------------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use thi... | bonifaido/zktraffic | zktraffic/base/client_message.py | Python | apache-2.0 | 14,527 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
import gc
import logging
import mock
import os
from multiprocessing import Process
import sys
import time
from shellbot import Context
from shellbot.spaces import Space, LocalSpace
class FakeChannel(object):
id = '*123'
title = '*title'
is_di... | bernard357/shellbot | tests/spaces/test_base.py | Python | apache-2.0 | 10,392 |
# -*- coding: utf-8 -*-
from django.contrib import messages
from django.db.models import Q
from django.forms.extras import widgets
from django.views import generic
from rest_framework import generics as rest_generic
from rest_framework import filters as rest_filters
from .forms import PacienteEditForm
from .models im... | gustavoatt/consultas | consultas_proyecto/pacientes_app/views.py | Python | mit | 2,398 |
from oldowan.mtconvert import seq2sites, sites2seq, str2sites
from string import translate
import pandas as pd
import sys
import csv
sys.path.append('../../scripts')
from utils import *
## load metadata
metadata = pd.read_csv('metadata.csv', index_col=0)
region = range2region('16024-16569;1-400')
hids = []
hvr1 = []... | ryanraaum/african-mtdna | popdata_sources/soares2012/process.py | Python | cc0-1.0 | 1,818 |
# Copyright (c) 2012-2015 Netforce Co. Ltd.
#
# 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, publ... | sidzan/netforce | netforce/netforce/module.py | Python | mit | 1,663 |
import matplotlib.pyplot as plt
import matplotlib.transforms as mtransforms
from matplotlib.patches import FancyBboxPatch
# Bbox object around which the fancy box will be drawn.
bb = mtransforms.Bbox([[0.3, 0.4], [0.7, 0.6]])
def draw_bbox(ax, bb):
# boxstyle=square with pad=0, i.e. bbox itself.
p_bbox = Fan... | lthurlow/Network-Grapher | proj/external/matplotlib-1.2.1/lib/mpl_examples/pylab_examples/fancybox_demo.py | Python | mit | 4,619 |
"""Support for Xiaomi Mi Flora BLE plant sensor."""
from datetime import timedelta
import logging
import btlewrap
from btlewrap import BluetoothBackendException
from miflora import miflora_poller # pylint: disable=import-error
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from... | tchellomello/home-assistant | homeassistant/components/miflora/sensor.py | Python | apache-2.0 | 7,558 |
#!/usr/bin/env python
# Copyright 2016 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.
"""Use your keyboard as your phone's keyboard. Experimental."""
import argparse
import copy
import os
import sys
import termios
import... | mrtnrdl/.macdots | scripts/bin/platform-tools/systrace/catapult/devil/devil/android/tools/keyboard.py | Python | unlicense | 3,475 |
"""
WSGI config for juliotrigo project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION... | juliotrigo/juliotrigo | juliotrigo/wsgi.py | Python | bsd-3-clause | 1,431 |
import importlib
import os
from rknfilter.conf import settings as default_settings
class Settings(object):
def __init__(self, env_var='RKNFILTER_SETTINGS_MODULE'):
self._add_settings(default_settings)
user_settings = os.environ.get(env_var)
if user_settings:
try:
... | DmitryFillo/rknfilter | rknfilter/conf/__init__.py | Python | bsd-2-clause | 862 |
import os
import re
import time
import pytest
from fanstatic import (Library,
Resource,
NeededResources,
Group,
init_needed,
del_needed,
get_needed,
clear_ne... | fsys/fanstatic | tests/test_core.py | Python | bsd-3-clause | 33,833 |
typeface_bbc = {
"description": "Typeface from the Acorn BBC Computer",
"geometry": {"width": 8, "height": 8},
"bitmaps": [
0x00000000, 0x00000000, 0x18181818, 0x18001800, # (spc) !
0x6c6c6c00, 0x00000000, 0x36367f36, 0x7f363600, # " #
0x0c3f683e, 0x0b7e1800, 0x60660c18, 0x306606... | slobberchops/rop | opc/text.py | Python | gpl-3.0 | 4,706 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Thread-based Server-side Socket Interface.
Copyright (c) 2017 Michael Roland <mi.roland@gmail.com>
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, e... | michaelroland/wdnas-dl2100-hwtools | threadedsockets/socketserver.py | Python | gpl-3.0 | 12,611 |
# 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 in the hope that it will be useful,
# but... | csutherl/sos | sos/plugins/ldap.py | Python | gpl-2.0 | 3,414 |
# -*- coding: UTF-8 -*-
# Copyright 2015 David Gwartney
#
# 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 l... | jdgwartney/esdvd | setup.py | Python | apache-2.0 | 2,138 |
# Generated by Django 2.2.9 on 2019-12-30 21:57
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('catalogue', '0026_book_preview_key'),
]
operations = [
migrations.AddField(
model_name='book',
name='findable',
... | fnp/wolnelektury | src/catalogue/migrations/0027_book_findable.py | Python | agpl-3.0 | 426 |
import socket
import time
REMOTE_SERVER = 'www.google.com'
def check_internet_connection():
print ("Checking for internet connection.")
connected = False
while not connected:
try:
s = socket.create_connection((REMOTE_SERVER, 80), 2)
connected = True
except:
... | sindrig/spoppy | spoppy/connectivity.py | Python | mit | 581 |
from django.contrib import admin
# Register your models here.
from .models import (
Soil,
SoilType,
SoilTexture,
)
class SoilModelAdmin(admin.ModelAdmin):
"""
Soil model admin settings
"""
list_display = ['soiltype', 'soiltexture', 'som', 'som_uom', 'soil_ph', 'soil_years', 'last_update',... | nkoech/csacompendium | csacompendium/soils/admin.py | Python | mit | 1,304 |
'''
Create an unified test_stub to share test operations
@author: Youyk
'''
import os
import random
import commands
import apibinding.api_actions as api_actions
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.zstack_test.zstack_test_volume as zstack_volume_header
import zstackwoodp... | zstackio/zstack-woodpecker | integrationtest/vm/multihosts/test_stub.py | Python | apache-2.0 | 106,641 |
"""
Author : tharindra galahena (inf0_warri0r)
Project: clustering wikipedia articles using hierarchical clustering
Blog : http://www.inf0warri0r.blogspot.com
Date : 26/12/2013
License:
Copyright 2013 Tharindra Galahena
This is free software: you can redistribute it and/or modify it under
the terms of the GN... | inf0-warri0r/hc | level_page.py | Python | gpl-3.0 | 1,634 |
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import logging
import six
import abc
import numpy as np
import constraints as cons
import utils as U
import globalopts
logger = logging.getLogger(__name__)
def factory():
if globalopts.opts.cluster... | zutshi/S3CAMR | src/modeling/cluster.py | Python | bsd-2-clause | 1,633 |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2010-2012 Cidadania S. Coop. Galega
#
# This file is part of e-cidadania.
#
# e-cidadania 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 Licen... | DROPCitizenShip/e-cidadania | tests/unit_tests/src/apps/ecidadania/debate/test_views.py | Python | gpl-3.0 | 3,741 |
"""memorylane URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-... | mongy910/MemoryLane | memorylane/memorylane/urls.py | Python | mit | 1,355 |
from django.conf.urls.defaults import *
from shoppy.shop.views import *
urlpatterns = patterns('',
(r'^$',index,{}, 'shoppy_home'),
(r'^cart/$',cartDisplay,{}, 'shoppy_cart'),
(r'^cart/add/(?P<product_id>\d+)/$', cartAdd, {},'shoppy_cart_add'),
(r'^cart/addMix/(?P<mix_id>\d+)/$', cartAddMix, {},'shopp... | pocketone/django-shoppy | shoppy/shop/urls.py | Python | bsd-3-clause | 4,939 |
import scipy
from scipy import ndimage
import cv2
import numpy as np
import sys
import torch
import deeplab_resnet_sketchParse_r5 #TODO
from torch.autograd import Variable
import torchvision.models as models
import torch.nn.functional as F
from collections import OrderedDict
import os
from os import walk
import matplot... | val-iisc/sketch-parse | exp-src/eval_r5_test.py | Python | mit | 4,699 |
# -*- coding: utf-8 -*-
"""
===============
peony-twitter
===============
An asynchronous Twitter API client for Python 3.6+
"""
__author__ = "Florian Badie"
__author_email__ = "florianbadie@gmail.com"
__url__ = "https://github.com/odrling/peony-twitter"
__version__ = "3.0.0"
__license__ = "MIT License"
__keyw... | odrling/peony-twitter | peony/__init__.py | Python | mit | 596 |
#!/usr/bin/env python
# Python Network Programming Cookbook -- Chapter - 5
# This program requires Python 2.7 or any later version
import os
import cgi
import argparse
import BaseHTTPServer
import CGIHTTPServer
import cgitb
cgitb.enable() ## enable CGI error reporting
def web_server(port):
server = BaseHTTPSer... | simontakite/sysadmin | pythonscripts/pythonnetworkingcoookbook/chapter5/5_7_cgi_server.py | Python | gpl-2.0 | 877 |
import os
from bpy import data, types
from .. import logger
def _image(func):
"""
:param func:
"""
def inner(name, *args, **kwargs):
"""
:param name:
:param *args:
:param **kwargs:
"""
if isinstance(name, types.Image):
mesh = name
... | ChainedLupine/ludum-dare-24-jam-entry | web/three.js/utils/exporters/blender/addons/io_three/exporter/api/image.py | Python | gpl-2.0 | 784 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2018-11-13 12:19
from __future__ import unicode_literals
import django.db.models.deletion
from django.db import migrations, models
import weblate.utils.fields
class Migration(migrations.Migration):
dependencies = [("trans", "0008_auto_20181015_2104")]
... | dontnod/weblate | weblate/trans/migrations/0009_auto_20181113_1219.py | Python | gpl-3.0 | 3,549 |
#!/usr/bin/env python
from setuptools import setup, find_packages
__version__ = "0.1"
setup(
name="ace",
author="Gregory Rehm",
author_email="grehm87@gmail.com",
version=__version__,
description="Work in 'Applied Computational Economics and Finance'",
packages=find_packages(),
entry_point... | hahnicity/ace | setup.py | Python | unlicense | 380 |
from django.contrib import admin
from adhocracy4.projects.admin import ProjectAdminFilter
from . import models
class ProjectFilter(ProjectAdminFilter):
project_key = 'module__project'
class LabelAdmin(admin.ModelAdmin):
list_filter = (
'module__project__organisation',
'module__project__is_... | liqd/adhocracy4 | adhocracy4/labels/admin.py | Python | agpl-3.0 | 407 |
"""
Classes that represent database functions.
"""
from django.db.models import IntegerField
from django.db.models.expressions import Func, Value
class Coalesce(Func):
"""
Chooses, from left to right, the first non-null expression and returns it.
"""
function = 'COALESCE'
def __init__(self, *expr... | devs1991/test_edx_docmode | venv/lib/python2.7/site-packages/django/db/models/functions.py | Python | agpl-3.0 | 4,821 |
import re
import collections
from enum import Enum
from ydk._core._dm_meta_info import _MetaInfoClassMember, _MetaInfoClass, _MetaInfoEnum
from ydk.types import Empty, YList, YLeafList, DELETE, Decimal64, FixedBitsDict
from ydk._core._dm_meta_info import ATTRIBUTE, REFERENCE_CLASS, REFERENCE_LIST, REFERENCE_LEAFLI... | 111pontes/ydk-py | cisco-ios-xe/ydk/models/cisco_ios_xe/_meta/_CISCO_OSPF_TRAP_MIB.py | Python | apache-2.0 | 5,683 |
# Copyright 2015, 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 f... | shishaochen/TensorFlow-0.8-Win | third_party/grpc/src/python/grpcio/grpc/framework/crust/implementations.py | Python | apache-2.0 | 14,691 |
# -*- coding: utf-8 -*-
from django import forms
class UploadForm(forms.Form):
uploadfiles = forms.FileField(widget=forms.ClearableFileInput(attrs={'multiple': True}), label='Add Tracks')
| ArcaneStreaming/Arcane-Server | arcane/browse/forms.py | Python | gpl-3.0 | 195 |
import sys
# variables
username=sys.argv[1]
password=sys.argv[2]
adminUrl=sys.argv[3]
applicationName=sys.argv[4]
serverName=sys.argv[5]
applactionEARFileName=sys.argv[6]
# connect to the server
connect(username, password, adminUrl)
# move to the managed server
serverConfig()
cd('Servers\server1')
ls()
# Depl... | AurionProject/Aurion | Product/Install/Weblogic/deployApp.py | Python | bsd-3-clause | 415 |
from flock_controller.mechanics.location import gen_Location, add_location
def main():
"""Set initial location of the central controller."""
location = gen_Location("0.856901647439813,14.08447265625")
add_location(location)
if __name__ == "__main__":
main()
| HTTP-APIs/hydra-flock-demo | controller_settings/set_location.py | Python | mit | 287 |
import json
from unittest.mock import patch
from django.test import TestCase
from draftjs_exporter.dom import DOM
from draftjs_exporter.html import HTML as HTMLExporter
from wagtail.admin.rich_text.converters.contentstate import (
ContentstateConverter, persist_key_for_block)
from wagtail.embeds.models import Em... | zerolab/wagtail | wagtail/admin/tests/test_contentstate.py | Python | bsd-3-clause | 48,701 |
"""
Support for Honeywell Round Connected and Honeywell Evohome thermostats.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/climate.honeywell/
"""
import logging
import socket
import datetime
import requests
import voluptuous as vol
import homeassistan... | HydrelioxGitHub/home-assistant | homeassistant/components/climate/honeywell.py | Python | apache-2.0 | 14,899 |
# http://djangobook.com/en/2.0/chapter14/
from django.contrib import auth
from django.http import HttpResponseRedirect
from django.views.generic.simple import direct_to_template
from translate.lang import tr
from .models import Users
from django.contrib.auth.models import User
def login(request):
if request.user... | rimbalinux/LMD3 | user/views.py | Python | bsd-3-clause | 1,553 |
# -*- coding: utf-8 -*-
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | googleads/google-ads-python | google/ads/googleads/v8/services/services/gender_view_service/transports/grpc.py | Python | apache-2.0 | 10,280 |
from django.conf.urls import patterns, include, url
from django.contrib.auth.views import login, logout
from django.views.generic import TemplateView
from django.conf.urls.static import static #DEBUG# Comment out on production server
from django.conf import settings #DEBUG# Currently only used for above debug line
fro... | beukueb/myflq | src/MyFLsite/MyFLsite/urls.py | Python | mit | 2,233 |
# -*- coding: utf-8 -*-
# Copyright (C) 2015 Kevin Ross, Optiv, Inc. (brad.spengler@optiv.com)
#
# 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 License, or
# (at your op... | lixiangning888/whole_project | modules/signatures_merge_tmp/powershell_command.py | Python | lgpl-3.0 | 2,922 |
# -*- coding: ibm850 -*-
template_typed = """
#ifdef TYPED_METHOD_BIND
template<class T $ifret ,class R$ $ifargs ,$ $arg, class P@$>
class MethodBind$argc$$ifret R$$ifconst C$ : public MethodBind {
public:
$ifret R$ $ifnoret void$ (T::*method)($arg, P@$) $ifconst const$;
#ifdef DEBUG_METHODS_ENABLED
virtual Varian... | Brickcaster/godot | core/make_binders.py | Python | mit | 8,499 |
# SIM-CITY client
#
# Copyright 2015 Netherlands eScience Center
#
# 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 appl... | NLeSC/sim-city-client | tests/test_document.py | Python | apache-2.0 | 2,955 |
#!/usr/bin/python3
""" dst.py:
"""
# Import Required Libraries (Standard, Third Party, Local) ********************
import datetime
import logging
# Authorship Info *************************************************************
__author__ = "Christopher Maue"
__copyright__ = "Copyright 2017, The RPi-Home Project"
__cr... | csm0042/rpihome_v3 | rpihome_v3/helpers/dst.py | Python | gpl-3.0 | 5,695 |
#!/usr/bin/env python
from peyotl.api import APIWrapper
from peyotl.utility.input_output import read_as_json, write_as_json
from peyotl.nexson_syntax import get_nexml_el
a = APIWrapper(phylesystem_api_kwargs={'get_from':'local'})
pa = a.phylesystem_api
p = pa.phylesystem_obj
for sid, fp in p.iter_study_filepaths():
... | mtholder/peyotl | dev/over-each-study.py | Python | bsd-2-clause | 511 |
from common_fixtures import * # NOQA
def test_register_physical_host(admin_client):
uri = 'sim://{}'.format(random_str())
agent = admin_client.create_agent(uri=uri)
agent = admin_client.wait_success(agent)
assert agent.state == 'active'
hosts = agent.hosts()
for _ in range(10):
hos... | alena1108/cattle | tests/integration/cattletest/core/test_physical_host.py | Python | apache-2.0 | 2,414 |
from subprocess import call
isbn_regex = '^(97(8|9)-?)?\d{9}(\d|X)$'
def fix_author(author):
parts = author.split(u', ')
if len(parts) == 2:
return parts[1] + u' ' + parts[0]
return author
def call_mktorrent(target, torrent_filename, announce, torrent_name=None):
args = [
'mktorren... | MADindustries/WhatManager2 | books/utils.py | Python | mit | 566 |
import os
import re
from opsbro.collector import Collector
def extract(input):
mo = re.search(r'^(?P<interface>eth\d+|eth\d+:\d+)\s+' +
r'Link encap:(?P<link_encap>\S+)\s+' +
r'(HWaddr\s+(?P<hardware_address>\S+))?' +
r'(\s+inet addr:(?P<ip_address>\S+))?'... | naparuba/kunai | data/global-configuration/packs/system/collectors/collector_interfaces.py | Python | mit | 1,852 |
from os.path import relpath
from coala_utils.decorators import enforce_signature, get_public_members
from coalib.results.SourcePosition import SourcePosition
from coalib.results.TextRange import TextRange
from coalib.results.AbsolutePosition import AbsolutePosition
class SourceRange(TextRange):
@enforce_signatu... | sils1297/coala | coalib/results/SourceRange.py | Python | agpl-3.0 | 4,979 |
import time
import os
import inspect
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(os.path.dirname(currentdir))
os.sys.path.insert(0, parentdir)
print("parentdir=", parentdir)
import json
from pybullet_envs.deep_mimic.learning.rl_world import RLWorld
... | nrz/ylikuutio | external/bullet3/examples/pybullet/gym/pybullet_envs/deep_mimic/testrl.py | Python | agpl-3.0 | 3,112 |
white, black = '#ffffff', '#000000'
grey = '#eeeeec', '#d3d7cf', '#babdb6', '#888a85', '#555753', '#2e3436'
red = '#ef2929', '#cc0000', '#a40000'
orange = '#fcaf3e', '#f57900', '#ce5c00'
yellow = '#fce94f', '#edd400', '#c4a000'
green = '#8ae234', '#73d216', '#4e9a06'
blue = '#729fcf', '#3465a4', '#204a87'
purple... | Kortemme-Lab/klab | klab/gfx/tango.py | Python | mit | 607 |
#import pydot_ng as pydot
import networkx as nx
import matplotlib.pyplot as plt
class NodeNotInGraph(Exception):
def __init__(self, node):
self.node = node
def __str__(self):
return "Node %s not in graph." % str(self.node)
class Edge(object):
def __init__(self, source, target, weight=1.0... | yrouben/6834-Grand-Challenge | sampling_path_planning/scripts/graph.py | Python | mit | 5,608 |
"""
Author: Justin Cappos
Module: Node Manager connection handling. This does everything up to handling
a request (i.e. accept connections, handle the order they should be
processed in, etc.) Requests will be handled one at a time.
Start date: August 28th, 2008
This is the node manager for Seatt... | drewwestrick/Repy-Web-Server | seattle_repy/nmconnectionmanager.py | Python | gpl-2.0 | 5,813 |
try:
from django.conf.urls import *
except ImportError: # django < 1.4
from django.conf.urls.defaults import *
from rest_framework.routers import DefaultRouter
from imagestore.views import ImageViewSet
router = DefaultRouter()
router.register(r'images', ImageViewSet)
urlpatterns = patterns('apiroot.views',... | goldhand/art-portfolio | art-portfolio/apiroot/urls.py | Python | bsd-3-clause | 402 |
import py, os, sys
from pytest import raises
from .support import setup_make, pylong, pyunicode
currpath = py.path.local(__file__).dirpath()
test_dct = str(currpath.join("datatypesDict"))
def setup_module(mod):
setup_make("datatypes")
class TestDATATYPES:
def setup_class(cls):
cls.test_dct = test_dc... | karies/root | bindings/pyroot/cppyy/cppyy/test/test_datatypes.py | Python | lgpl-2.1 | 45,271 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# === This file is part of Calamares - <http://github.com/calamares> ===
#
# Copyright 2014, Teo Mrnjavac <teo@kde.org>
#
# Calamares is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# ... | shadeslayer/calamares | src/modules/testmodule.py | Python | gpl-3.0 | 3,132 |
# Copyright 2021 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | google-research/DBAP-algorithm | third_party/rlkit_library/rlkit/envs/mujoco_image_env.py | Python | apache-2.0 | 5,856 |
#!/usr/bin/env python
# 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/.
""" This module implements the Telemetry API for Spark.
Example usage:
pings =... | whd/python_moztelemetry | moztelemetry/spark.py | Python | mpl-2.0 | 18,590 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-06-08 17:57
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('fruit', '0001_initial'),
('meat'... | donkirkby/djsquash | fruit/migrations/0002_cranberry_bacon.py | Python | mit | 583 |
import numpy as np
import pandas as pd
import time
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import colors
import seaborn as sns
from scipy.stats import gaussian_kde
import halfspace.scripts as hss
import halfspace.projections as hsp
import sys
sys.path.append('/Users/itchy... | cossatot/wnfs_stress | scripts/wnfs_gal_fms_T_inv.py | Python | cc0-1.0 | 11,258 |
'''
Build a JSON Configuration Parser that can view, write and edit
a JSON conf file.
copyright 2014 Alec Nikolas Reiter
license MIT
'''
import json
from collections import UserDict
from pprint import pprint
from jsonpath_rw import parse
from .utils import root
class JSONConfigParser(UserDict):
... | justanr/JSONConfigParser | jsonconfigparser/configparser.py | Python | mit | 1,847 |
import numpy
import scipy.sparse
import gc
from sppy.linalg.GeneralLinearOperator import GeneralLinearOperator
from sandbox.util.Parameter import Parameter
import sppy.linalg
class RandomisedSVD(object):
"""
Compute the randomised SVD using the algorithm on page 9 of Halko et al.,
Finding Structure ... | charanpald/sandbox | sandbox/misc/RandomisedSVD.py | Python | gpl-3.0 | 2,668 |
from allauth.account import views as allauth_views
from allauth.socialaccount import views as socialaccount_views
from django.conf.urls import url
from . import views
urlpatterns = [
url(
r'^stadt/signup/$',
views.Create.as_view(),
name='account_signup'),
url(r'^stadt/login/signup/$',... | stadtgestalten/stadtgestalten | grouprise/features/gestalten/urls.py | Python | agpl-3.0 | 1,660 |
# Copyright 2017 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/tpu/feature_column_test.py | Python | apache-2.0 | 12,199 |
def add_line_breakpoint(plugin, pydb, type, file, line, condition, expression, func_name):
return None
def add_exception_breakpoint(plugin, pydb, type, exception):
return False
def remove_exception_breakpoint(plugin, pydb, type, exception):
return False
def get_breakpoints(plugin, pydb):
return None
... | dannyperry571/theapprentice | script.module.pydevd/lib/pydevd_trace_api.py | Python | gpl-2.0 | 1,048 |
"""Test the Broadlink config flow."""
import errno
import socket
from unittest.mock import call, patch
import broadlink.exceptions as blke
import pytest
from homeassistant import config_entries, setup
from homeassistant.components.broadlink.const import DOMAIN
from homeassistant.components.dhcp import HOSTNAME, IP_AD... | w1ll1am23/home-assistant | tests/components/broadlink/test_config_flow.py | Python | apache-2.0 | 33,004 |
#!/usr/bin/python3
"""
Copyright 2015, 2017 Lukas Toggenburger; https://github.com/ltog/photomapping-utils
This program 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
... | ltog/photomapping-utils | general/merge_gpx.py | Python | gpl-3.0 | 7,468 |
#!/usr/bin/env python
"""
Artificial Intelligence for Humans
Volume 2: Nature-Inspired Algorithms
Python Version
http://www.aifh.org
http://www.jeffheaton.com
Code repository:
https://github.com/jeffheaton/aifh
Copyright 2014 by Jeff Heaton
Licensed under the Apache License, Versi... | PeterLauris/aifh | vol2/vol2-python-examples/examples/capstone_alife/alife_milestone3.py | Python | apache-2.0 | 2,094 |
# -*- coding: utf-8 -*-
# Copyright 2014-2015 Michael Helmling
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation
import unittest
from lpdec.channels import *
from lpdec.codes import B... | supermihi/lpdec | test/test_adaptivelp.py | Python | gpl-3.0 | 2,123 |
"""
http://amoffat.github.io/sh/
"""
#===============================================================================
# Copyright (C) 2011-2015 by Andrew Moffat
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to dea... | Eddy0402/Environment | vim/ycmd/third_party/sh/sh.py | Python | gpl-3.0 | 80,156 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2019-12-24 19:03
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('astrobin', '0031_add_collection_order_by_tag'),
]
operations = [
migrations.AddField(
model_name='imag... | astrobin/astrobin | astrobin/migrations/0032_add_skip_notifications.py | Python | agpl-3.0 | 536 |
# ***************************************************************************
# * (c) 2009, 2010 Yorik van Havre <yorik@uncreated.net> *
# * (c) 2009, 2010 Ken Cline <cline@frii.com> *
# * (c) 2020 Eliud Cabrera Castillo <e.cabrera-castillo@tum.de> *
# * ... | sanguinariojoe/FreeCAD | src/Mod/Draft/draftguitools/gui_dimension_ops.py | Python | lgpl-2.1 | 4,083 |
import os.path
import buildbot
from twisted.spread import pb
from twisted.python import log
from twisted.internet import reactor, defer
from twisted.application import service, internet
from twisted.cred import credentials
from buildbot.util import now
from buildbot.pbutil import ReconnectingPBClientFactory
from bu... | CauldronDevelopmentLLC/buildbot | buildbot/slave/bot.py | Python | gpl-2.0 | 19,716 |
from webportfolio import WebPortfolio, register_package
register_package(__name__)
def view(template=None):
"""
Create the Maintenance view
Must be instantiated
import maintenance_view
MaintenanceView = maintenance_view()
:param view_template_: The directory containing the view pages
:r... | mardix/webportfolio | webportfolio/packages/maintenance_page/__init__.py | Python | mit | 877 |
"""
./bin/spark-submit --packages org.apache.spark:spark-sql-kafka-0-10_2.11:2.4.4 /vagrant/mnet/deploy/test/sp_test6.py
spark-sql-kafka-0-10_2.11:2.4.4 ===> 2.11代表scala版本,2.4.4代表spark版本
kafka:kafka_2.11-2.3.0.tgz
spark:spark-2.4.4-bin-hadoop2.7.tgz
"""
from pyspark.sql import SparkSession
from pyspark.sql.functions i... | zhexiao/mnet | deploy/test/sp_test6_2.py | Python | apache-2.0 | 1,471 |
# test revlog interaction about raw data (flagprocessor)
from __future__ import absolute_import, print_function
import sys
from edenscm.mercurial import encoding, node, revlog, transaction, vfs
from hghave import require
require(["py2"])
# TESTTMP is optional. This makes it convenient to run without run-tests.py... | facebookexperimental/eden | eden/scm/tests/test-revlog-raw.py | Python | gpl-2.0 | 11,486 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.