text stringlengths 0 1.05M | meta dict |
|---|---|
"""Application body"""
import os
from urllib.error import HTTPError
from urllib.request import urlopen
from app.auth import HubAuth
from flask import Flask, redirect
from webargs import Arg
from webargs.flaskparser import use_args
def create_app(config='production'):
app = Flask(__name__, static_url_path='/static'... | {
"repo_name": "alvinwan/DS8-Interact",
"path": "app/__init__.py",
"copies": "1",
"size": "2192",
"license": "apache-2.0",
"hash": -4437046985736566000,
"line_mean": 29.0410958904,
"line_max": 72,
"alpha_frac": 0.7062043796,
"autogenerated": false,
"ratio": 3.552674230145867,
"config_test": true... |
# Application condition
func.id == max_used_id and not cur_node_is_processed
# Reaction
function_code = func.Body
function_code = function_code.replace("Sensor1", port_values[0] + "1)");
function_code = function_code.replace("Sensor2", port_values[1] + "2)");
function_code = function_code.replace("Sensor3", port_valu... | {
"repo_name": "tara-sova/qreal",
"path": "plugins/tools/visualInterpreter/examples/robotsCodeGeneration/reactionsStorage/FunctionGenerator.py",
"copies": "12",
"size": "1093",
"license": "apache-2.0",
"hash": 8923680166499430000,
"line_mean": 32.1212121212,
"line_max": 72,
"alpha_frac": 0.6349496798,... |
# Application condition
waitFor.id == max_used_id and not cur_node_is_processed
# Reaction
port = "NXT_PORT_S" + waitFor.Port
color_nxt_type = ""
color_str = waitFor.Color
if color_str == "Красный":
color_nxt_type = "NXT_COLOR_RED"
elif color_str == "Зелёный":
color_nxt_type = "NXT_COLOR_GREEN"
elif color_str ==... | {
"repo_name": "Ashatta/qreal",
"path": "plugins/tools/visualInterpreter/examples/robotsCodeGeneration/reactionsStorage/WaitForColorBlockGenerator.py",
"copies": "12",
"size": "1127",
"license": "apache-2.0",
"hash": -9194273822989110000,
"line_mean": 31.0882352941,
"line_max": 112,
"alpha_frac": 0.67... |
""" application config
"""
from types import SimpleNamespace
bootstrap = SimpleNamespace(
# Is bootstrap running
running=False,
# Attached output
output=None
)
app = SimpleNamespace(
# Juju bootstrap details
bootstrap=bootstrap,
# The conjure-up UI framework
ui=None,
# Contains ... | {
"repo_name": "battlemidget/conjure-up",
"path": "conjureup/app_config.py",
"copies": "1",
"size": "1169",
"license": "mit",
"hash": -1215708651759780400,
"line_mean": 18.4833333333,
"line_max": 64,
"alpha_frac": 0.6826347305,
"autogenerated": false,
"ratio": 4.282051282051282,
"config_test": f... |
""" application config
"""
import json
from types import SimpleNamespace
bootstrap = SimpleNamespace(
# Is bootstrap running
running=False,
# Attached output
output=None
)
maas = SimpleNamespace(
# Client
client=None,
# API key
api_key=None,
# API Endpoint
endpoint=None
)
j... | {
"repo_name": "conjure-up/conjure-up",
"path": "conjureup/app_config.py",
"copies": "3",
"size": "5539",
"license": "mit",
"hash": 5308395890383095000,
"line_mean": 22.9783549784,
"line_max": 79,
"alpha_frac": 0.5903592706,
"autogenerated": false,
"ratio": 4.317225253312548,
"config_test": true... |
## Application configuration
from luggage import crypto
## Public configuration -- these pose no security risk
## if published.
PARSE_APPLICATION_ID = "sYIULJPxHZCryGbqxbNfsXF8PPU4Blf4Ow5b8SFc"
STATE_APPLICATION_ID = "jcMhpH2gLjin9TK3oQH25Nn4kOG1XQHE8K0WmySL"
## Secret configuration -- these API keys would be a probl... | {
"repo_name": "moshez/boredbot",
"path": "boredbot_deploy/config.py",
"copies": "1",
"size": "1153",
"license": "mit",
"hash": -3227251536802526700,
"line_mean": 45.12,
"line_max": 142,
"alpha_frac": 0.7658282741,
"autogenerated": false,
"ratio": 2.3822314049586777,
"config_test": false,
"has... |
"""Application configuration."""
import logging
from contextlib import suppress
from importlib import import_module
from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
from resolwe.storage.connectors import connectors
from resolwe.storage.connectors.baseconnector import BaseStora... | {
"repo_name": "genialis/resolwe",
"path": "resolwe/storage/apps.py",
"copies": "1",
"size": "2138",
"license": "apache-2.0",
"hash": -2122979579628690000,
"line_mean": 37.1785714286,
"line_max": 88,
"alpha_frac": 0.6071094481,
"autogenerated": false,
"ratio": 5.078384798099762,
"config_test": t... |
"""Application configuration."""
import sys
from django.apps import AppConfig
class ElasticConfig(AppConfig):
"""Application configuration."""
name = 'resolwe.elastic'
def ready(self):
"""Perform application initialization."""
# Initialize the type extension composer.
from . com... | {
"repo_name": "jberci/resolwe",
"path": "resolwe/elastic/apps.py",
"copies": "1",
"size": "1074",
"license": "apache-2.0",
"hash": 5637985595168791000,
"line_mean": 32.5625,
"line_max": 78,
"alpha_frac": 0.6368715084,
"autogenerated": false,
"ratio": 4.995348837209303,
"config_test": false,
"... |
""" Application configuration """
import os
class Config:
""" Base Configuration """
APP_DIR = os.path.abspath(os.path.dirname(__file__)) # this directory
PROJECT_ROOT = os.path.abspath(os.path.join(APP_DIR, os.pardir))
SECRET_KEY = os.environ.get(
'SECRET_KEY',
'alsdkjfoqw90eurjo... | {
"repo_name": "cfflymolo/personal-website",
"path": "app/config.py",
"copies": "1",
"size": "1441",
"license": "mit",
"hash": 1914178985617479700,
"line_mean": 23.4237288136,
"line_max": 76,
"alpha_frac": 0.6391394865,
"autogenerated": false,
"ratio": 3.3985849056603774,
"config_test": true,
... |
"""Application core."""
from flask.ext.mail import Mail
from flask.ext.security import Security
from flask.ext.sqlalchemy import SQLAlchemy
__all__ = 'db',
db = SQLAlchemy() # NOQA
mail = Mail() # NOQA
security = Security() # NOQA
class Server(object):
"""A wrapper around common SQLAlchemy functionality."... | {
"repo_name": "dirn/Secret-Santa",
"path": "xmas/core.py",
"copies": "1",
"size": "1632",
"license": "bsd-3-clause",
"hash": 6010419583069413000,
"line_mean": 26.2,
"line_max": 71,
"alpha_frac": 0.5949754902,
"autogenerated": false,
"ratio": 4.785923753665689,
"config_test": false,
"has_no_ke... |
'''Application Data (bpy.app)
This module contains application values that remain unchanged during runtime.
'''
debug = None
'''Boolean, for debug info (started with --debug / --debug_* matching this attribute name)
'''
debug_events = None
'''Boolean, for debug info (started with --debug / -... | {
"repo_name": "kabuku/blender-python",
"path": "blenderlib/bpy.app.py",
"copies": "1",
"size": "3091",
"license": "mit",
"hash": 5422606904759285000,
"line_mean": 14.3544973545,
"line_max": 90,
"alpha_frac": 0.6211582012,
"autogenerated": false,
"ratio": 3.81134401972873,
"config_test": false,
... |
APPLICATION_DATA = (
(730, 'Counter-Strike: Global Offensive', 'csgo'),
(620, 'Portal 2', 'portal2'),
(723, 'Steam', 'steam'),
(570, 'Dota 2', 'dota2'),
(440, 'Team Fortress 2', 'tf2')
)
APP_IDS = []
APP_NAMES = {}
APP_SHORT_NAMES = {}
APP_SHORT_NAME_TO_ID = {}
def __init_modul... | {
"repo_name": "ClifHouck/desperado",
"path": "desperado/data.py",
"copies": "1",
"size": "1175",
"license": "bsd-3-clause",
"hash": 6404979557817983000,
"line_mean": 26.3255813953,
"line_max": 70,
"alpha_frac": 0.6153191489,
"autogenerated": false,
"ratio": 2.8381642512077296,
"config_test": fa... |
""" Application entrypoint
"""
import argparse
import os
import os.path as path
import sys
import textwrap
import uuid
import yaml
from prettytable import PrettyTable
from termcolor import colored
from conjureup import __version__ as VERSION
from conjureup import async, consts, controllers, utils
from conjureup.app_... | {
"repo_name": "battlemidget/conjure-up",
"path": "conjureup/app.py",
"copies": "1",
"size": "11491",
"license": "mit",
"hash": 8045641459085238000,
"line_mean": 37.3033333333,
"line_max": 79,
"alpha_frac": 0.5642676878,
"autogenerated": false,
"ratio": 4.027690150718542,
"config_test": true,
... |
"""Application environment.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import abc
import logging
import os
import six
from treadmill import watchdog
_LOGGER = logging.getLogger(__name__)
@six.add_metacl... | {
"repo_name": "bretttegart/treadmill",
"path": "lib/python/treadmill/appenv/appenv.py",
"copies": "1",
"size": "3322",
"license": "apache-2.0",
"hash": 4484385793310961000,
"line_mean": 30.3396226415,
"line_max": 78,
"alpha_frac": 0.5927152318,
"autogenerated": false,
"ratio": 3.298907646474677,
... |
"""Application environments, which determine the servers, database and other
conditions for deployment.
"""
from fabric.api import require, env
import os
from buedafab import aws
def _not_localhost():
"""All non-localhost environments need to install the "production" pip
requirements, which typically includes... | {
"repo_name": "alexmerser/ops",
"path": "buedafab/environments.py",
"copies": "3",
"size": "4285",
"license": "mit",
"hash": -7307526362049874000,
"line_mean": 34.7083333333,
"line_max": 80,
"alpha_frac": 0.6665110852,
"autogenerated": false,
"ratio": 4.057765151515151,
"config_test": false,
... |
"""Application factory."""
from flask import Flask
from flask.ext.security import SQLAlchemyUserDatastore
from xmas.core import db, mail, security
from xmas.models import Role, User
from xmas.utils import register_blueprints
__all__ = 'create_app',
def create_app(package_name, package_path, settings_override=None,... | {
"repo_name": "dirn/Secret-Santa",
"path": "xmas/factory.py",
"copies": "1",
"size": "1217",
"license": "bsd-3-clause",
"hash": 8908976718662456000,
"line_mean": 28.6829268293,
"line_max": 71,
"alpha_frac": 0.687756779,
"autogenerated": false,
"ratio": 3.964169381107492,
"config_test": false,
... |
"""Application factory."""
from flask import Flask
from flask_security import SQLAlchemyUserDatastore
from pygotham.core import db, mail, migrate, security
from pygotham.models import Role, User
from pygotham.utils import check_required_settings, register_blueprints
__all__ = ('create_app',)
def create_app(package... | {
"repo_name": "djds23/pygotham-1",
"path": "pygotham/factory.py",
"copies": "1",
"size": "1335",
"license": "bsd-3-clause",
"hash": 8824202032778256000,
"line_mean": 30.0465116279,
"line_max": 71,
"alpha_frac": 0.6943820225,
"autogenerated": false,
"ratio": 3.892128279883382,
"config_test": fal... |
# Application file
#
# Simple application to add a business and list businesses
from flask import Flask, url_for
from flask import request, render_template, flash, redirect
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.security import Security, utils
import forms
from forms import BizForm, AddBiz
# Cr... | {
"repo_name": "akaak/flask-mega-tutorial",
"path": "part-iii-forms/app.py",
"copies": "1",
"size": "1658",
"license": "bsd-3-clause",
"hash": 36544880659954710,
"line_mean": 23.0289855072,
"line_max": 78,
"alpha_frac": 0.6314837153,
"autogenerated": false,
"ratio": 3.5809935205183585,
"config_t... |
"""Application framework.
This framework is somewhat opinionated; it assumes that applications
need four pieces being initialized before start:
* contextlib.ExitStack
* garage.parameters
* garage.parts
* logging
(At least in my use cases, they are almost ubiquitous.)
"""
__all__ = [
'App',
'ensure_app... | {
"repo_name": "clchiou/garage",
"path": "py/garage/garage/apps.py",
"copies": "1",
"size": "10651",
"license": "mit",
"hash": -1834513047060682500,
"line_mean": 29.6945244957,
"line_max": 79,
"alpha_frac": 0.6170312647,
"autogenerated": false,
"ratio": 3.9801943198804186,
"config_test": true,
... |
"""Application helper utilities."""
import importlib
import pkgutil
from flask import Blueprint
__all__ = ('check_required_settings', 'register_blueprints',)
DOES_NOT_EXIST = '!@DNE@!' # Placeholder value to use for missing settings.
REQUIRED_SETTINGS = 'SECRET_KEY', 'SECURITY_PASSWORD_SALT'
def check_required_s... | {
"repo_name": "djds23/pygotham-1",
"path": "pygotham/utils.py",
"copies": "3",
"size": "1025",
"license": "bsd-3-clause",
"hash": 7247918413007204000,
"line_mean": 34.3448275862,
"line_max": 78,
"alpha_frac": 0.6595121951,
"autogenerated": false,
"ratio": 3.8679245283018866,
"config_test": fals... |
# application import
from content.models import Image
from models import Season
class GamePhotoHelper:
"""Helper classs to prepare Game photo view data"""
def __init__(self):
pass
@classmethod
def get_photos(self, albumn_slug):
"""Get photos by slug for a view"""
photo... | {
"repo_name": "vollov/lotad",
"path": "game/service.py",
"copies": "1",
"size": "2228",
"license": "mit",
"hash": 3605851955243056600,
"line_mean": 27.2025316456,
"line_max": 99,
"alpha_frac": 0.4842908438,
"autogenerated": false,
"ratio": 3.9087719298245616,
"config_test": false,
"has_no_key... |
"""Application initialization and running."""
# Copyright © 2014 Mikko Ronkainen <firstname@mikkoronkainen.com>
# License: MIT, see the LICENSE file.
import configparser as cp
import distutils.util as du
import sfml as sf
from pymazing import framebuffer, game_state_simple_cube, game_state_loaded_level, gam... | {
"repo_name": "mikoro/pymazing",
"path": "pymazing/application.py",
"copies": "1",
"size": "1899",
"license": "mit",
"hash": -6815901433268958000,
"line_mean": 36.7346938776,
"line_max": 94,
"alpha_frac": 0.7012644889,
"autogenerated": false,
"ratio": 3.65,
"config_test": true,
"has_no_keywor... |
APPLICATION_LABEL = 'cog'
PURPOSE_TYPES = (
'Overall Project Coordination',
'Steering Committee',
'Design',
'Design and Implementation Review',
'Task Prioritization',
'Requirements Identification',
'S... | {
"repo_name": "sashakames/COG",
"path": "cog/models/constants.py",
"copies": "2",
"size": "6453",
"license": "bsd-3-clause",
"hash": 2739642855856173600,
"line_mean": 38.8333333333,
"line_max": 198,
"alpha_frac": 0.5409886874,
"autogenerated": false,
"ratio": 3.7582993593476997,
"config_test": ... |
'''Application logic and muxing'''
from collections import defaultdict
import json
import logging
import re
import sys
import json
import urllib
from flask import url_for, session, request
import github
import github_comments
class PullRequest(object):
@staticmethod
def from_github(db, token, login, owner, ... | {
"repo_name": "danvk/better-pull-requests",
"path": "gitcritic.py",
"copies": "1",
"size": "7875",
"license": "apache-2.0",
"hash": -6767284965684197000,
"line_mean": 34.6334841629,
"line_max": 216,
"alpha_frac": 0.5594920635,
"autogenerated": false,
"ratio": 3.9081885856079404,
"config_test": ... |
"""Application management CLI"""
import os
from pathlib import Path
import sys
from sys import stderr
# noinspection PyPackageRequirements
from dotenv import load_dotenv
from typing import Dict
from flask_script import Manager, Shell
from psycopg2 import DatabaseError
from sqlalchemy.exc import StatementError
from pm... | {
"repo_name": "joeflack4/pma-api",
"path": "manage.py",
"copies": "1",
"size": "5506",
"license": "mit",
"hash": -1511081847432253200,
"line_mean": 28.7621621622,
"line_max": 79,
"alpha_frac": 0.6304031965,
"autogenerated": false,
"ratio": 3.766073871409029,
"config_test": false,
"has_no_keyw... |
"""Application management command utility functions"""
from collections import defaultdict
from django.core.exceptions import ValidationError
from django.db import transaction
from applications.api import derive_application_state
from applications.constants import APPROVED_APP_STATES
from applications.models import (... | {
"repo_name": "mitodl/bootcamp-ecommerce",
"path": "applications/management/utils.py",
"copies": "1",
"size": "6610",
"license": "bsd-3-clause",
"hash": 9168199669001570000,
"line_mean": 42.2026143791,
"line_max": 117,
"alpha_frac": 0.6593040847,
"autogenerated": false,
"ratio": 4.020681265206813... |
"""Application manager."""
import csv
import glob
import logging
import os
from flask_script import Manager, Shell
import xlrd
from pma_api import create_app, db
from pma_api.models import (Cache, Characteristic, CharacteristicGroup,
Country, Data, EnglishString, Geography, Indicator,
... | {
"repo_name": "jkpr/pma-api",
"path": "manage.py",
"copies": "1",
"size": "5082",
"license": "mit",
"hash": -4368485461093442600,
"line_mean": 26.7704918033,
"line_max": 79,
"alpha_frac": 0.6082251082,
"autogenerated": false,
"ratio": 3.7953696788648243,
"config_test": false,
"has_no_keywords... |
""" Application menu setup and callable actions
"""
import os
import sys
import collections
# local imports
import nginx
import php
import mysql
import config_loader
import package_installer
import system
import ssh
import vim
import wordpress
import letsencrypt
import postfix
from teminal_colors import echo
def menu... | {
"repo_name": "stef-k/starter",
"path": "menu.py",
"copies": "1",
"size": "4989",
"license": "mit",
"hash": -5550848467688631000,
"line_mean": 40.2314049587,
"line_max": 79,
"alpha_frac": 0.5339747444,
"autogenerated": false,
"ratio": 4.418954827280779,
"config_test": true,
"has_no_keywords":... |
import os, os.path
from sqlalchemy import select
from sqlalchemy.orm import column_property
from flask import current_app as app
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from flask_login import LoginManager
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
app.config['SQLALCHEMY_... | {
"repo_name": "0xquad/flask-app-template",
"path": "app.tmpl/models.py",
"copies": "1",
"size": "1705",
"license": "mit",
"hash": 4369501270483260400,
"line_mean": 24.0735294118,
"line_max": 90,
"alpha_frac": 0.682111437,
"autogenerated": false,
"ratio": 3.077617328519856,
"config_test": false,... |
"""Application Models"""
import os
class PEP(object):
LINE_READ_COUNT = 20
def __init__(self, pep_text):
self.pep_text = pep_text
@classmethod
def load_pep(cls, pep_number, directory):
if not os.path.isdir(directory):
raise ValueError('Unexpected directory value: %s' % di... | {
"repo_name": "kennethzfeng/pep-visualize",
"path": "app/models.py",
"copies": "1",
"size": "1805",
"license": "mit",
"hash": -2785282434247313000,
"line_mean": 29.0833333333,
"line_max": 74,
"alpha_frac": 0.5152354571,
"autogenerated": false,
"ratio": 3.993362831858407,
"config_test": false,
... |
# Application Name: medvid.io Demp App
# Description: Basic medvid.io web app implemented in Python 2.7. Requires medvid.io deveoper account.
# THIS APPLICATION IS FOR DEMO PURPOSES ONLY. IT HAS LIMITED SECURITY CAPABILITIES AND LIMITED ERROR HANDLING. DO NOT RUN THIS
# ON A PUBLIC WEB SERVER OR PRODUCTION ENVIRONMENT.... | {
"repo_name": "ReelDx/medvidio-webapp-demo",
"path": "bin/app.py",
"copies": "1",
"size": "15586",
"license": "mit",
"hash": -568817257387280960,
"line_mean": 40.2328042328,
"line_max": 336,
"alpha_frac": 0.6969074811,
"autogenerated": false,
"ratio": 2.9835375191424194,
"config_test": false,
... |
"""Application
"""
from snipping import engine
from snipping import key_bindings
from snipping import layout
from snipping import prompt_toolkit
from snipping.prompt_toolkit import buffers
from snipping.prompt_toolkit import style
from snipping.utils import fileutil
class Application(prompt_toolkit.Application):
... | {
"repo_name": "yittg/Snipping",
"path": "snipping/application.py",
"copies": "1",
"size": "1711",
"license": "mit",
"hash": 6018094522869136000,
"line_mean": 31.2830188679,
"line_max": 74,
"alpha_frac": 0.6440677966,
"autogenerated": false,
"ratio": 4.103117505995204,
"config_test": false,
"h... |
""" application page """
from PyQt5.QtWidgets import QWidget
from PyQt5 import QtCore, QtGui, QtWidgets
class Application(QWidget):
def __init__(self, parent=None):
super(Application, self).__init__(parent)
self.setupUi(self)
def setupUi(self, QWidget):
QWidget.setObjectName("QWidget... | {
"repo_name": "whuang001/cts",
"path": "gui/Application.py",
"copies": "1",
"size": "5436",
"license": "mit",
"hash": -7157054241950525000,
"line_mean": 55.0412371134,
"line_max": 89,
"alpha_frac": 0.6994113319,
"autogenerated": false,
"ratio": 3.7567380787836906,
"config_test": false,
"has_n... |
"""Application Programming Interface (API)"""
import re
import logging
from xml.etree.ElementTree import (
Element,
fromstring
)
from collections import OrderedDict
from io import BytesIO
from http import HTTPStatus
from typing import (
Any,
Callable,
Dict,
Iterator,
List,
Optional,
... | {
"repo_name": "MGHComputationalPathology/dicomweb-client",
"path": "src/dicomweb_client/api.py",
"copies": "1",
"size": "106071",
"license": "mit",
"hash": 3129006970129366000,
"line_mean": 34.0763888889,
"line_max": 142,
"alpha_frac": 0.5489153492,
"autogenerated": false,
"ratio": 4.515581098339... |
# /application/project.py
from portfolio.models import Project, needs_db
from portfolio.admin import needs_logged_in
from portfolio.application import application
from flask import abort, jsonify, request
@application.route("/api/projects/count")
@needs_db
def project_count(db_session):
""" Returns the number of ... | {
"repo_name": "TumblrCommunity/PowerPortfolio",
"path": "portfolio/application/project.py",
"copies": "1",
"size": "2605",
"license": "mit",
"hash": 8730913199126216000,
"line_mean": 26.4210526316,
"line_max": 71,
"alpha_frac": 0.5765834933,
"autogenerated": false,
"ratio": 3.9831804281345566,
... |
# ./application.py
from flask import Flask, jsonify, make_response, request, session, redirect
from apiclient.discovery import build
from apiclient.errors import HttpError
from oauth2client.tools import argparser
import isodate
import string
import random
import requests
import base64
import os
import urllib
import ba... | {
"repo_name": "achang97/YouTunes",
"path": "application.py",
"copies": "1",
"size": "15630",
"license": "mit",
"hash": 2341502402560118300,
"line_mean": 30.3855421687,
"line_max": 179,
"alpha_frac": 0.6142034549,
"autogenerated": false,
"ratio": 3.7781000725163163,
"config_test": true,
"has_n... |
# application.py
import wx
import sys
#from waxconfig import WaxConfig
#import font
class Application(wx.App):
def __init__(self, frameklass, *args, **kwargs):
# takes a frame *class* plus arbitrary options. these options will
# be passed to the frame constructor.
self.frameklass = framek... | {
"repo_name": "bblais/plasticity",
"path": "plasticity/dialogs/waxy/application.py",
"copies": "1",
"size": "1039",
"license": "mit",
"hash": -1217205376491620400,
"line_mean": 31.46875,
"line_max": 75,
"alpha_frac": 0.624639076,
"autogenerated": false,
"ratio": 3.8058608058608057,
"config_test... |
# Released under the MIT licence.
# Copyright (C) Peter Hinch 2018
# The App class emulates a user application intended to service a single
# client. In this case we have four instances of the application servicing
# clients with ID's 1-4.
import uasyncio as asyncio
loop = asyncio.get_event_loop(runq_len=32, waitq_l... | {
"repo_name": "peterhinch/micropython-samples",
"path": "resilient/application.py",
"copies": "1",
"size": "2171",
"license": "mit",
"hash": -129621345335257170,
"line_mean": 32.921875,
"line_max": 79,
"alpha_frac": 0.6153846154,
"autogenerated": false,
"ratio": 3.8021015761821366,
"config_test... |
import hashlib
import os
class chayi():
def __init__(self,old_path,new_path):
self.old_path=old_path #定义旧代码的目录
self.new_path=new_path #定义新代码的目录
def md5(self,data):
key=hashlib.md5(bytes("007",encoding="utf-8"))
key.update(data)
result=key.hexdigest()
return result
... | {
"repo_name": "xiaoyongaa/ALL",
"path": "python最新函数/差异.py",
"copies": "1",
"size": "2479",
"license": "apache-2.0",
"hash": 7087643319016135000,
"line_mean": 29.8888888889,
"line_max": 78,
"alpha_frac": 0.4822312191,
"autogenerated": false,
"ratio": 2.8758085381630014,
"config_test": false,
"... |
import socket,os,pickle
ip_port=("127.0.0.1",9999)
server=socket.socket()
server.bind(ip_port)
server.listen() #监听端口
def connect():
while True:
conn,addr=server.accept()
while True:
try:
print("等待")
#等待电话打进来
print("电话来了")
... | {
"repo_name": "xiaoyongaa/ALL",
"path": "最新socket网络编程/简单socket例子(server).py",
"copies": "1",
"size": "1690",
"license": "apache-2.0",
"hash": 8120792307286840000,
"line_mean": 29.0769230769,
"line_max": 86,
"alpha_frac": 0.429028133,
"autogenerated": false,
"ratio": 3.4,
"config_test": false,
... |
import socket,pickle
ip_port=("192.168.1.10",9999)
client=socket.socket() #声明socket类型对象
client.connect(ip_port)
while True:
inp=input("请输入你要发送的文字>>>:").strip()
if len(inp)==0:continue
client.send(bytes(inp,encoding="utf-8")) #发送第一次信息
stat=str(client.recv(1024),encoding="utf-8")
print(stat)
if ... | {
"repo_name": "xiaoyongaa/ALL",
"path": "最新socket网络编程/简单socket例子(client).py",
"copies": "1",
"size": "1480",
"license": "apache-2.0",
"hash": -5820689534308806000,
"line_mean": 26.7142857143,
"line_max": 55,
"alpha_frac": 0.5014727541,
"autogenerated": false,
"ratio": 2.8710359408033828,
"confi... |
import paramiko
import sys
import os
import socket
def run():
host_list=[{"host":"192.168.1.10","username":"root","port":"22","password":"1","auth_id":"p"},
{"host":"192.168.1.11","username":"root","port":"22","password":"1","auth_id":"r"},
{"host":"192.168.1.12","username":"root","port... | {
"repo_name": "xiaoyongaa/ALL",
"path": "paramiko目录/终极版本适应框架.py",
"copies": "1",
"size": "1958",
"license": "apache-2.0",
"hash": -5628242467332687000,
"line_mean": 30.4333333333,
"line_max": 98,
"alpha_frac": 0.5455991516,
"autogenerated": false,
"ratio": 3.1804384485666106,
"config_test": fal... |
#!/application/python3.5/bin/python3.5
import paramiko
import sys
import os
import select
import tty
import termios
from paramiko.py3compat import u
ip="192.168.1.11"
port=22
username="x"
password="1"
tran=paramiko.Transport((ip,port))
tran.start_client()
tran.auth_password(username,password)
chan=tran.open_session() ... | {
"repo_name": "xiaoyongaa/ALL",
"path": "paramiko目录/paramiko模块之肆意妄为.py",
"copies": "1",
"size": "1342",
"license": "apache-2.0",
"hash": -3598382750280346600,
"line_mean": 25.2,
"line_max": 79,
"alpha_frac": 0.6358234295,
"autogenerated": false,
"ratio": 2.5063829787234044,
"config_test": false... |
#!/application/python3.5/bin/python3.5
import paramiko
import sys
import os
import socket
import getpass
from paramiko.py3compat import u
# windows does not have termios...
#判断主机为linux还是windows
try:
import termios #判断主机为linux还是windows
import tty
has_termios=True
print("this is linux")
except Exceptio... | {
"repo_name": "xiaoyongaa/ALL",
"path": "paramiko目录/终极版本.py",
"copies": "1",
"size": "4515",
"license": "apache-2.0",
"hash": 1318886414157745700,
"line_mean": 29.6470588235,
"line_max": 98,
"alpha_frac": 0.5063594912,
"autogenerated": false,
"ratio": 3.1882172915072684,
"config_test": false,
... |
"""Application registry."""
import collections
import inspect
from .common import ResourceID
from .typings import ResourceIdentifier
class Registry(collections.UserDict):
"""
JSON API application registry.
This is a dictionary created on JSON API application set up.
It contains a mapping between ty... | {
"repo_name": "vovanbo/aiohttp_json_api",
"path": "aiohttp_json_api/registry.py",
"copies": "1",
"size": "2054",
"license": "mit",
"hash": 959521360515591600,
"line_mean": 31.6031746032,
"line_max": 78,
"alpha_frac": 0.5666991237,
"autogenerated": false,
"ratio": 4.514285714285714,
"config_test... |
#Application Requirements:
# Python 3.X (Latest is recommended)
# Pillow Image Library
# Tkinter GUI Library (comes by default with Python Build, just make sure though
import sys, os;
import time;
from multiprocessing import Process;
import _thread as thread;
#from tkinter import Tk, Button, Menu, Canva... | {
"repo_name": "duaraghav8/LILY",
"path": "engine.py",
"copies": "1",
"size": "11523",
"license": "mit",
"hash": -1958456998744605400,
"line_mean": 32.2946428571,
"line_max": 205,
"alpha_frac": 0.6355983685,
"autogenerated": false,
"ratio": 3.0172820109976435,
"config_test": false,
"has_no_key... |
#!/Applications/Anaconda3/anaconda/bin/python
# https://www.thecodeship.com/web-development/proxypy-cross-domain-javascript-requests-python/
from flask import Flask, request, Response, render_template, send_from_directory
import json
import proxypy
import urllib.parse
import os
app = Flask(__name__,static_folder='pu... | {
"repo_name": "zmijunkie/elm_haltestellen_monitor_bootstrap4",
"path": "server.py",
"copies": "1",
"size": "1405",
"license": "bsd-2-clause",
"hash": 2903474493433083400,
"line_mean": 33.2926829268,
"line_max": 109,
"alpha_frac": 0.7231316726,
"autogenerated": false,
"ratio": 3.1859410430839,
"... |
#!/Applications/anaconda/envs/imgPIL/bin
# Python Challenge - 11
# http://www.pythonchallenge.com/pc/return/5808.html
# Username: huge; Password: file
# Keyword: evil
'''
Uses Anaconda environment with Pillow for image processing
- Python 3.7, numpy, and Pillow (PIL)
- Run `source activate imgPIL`, `python cha... | {
"repo_name": "HKuz/PythonChallenge",
"path": "Challenges/chall_11.py",
"copies": "1",
"size": "1455",
"license": "mit",
"hash": 9140503849155127000,
"line_mean": 28.693877551,
"line_max": 72,
"alpha_frac": 0.606185567,
"autogenerated": false,
"ratio": 3.1699346405228757,
"config_test": false,
... |
#!/Applications/anaconda/envs/imgPIL/bin
# Python Challenge - 14
# http://www.pythonchallenge.com/pc/return/italy.html
# Username: huge; Password: file
# Keyword: cat
'''
Uses Anaconda environment with Pillow for image processing
- Python 3.7, numpy, and Pillow (PIL)
- Run `source activate imgPIL`, `python cha... | {
"repo_name": "HKuz/PythonChallenge",
"path": "Challenges/chall_14.py",
"copies": "1",
"size": "2330",
"license": "mit",
"hash": -1914488259990793500,
"line_mean": 29.2597402597,
"line_max": 66,
"alpha_frac": 0.5497854077,
"autogenerated": false,
"ratio": 3.4416543574593796,
"config_test": fals... |
#!/Applications/anaconda/envs/imgPIL/bin
# Python Challenge - 16
# www.pythonchallenge.com/pc/return/mozart.html
# Username: huge; Password: file
# Keyword: romance
'''
Uses Anaconda environment with Pillow for image processing
- Python 3.7, numpy, and Pillow (PIL)
- Run `source activate imgPIL`, `python chall... | {
"repo_name": "HKuz/PythonChallenge",
"path": "Challenges/chall_16.py",
"copies": "1",
"size": "1552",
"license": "mit",
"hash": 2186771597907513900,
"line_mean": 28.8461538462,
"line_max": 68,
"alpha_frac": 0.612757732,
"autogenerated": false,
"ratio": 3.2605042016806722,
"config_test": false,... |
#!/Applications/anaconda/envs/imgPIL/bin
# Python Challenge - 22
# http://www.pythonchallenge.com/pc/hex/copper.html
# http://www.pythonchallenge.com/pc/hex/white.gif
# Username: butter; Password: fly
# Keyword: bonus
'''
Uses Anaconda environment with Pillow for image processing
- Python 3.7, numpy, and Pillow (P... | {
"repo_name": "HKuz/PythonChallenge",
"path": "Challenges/chall_22.py",
"copies": "1",
"size": "2224",
"license": "mit",
"hash": -3107083838477155300,
"line_mean": 31.231884058,
"line_max": 78,
"alpha_frac": 0.5431654676,
"autogenerated": false,
"ratio": 3.598705501618123,
"config_test": false,... |
#!/Applications/anaconda/envs/imgPIL/bin
# Python Challenge - 25
# http://www.pythonchallenge.com/pc/hex/lake.html
# Username: butter; Password: fly
# Keyword: decent
'''
Uses Anaconda environment with Pillow for image processing
- Python 3.7, numpy, and Pillow (PIL)
- Run `source activate imgPIL`, `python cha... | {
"repo_name": "HKuz/PythonChallenge",
"path": "Challenges/chall_25.py",
"copies": "1",
"size": "2083",
"license": "mit",
"hash": 8976935247152338000,
"line_mean": 33.7166666667,
"line_max": 79,
"alpha_frac": 0.618819011,
"autogenerated": false,
"ratio": 3.1898928024502298,
"config_test": false,... |
#!/Applications/anaconda/envs/imgPIL/bin
# Python Challenge - 27
# http://www.pythonchallenge.com/pc/hex/speedboat.html
# http://www.pythonchallenge.com/pc/hex/zigzag.gif
# Username: butter; Password: fly
# Keyword: ../ring/bell.html, repeat, switch
'''
Uses Anaconda environment with Pillow for image processing
- ... | {
"repo_name": "HKuz/PythonChallenge",
"path": "Challenges/chall_27.py",
"copies": "1",
"size": "1899",
"license": "mit",
"hash": 8282176164191294000,
"line_mean": 29.6290322581,
"line_max": 77,
"alpha_frac": 0.5681937862,
"autogenerated": false,
"ratio": 3.246153846153846,
"config_test": false,... |
#!/Applications/anaconda/envs/imgPIL/bin
# Python Challenge - 28
# http://www.pythonchallenge.com/pc/ring/bell.html
# http://www.pythonchallenge.com/pc/ring/green.html
# Username: repeat; Password: switch
# Keyword: guido
'''
Uses Anaconda environment with Pillow for image processing
- Python 3.7, numpy, and Pillo... | {
"repo_name": "HKuz/PythonChallenge",
"path": "Challenges/chall_28.py",
"copies": "1",
"size": "1199",
"license": "mit",
"hash": -1396793311569825000,
"line_mean": 27.5476190476,
"line_max": 77,
"alpha_frac": 0.6055045872,
"autogenerated": false,
"ratio": 3.214477211796247,
"config_test": false... |
#!/Applications/anaconda/envs/imgPIL/bin
# Python Challenge - 30
# http://www.pythonchallenge.com/pc/ring/yankeedoodle.html
# http://www.pythonchallenge.com/pc/ring/yankeedoodle.csv
# Username: repeat; Password: switch
# Keyword: grandpa
'''
Uses Anaconda environment with Pillow for image processing
- Python 3.7, ... | {
"repo_name": "HKuz/PythonChallenge",
"path": "Challenges/chall_30.py",
"copies": "1",
"size": "1730",
"license": "mit",
"hash": 4410425752049177000,
"line_mean": 31.641509434,
"line_max": 76,
"alpha_frac": 0.576300578,
"autogenerated": false,
"ratio": 3.0948121645796065,
"config_test": false,
... |
#!/Applications/anaconda/envs/imgPIL/bin
# Python Challenge - 31
# http://www.pythonchallenge.com/pc/ring/grandpa.html
# http://www.pythonchallenge.com/pc/rock/grandpa.html
# Username: repeat; Password: switch
# Keyword: kohsamui, thailand; arecibo
'''
Uses Anaconda environment with Pillow for image processing
- P... | {
"repo_name": "HKuz/PythonChallenge",
"path": "Challenges/chall_31.py",
"copies": "1",
"size": "2272",
"license": "mit",
"hash": -2450235680595348000,
"line_mean": 30.5555555556,
"line_max": 73,
"alpha_frac": 0.542693662,
"autogenerated": false,
"ratio": 3.2,
"config_test": false,
"has_no_key... |
#!/Applications/anaconda/envs/imgPIL/bin
# Python Challenge - 33
# http://www.pythonchallenge.com/pc/rock/beer.html
# http://www.pythonchallenge.com/pc/rock/beer2.png
# Username: kohsamui; Password: thailand
# Keyword: gremlins
'''
Uses Anaconda environment with Pillow for image processing
- Python 3.7, numpy, and... | {
"repo_name": "HKuz/PythonChallenge",
"path": "Challenges/chall_33.py",
"copies": "1",
"size": "1955",
"license": "mit",
"hash": -2832526241788979000,
"line_mean": 31.5833333333,
"line_max": 77,
"alpha_frac": 0.5887468031,
"autogenerated": false,
"ratio": 3.33617747440273,
"config_test": false,... |
#!/Applications/anaconda/envs/imgPIL/bin
# Python Challenge - 7
# http://www.pythonchallenge.com/pc/def/hockey.html
# http://www.pythonchallenge.com/pc/def/oxygen.html
# Keyword: integrity
'''
Uses Anaconda environment with Pillow for image processing
- Python 3.7, numpy, and Pillow (PIL)
- Run `source activat... | {
"repo_name": "HKuz/PythonChallenge",
"path": "Challenges/chall_07.py",
"copies": "1",
"size": "1417",
"license": "mit",
"hash": -4766237816565861000,
"line_mean": 26.25,
"line_max": 66,
"alpha_frac": 0.6224417784,
"autogenerated": false,
"ratio": 3.2058823529411766,
"config_test": false,
"ha... |
#!/Applications/anaconda/envs/imgPIL/bin
# Python Challenge - 9
# http://www.pythonchallenge.com/pc/return/good.html
# Username: huge; Password: file
# Keywords: cow, bull
'''
Uses Anaconda environment with Pillow for image processing
- Python 3.7, numpy, and Pillow (PIL)
- Run `source activate imgPIL`, `pytho... | {
"repo_name": "HKuz/PythonChallenge",
"path": "Challenges/chall_09.py",
"copies": "1",
"size": "6844",
"license": "mit",
"hash": -6436411643647133000,
"line_mean": 50.8484848485,
"line_max": 79,
"alpha_frac": 0.5562536528,
"autogenerated": false,
"ratio": 2.2395287958115184,
"config_test": fals... |
#!/Applications/anaconda/envs/Python3/bin
def main():
'''Examples Using Exceptions in Python'''
# Python exceptions: http://docs.python.org/library/exceptions.html
# Catch exceptions with try
try:
f = open('noFile.txt')
except IOError as e:
print('Oh no, IOError:', e)
except Va... | {
"repo_name": "HKuz/Test_Code",
"path": "exceptions.py",
"copies": "1",
"size": "1762",
"license": "mit",
"hash": 1331444594956361700,
"line_mean": 24.1714285714,
"line_max": 79,
"alpha_frac": 0.5828603859,
"autogenerated": false,
"ratio": 4.16548463356974,
"config_test": false,
"has_no_keywo... |
#!/Applications/anaconda/envs/Python3/bin
import re
def main():
'''Examples Using Regular Expressions in Python'''
printRomanNumerals('sonnets.txt')
replaceWord('sonnets.txt', 'beauty', 'vomit')
# replaceWord('sonnets.txt', 'love', 'shart')
return 0
def printRomanNumerals(filename):
'''Re... | {
"repo_name": "HKuz/Test_Code",
"path": "Regex/regex.py",
"copies": "1",
"size": "1298",
"license": "mit",
"hash": -6238065345010001000,
"line_mean": 24.4509803922,
"line_max": 73,
"alpha_frac": 0.6171032357,
"autogenerated": false,
"ratio": 3.615598885793872,
"config_test": false,
"has_no_ke... |
#!/Applications/anaconda/envs/Python3/bin
import sys
def main():
'''Python 3 Quick Start Code Examples'''
# Get input from user and display it
# feels = input("On a scale of 1-10, how do you feel? ")
# print("You selected: {}".format(feels))
# Python Data Types
integer = 42
floater = 3.1... | {
"repo_name": "HKuz/Test_Code",
"path": "setup.py",
"copies": "1",
"size": "4412",
"license": "mit",
"hash": 3006655741803645000,
"line_mean": 32.1729323308,
"line_max": 98,
"alpha_frac": 0.5410244787,
"autogenerated": false,
"ratio": 3.75809199318569,
"config_test": false,
"has_no_keywords":... |
# Application Scope Bucket
from datetime import datetime
import json
from kii import exceptions as exc, results as rs
from kii.data.clauses import (
Clause,
AllClause,
AndClause,
)
from kii.helpers import BucketsHelper
# Manage Buckets
class ManageBuckets(BucketsHelper):
def __init__(self, scope, buc... | {
"repo_name": "ta2xeo/python3-kii",
"path": "kii/data/application/__init__.py",
"copies": "1",
"size": "15123",
"license": "mit",
"hash": -5617599474132138000,
"line_mean": 25.8614564831,
"line_max": 100,
"alpha_frac": 0.5939959003,
"autogenerated": false,
"ratio": 4.043582887700535,
"config_te... |
"""Application settings."""
from os import environ as env
from pygotham.utils import DOES_NOT_EXIST
def bool_(key, default):
"""Return an environment setting represented as a boolean."""
return env.get(key, str(default)).lower() == 'true'
DEBUG = bool_('DEBUG', False)
SECRET_KEY = env.get('SECRET_KEY', DO... | {
"repo_name": "djds23/pygotham-1",
"path": "pygotham/settings.py",
"copies": "1",
"size": "1644",
"license": "bsd-3-clause",
"hash": 405854103931126500,
"line_mean": 29.4444444444,
"line_max": 74,
"alpha_frac": 0.7378345499,
"autogenerated": false,
"ratio": 3.010989010989011,
"config_test": fal... |
"""Applications filters"""
import pytest
from applications.constants import (
ALL_REVIEW_STATUSES,
REVIEW_STATUS_REJECTED,
REVIEW_STATUS_APPROVED,
REVIEW_STATUS_PENDING,
)
from applications.factories import ApplicationStepSubmissionFactory
from applications.filters import ApplicationStepSubmissionFilte... | {
"repo_name": "mitodl/bootcamp-ecommerce",
"path": "applications/filters_test.py",
"copies": "1",
"size": "3114",
"license": "bsd-3-clause",
"hash": 1195086406913279000,
"line_mean": 33.9887640449,
"line_max": 93,
"alpha_frac": 0.7292870906,
"autogenerated": false,
"ratio": 4.146471371504661,
"... |
applications= ['jevans', 'jhoule', 'mpuello', 'kyang']
development= ['rdw', 'ysaxena', 'scarnes']
infrastructure= ['smeltzer', 'tpenn', 'awestfall']
df_app= df.loc[df.person.isin(applications)]
51 df_app_break= df_app.loc[df_app.component.isin(break_component)]
52 df_dev= df.loc[df.person.isin(de... | {
"repo_name": "artopping/nyu-python",
"path": "course2/data_project/test_data.py",
"copies": "1",
"size": "2474",
"license": "mit",
"hash": 5220973949052489000,
"line_mean": 43.1785714286,
"line_max": 110,
"alpha_frac": 0.6576394503,
"autogenerated": false,
"ratio": 3.0771144278606966,
"config_... |
"""Applications List Dialog"""
import logging
import sys
from PyQt5 import QtWidgets
import ui.functions
from database.db import Database
from helpers.functions import ham
from ui.window.ui_applications_list import (
Ui_AppListDialog,
)
logger = logging.getLogger(__name__)
class AppListDialog(QtWidgets.QDialog... | {
"repo_name": "hueyyeng/AssetsBrowser",
"path": "ui/dialog/applications_list.py",
"copies": "1",
"size": "1031",
"license": "mit",
"hash": -5430191292202712000,
"line_mean": 24.1463414634,
"line_max": 57,
"alpha_frac": 0.676042677,
"autogenerated": false,
"ratio": 3.6690391459074734,
"config_te... |
# application specific
from ..utils import flatten
from .grammar_parser import GrammarParser
from ..nodes import AST, ContainerNode, ListNode
from ..exceptions import TyrianSyntaxError, NoSuchGrammar
__all__ = ['Parser']
class Parser(object):
"""
Simplifies parsing
"""
def __init__(self, **kwargs):
... | {
"repo_name": "Mause/tyrian",
"path": "tyrian/typarser/typarser.py",
"copies": "1",
"size": "1925",
"license": "mit",
"hash": -3874144051819062300,
"line_mean": 27.7313432836,
"line_max": 78,
"alpha_frac": 0.558961039,
"autogenerated": false,
"ratio": 4.415137614678899,
"config_test": false,
... |
# application specific
from .utils import flatten
class AST(object):
"""
Is the overruling object returned from the \
:py:class:`Parser <tyrian.typarser.Parser>`
"""
def __init__(self, content):
self.content = content
def __repr__(self):
return '<AST len(content)=={}>'.format(... | {
"repo_name": "Mause/tyrian",
"path": "tyrian/nodes.py",
"copies": "1",
"size": "3450",
"license": "mit",
"hash": -5489936147959956000,
"line_mean": 23.2957746479,
"line_max": 77,
"alpha_frac": 0.5562318841,
"autogenerated": false,
"ratio": 3.9884393063583814,
"config_test": false,
"has_no_ke... |
# application specific
from ..utils import logger
logger = logger.getChild('LispRegistry')
if 'lisp_registry' not in globals():
lisp_registry = {}
def lisp_function(**kwargs):
"""
Registers decorated function in the lisp_registry
if the decorator is being used like so;
.. code-block:: python
... | {
"repo_name": "Mause/tyrian",
"path": "tyrian/lisp_runtime/registry.py",
"copies": "1",
"size": "1169",
"license": "mit",
"hash": -2521925242921467000,
"line_mean": 19.1551724138,
"line_max": 71,
"alpha_frac": 0.5962360992,
"autogenerated": false,
"ratio": 4.189964157706093,
"config_test": fals... |
"""Application-specific settings."""
import os
from django.conf import settings as _settings
from django.core.exceptions import ImproperlyConfigured
###############################################################################
# Single settings.
######################################################################... | {
"repo_name": "Moliholy/cvmfs-browser",
"path": "cvmfs_browser/app_settings.py",
"copies": "2",
"size": "9904",
"license": "bsd-3-clause",
"hash": -3714563299199048000,
"line_mean": 37.0923076923,
"line_max": 100,
"alpha_frac": 0.6153069467,
"autogenerated": false,
"ratio": 4.311710927296474,
"... |
APPLICATIONS_PREFIX = "/applications/plexmanager"
NAME = L('Title')
# make sure to replace artwork with what you want
# these filenames reference the example files in
# the Contents/Resources/ folder in the bundle
ART = 'art-default.jpg'
ICON = 'icon-default.png'
####################################################... | {
"repo_name": "rxsegrxup/PlexMan.bundle",
"path": "Contents/Code/__init__.py",
"copies": "3",
"size": "3741",
"license": "mit",
"hash": -746035014535664000,
"line_mean": 28.6904761905,
"line_max": 132,
"alpha_frac": 0.6233627372,
"autogenerated": false,
"ratio": 4.005353319057816,
"config_test"... |
#!/Applications/RevAssign.app/Contents/Resources/miniconda/bin/python
# 1. Treat the mpc file as a long string.
# 2. Find and replace a segment of that string with given args.
# 3. Save to a new mpc file.
import os
import sys
import pickle
import xlrd # tools for reading spreadsheets
import xlwt # tools for writing sp... | {
"repo_name": "nckz/RevAssign",
"path": "utils/findReplaceMPC.py",
"copies": "1",
"size": "1330",
"license": "bsd-2-clause",
"hash": -8789627225493460000,
"line_mean": 26.1428571429,
"line_max": 90,
"alpha_frac": 0.6466165414,
"autogenerated": false,
"ratio": 3.107476635514019,
"config_test": f... |
APPLICATION_STATUS_ACCEPTED = "accepted"
APPLICATION_STATUS_REJECTED = "rejected"
APPLICATION_STATUS_UPDATE_REQUEST = "update_request"
APPLICATION_STATUS_REVISIONS_REQUIRED = "revisions_required"
APPLICATION_STATUS_PENDING = "pending"
APPLICATION_STATUS_IN_PROGRESS = "in progress"
APPLICATION_STATUS_COMPLETED = "comple... | {
"repo_name": "DOAJ/doaj",
"path": "portality/constants.py",
"copies": "1",
"size": "1115",
"license": "apache-2.0",
"hash": -148926764080994370,
"line_mean": 30.8571428571,
"line_max": 60,
"alpha_frac": 0.7775784753,
"autogenerated": false,
"ratio": 3.420245398773006,
"config_test": false,
"... |
"""Application support library for using information exported by nameq."""
from __future__ import absolute_import
__all__ = [
"DEFAULT_STATEDIR",
"Feature",
"FeatureMonitor",
"log",
"remove_feature",
"set_feature",
]
import errno
import fcntl
import json
import logging
import os
import select... | {
"repo_name": "ninchat/nameq",
"path": "python/nameq/__init__.py",
"copies": "1",
"size": "9921",
"license": "mit",
"hash": 2429355859801083000,
"line_mean": 26.7122905028,
"line_max": 94,
"alpha_frac": 0.5604273763,
"autogenerated": false,
"ratio": 4.008484848484849,
"config_test": false,
"h... |
"""application_tags
Revision ID: 3dbf6db7f9eb
Revises: 7cf5787a089e
Create Date: 2019-01-08 20:51:11.845673
"""
# From: http://alembic.zzzcomputing.com/en/latest/cookbook.html#conditional-migration-elements
from alembic import op
import sqlalchemy as sa
import commandment.dbtypes
from alembic import context
# re... | {
"repo_name": "jessepeterson/commandment",
"path": "commandment/alembic/versions/3dbf6db7f9eb_application_tags.py",
"copies": "1",
"size": "1268",
"license": "mit",
"hash": -8172776586826064000,
"line_mean": 24.36,
"line_max": 94,
"alpha_frac": 0.6940063091,
"autogenerated": false,
"ratio": 3.363... |
# Application to pull streaming data from twitter and determine the sentiment of them.
from tweepy import Stream
from tweepy import OAuthHandler
from tweepy.streaming import StreamListener
import json
import sys
import webbrowser
import codecs
import csv
from string import punctuation
import matplotlib.pyplot as plt
im... | {
"repo_name": "Swaraj1998/MyCode",
"path": "ML-Workshop/Data/Twitter_Sentiment.py",
"copies": "1",
"size": "7162",
"license": "mit",
"hash": -5909815142245055000,
"line_mean": 34.4554455446,
"line_max": 142,
"alpha_frac": 0.5886623848,
"autogenerated": false,
"ratio": 3.5142296368989205,
"confi... |
# application to read CMAQ netCDF file and create
# desired CSV file, suitable for loading into DB
import numpy as np
import pandas as pd
import xarray as xr
import datetime
import yaml
# get file path configs
fd = open("./create_cmaq_csv_config.yml")
config = yaml.safe_load(fd)
fd.close()
cmaq2011 = config['cmaq201... | {
"repo_name": "mjstealey/exposures-api",
"path": "sample-data/cmaq-netcdf/create_cmaq_csv.py",
"copies": "2",
"size": "1654",
"license": "mit",
"hash": -6683876174513744000,
"line_mean": 34.1914893617,
"line_max": 322,
"alpha_frac": 0.6934703748,
"autogenerated": false,
"ratio": 2.881533101045296... |
'''Application used to generate KV code for BorderImages.'''
import kivy
kivy.require('1.9.2')
from kivy.app import App
from kivy.lang import Builder
from kivy.uix.widget import Widget
from kivy.uix.boxlayout import BoxLayout
from kivy.properties import (
BooleanProperty,
ListProperty,
StringProperty,
... | {
"repo_name": "rafalo1333/KivyBorderImageTool",
"path": "main.py",
"copies": "1",
"size": "2270",
"license": "mit",
"hash": 4236131175792662500,
"line_mean": 24.7954545455,
"line_max": 78,
"alpha_frac": 0.636123348,
"autogenerated": false,
"ratio": 3.8803418803418803,
"config_test": false,
"h... |
import json
from flask import Blueprint, request, url_for, jsonify, redirect, abort, current_app as app, session
from flask_genshi import Genshi, render_template
from flask_login import login_user, logout_user, login_required, current_user
from sqlalchemy import literal, text, and_, or_
from sqlalchemy.orm.exc import... | {
"repo_name": "0xquad/flask-app-template",
"path": "app.tmpl/views.py",
"copies": "1",
"size": "2237",
"license": "mit",
"hash": -515327245951839940,
"line_mean": 26.9625,
"line_max": 100,
"alpha_frac": 0.6477425123,
"autogenerated": false,
"ratio": 3.6672131147540985,
"config_test": false,
"... |
"""Application views."""
import csv
import itertools
import json
import math
import mimetypes
import os
import peewee
import secrets
import shutil
import traceback
from datetime import datetime
from io import BytesIO
import requests
import tablib
import yaml
from flask import (Response, abort, flash, jsonify, redir... | {
"repo_name": "Royal-Society-of-New-Zealand/NZ-ORCID-Hub",
"path": "orcid_hub/views.py",
"copies": "1",
"size": "165778",
"license": "mit",
"hash": 4529615198530900000,
"line_mean": 40.3308401895,
"line_max": 120,
"alpha_frac": 0.5566661439,
"autogenerated": false,
"ratio": 4.084308556505457,
"... |
#Applies an algorithm to significantly decimate dense microlens data (eg from wfirst data challenge) without losing information.
import numpy as np
import argparse
import matplotlib
import matplotlib.pyplot as plt
#The idea here is that we successively pass over the data, decimating progressive factors of two
#In each... | {
"repo_name": "JohnGBaker/gleam",
"path": "script/decimate.py",
"copies": "1",
"size": "11865",
"license": "apache-2.0",
"hash": 7788371446339336000,
"line_mean": 39.9137931034,
"line_max": 146,
"alpha_frac": 0.6227560051,
"autogenerated": false,
"ratio": 2.66270197486535,
"config_test": false,... |
"""Applies an OSMChange file to the database"""
import sys
import os
import time
import urllib2
import StringIO
import gzip
from datetime import datetime
from xml.sax import make_parser
from xml.sax.handler import ContentHandler
from pymongo import Connection
def convert_time(isotime):
"Returns the time string as... | {
"repo_name": "iandees/mongosm",
"path": "apply-osmchange.py",
"copies": "1",
"size": "7918",
"license": "mit",
"hash": -1486452090332511700,
"line_mean": 38.59,
"line_max": 125,
"alpha_frac": 0.4945693357,
"autogenerated": false,
"ratio": 4.187202538339503,
"config_test": false,
"has_no_keyw... |
"""Applies the APASS-based calibration to the resolved catalogues."""
import os
import glob
import numpy as np
from astropy import log
from astropy import table
from astropy.table import Table
from astropy.io import fits
from surveytools import SURVEYTOOLS_DATA
def get_calib_group(imagetbl="vphas-dr2-red-images.fit... | {
"repo_name": "barentsen/surveytools",
"path": "scripts/apply-calibration/apply-calibration.py",
"copies": "1",
"size": "4912",
"license": "mit",
"hash": -1729786211372585500,
"line_mean": 36.2121212121,
"line_max": 99,
"alpha_frac": 0.5981270358,
"autogenerated": false,
"ratio": 3.05282784338098... |
# app lives in a directory above our example
# project so we need to make sure it is findable on our path.
import sys
from os.path import abspath, dirname, join
PROJECT_DIR = abspath(dirname(__file__))
grandparent = abspath(join(PROJECT_DIR, '..'))
for path in (grandparent, PROJECT_DIR):
if path not in sys.path:
... | {
"repo_name": "madisona/django-contact-form",
"path": "example/settings.py",
"copies": "1",
"size": "4953",
"license": "bsd-3-clause",
"hash": -5600193003733385000,
"line_mean": 28.6586826347,
"line_max": 79,
"alpha_frac": 0.6743387846,
"autogenerated": false,
"ratio": 3.6259150805270863,
"conf... |
# app lives in a directory above our example
# project so we need to make sure it is findable on our path.
import sys
from os.path import abspath, dirname, join
parent = abspath(dirname(__file__))
grandparent = abspath(join(parent, '..'))
for path in (grandparent, parent):
if path not in sys.path:
sys.path.... | {
"repo_name": "imtapps/django-forms-ext",
"path": "example/settings.py",
"copies": "1",
"size": "1220",
"license": "bsd-2-clause",
"hash": 1489276251031723,
"line_mean": 23.4,
"line_max": 62,
"alpha_frac": 0.6819672131,
"autogenerated": false,
"ratio": 3.3795013850415514,
"config_test": false,
... |
# app lives in a directory above our example
# project so we need to make sure it is findable on our path.
import sys
import os
from os.path import abspath, dirname, join
parent = abspath(dirname(__file__))
grandparent = abspath(join(parent, '..'))
for path in (grandparent, parent):
if path not in sys.path:
... | {
"repo_name": "imtapps/django-admin-ext",
"path": "example/settings.py",
"copies": "1",
"size": "2126",
"license": "bsd-2-clause",
"hash": 8436451740365314000,
"line_mean": 31.2121212121,
"line_max": 117,
"alpha_frac": 0.6636876764,
"autogenerated": false,
"ratio": 3.729824561403509,
"config_te... |
# app lives in a directory above our example
# project so we need to make sure it is findable on our path.
import sys
from os.path import abspath, dirname, join
from os import pardir
PROJECT_DIR = abspath(dirname(__file__))
grandparent = abspath(join(PROJECT_DIR, pardir))
for path in (grandparent, PROJECT_DIR):
i... | {
"repo_name": "madisona/zendesk_django_auth",
"path": "example/settings.py",
"copies": "1",
"size": "1945",
"license": "bsd-3-clause",
"hash": -2876088033469813000,
"line_mean": 23.6329113924,
"line_max": 65,
"alpha_frac": 0.7064267352,
"autogenerated": false,
"ratio": 3.2255389718076284,
"conf... |
# App logic
from __future__ import print_function
import os
from . import keys
from . import readchar
from . import command
from . import renderer
from .filter import filter_commands
from sys import version_info, platform
if version_info[0] == 2:
keyboard_input = raw_input
else:
keyboard_input = input
def ge... | {
"repo_name": "pindexis/marker",
"path": "marker/core.py",
"copies": "1",
"size": "4866",
"license": "mit",
"hash": -8688739651781158000,
"line_mean": 31.0131578947,
"line_max": 141,
"alpha_frac": 0.6224825319,
"autogenerated": false,
"ratio": 3.777950310559006,
"config_test": false,
"has_no_... |
# app/logs.py
from logging import ERROR, DEBUG, Filter, Formatter, StreamHandler
from logging.handlers import TimedRotatingFileHandler
from flask import request
class ContextualFilter(Filter):
def filter(self, log_record):
log_record.url = request.path
log_record.method = request.method
... | {
"repo_name": "ChristopherGS/sensor_readings",
"path": "app/logs.py",
"copies": "2",
"size": "2009",
"license": "bsd-3-clause",
"hash": -3422077123448581000,
"line_mean": 32.5,
"line_max": 87,
"alpha_frac": 0.6455948233,
"autogenerated": false,
"ratio": 4.159420289855072,
"config_test": false,
... |
"""Apply a function passed as parameter.
Defaults to passing."""
import logging
import pypes.component
log = logging.getLogger(__name__)
class SingleFunction(pypes.component.Component):
"""
mandatory input packet attributes:
- data: the input to the function
optional input packet attributes:
-... | {
"repo_name": "Enucatl/pypes",
"path": "pypes/plugins/single_function.py",
"copies": "1",
"size": "1863",
"license": "apache-2.0",
"hash": -2654871278815607000,
"line_mean": 28.109375,
"line_max": 75,
"alpha_frac": 0.5507246377,
"autogenerated": false,
"ratio": 4.864229765013055,
"config_test":... |
""" Apply aggregate functions to data.
"""
from operator import itemgetter
from .buffer import _ReaderBuffer
from .buffer import _WriterBuffer
__all__ = "AggregateReader", "AggregateWriter"
class _Aggregator(object):
""" Base class for AggregateReader and AggregateWriter.
During aggregation, incoming... | {
"repo_name": "mdklatt/serial-python",
"path": "src/serial/core/reduce.py",
"copies": "1",
"size": "6042",
"license": "mit",
"hash": -7115087637715033000,
"line_mean": 34.3333333333,
"line_max": 80,
"alpha_frac": 0.5958291956,
"autogenerated": false,
"ratio": 5.064543168482817,
"config_test": f... |
#Apply a mask to a fasta file
#The mask contains [0-9] and possibly other characters (counts as -1)
#Replaces everything in the orginal fasta with Ns if it is below the integer level specified
#If no mask file is specificed, then it just produces an output that reads 0/1/2/3/4 according to
#whether the input is uncall... | {
"repo_name": "mathii/gdc",
"path": "maskfa.py",
"copies": "1",
"size": "2666",
"license": "apache-2.0",
"hash": 6165873969583507000,
"line_mean": 35.027027027,
"line_max": 112,
"alpha_frac": 0.5266316579,
"autogenerated": false,
"ratio": 3.7286713286713287,
"config_test": false,
"has_no_keyw... |
"""Apply arbitrary daily shifts within the climate file."""
import sys
import os
from datetime import date, timedelta
from pyiem.util import get_dbconn
from pandas.io.sql import read_sql
from tqdm import tqdm
MYHUCS = [x.strip() for x in open("myhucs.txt")]
FLOOR = date(2007, 1, 1)
CEILING = date(2020, 12, 31)
def ... | {
"repo_name": "akrherz/dep",
"path": "scripts/climatechange/shift_cli.py",
"copies": "2",
"size": "3360",
"license": "mit",
"hash": -8582318352226996000,
"line_mean": 35.1290322581,
"line_max": 77,
"alpha_frac": 0.524702381,
"autogenerated": false,
"ratio": 3.7086092715231787,
"config_test": fa... |
"""Apply arbitrary multiplier to baseline precip.
see GH #39
"""
import os
import sys
from multiprocessing import Pool
from tqdm import tqdm
def editor(arg):
"""Do the editing."""
fn, scenario, multiplier = arg
newfn = fn.replace("/i/0/", "/i/%s/" % (scenario,))
newdir = os.path.dirname(newfn)
i... | {
"repo_name": "akrherz/dep",
"path": "scripts/cligen/arb_precip_delta.py",
"copies": "2",
"size": "1552",
"license": "mit",
"hash": -7547725567089156000,
"line_mean": 24.4426229508,
"line_max": 78,
"alpha_frac": 0.5592783505,
"autogenerated": false,
"ratio": 3.6261682242990654,
"config_test": f... |
"""Apply a set of rolling filter to a data cube
This version takes a single CSV file as input parameter with optional job_id
parameter. This interface is optimized for submitting jobs on a Slurm cluster.
"""
import argparse
import os
from datetime import datetime
from glob import glob
from multiprocessing import Pool,... | {
"repo_name": "piyanatk/sim",
"path": "scripts/fg1p/apply_filters3.py",
"copies": "1",
"size": "5344",
"license": "mit",
"hash": 4169472958002339000,
"line_mean": 36.6338028169,
"line_max": 80,
"alpha_frac": 0.6122754491,
"autogenerated": false,
"ratio": 3.569806279225117,
"config_test": false,... |
"""Apply a set of rolling filter to a data cubes and separately save output
without stitching to form an image cube"""
import argparse
import os
from glob import glob
from multiprocessing import Pool, current_process
import numpy as np
import xarray as xr
from opstats.foreground import apply_filter
def run(binnum):... | {
"repo_name": "piyanatk/sim",
"path": "scripts/fg1p/apply_filters_nostitch.py",
"copies": "1",
"size": "3401",
"license": "mit",
"hash": -1063452672134457900,
"line_mean": 33.01,
"line_max": 80,
"alpha_frac": 0.6277565422,
"autogenerated": false,
"ratio": 3.2145557655954633,
"config_test": fals... |
"""Apply a set of rolling filter to a data cubes"""
import argparse
import os
from datetime import datetime
from glob import glob
from multiprocessing import Pool, Array, current_process
import numpy as np
import xarray as xr
from opstats.foreground import apply_filter
def do_mask(i):
process = current_process(... | {
"repo_name": "piyanatk/sim",
"path": "scripts/fg1p/apply_filters.py",
"copies": "1",
"size": "4384",
"license": "mit",
"hash": 32313809912170416,
"line_mean": 35.2314049587,
"line_max": 80,
"alpha_frac": 0.6204379562,
"autogenerated": false,
"ratio": 3.5241157556270095,
"config_test": false,
... |
"""Apply a set of rolling filter to a data cubes
This copy read complex filter dataset.
"""
import argparse
import os
from glob import glob
from multiprocessing import Pool, Array, current_process
import numpy as np
import xarray as xr
from opstats.foreground import apply_filter
def do_mask(i):
process = curre... | {
"repo_name": "piyanatk/sim",
"path": "scripts/fg1p/apply_filters2.py",
"copies": "1",
"size": "4136",
"license": "mit",
"hash": 7481226182816106000,
"line_mean": 34.3504273504,
"line_max": 78,
"alpha_frac": 0.6266924565,
"autogenerated": false,
"ratio": 3.4380714879467997,
"config_test": false... |
# applyconfidence.py
# Applies models that were trained by logisticconfidence.py in order to estimate
# the likely accuracy of page-level predictions for volumes. Accuracy is being
# estimated at the volume level so that users can choose to filter out volumes
# of dubious reliability.
# We're generating two kinds of ... | {
"repo_name": "tedunderwood/genre",
"path": "confidencefilter/applyconfidence.py",
"copies": "1",
"size": "17657",
"license": "mit",
"hash": -1804200273645564700,
"line_mean": 36.4883227176,
"line_max": 261,
"alpha_frac": 0.6541315059,
"autogenerated": false,
"ratio": 3.9150776053215077,
"confi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.