text stringlengths 0 1.05M | meta dict |
|---|---|
import sys
import os
from OMPython import OMCSession
# Start OMC session and load MSL
omc = OMCSession()
omc.sendExpression("loadModel(Modelica)")
# Load OpenIPSL and get all models
omc.sendExpression('loadFile("C:\dev\OSS\OpenIPSL_Repo\OpenIPSL\package.mo")')
omc.sendExpression('loadFile("C:\dev\OSS\OpenIPSL_Repo\... | {
"repo_name": "fran-jo/OpenIPSL",
"path": "Support/addCopyright.py",
"copies": "4",
"size": "2756",
"license": "mpl-2.0",
"hash": -6566674633318916000,
"line_mean": 49.1272727273,
"line_max": 169,
"alpha_frac": 0.7550798258,
"autogenerated": false,
"ratio": 3.149714285714286,
"config_test": fal... |
"""Apply filters to a level or CustomObject."""
import os
import sys
import argparse
from contextlib import contextmanager
from distance import DefaultClasses
from distance.levelobjects import LevelObject
from distance.filter import getfilter
from distance.printing import PrintContext
level_objects = DefaultClasse... | {
"repo_name": "ferreum/distanceutils",
"path": "distance_scripts/filterlevel.py",
"copies": "1",
"size": "5909",
"license": "mit",
"hash": -5196361615892881000,
"line_mean": 28.9949238579,
"line_max": 99,
"alpha_frac": 0.5716703334,
"autogenerated": false,
"ratio": 4.016995241332427,
"config_te... |
# Applying Machine Learning to entiment Analysis
'''
In this chapter, we will delve into a subfield of natural language processing (NLP) called sentiment analysis
and learn how to use machine learning algorithms to classify documents based on their polarity: the attitude
of the writer. The topics will cover in the fol... | {
"repo_name": "wei-Z/Python-Machine-Learning",
"path": "self_practice/Chapter 8 Applying Machine Learning to Sentiment Analysis.py",
"copies": "1",
"size": "6663",
"license": "mit",
"hash": 6673447254264849000,
"line_mean": 31.9900990099,
"line_max": 110,
"alpha_frac": 0.621641903,
"autogenerated":... |
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import cvxpy as cp
import networkx as nx
import pyprobml_utils as pml
url = 'https://raw.githubusercontent.com/empathy87/The-Elements-of-Statistical-Learning-Python-Notebooks/master/data/protein.data'
df = pd.read_csv(url, header=None, sep=' ')
X... | {
"repo_name": "probml/pyprobml",
"path": "scripts/ggm_lasso_demo.py",
"copies": "1",
"size": "3080",
"license": "mit",
"hash": -5806677321704314000,
"line_mean": 40.04,
"line_max": 152,
"alpha_frac": 0.6650422352,
"autogenerated": false,
"ratio": 2.8212648945921175,
"config_test": false,
"has... |
"""Apply K-folds CV for some model define in ch3 and ch4.
Note:All CV get approximately result as book, but most CV use one standard rule can not get same best alpha with book.
If I use CV with randomize train data, I can get the result as same as book most time.
"""
import numpy as np
from ..ch3.models import *... | {
"repo_name": "littlezz/ESL-Model",
"path": "esl_model/ch7/models.py",
"copies": "1",
"size": "6907",
"license": "mit",
"hash": 6670187029120702000,
"line_mean": 33.3631840796,
"line_max": 118,
"alpha_frac": 0.5752135515,
"autogenerated": false,
"ratio": 3.3351038145823275,
"config_test": true,... |
"""Apply patches to a parsed json document.
Add { op: "add", path: "/a/b/c", value: v }
Add value v to /a/b at index c. If /a/b is a list, c must be an integer, and
v will be inserted at c. To append a value to list, use a trailing / in the
path.
Remove { op: "remove", path: "/a/b/c" }
Remove the key c from d... | {
"repo_name": "treycucco/bidon",
"path": "bidon/json_patch.py",
"copies": "1",
"size": "7542",
"license": "mit",
"hash": 628688902057338900,
"line_mean": 27.6768060837,
"line_max": 100,
"alpha_frac": 0.6453195439,
"autogenerated": false,
"ratio": 3.321003963011889,
"config_test": true,
"has_n... |
# Apply Prewitt filter
#
import sys, os
import numpy as np
from scipy.ndimage import prewitt
#
# Import the module with the I/O scaffolding of the External Attribute
#
sys.path.insert(0, os.path.join(sys.path[0], '..'))
import extattrib as xa
#
# These are the attribute parameters
#
xa.params = {
'Input': 'Input',
'... | {
"repo_name": "waynegm/OpendTect-External-Attributes",
"path": "Python_3/tests/ex_prewitt_filter.py",
"copies": "1",
"size": "1272",
"license": "mit",
"hash": -8707223864004890000,
"line_mean": 24.9591836735,
"line_max": 89,
"alpha_frac": 0.6627358491,
"autogenerated": false,
"ratio": 2.689217758... |
"""Apply simple tranformations to the views"""
from qtpy import QtWidgets
from .pdsspect_image_set import PDSSpectImageSetViewBase
class TransformsController(object):
"""Controller for :class:`Transforms`
Parameters
----------
image_set : :class:`~.pdsspect_image_set.PDSSpectImageSet`
pdsspe... | {
"repo_name": "planetarypy/pdsspect",
"path": "pdsspect/transforms.py",
"copies": "1",
"size": "5701",
"license": "bsd-3-clause",
"hash": 2089581515304993000,
"line_mean": 31.209039548,
"line_max": 77,
"alpha_frac": 0.6018242414,
"autogenerated": false,
"ratio": 3.6875808538163,
"config_test": ... |
#Apply the calibration fields to the RAW science data to produce
#reduced science data.
#Import whatever modules will be used
import os
import sys
import numpy as np
import matplotlib.pyplot as plt
from astropy.table import Table
from astropy.io import fits, ascii
from scipy import stats
# Import AstroImage
import as... | {
"repo_name": "jmontgom10/pyBDP",
"path": "03_reduceScienceData.py",
"copies": "2",
"size": "6909",
"license": "mit",
"hash": 7142826908752526000,
"line_mean": 39.1686046512,
"line_max": 81,
"alpha_frac": 0.6031263569,
"autogenerated": false,
"ratio": 4.033274956217163,
"config_test": false,
... |
""" Apply The Cannon to the AAOmega Spectra! """
import numpy as np
import matplotlib.pyplot as plt
import sys
from TheCannon import dataset
from TheCannon import model
DATA_DIR = '/Users/annaho/Data/AAOmega/Run_13_July'
SMALL = 1.0 / 1000000000.0
def test_step_iteration(ds, md, starting_guess):
errs, chisq = m... | {
"repo_name": "annayqho/TheCannon",
"path": "code/aaomega/aaomega_run_cannon.py",
"copies": "1",
"size": "11861",
"license": "mit",
"hash": -1011203198642544100,
"line_mean": 35.1615853659,
"line_max": 70,
"alpha_frac": 0.5991906247,
"autogenerated": false,
"ratio": 2.5092024539877302,
"config_... |
"""Apply the mask to the nifiti data
Usage: roinii_butterfly roiname newname
"""
import re
import os
import sys
from roi.pre import join_time
import nibabel as nb
from metaaccumulate.data.nii import findallnii, masknii
def create(mask, path, niipartial, newname, restart=False):
"""Create a roi dataset using all ... | {
"repo_name": "parenthetical-e/wheelerdata",
"path": "preprocess/archive/roinii_butterfly.py",
"copies": "1",
"size": "5115",
"license": "bsd-2-clause",
"hash": 1263939706202087700,
"line_mean": 28.9122807018,
"line_max": 79,
"alpha_frac": 0.5704789834,
"autogenerated": false,
"ratio": 3.54469854... |
"""Apply the mask to the nifiti data
Usage: roinii_fh_custom path/to/mask.hdr
"""
import os
import sys
import nibabel as nb
from roi.pre import mask as masknii
if __name__ == "__main__":
# ----
# Create a place for the roi data to
# live if necessary.
# ----
# Process argv
if len(sys... | {
"repo_name": "parenthetical-e/wheelerdata",
"path": "preprocess/archive/roinii_fh_custom.py",
"copies": "1",
"size": "2279",
"license": "bsd-2-clause",
"hash": -5611509460986953000,
"line_mean": 33.0149253731,
"line_max": 73,
"alpha_frac": 0.5454146556,
"autogenerated": false,
"ratio": 3.1304945... |
"""Apply the mask to the nifiti data
Usage: roinii_fh roifile
"""
import re
import os
import sys
import nibabel as nb
from roi.pre import join_time
from fmrilearn.load import load_roifile
from fmrilearn.preprocess.nii import findallnii
from fmrilearn.preprocess.nii import masknii
def create(args):
"""Create a r... | {
"repo_name": "parenthetical-e/wheelerdata",
"path": "preprocess/archive/rfroinii_fh.py",
"copies": "1",
"size": "3479",
"license": "bsd-2-clause",
"hash": 6098314850761418000,
"line_mean": 30.9174311927,
"line_max": 69,
"alpha_frac": 0.5855130785,
"autogenerated": false,
"ratio": 3.4041095890410... |
# applytheme.py
"""
Apply Theme
This script will apply the specified theme to all webs in the
specified web application.
Usage:
ipy applytheme.py --url http://myserver --theme Petal
Arguments:
--url - web application url
--theme - theme to apply
[--force] - apply the theme even if it is a... | {
"repo_name": "glenc/sp.py",
"path": "src/applytheme.py",
"copies": "1",
"size": "1226",
"license": "bsd-3-clause",
"hash": -4057796243761332700,
"line_mean": 20.7037037037,
"line_max": 98,
"alpha_frac": 0.6247960848,
"autogenerated": false,
"ratio": 3.1435897435897435,
"config_test": false,
... |
# Apply the models to predict what ratings I will give for books on my To-Read list
from goodreads import client
import pandas as pd
import time
import pickle
from my_settings import api_key, api_secret, username # loading private information
from sklearn.externals import joblib
from sklearn.preprocessing import Impu... | {
"repo_name": "dr-rodriguez/Exploring-Goodreads",
"path": "prediction.py",
"copies": "1",
"size": "4402",
"license": "mit",
"hash": -784526257825142100,
"line_mean": 35.0901639344,
"line_max": 119,
"alpha_frac": 0.6453884598,
"autogenerated": false,
"ratio": 3.2826249067859807,
"config_test": f... |
"""Apply the same action to the simulated and real A1 robot.
As a basic debug tool, this script allows you to execute the same action
(which you choose from the pybullet GUI) on the simulation and real robot
simultaneouly. Make sure to put the real robbot on rack before testing.
"""
from absl import app
from absl im... | {
"repo_name": "google-research/motion_imitation",
"path": "motion_imitation/examples/a1_robot_exercise.py",
"copies": "1",
"size": "1931",
"license": "apache-2.0",
"hash": -5347985609148930000,
"line_mean": 32.2931034483,
"line_max": 73,
"alpha_frac": 0.7120662869,
"autogenerated": false,
"ratio"... |
"""Apply thresholds to arrays.
The following work on 2D arrays.
"""
from skimage import filter
def binary(parameters):
"""Applies a binary threshold to an array
:param parameters['data'][0]: input array
:type parameters['data'][0]: numpy.array
:param parameters['threshold']: the threshold value
... | {
"repo_name": "cpsaltis/pythogram-core",
"path": "src/gramcore/filters/thresholds.py",
"copies": "1",
"size": "1084",
"license": "mit",
"hash": -3915828157225141000,
"line_mean": 21.5833333333,
"line_max": 71,
"alpha_frac": 0.6697416974,
"autogenerated": false,
"ratio": 4.059925093632959,
"conf... |
"""Apply transformations that work on (almost) all entities."""
import itertools
from collections import defaultdict
from srctools.bsp_transform import trans, Context
from srctools.logger import get_logger
from srctools import Output
from srctools.packlist import FileType
LOGGER = get_logger(__name__)
@trans('Atta... | {
"repo_name": "TeamSpen210/srctools",
"path": "srctools/bsp_transform/globals.py",
"copies": "1",
"size": "4472",
"license": "unlicense",
"hash": -1881577694851794700,
"line_mean": 31.8823529412,
"line_max": 95,
"alpha_frac": 0.5843023256,
"autogenerated": false,
"ratio": 3.9331574318381706,
"c... |
# Apply White or Black Background Mask
import cv2
from . import print_image
from . import plot_image
from . import fatal_error
def apply_mask(img, mask, mask_color, device, debug=None):
"""Apply white image mask to image, with bitwise AND operator bitwise NOT operator and ADD operator.
Inputs:
img ... | {
"repo_name": "AntonSax/plantcv",
"path": "plantcv/apply_mask.py",
"copies": "2",
"size": "1999",
"license": "mit",
"hash": 8563320097765894000,
"line_mean": 35.3454545455,
"line_max": 104,
"alpha_frac": 0.6233116558,
"autogenerated": false,
"ratio": 3.8076190476190477,
"config_test": false,
... |
# Apply White or Black Background Mask
import os
import cv2
import numpy as np
from plantcv.plantcv import params
from plantcv.plantcv import plot_image
from plantcv.plantcv import print_image
from plantcv.plantcv import fatal_error
from plantcv.plantcv.transform import rescale
def apply_mask(img, mask, mask_color):... | {
"repo_name": "stiphyMT/plantcv",
"path": "plantcv/plantcv/apply_mask.py",
"copies": "2",
"size": "2068",
"license": "mit",
"hash": -8752908898814727000,
"line_mean": 30.3333333333,
"line_max": 106,
"alpha_frac": 0.6039651838,
"autogenerated": false,
"ratio": 3.640845070422535,
"config_test": f... |
"""App middleware."""
import httplib
import logging
import sys
import webapp2
from webapp2_extras import securecookie
from webapp2_extras import security
from webapp2_extras import sessions
from . import error
from error import Abort
from . import model
from . import settings
from . import shared
from google.appeng... | {
"repo_name": "fredsa/instant-tty",
"path": "gae/middleware.py",
"copies": "1",
"size": "5826",
"license": "apache-2.0",
"hash": 4269562291080496000,
"line_mean": 29.8253968254,
"line_max": 81,
"alpha_frac": 0.6850326124,
"autogenerated": false,
"ratio": 3.6641509433962263,
"config_test": false... |
# app/miembros/forms.py
# coding: utf-8
from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField, HiddenField, SelectField
from wtforms import DateField, BooleanField
from wtforms.validators import InputRequired, Length, Optional, DataRequired
class MiembroForm(FlaskForm):
"""
... | {
"repo_name": "originaltebas/chmembers",
"path": "app/miembros/forms.py",
"copies": "1",
"size": "4059",
"license": "mit",
"hash": -8986223490170150000,
"line_mean": 39.3163265306,
"line_max": 78,
"alpha_frac": 0.5381575698,
"autogenerated": false,
"ratio": 3.787652011225444,
"config_test": fal... |
# app/miembros/views.py
# coding: utf-8
from flask import flash, jsonify
from flask import redirect, render_template, url_for, request
from flask_login import current_user, login_required
from sqlalchemy import func
from app.miembros import miembros
from app.miembros.forms import MiembroForm, DireccionModalF... | {
"repo_name": "originaltebas/chmembers",
"path": "app/miembros/views.py",
"copies": "1",
"size": "19032",
"license": "mit",
"hash": 6993028745897006000,
"line_mean": 41.056561086,
"line_max": 84,
"alpha_frac": 0.4598287005,
"autogenerated": false,
"ratio": 3.6367284540416587,
"config_test": fal... |
# app/models.py
from app import db
from sqlalchemy import Column, DateTime
from datetime import datetime
class Blog(db.Model):
__tablename__ = "articles"
id = db.Column(db.Integer, primary_key=True)
article_title = db.Column(db.String, nullable=False)
article_author = db.Column(db.String, nullable... | {
"repo_name": "weldon0405/weldon-blog",
"path": "app/models.py",
"copies": "1",
"size": "1493",
"license": "mit",
"hash": -1141020366648931200,
"line_mean": 29.4897959184,
"line_max": 114,
"alpha_frac": 0.6644340255,
"autogenerated": false,
"ratio": 3.650366748166259,
"config_test": false,
"h... |
# app/models.py
from colorfield.fields import ColorField
from django.db import models
nullable = {'blank': True, 'null': True}
class SourceFile(models.Model):
project = models.CharField(max_length=200, **nullable)
name = models.CharField(max_length=200)
path = models.CharField(max_length=200)
langu... | {
"repo_name": "johntellsall/shotglass",
"path": "shotglass/app/models.py",
"copies": "1",
"size": "2877",
"license": "mit",
"hash": -9017397917596020000,
"line_mean": 28.0606060606,
"line_max": 72,
"alpha_frac": 0.6478971151,
"autogenerated": false,
"ratio": 3.8308921438082555,
"config_test": f... |
# app/models.py
import datetime
from sqlalchemy.ext.hybrid import hybrid_property
from sqlalchemy.sql.functions import sum
from . import bcrypt
from flask_sqlalchemy import SQLAlchemy
db = SQLAlchemy()
tag_categories_tags = db.Table('tag_categories_tags',
db.Column('tag_category_id',
... | {
"repo_name": "cisko3000/flask-inventory",
"path": "app/models.py",
"copies": "2",
"size": "10733",
"license": "mit",
"hash": 4303363038070691300,
"line_mean": 33.7378640777,
"line_max": 94,
"alpha_frac": 0.557439672,
"autogenerated": false,
"ratio": 3.9722427831236122,
"config_test": false,
... |
"""app/models.py: Tutorial IV - Databases.
database models: collection of classes whose purpose is to represent the
data that we will store in our database.
The ORM layer (SQLAlchemy) will do the translations required to map
objects created from these classes into rows in the proper database table.
... | {
"repo_name": "mckinziebrandon/DeepChatModels",
"path": "webpage/deepchat/models.py",
"copies": "1",
"size": "3794",
"license": "mit",
"hash": -4557536129941017000,
"line_mean": 38.5208333333,
"line_max": 89,
"alpha_frac": 0.651555087,
"autogenerated": false,
"ratio": 3.6621621621621623,
"confi... |
APP_NAME = 'cronjobs'
PACKAGE_NAME = 'django-%s' % APP_NAME
DESCRIPTION = 'django cronjobs app'
PROJECT_URL = 'http://github.com/divio/%s/' % PACKAGE_NAME
AUTHOR="Patrick Lauber"
EXTRA_CLASSIFIERS = []
INSTALL_REQUIRES = []
VERSION = '0.1.7'
# DO NOT EDIT ANYTHING DOWN HERE... this should be common to all django a... | {
"repo_name": "divio/django-cronjobs",
"path": "setup.py",
"copies": "1",
"size": "1620",
"license": "bsd-3-clause",
"hash": 1135350465895205100,
"line_mean": 28.4727272727,
"line_max": 111,
"alpha_frac": 0.6802469136,
"autogenerated": false,
"ratio": 3.6902050113895215,
"config_test": false,
... |
app_name = 'flying-robots'
version = '0.2.0'
description = 'A three-dimensional clone of the classic bsd-robots game.'
author = 'Alan Bunbury'
homepage_url = 'http://bunburya.github.com/FlyingRobots'
download_url = 'https://github.com/bunburya/FlyingRobots'
license_name = 'MIT'
license_text = """Copyright (C) 2012 {}
... | {
"repo_name": "bunburya/FlyingRobots",
"path": "flying_robots/metadata.py",
"copies": "1",
"size": "1362",
"license": "mit",
"hash": 1465222703128971300,
"line_mean": 49.4444444444,
"line_max": 79,
"alpha_frac": 0.7856093979,
"autogenerated": false,
"ratio": 4.041543026706232,
"config_test": fa... |
# appname/forms.py
from django import forms
from django.contrib.auth.forms import UserCreationForm, UserChangeForm
from registerApp.models import CustomUser
from django.contrib.auth import get_user_model
from django.core.exceptions import ValidationError
class SignupForm(forms.Form):
email = forms.Emai... | {
"repo_name": "siddver007/project_django_allauth_slate_razorpay",
"path": "registerApp/forms.py",
"copies": "1",
"size": "2075",
"license": "mit",
"hash": -7088288106352688000,
"line_mean": 29.9701492537,
"line_max": 143,
"alpha_frac": 0.6308433735,
"autogenerated": false,
"ratio": 4.117063492063... |
app_name = "frappe"
app_title = "Frappe Framework"
app_publisher = "Web Notes Technologies Pvt. Ltd. and Contributors"
app_description = "Full Stack Web Application Framwork in Python"
app_icon = "assets/frappe/images/frappe.svg"
app_version = "4.0.0-wip"
app_color = "#3498db"
before_install = "frappe.utils.install.be... | {
"repo_name": "cadencewatches/frappe",
"path": "frappe/hooks.py",
"copies": "1",
"size": "2265",
"license": "mit",
"hash": -7576793671107759000,
"line_mean": 29.6081081081,
"line_max": 104,
"alpha_frac": 0.7311258278,
"autogenerated": false,
"ratio": 2.9530638852672753,
"config_test": false,
... |
app_name = "frappe"
app_title = "Frappe Framework"
app_publisher = "Web Notes Technologies Pvt. Ltd."
app_description = "Full Stack Web Application Framework in Python"
app_icon = "assets/frappe/images/frappe.svg"
app_version = "4.4.1"
app_color = "#3498db"
app_email = "support@frappe.io"
before_install = "frappe.util... | {
"repo_name": "rohitwaghchaure/frappe-alec",
"path": "frappe/hooks.py",
"copies": "1",
"size": "3073",
"license": "mit",
"hash": -6850745078752930000,
"line_mean": 34.3218390805,
"line_max": 106,
"alpha_frac": 0.742271396,
"autogenerated": false,
"ratio": 3.0009765625,
"config_test": false,
"... |
app_name = "frappe"
# app_title = "Frappe Framework"
app_title = "LetzERP"
# app_publisher = "Web Notes Technologies Pvt. Ltd."
app_publisher = "LetzERP Pvt. Ltd."
app_description = "Full Stack Web Application Framework in Python"
app_icon = "assets/frappe/images/LetzERP.svg"
app_version = "5.0.0-alpha"
app_color = "#3... | {
"repo_name": "gangadharkadam/letzfrappe",
"path": "frappe/hooks.py",
"copies": "1",
"size": "3050",
"license": "mit",
"hash": 1983688000791899600,
"line_mean": 31.4468085106,
"line_max": 86,
"alpha_frac": 0.728852459,
"autogenerated": false,
"ratio": 2.913085004775549,
"config_test": false,
... |
app_name = "frappe"
# app_title = "Frappe Framework"
app_title = "letzERP"
# app_publisher = "Web Notes Technologies Pvt. Ltd."
app_publisher = "letzERP Pvt. Ltd."
app_description = "Full Stack Web Application Framework in Python"
app_icon = "assets/frappe/images/LetzERP.svg"
app_version = "5.0.0-alpha"
app_color = "#3... | {
"repo_name": "letzerp/framework",
"path": "frappe/hooks.py",
"copies": "1",
"size": "3050",
"license": "mit",
"hash": -2013207959912437200,
"line_mean": 31.4468085106,
"line_max": 86,
"alpha_frac": 0.728852459,
"autogenerated": false,
"ratio": 2.913085004775549,
"config_test": false,
"has_no... |
APP_NAME = 'LXDUI'
APP_CLI_CMD = 'lxdui'
VERSION = '2.1.2'
GIT_URL = 'https://github.com/AdaptiveScale/lxdui.git'
LXD_URL = 'http://localhost:8443'
LICENSE = 'Apache 2.0'
AUTHOR = 'AdaptiveScale, Inc.'
AUTHOR_URL = 'http://www.adaptivescale.com'
AUTHOR_EMAIL = 'info@adaptivescale.com'
KEYWORDS = 'lxc lxc-containers lxd... | {
"repo_name": "AdaptiveScale/lxdui",
"path": "app/__metadata__.py",
"copies": "1",
"size": "1925",
"license": "apache-2.0",
"hash": -4546222546446831600,
"line_mean": 26.8985507246,
"line_max": 56,
"alpha_frac": 0.7153246753,
"autogenerated": false,
"ratio": 2.264705882352941,
"config_test": fa... |
APP_NAME = "mvp_births"
BIRTH_INDICATORS = dict(
app=APP_NAME,
indicators=dict(
child_cases_by_status=dict(
num_births_registered=dict(
description="No. of Births Registered",
title="# Births Registered",
indicator_key="dob delivered"
... | {
"repo_name": "SEL-Columbia/commcare-hq",
"path": "custom/_legacy/mvp/static_definitions/couch/births.py",
"copies": "1",
"size": "3805",
"license": "bsd-3-clause",
"hash": 6033289475864329000,
"line_mean": 35.9417475728,
"line_max": 99,
"alpha_frac": 0.5024967148,
"autogenerated": false,
"ratio"... |
APP_NAME = "mvp_chw_referrals"
CHW_REFERRAL_INDICATORS = dict(
app=APP_NAME,
indicators=dict(
urgent_referrals_by_case=dict(
urgent_referral_followups=dict(
description="No. urgent referrals (codes A, E, B) or treatment receiving CHW follow-up within 2 days " \
... | {
"repo_name": "qedsoftware/commcare-hq",
"path": "custom/_legacy/mvp/static_definitions/couch/chw_referrals.py",
"copies": "4",
"size": "1853",
"license": "bsd-3-clause",
"hash": 5554367663020233000,
"line_mean": 39.2826086957,
"line_max": 120,
"alpha_frac": 0.5650296816,
"autogenerated": false,
... |
APP_NAME = "mvp_chw_visits"
CHW_VISIT_ACTIVE_CASES_INDICATORS = dict(
app=APP_NAME,
indicators=dict(
all_cases=dict(
household_cases_90days=dict(
description="No. of active households in the past 90 days",
title="# Households in past 90 days",
... | {
"repo_name": "benrudolph/commcare-hq",
"path": "custom/_legacy/mvp/static_definitions/couch/chw_visits.py",
"copies": "4",
"size": "6673",
"license": "bsd-3-clause",
"hash": -7878150383016447000,
"line_mean": 41.5031847134,
"line_max": 117,
"alpha_frac": 0.5330436086,
"autogenerated": false,
"ra... |
APP_NAME = "mvp_maternal_health"
MATERNAL_HEALTH_INDICATORS = dict(
app=APP_NAME,
indicators=dict(
pregnancy_danger_signs=dict(
pregnancy_visit_danger_sign=dict(
description="No. of Pregnant Women With Danger Sign Recorded During Visit",
title="# Pregnant Wom... | {
"repo_name": "qedsoftware/commcare-hq",
"path": "custom/_legacy/mvp/static_definitions/couch/maternal_health.py",
"copies": "4",
"size": "2681",
"license": "bsd-3-clause",
"hash": 7936399941027489000,
"line_mean": 37.3,
"line_max": 112,
"alpha_frac": 0.5676986199,
"autogenerated": false,
"ratio"... |
APP_NAME = 'PyWright'
cfg = {
'name':APP_NAME,
'version':'beta1',
'description':'',
'author':'',
'author_email':'',
'url':'',
'py2exe.target':'',
'py2exe.icon':'bb.ico', #64x64
'py2exe.binary':APP_NAME, #leave off the .exe, it will be added
'py2app.target':'',
'py... | {
"repo_name": "crxtrdude/pywright",
"path": "setup.py",
"copies": "1",
"size": "8188",
"license": "bsd-3-clause",
"hash": -9022603167092121000,
"line_mean": 31.752,
"line_max": 121,
"alpha_frac": 0.5615534929,
"autogenerated": false,
"ratio": 3.364009860312243,
"config_test": false,
"has_no_k... |
APP_NAME = 'sitepermissions'
PACKAGE_NAME = 'django-%s' % APP_NAME
DESCRIPTION = 'django sitepermissions app'
PROJECT_URL = 'http://github.com/ojii/%s/' % PACKAGE_NAME
INSTALL_REQUIRES = [
]
AUTHOR = "Jonas Obrist"
EXTRA_CLASSIFIERS = [
]
# DO NOT EDIT ANYTHING DOWN HERE... this should be common to all django app ... | {
"repo_name": "czpython/django-sitepermissions",
"path": "setup.py",
"copies": "2",
"size": "1566",
"license": "bsd-3-clause",
"hash": -2377350033671704000,
"line_mean": 26.4912280702,
"line_max": 111,
"alpha_frac": 0.6794380587,
"autogenerated": false,
"ratio": 3.764423076923077,
"config_test"... |
APP_NAME = 'Stripe Growl'
class StripeNotifier(object):
NOTIFICATIONS = [
# App events
'info',
'error',
# Stripe event types
'charge.succeeded',
]
def __init__(self, api_key, max_events, since_id=None):
"""
max_events: if None, defaults to 4. This is... | {
"repo_name": "michaelschade/stripe_growl",
"path": "stripe_growl.py",
"copies": "1",
"size": "5011",
"license": "mit",
"hash": 5305138244858627000,
"line_mean": 34.7928571429,
"line_max": 79,
"alpha_frac": 0.5388146079,
"autogenerated": false,
"ratio": 4.349826388888889,
"config_test": false,
... |
# app
from app import app
from helpers import stripped, name_image_file
# flickr_api
import flickr_api, json, urllib
from flickr_api.api import flickr
flickr_key = app.config['FLICKR_API_KEY']
flickr_secret = app.config['FLICKR_API_SECRET']
# authorize access to flickr
flickr_api.set_keys(api_key = flickr_key, api_sec... | {
"repo_name": "phrazzld/feedingtube",
"path": "feedtube.py",
"copies": "1",
"size": "5318",
"license": "mit",
"hash": -8536054303716623000,
"line_mean": 35.4246575342,
"line_max": 142,
"alpha_frac": 0.5665663783,
"autogenerated": false,
"ratio": 3.6474622770919067,
"config_test": true,
"has_n... |
import sys, os # Python path kludge - omit these 2 lines if BrickPython is installed.
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(sys.argv[0]))))
from BrickPython.TkApplication import TkApplication
from BrickPython.Sensor import Sensor, TouchSensor, LightSensor,\
UltrasonicSensor
import log... | {
"repo_name": "charlesweir/BrickPython",
"path": "ExamplePrograms/TrialApp.py",
"copies": "1",
"size": "1443",
"license": "mit",
"hash": -5511892959312622000,
"line_mean": 32.5581395349,
"line_max": 105,
"alpha_frac": 0.6507276507,
"autogenerated": false,
"ratio": 3.738341968911917,
"config_tes... |
"""App."""
import os
import altair as alt
import streamlit as st
import i18n
lang = os.environ.get('LANG') or 'en'
i18n.set('filename_format', '{locale}.{format}')
i18n.set('locale', lang)
i18n.set('fallback', 'en')
i18n.load_path.append(os.path.dirname(__file__) + '/../locales')
from ..model.parameters import Para... | {
"repo_name": "CodeForPhilly/chime",
"path": "src/penn_chime/view/st_app.py",
"copies": "1",
"size": "3332",
"license": "mit",
"hash": 7359756714632330000,
"line_mean": 30.1401869159,
"line_max": 146,
"alpha_frac": 0.6494597839,
"autogenerated": false,
"ratio": 2.8333333333333335,
"config_test"... |
'''App
========
This module provides an App class used to run a Moa experiment.
'''
import os
from os import path
import tempfile
import json
import kivy
from kivy.properties import StringProperty, ObjectProperty
from kivy.app import App
from kivy.lang import Builder
from kivy import resources
import moa.factory_re... | {
"repo_name": "matham/moa",
"path": "moa/app.py",
"copies": "1",
"size": "10612",
"license": "mit",
"hash": -7219055871107948000,
"line_mean": 36.3661971831,
"line_max": 78,
"alpha_frac": 0.5397663023,
"autogenerated": false,
"ratio": 4.550600343053174,
"config_test": false,
"has_no_keywords"... |
"""App
The Sebureem web-server based on Bottle
"""
from flask import url_for, redirect, request, render_template, json
from playhouse.shortcuts import model_to_dict
from sebureem import app, db
from sebureem.models import Sebura, Sebuks
@app.route('/comments/<topic>', methods=['GET', 'POST'])
def comment(topic):
... | {
"repo_name": "Erwhann-Rouge/sebureem",
"path": "sebureem/views.py",
"copies": "1",
"size": "2062",
"license": "bsd-3-clause",
"hash": -8559075031679863000,
"line_mean": 25.4358974359,
"line_max": 76,
"alpha_frac": 0.6304558681,
"autogenerated": false,
"ratio": 3.4139072847682117,
"config_test"... |
"""AppointmentGroups API Tests for Version 1.0.
This is a testing template for the generated AppointmentGroupsAPI Class.
"""
import unittest
import requests
import secrets
from py3canvas.apis.appointment_groups import AppointmentGroupsAPI
from py3canvas.apis.appointment_groups import Appointmentgroup
from py3... | {
"repo_name": "tylerclair/py3canvas",
"path": "py3canvas/tests/appointment_groups.py",
"copies": "1",
"size": "2679",
"license": "mit",
"hash": -8697798763275353000,
"line_mean": 41.2096774194,
"line_max": 126,
"alpha_frac": 0.7118327734,
"autogenerated": false,
"ratio": 4.153488372093023,
"con... |
"""AppointmentGroups API Version 1.0.
This API client was generated using a template. Make sure this code is valid before using it.
"""
import logging
from datetime import date, datetime
from .base import BaseCanvasAPI
from .base import BaseModel
class AppointmentGroupsAPI(BaseCanvasAPI):
"""AppointmentGroups AP... | {
"repo_name": "tylerclair/py3canvas",
"path": "py3canvas/apis/appointment_groups.py",
"copies": "1",
"size": "33026",
"license": "mit",
"hash": 5549870121494199000,
"line_mean": 45.1902097902,
"line_max": 557,
"alpha_frac": 0.6678980197,
"autogenerated": false,
"ratio": 4.266373853507298,
"conf... |
"""AppointmentGroups API Version 1.0.
This API client was generated using a template. Make sure this code is valid before using it.
"""
import logging
from datetime import date, datetime
from base import BaseCanvasAPI
from base import BaseModel
class AppointmentGroupsAPI(BaseCanvasAPI):
"""Appointment... | {
"repo_name": "PGower/PyCanvas",
"path": "pycanvas/apis/appointment_groups.py",
"copies": "1",
"size": "33736",
"license": "mit",
"hash": 5976230408918029000,
"line_mean": 45.1832167832,
"line_max": 557,
"alpha_frac": 0.6537526678,
"autogenerated": false,
"ratio": 4.355280144590757,
"config_tes... |
#app = publications
import models
from django.contrib import admin
from django import forms
from django.core import urlresolvers
from widgetry.tabs.placeholderadmin import ModelAdminWithTabsAndCMSPlaceholder
from arkestra_utilities.admin_mixins import AutocompleteMixin, ButtonLinkWidget
from contacts_a... | {
"repo_name": "evildmp/arkestra-publications",
"path": "publications/admin.py",
"copies": "1",
"size": "8117",
"license": "bsd-2-clause",
"hash": 8005268742710844000,
"line_mean": 33.9159292035,
"line_max": 79,
"alpha_frac": 0.6100776149,
"autogenerated": false,
"ratio": 4.361633530360021,
"con... |
# app.py created from http://charlesleifer.com/blog/how-to-make-a-flask-blog-in-one-hour-or-less/
import datetime
import functools
import os
import re
import urllib
from flask import (Flask, abort, flash, Markup, redirect, render_template,
request, Response, session, url_for)
from markdown import ma... | {
"repo_name": "artopping/nyu-python",
"path": "course3/assignments/app/app.py",
"copies": "1",
"size": "7205",
"license": "mit",
"hash": 4548576947512361000,
"line_mean": 32.3564814815,
"line_max": 97,
"alpha_frac": 0.6154059681,
"autogenerated": false,
"ratio": 3.733160621761658,
"config_test"... |
import os
import json
from flask import Flask, request, redirect, url_for, render_template, send_from_directory
from werkzeug.utils import secure_filename
from nltk.tokenize import RegexpTokenizer
from collections import Counter
from pymongo import MongoClient
import datetime
import hashlib
client = MongoClient('loc... | {
"repo_name": "Sledro/College-Programs",
"path": "Year-3/Python/FileAnalysisApp/app.py",
"copies": "1",
"size": "5905",
"license": "mit",
"hash": 6782828170468656000,
"line_mean": 31.9888268156,
"line_max": 89,
"alpha_frac": 0.5544453853,
"autogenerated": false,
"ratio": 4.303935860058309,
"con... |
# app.py for Change4Change
import flask
from flask import Flask, request, url_for, jsonify
import json
import logging
# Date handling
import arrow
###
# Globals
###
app = flask.Flask(__name__)
import CONFIG
import uuid
app.secret_key = str(uuid.uuid4())
app.debug = CONFIG.DEBUG
app.logger.setLevel(logging.DEBUG)
... | {
"repo_name": "civiclee/Hack4Cause2017",
"path": "src/quack4acause/apptest.py",
"copies": "1",
"size": "1319",
"license": "mit",
"hash": 854296896280158000,
"line_mean": 20.6229508197,
"line_max": 75,
"alpha_frac": 0.6429112964,
"autogenerated": false,
"ratio": 3.2014563106796117,
"config_test"... |
# app.py for Change4Change
import flask
from flask import Flask, request, url_for, jsonify, render_template
from flask.ext.sqlalchemy import SQLAlchemy
from datetime import datetime
import json
import logging
import CONFIG
import uuid
###
# Globals
###
app = flask.Flask(__name__)
# Database Globals
SQLALCHEMY_DATAB... | {
"repo_name": "civiclee/Hack4Cause2017",
"path": "src/quack4acause/DonationApp/app.py",
"copies": "1",
"size": "2427",
"license": "mit",
"hash": 3916433023359697400,
"line_mean": 24.8191489362,
"line_max": 106,
"alpha_frac": 0.6975690152,
"autogenerated": false,
"ratio": 3.293080054274084,
"con... |
# App.py
# Application stuff.
# The application is responsible for managing the main frame window.
#
# We also grab the FileOpen command, to invoke our Python editor
" The PythonWin application code. Manages most aspects of MDI, etc "
import win32con
import win32api
import win32ui
import sys
import string
import os
fro... | {
"repo_name": "Mj258/weiboapi",
"path": "srapyDemo/envs/Lib/site-packages/pythonwin/pywin/framework/app.py",
"copies": "12",
"size": "13974",
"license": "mit",
"hash": -3339061744887958000,
"line_mean": 33.25,
"line_max": 262,
"alpha_frac": 0.7196937169,
"autogenerated": false,
"ratio": 3.0638017... |
# app.py
# AtomicPuppy uses asyncio coroutines for concurrent IO
import asyncio
import signal
from atomicpuppy import AtomicPuppy
import sys
from decouple import config
from apps.readaccount.logger import logging
from apps.readaccount.processors import process_deposit, process_transfer
logger = logging.getLogger(__nam... | {
"repo_name": "ferstdigital/cqrs-python-demo",
"path": "apps/readaccount/app.py",
"copies": "1",
"size": "1224",
"license": "mit",
"hash": 2360747732311586300,
"line_mean": 27.488372093,
"line_max": 73,
"alpha_frac": 0.7034313725,
"autogenerated": false,
"ratio": 3.4971428571428573,
"config_tes... |
# app.py
# Creator: Max Greenwald
# Updated: 3/20/17
# Purpose: Create a Flask app and define the necessary API routes
from flask import Flask, jsonify, request, abort
from flask_sqlalchemy import SQLAlchemy
from models import (Doctor, Review)
# Initialize Flask app with SQLAlchemy
app = Flask(__name__)
app.config.fr... | {
"repo_name": "mgreenw/flask-restapi-example",
"path": "app.py",
"copies": "1",
"size": "2561",
"license": "mit",
"hash": -262296473858993820,
"line_mean": 32.2597402597,
"line_max": 184,
"alpha_frac": 0.65560328,
"autogenerated": false,
"ratio": 3.5868347338935576,
"config_test": false,
"has... |
# app.py
from flask import Flask
from flask import render_template
from flask import Response
app = Flask(__name__)
app.config.from_pyfile('config.py')
@app.route('/coreos-ipxe/<userid>/<sshkeyname>/<instanceid>')
@app.route('/coreos-ipxe/<userid>/<sshkeyname>/<instanceid>/<channel>')
def coreos_ipxe(userid, instance... | {
"repo_name": "andrewrothstein/docker-coreos-ipxeserver",
"path": "app.py",
"copies": "1",
"size": "1214",
"license": "mit",
"hash": -1393081201703767000,
"line_mean": 25.9777777778,
"line_max": 71,
"alpha_frac": 0.7100494234,
"autogenerated": false,
"ratio": 3.0199004975124377,
"config_test": ... |
# app.py
import datetime
import functools
import os
import re
import urllib
from flask import (Flask, flash, Markup, redirect, render_template, request, Response, session, url_for)
from markdown import markdown
from markdown.extensions.codehilite import CodeHiliteExtension
from markdown.extensions.extra import ExtraEx... | {
"repo_name": "ghosthand7/gh7.tech",
"path": "app.py",
"copies": "1",
"size": "7055",
"license": "mit",
"hash": -3277533033472818700,
"line_mean": 29.5411255411,
"line_max": 104,
"alpha_frac": 0.6103472714,
"autogenerated": false,
"ratio": 3.7566560170394037,
"config_test": false,
"has_no_key... |
""" app.py """
from flask import Flask, render_template
import pybreaker
import requests
from listener import LogListener
app = Flask(__name__)
time_breaker = pybreaker.CircuitBreaker(fail_max=3, reset_timeout=30)
time_breaker.add_listeners(LogListener(app))
@time_breaker
def _get_time():
try:
respons... | {
"repo_name": "danriti/short-circuit",
"path": "app.py",
"copies": "1",
"size": "1398",
"license": "mit",
"hash": 8355183602852748000,
"line_mean": 24.4181818182,
"line_max": 74,
"alpha_frac": 0.6766809728,
"autogenerated": false,
"ratio": 3.6984126984126986,
"config_test": false,
"has_no_key... |
# app.py
import datetime
import functools
import re
import os
import urllib
from flask import (Flask, abort, flash, Markup, redirect, render_template,
request, Response, session, url_for)
from markdown import markdown
from markdown.extensions.codehilite import CodeHiliteExtension
from markdown.exte... | {
"repo_name": "HiroIshikawa/21playground",
"path": "payblog/blog/app/app.py",
"copies": "1",
"size": "7375",
"license": "mit",
"hash": -9175709813989772000,
"line_mean": 31.2096069869,
"line_max": 79,
"alpha_frac": 0.6122033898,
"autogenerated": false,
"ratio": 3.7859342915811087,
"config_test"... |
""" app.py """
import json
import os
import sys
from flask import Flask, jsonify
from flask import request # for getting query string
# eg: request.args.get('user') will get '?user=some-value'
from flask_restful import Api
from flask_restful import Resource
from werkzeug.exceptions import NotFound
from lemmatize.l... | {
"repo_name": "kylepjohnson/cltk_api_v2",
"path": "app/app.py",
"copies": "1",
"size": "5837",
"license": "mit",
"hash": 6949494212429706000,
"line_mean": 29.7210526316,
"line_max": 108,
"alpha_frac": 0.6200102793,
"autogenerated": false,
"ratio": 3.286599099099099,
"config_test": false,
"has... |
"""app.py
revision: 0.1 24.4.2014 initial by David Levy
Tornado server for mongodb tornado angular tutorial
"""
import os
import sys
import tornado
import pymongo
from tornado.options import options
from tornado import ioloop, web
from handlers.blog_handler import BlogHandler
from handlers.entry_handler import Entry... | {
"repo_name": "niharathomas/mongodb-tornado-angular",
"path": "src/server/app.py",
"copies": "2",
"size": "2389",
"license": "mit",
"hash": -7174503011925264000,
"line_mean": 26.4597701149,
"line_max": 86,
"alpha_frac": 0.6395981582,
"autogenerated": false,
"ratio": 3.8532258064516127,
"config_... |
# app.py
# runs connectfour program with Flask
# J. Hassler Thurston
# Personal website
# 12 January 2014
from datetime import timedelta
from flask import Flask, request, jsonify, abort, make_response, current_app
from functools import update_wrapper
import board, compute_moves
app = Flask(__name__)
# from http://fla... | {
"repo_name": "jthurst3/connectfour",
"path": "connectfour_app.py",
"copies": "1",
"size": "4892",
"license": "mit",
"hash": -7022930809173088000,
"line_mean": 31.8322147651,
"line_max": 107,
"alpha_frac": 0.6788634505,
"autogenerated": false,
"ratio": 3.5708029197080293,
"config_test": false,
... |
# app.py
# where the first point of contact for all user messages goes through and where the bot replies back
import os
import sys
import json
import subprocess
import requests
from flask import Flask, request
# custom made modules
import sheets
import ai
app = Flask(__name__)
@app.route('/', methods=['GET'])
de... | {
"repo_name": "tauseef-khan/london-prayer-times-bot",
"path": "app.py",
"copies": "1",
"size": "5473",
"license": "mit",
"hash": 4605186054947645400,
"line_mean": 35.7315436242,
"line_max": 184,
"alpha_frac": 0.6035081308,
"autogenerated": false,
"ratio": 4.245927075252133,
"config_test": false... |
# app.py or app/__init__.py
from flask import Flask, render_template, jsonify
import os
from action_commands import *
app = Flask(__name__)
app.config.from_object('config')
@app.route('/')
def home():
return render_template('dashboard.html')
@app.route('/dashboard')
def dashboard():
return render_template(... | {
"repo_name": "doron2402/CameraControlXYRoboticArm",
"path": "Server/app.py",
"copies": "1",
"size": "1123",
"license": "mit",
"hash": -3523815916798266000,
"line_mean": 23.4130434783,
"line_max": 77,
"alpha_frac": 0.6233303651,
"autogenerated": false,
"ratio": 3.476780185758514,
"config_test":... |
# app.py rebuilding to test (from http://charlesleifer.com/blog/how-to-make-a-flask-blog-in-one-hour-or-less/)
import datetime
import functools
import os
import re
import urllib
from flask import (Flask, abort, flash, Markup, redirect, render_template,
request, Response, session, url_for)
from markd... | {
"repo_name": "artopping/nyu-python",
"path": "course3/assignments/blog_virtual/app/app.py",
"copies": "1",
"size": "2688",
"license": "mit",
"hash": -8142415417861687000,
"line_mean": 29.8965517241,
"line_max": 110,
"alpha_frac": 0.677827381,
"autogenerated": false,
"ratio": 3.4198473282442747,
... |
# App.py
# Application stuff.
# The application is responsible for managing the main frame window.
#
# We also grab the FileOpen command, to invoke our Python editor
" The PythonWin application code. Manages most aspects of MDI, etc "
import win32con
import win32api
import win32ui
import sys
import string
im... | {
"repo_name": "Southpaw-TACTIC/Team",
"path": "src/python/Lib/site-packages/pythonwin/pywin/framework/app.py",
"copies": "1",
"size": "14375",
"license": "epl-1.0",
"hash": 403607803519312260,
"line_mean": 33.5816831683,
"line_max": 262,
"alpha_frac": 0.7007304348,
"autogenerated": false,
"ratio"... |
#!/app/python3.5/bin/python3.5
import os
import sys
import shutil
projcet="ALL/"
user="xiaoyong/"
class all:
def cmd(self,version):
res=os.system("mkdir -p /code/"+user)
if res==0:
print("代码目录创建成功")
os.chdir("/code/"+user)
res=os.system("git clone https://github.c... | {
"repo_name": "xiaoyongaa/ALL",
"path": "启动停止脚本/git自动拉取代码脚本.py",
"copies": "1",
"size": "1767",
"license": "apache-2.0",
"hash": -3298676366177820000,
"line_mean": 29.3921568627,
"line_max": 86,
"alpha_frac": 0.4189799871,
"autogenerated": false,
"ratio": 3.0918163672654693,
"config_test": fals... |
# app.py - Upper-Polo To Do List App
# This file defines a function named 'main' that
# implements the app runtime loop.
from todoclass import ToDoList
def print_menu():
# Display menu
print("\n\n1. Add Item")
print("2. Remove Item")
print("3. List Items")
print("4. Mark Done")
print("0. Exi... | {
"repo_name": "Upper-Polo/todo_list",
"path": "app.py",
"copies": "1",
"size": "1249",
"license": "mit",
"hash": 6257703254271599000,
"line_mean": 21.3035714286,
"line_max": 56,
"alpha_frac": 0.5052041633,
"autogenerated": false,
"ratio": 3.706231454005935,
"config_test": false,
"has_no_keywo... |
#app_quobit models
from django.db import models
from django.contrib.auth.models import User
class QEvent(models.Model):
title = models.CharField(max_length=50)
created_by_user_id = models.IntegerField(max_length=50)
created_by_fbid = models.IntegerField(max_length=50)
created_by_username = models.CharField(max_le... | {
"repo_name": "asen6/amartyasenguptadotcom",
"path": "app_quobit/models.py",
"copies": "1",
"size": "2213",
"license": "bsd-3-clause",
"hash": 4814943283798117000,
"line_mean": 29.75,
"line_max": 80,
"alpha_frac": 0.7415273385,
"autogenerated": false,
"ratio": 2.9585561497326203,
"config_test":... |
#app_quobit views
from django.core.cache import cache
from django.contrib.auth.forms import UserCreationForm
from django.views.generic.simple import direct_to_template
from django.http import HttpResponseRedirect
from django.views.generic.simple import direct_to_template
from django.shortcuts import render_to_r... | {
"repo_name": "asen6/amartyasenguptadotcom",
"path": "app_quobit/views.py",
"copies": "1",
"size": "5668",
"license": "bsd-3-clause",
"hash": 1160748265949137400,
"line_mean": 32.1445783133,
"line_max": 137,
"alpha_frac": 0.6931898377,
"autogenerated": false,
"ratio": 2.9474778991159645,
"confi... |
import datetime
import random
import os
from time import sleep
import photos
import quotes
import tweets
# import posts
def clear_screen():
os.system("cls" if os.name == 'nt' else 'clear')
def bot_loop():
"""Repeatedly pulls random quote and tweets it"""
pic_file = 'quote-image.jpg'
previous_quotes = list()
... | {
"repo_name": "fpcorso/twitter-quotes-bot",
"path": "quote-bot.py",
"copies": "1",
"size": "1770",
"license": "mit",
"hash": 4954786426132562000,
"line_mean": 25.4179104478,
"line_max": 80,
"alpha_frac": 0.6655367232,
"autogenerated": false,
"ratio": 3.1607142857142856,
"config_test": false,
... |
"""App related models."""
from __future__ import unicode_literals
import datetime
from django.db import models
from django.utils import timezone
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext as _
from . import constants
from . import lib
class DNSRecor... | {
"repo_name": "tonioo/modoboa",
"path": "modoboa/dnstools/models.py",
"copies": "1",
"size": "2728",
"license": "isc",
"hash": 6986418549691401000,
"line_mean": 31.0941176471,
"line_max": 78,
"alpha_frac": 0.6195014663,
"autogenerated": false,
"ratio": 4.0058737151248165,
"config_test": false,
... |
"""App related models."""
import datetime
from django.db import models
from django.utils import timezone
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext as _
from . import constants
from . import lib
class DNSRecordManager(models.Manager):
"""Custom m... | {
"repo_name": "modoboa/modoboa",
"path": "modoboa/dnstools/models.py",
"copies": "1",
"size": "2687",
"license": "isc",
"hash": -1916337480961860600,
"line_mean": 31.3734939759,
"line_max": 78,
"alpha_frac": 0.6174171939,
"autogenerated": false,
"ratio": 4.004470938897168,
"config_test": false,... |
"""App. related serializers."""
from django.utils.translation import ugettext as _
from rest_framework import serializers
from ... import models
PERIODS = [
("day", "Day"),
("week", "Week"),
("month", "Month"),
("year", "Year"),
("custom", "Custom")
]
class StatisticsInputSerializer(serialize... | {
"repo_name": "modoboa/modoboa",
"path": "modoboa/maillog/api/v2/serializers.py",
"copies": "1",
"size": "2029",
"license": "isc",
"hash": 1689392112415872800,
"line_mean": 25.3506493506,
"line_max": 79,
"alpha_frac": 0.6550024643,
"autogenerated": false,
"ratio": 4.488938053097345,
"config_tes... |
"""App related serializers."""
from rest_framework import serializers
from modoboa.admin import models as admin_models
from ... import models
class MXRecordSerializer(serializers.ModelSerializer):
"""Serializer for MXRecord."""
class Meta:
model = admin_models.MXRecord
fields = ("name", "a... | {
"repo_name": "modoboa/modoboa",
"path": "modoboa/dnstools/api/v2/serializers.py",
"copies": "1",
"size": "1431",
"license": "isc",
"hash": -8862499637446831000,
"line_mean": 27.0588235294,
"line_max": 78,
"alpha_frac": 0.679245283,
"autogenerated": false,
"ratio": 4.053824362606233,
"config_te... |
"""App related signal handlers."""
import redis
from django.conf import settings
from django.db.models import signals
from django.dispatch import receiver
from modoboa.admin import models as admin_models
from . import constants
def set_message_limit(instance, key):
"""Store message limit in Redis."""
old_... | {
"repo_name": "modoboa/modoboa",
"path": "modoboa/policyd/handlers.py",
"copies": "1",
"size": "1435",
"license": "isc",
"hash": 1874189273512701000,
"line_mean": 30.8888888889,
"line_max": 68,
"alpha_frac": 0.7045296167,
"autogenerated": false,
"ratio": 3.727272727272727,
"config_test": false,... |
"""App. related viewsets."""
import time
from django.db.models import Q
from drf_spectacular.utils import extend_schema
from rest_framework import filters, permissions, response, viewsets
from modoboa.admin import models as admin_models
from modoboa.lib import pagination
from ... import models
from ... import sign... | {
"repo_name": "modoboa/modoboa",
"path": "modoboa/maillog/api/v2/viewsets.py",
"copies": "1",
"size": "2523",
"license": "isc",
"hash": 505269602472346430,
"line_mean": 35.0428571429,
"line_max": 78,
"alpha_frac": 0.6547760602,
"autogenerated": false,
"ratio": 4.212020033388981,
"config_test": ... |
"""App related views."""
from django.utils.translation import ugettext as _
from django.views import generic
from django.contrib.auth import mixins as auth_mixins
from modoboa.admin import models as admin_models
from . import models
class DomainAccessRequiredMixin(auth_mixins.AccessMixin):
"""Check if user ca... | {
"repo_name": "modoboa/modoboa",
"path": "modoboa/dnstools/views.py",
"copies": "2",
"size": "2669",
"license": "isc",
"hash": -6050484345232529000,
"line_mean": 30.0348837209,
"line_max": 77,
"alpha_frac": 0.6399400525,
"autogenerated": false,
"ratio": 4.297906602254429,
"config_test": true,
... |
"""apprelease 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-... | {
"repo_name": "gabrielferreira/apprelease",
"path": "apprelease/urls.py",
"copies": "1",
"size": "2039",
"license": "apache-2.0",
"hash": -8333883704245282000,
"line_mean": 44.3111111111,
"line_max": 123,
"alpha_frac": 0.721922511,
"autogenerated": false,
"ratio": 3.5215889464594126,
"config_te... |
"""Apprise platform for notify component."""
import logging
import apprise
import voluptuous as vol
from homeassistant.components.notify import (
ATTR_TARGET,
ATTR_TITLE,
ATTR_TITLE_DEFAULT,
PLATFORM_SCHEMA,
BaseNotificationService,
)
from homeassistant.const import CONF_URL
import homeassistant.h... | {
"repo_name": "kennedyshead/home-assistant",
"path": "homeassistant/components/apprise/notify.py",
"copies": "2",
"size": "2074",
"license": "apache-2.0",
"hash": -5892029862035679000,
"line_mean": 29.0579710145,
"line_max": 73,
"alpha_frac": 0.6663452266,
"autogenerated": false,
"ratio": 4.02718... |
# Approach 1. Use a tuple to store data and min in every stack element
class StackWithMin(object):
def __init__(self, storage = []):
self.storage = storage
def empty(self):
return len(self.storage) == 0
def push(self, value):
if len(self.storage) == 0 or value < self.storage[-1][1]:
self.storage.append((val... | {
"repo_name": "aattaran/Machine-Learning-with-Python",
"path": "CTCI/Chapter 3/Question3_2/ChapQ3.2.py",
"copies": "1",
"size": "1567",
"license": "bsd-3-clause",
"hash": 5569047754290778000,
"line_mean": 24.2903225806,
"line_max": 78,
"alpha_frac": 0.6056158264,
"autogenerated": false,
"ratio": ... |
"""Approaches for calculating haplotype phasing of variants.
"""
import os
from bcbio import broad
from bcbio.utils import file_exists
from bcbio.distributed.transaction import file_transaction
from bcbio.pipeline import shared
from bcbio.variation import bamprep
def has_variants(vcf_file):
with open(vcf_file) as... | {
"repo_name": "Cyberbio-Lab/bcbio-nextgen",
"path": "bcbio/variation/phasing.py",
"copies": "12",
"size": "1817",
"license": "mit",
"hash": 7322323050238250000,
"line_mean": 40.2954545455,
"line_max": 89,
"alpha_frac": 0.5767749037,
"autogenerated": false,
"ratio": 3.6930894308943087,
"config_t... |
# approach is way too slow
from collections import deque
def main():
global seed
def traverse_groups(x, y, group_no):
q = deque()
q.append((x,y))
count = 0
while len(q) > 0:
# if count > 1:
# exit()
count +=1
cx, cy = q.poplef... | {
"repo_name": "rvrheenen/OpenKattis",
"path": "Python/forestfires/forestfires.py",
"copies": "1",
"size": "3703",
"license": "mit",
"hash": 3822340594949914600,
"line_mean": 38.3936170213,
"line_max": 183,
"alpha_frac": 0.4636780988,
"autogenerated": false,
"ratio": 3.236888111888112,
"config_t... |
# app/roles/views.py
# coding: utf-8
from flask import flash
from flask import redirect, render_template, url_for
from flask_login import current_user, login_required
from app.roles import roles
from app.roles.forms import RolForm
from app import db
from app.models import Rol
def check_edit_or_admin(... | {
"repo_name": "originaltebas/chmembers",
"path": "app/roles/views.py",
"copies": "1",
"size": "3907",
"license": "mit",
"hash": -2047602267157651200,
"line_mean": 26.5109489051,
"line_max": 72,
"alpha_frac": 0.5752688172,
"autogenerated": false,
"ratio": 3.324255319148936,
"config_test": false,... |
@app.route('/api/v1.0/<int:api_key>/scrape/rushhour/new',methods=['GET'])
########scrapes the Rush Hour index page
def get_rush_hour_index(api_key):
if str(api_key)!=the_api_key:
return 401
#base_url = 'http://www.rushhour.nl/store_master.php?idxGroup=2&idxGenre=2&idxSubGenre=&app=250'
week = datet... | {
"repo_name": "siquick/ss_api",
"path": "api/retired_rushhour.py",
"copies": "2",
"size": "4591",
"license": "apache-2.0",
"hash": -6474510252118122000,
"line_mean": 32.7647058824,
"line_max": 406,
"alpha_frac": 0.6144630799,
"autogenerated": false,
"ratio": 3.324402606806662,
"config_test": fa... |
@APP.route("/api/v1/channel/<int:channel>/permit/<int:user>",
methods=["GET", "PATCH", "DELETE"])
def chan_permit(channel, user):
"""
This endpoint is used to check and set permits on a per-channel, per-user
basis.
Methods:
- GET:
This method will return the information a... | {
"repo_name": "CactusDev/CactusAPI",
"path": "permit_examples.py",
"copies": "1",
"size": "2771",
"license": "mit",
"hash": 5575702641372676000,
"line_mean": 34.0759493671,
"line_max": 78,
"alpha_frac": 0.4954889931,
"autogenerated": false,
"ratio": 4.602990033222591,
"config_test": false,
"h... |
@app.route('/log')
def log():
if 'user' is session:
user_session - escape(session['user']).capitalize()
return render_template('login.html', user_session=user_session)
return redirect(url_for('login'))
@app.route('/login', methods=['GET', 'POST'])
def login():
error = None
if 'user' is session:
return redi... | {
"repo_name": "Ahmad31/Web_Flask_Cassandra",
"path": "backup_code.py",
"copies": "1",
"size": "6284",
"license": "apache-2.0",
"hash": -8459540921603265000,
"line_mean": 26.9333333333,
"line_max": 207,
"alpha_frac": 0.6359007002,
"autogenerated": false,
"ratio": 2.865481076151391,
"config_test"... |
# approved senders: https://support.google.com/a/answer/2368132
password = raw_input('Enter the admin password: ')
import smtplib
import csv
import time
csvFile = 'userAccountsToEmail2.csv'
logFile = open('userAccountsThatHaveBeenEmailed.csv', 'a') #open a log file that we'll append to
totalRows = sum(1 for row in ... | {
"repo_name": "misterhay/GoogleAppsProvisioning",
"path": "sendEmails.py",
"copies": "1",
"size": "2980",
"license": "unlicense",
"hash": 5241556925070116000,
"line_mean": 53.2,
"line_max": 268,
"alpha_frac": 0.7177852349,
"autogenerated": false,
"ratio": 3.6033857315598548,
"config_test": fals... |
# Approximate 2d posterior using PyMc3
# https://www.ritchievink.com/blog/2019/06/10/bayesian-inference-how-we-are-able-to-chase-the-posterior/
# We use the same data and model as in posteriorGrid2d.py
import numpy as np
import matplotlib.pyplot as plt
from scipy import stats
import pymc3 as pm
figdir = "../figures"... | {
"repo_name": "probml/pyprobml",
"path": "scripts/bayes_unigauss_2d_pymc3.py",
"copies": "1",
"size": "1756",
"license": "mit",
"hash": 5949871983714751000,
"line_mean": 27.8032786885,
"line_max": 104,
"alpha_frac": 0.6884965831,
"autogenerated": false,
"ratio": 2.7961783439490446,
"config_test... |
# Approximate 2d posterior using pyro SVI
# https://www.ritchievink.com/blog/2019/06/10/bayesian-inference-how-we-are-able-to-chase-the-posterior/
# We use the same data and model as in posteriorGrid2d.py
import numpy as np
import matplotlib.pyplot as plt
from scipy import stats
import pyro
import pyro.distributions... | {
"repo_name": "probml/pyprobml",
"path": "scripts/bayes_unigauss_2d_pyro.py",
"copies": "1",
"size": "2943",
"license": "mit",
"hash": 7117855916930375000,
"line_mean": 29.3505154639,
"line_max": 104,
"alpha_frac": 0.6530750934,
"autogenerated": false,
"ratio": 2.9817629179331306,
"config_test"... |
"""Approximate bilateral rank filter for local (custom kernel) mean.
The local histogram is computed using a sliding window similar to the method
described in [1]_.
The pixel neighborhood is defined by:
* the given structuring element
* an interval [g-s0, g+s1] in greylevel around g the processed pixel greylevel
Th... | {
"repo_name": "warmspringwinds/scikit-image",
"path": "skimage/filters/rank/bilateral.py",
"copies": "3",
"size": "7652",
"license": "bsd-3-clause",
"hash": 3386529946054214700,
"line_mean": 33.4684684685,
"line_max": 79,
"alpha_frac": 0.6317302666,
"autogenerated": false,
"ratio": 3.539315448658... |
# approximate fbp alg.
from pylab import *
import numpy
ion()
convolve = numpy.convolve
import tomo2D as tomo
import time
from phantoms_tomo2D import generate_shepp_logan
phshepp = generate_shepp_logan()
print '''This program is designed to run in an ipython shell with matplotlib.
From terminal command line run:
... | {
"repo_name": "jakobsj/how_little_data",
"path": "largescale_code/fanbeam_fbp_test.py",
"copies": "1",
"size": "2625",
"license": "mit",
"hash": 6901355039078949000,
"line_mean": 21.6293103448,
"line_max": 103,
"alpha_frac": 0.6308571429,
"autogenerated": false,
"ratio": 2.401646843549863,
"con... |
"""Approximate nearest neighbor search"""
# Author: Maheshakya Wijewardena <maheshakya.10@cse.mrt.ac.lk>
# Joel Nothman <joel.nothman@gmail.com>
import numpy as np
import warnings
from scipy import sparse
from .base import KNeighborsMixin, RadiusNeighborsMixin
from ..base import BaseEstimator
from ..utils.va... | {
"repo_name": "BiaDarkia/scikit-learn",
"path": "sklearn/neighbors/approximate.py",
"copies": "4",
"size": "22450",
"license": "bsd-3-clause",
"hash": 7759991538327436000,
"line_mean": 39.7441016334,
"line_max": 79,
"alpha_frac": 0.5792427617,
"autogenerated": false,
"ratio": 4.3173076923076925,
... |
"""Approximate nearest neighbor search"""
# Author: Maheshakya Wijewardena <maheshakya.10@cse.mrt.ac.lk>
# Joel Nothman <joel.nothman@gmail.com>
import warnings
import numpy as np
from scipy import sparse
from .base import KNeighborsMixin, RadiusNeighborsMixin
from ..base import BaseEstimator
from ..metrics.... | {
"repo_name": "DailyActie/Surrogate-Model",
"path": "01-codes/scikit-learn-master/sklearn/neighbors/approximate.py",
"copies": "1",
"size": "22392",
"license": "mit",
"hash": 98454337719433730,
"line_mean": 39.7868852459,
"line_max": 79,
"alpha_frac": 0.5789121115,
"autogenerated": false,
"ratio"... |
''' Approximate the strategy oddments for 2 person zero-sum games of perfect information.
Applies the iterative solution method described by J.D. Williams in his classic
book, The Compleat Strategyst, ISBN 0-486-25101-2. See chapter 5, page 180 for details. '''
from operator import add, neg
def solve(payoff_matrix... | {
"repo_name": "ActiveState/code",
"path": "recipes/Python/496825_Game_theory_payoff_matrix_solver/recipe-496825.py",
"copies": "1",
"size": "1456",
"license": "mit",
"hash": 55806182586348190,
"line_mean": 41.8235294118,
"line_max": 93,
"alpha_frac": 0.6153846154,
"autogenerated": false,
"ratio":... |
"""Approximating spectral functions with tensor networks.
"""
import numpy as np
import random
import quimb as qu
from .tensor_gen import MPO_rand, MPO_zeros_like
def construct_lanczos_tridiag_MPO(A, K, v0=None, initial_bond_dim=None,
beta_tol=1e-6, max_bond=None, seed=False,
... | {
"repo_name": "jcmgray/quijy",
"path": "quimb/tensor/tensor_approx_spectral.py",
"copies": "1",
"size": "1751",
"license": "mit",
"hash": -2138345272080495600,
"line_mean": 28.1833333333,
"line_max": 79,
"alpha_frac": 0.5134209023,
"autogenerated": false,
"ratio": 2.9478114478114477,
"config_te... |
# Approximation algorithms for joint partition and prediction (JointPartPred)
import numpy as np
from copy import copy
from scipy.sparse import csr_matrix
from snpp.utils import nonzero_edges, predict_signs_using_partition
from snpp.utils.signed_graph import matrix2graph
from snpp.utils.status import Status
def ite... | {
"repo_name": "xiaohan2012/snpp",
"path": "snpp/cores/joint_part_pred.py",
"copies": "1",
"size": "3218",
"license": "mit",
"hash": 3355528034924686000,
"line_mean": 31.18,
"line_max": 86,
"alpha_frac": 0.5515848353,
"autogenerated": false,
"ratio": 4.1576227390180875,
"config_test": false,
"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.