text
stringlengths
4
1.02M
meta
dict
""" Sample pyspark script to be uploaded to Cloud Storage and run on Cloud Dataproc. Note this file is not intended to be run directly, but run inside a PySpark environment. """ # [START dataproc_pyspark_sort] import pyspark sc = pyspark.SparkContext() rdd = sc.parallelize(["Hello,", "world!", "dog", "elephant", "pa...
{ "content_hash": "76fd6212dfa64c611db5963d8efd6d05", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 75, "avg_line_length": 26.8, "alnum_prop": 0.7263681592039801, "repo_name": "GoogleCloudPlatform/python-docs-samples", "id": "cecba896164a3b8b49421548096bc0254fb72724", "si...
from __future__ import unicode_literals from django.db import migrations def set_null_to_blank(queryset, fields): for element in queryset: for field in fields: value = getattr(element, field) if value is None: setattr(element, field, '') element.save() de...
{ "content_hash": "404047757d29ac0023d446a76b7672c1", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 67, "avg_line_length": 22.725, "alnum_prop": 0.5786578657865786, "repo_name": "rdmorganiser/rdmo", "id": "53d11bd7991817f20c073ea0767cd6db43ef8d36", "size": "983", "binar...
from django.shortcuts import HttpResponse, redirect from django.contrib.auth.models import User from django.contrib.auth import login, authenticate from django.middleware import csrf def index(request): if 'csrf_token' not in request.GET: added_query_string = '?csrf_token=%s' if len(request.GET) == 0 else ...
{ "content_hash": "d4c8c22e49f834f52c42270864f52740", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 101, "avg_line_length": 41.476190476190474, "alnum_prop": 0.6555683122847302, "repo_name": "STU-Fudan/Chitoge", "id": "bf8181b80ba0d5034d4d972a6d05018ba431813e", "size": "1...
from si7021 import * from bookshelf import * from adjustThermostat import * from setLightOn import * from setLightOff import * try: print ("Execute getTempC") print (getTempC()) except (IOError): print ("Failure to get Temperature") try: print ("Execute getHumidity") print (getHumidity()) exce...
{ "content_hash": "285d9d5fc7c9d91321718a3bcd817488", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 48, "avg_line_length": 21.918367346938776, "alnum_prop": 0.6675977653631285, "repo_name": "webbhm/OpenAg-MVP", "id": "f77fd5948ab7c15c33874ae4ff93b817956b4ddd", "size": "11...
from Isis.expressions import numpy_parse_eval_expr from Isis.iboost.general import sendErrorMsg, sendWarningMsg from Isis.iboost.rootio import treeToArray, arrayToTree from Isis.iroot import ROOT as rt from Isis.utils import string_list_filter from Isis.statistics import freq_eff import collections, math, numpy, panda...
{ "content_hash": "970f863a9fad457ea973920051e6b1f9", "timestamp": "", "source": "github", "line_count": 325, "max_line_length": 100, "avg_line_length": 33.60307692307693, "alnum_prop": 0.5212892592253456, "repo_name": "mrpPhys/Isis", "id": "da2174d193dc87c9a9d1234de66d267a78cb0b7b", "size": "11496"...
import pandas as pd import numpy as np import capstone_model as ccd import contestdata_preprocess as pp #*************************** STATICS ************************************ outputFile = "D:/DataScience/submission60.csv" IDcol = 'row_id' file_TrainValues = "D:/DataScience/pp_train_values.csv" file_Tra...
{ "content_hash": "cc51094e3849f57eb37539b497a99610", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 80, "avg_line_length": 34.72727272727273, "alnum_prop": 0.6138743455497382, "repo_name": "cbenge509/DataScienceCapstone_Oct2017", "id": "615b1c4c9d18cf9a00b0c4e152fd17d46f316...
class QuotesbotPipeline(object): def process_item(self, item, spider): return item
{ "content_hash": "65dad5885f736ad062a2ad4225bf5437", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 41, "avg_line_length": 31.666666666666668, "alnum_prop": 0.6947368421052632, "repo_name": "thetypist/scrappybot", "id": "2aff2d76ba60e71b0b4f006e955991239bacb4a8", "size": "...
""" randomMedia_Test.py Created by Nikolaus Sonnenschein on 2008-02-20. Copyright (c) 2008 Jacobs University of Bremen. All rights reserved. """ import unittest import copy from ifba.GlpkWrap.metabolism import Metabolism from ifba.GlpkWrap.randomMedia import Almaas from ifba.GlpkWrap import fluxdist, util class ran...
{ "content_hash": "32432f8415f2f9ce726317b1ef287b27", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 69, "avg_line_length": 29, "alnum_prop": 0.7122015915119363, "repo_name": "phantomas1234/fbaproject", "id": "2d5a287a55b9ac4549310eaa50ad7ddab6c4087b", "size": "794", "bi...
from __future__ import unicode_literals from builtins import str import unittest from django.contrib.contenttypes.models import ContentType from isisdata.models import ISODateValue, ISODateRangeValue, Attribute, AttributeType import datetime class TestISODateValue(unittest.TestCase): def setUp(self): val...
{ "content_hash": "c57529e78dc187e071a7fd12261182a9", "timestamp": "", "source": "github", "line_count": 141, "max_line_length": 86, "avg_line_length": 35.645390070921984, "alnum_prop": 0.6350974930362117, "repo_name": "upconsulting/IsisCB", "id": "a141fb348d236e36021d03eded1dce6da8190d51", "size": ...
import sys from pprint import pprint from django.core.management.base import BaseCommand, CommandError from fo2.connections import db_cursor_so class Command(BaseCommand): help = 'Mostra o count(*) de todas as tabelas do Systêxtil' def handle(self, *args, **options): try: systextil_conn...
{ "content_hash": "c8c7691304c6127dcd83b9d9ce47b0ee", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 72, "avg_line_length": 29.742857142857144, "alnum_prop": 0.5312199807877042, "repo_name": "anselmobd/fo2", "id": "84e9a84cf9e30adb5e515e5da96e8abd3135372f", "size": "1042",...
""" setup.py -allows the foodlog package to be installed via: $ python setup.py install -or installed for development via: $ python setup.py develop -once installed, the package can be imported from anywhere on the system (as opposed to just when within the same directory) """ from setup...
{ "content_hash": "787e2d0c275ae8e875cd18e6a7f2f7d2", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 82, "avg_line_length": 33.22727272727273, "alnum_prop": 0.6470588235294118, "repo_name": "oostin623/FoodLog", "id": "2ddc51521de9c0a1acc87c57feea432bd014f04a", "size": "731...
"""Reconstruction Evaluation.""" from os import path import numpy as np import tensorflow.compat.v1 as tf from tensorflow_graphics.projects.nasa.lib import datasets from tensorflow_graphics.projects.nasa.lib import models from tensorflow_graphics.projects.nasa.lib import utils tf.disable_eager_execution() flags = t...
{ "content_hash": "82795909eef8a21dbade35956412ccd7", "timestamp": "", "source": "github", "line_count": 153, "max_line_length": 80, "avg_line_length": 29.84967320261438, "alnum_prop": 0.5947011167068097, "repo_name": "tensorflow/graphics", "id": "3e7335ceb844d3fdd0595df24d693543b2aa483b", "size": "...
''' The MIT License (MIT) Copyright (c) 2016 WavyCloud Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, p...
{ "content_hash": "f135609f2f52d74472357faf64f03f21", "timestamp": "", "source": "github", "line_count": 181, "max_line_length": 665, "avg_line_length": 44.729281767955804, "alnum_prop": 0.7561758893280632, "repo_name": "wavycloud/pyboto3", "id": "fdffd5917166a55fe1f4a39d5361bee3fcf43964", "size": "...
import numpy as np import itertools import copy from dipy.segment.clustering import Cluster, ClusterCentroid from dipy.segment.clustering import ClusterMap, ClusterMapCentroid from dipy.segment.clustering import Clustering from nose.tools import assert_equal, assert_true, assert_false from numpy.testing import assert...
{ "content_hash": "c4e4e357a43c33f2a5a387cbb6a3679a", "timestamp": "", "source": "github", "line_count": 728, "max_line_length": 102, "avg_line_length": 34.61126373626374, "alnum_prop": 0.680080962019288, "repo_name": "rfdougherty/dipy", "id": "24b44f1dae65e238cf432f7c2474f980f4b16f58", "size": "251...
import os, psycopg2, urllib.parse from flask import Flask, request, g, url_for, render_template from contextlib import closing app = Flask(__name__) app.config.from_object(__name__) def connect_db(): urllib.parse.uses_netloc.append("postgres") url = urllib.parse.urlparse(os.environ["DATABASE_URL"]) conn = psycopg2...
{ "content_hash": "de2d19f4109281180af3de58f34d6119", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 85, "avg_line_length": 28.471698113207548, "alnum_prop": 0.6891981444665342, "repo_name": "drewdez/mlb-countdown", "id": "8a3c7ac40e06116ed9310e2328e0f3535bedd5f9", "size":...
from __future__ import unicode_literals from django.conf import settings import django.core.validators from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_...
{ "content_hash": "7b48c8d7162cbacfa202d64c5de93742", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 285, "avg_line_length": 56.72164948453608, "alnum_prop": 0.5732460923300617, "repo_name": "ServiceLearningB/ServiceLearningNew", "id": "63a888474c2bc9c711d0e91272d9ce6bae8428...
__author__ = 'ar' import glob import json import os from functools import wraps from app.backend.core import utils as dlsutils from app.backend.core.models.cfg import CFG_MODEL, CFG_SOLVER, CFG_MODEL_TRAIN, CFG_PROGRESS, \ PREFIX_SNAPSHOT, EXT_MODEL_WEIGHTS, PREFIX_TASKS_DIR, CFG_EVAL_ROC, PREFIX_EVAL_ROC_DIR, CF...
{ "content_hash": "93b14dac9f77cb6a0dbf3231e02a6122", "timestamp": "", "source": "github", "line_count": 256, "max_line_length": 130, "avg_line_length": 38.1796875, "alnum_prop": 0.5878862287702067, "repo_name": "SummaLabs/DLS", "id": "3f721065c0cd33da590da05dcc490f5eb95f7f59", "size": "9816", "bi...
""" sudo raspi-config enable spi spi documentation http://tightdev.net/SpiDev_Doc.pdf using an opamp to amplify audio line http://www.instructables.com/id/Arduino-Audio-Input/step3/Non-Inverting-Amplifier/ """ # works with MCP3008, ch0 # returns x/10ths of a volt import spidev import time import csv spi=spidev.SpiD...
{ "content_hash": "430b8d5bce05ba669492fa5c756e2896", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 159, "avg_line_length": 30.285714285714285, "alnum_prop": 0.6939203354297694, "repo_name": "mnr/rubberfish", "id": "e4e7f768c908f29bde9ae9f5f0eaafb2c5cc7afc", "size": "1908...
import sys, os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. sys.path.insert(0, os.path.abspath('../exts')) # -- General confi...
{ "content_hash": "6e47f0310882e24ff6ace3504e368761", "timestamp": "", "source": "github", "line_count": 213, "max_line_length": 80, "avg_line_length": 31.685446009389672, "alnum_prop": 0.703659801452067, "repo_name": "PointCloudLibrary/blog", "id": "691a7b33af4441aaf418bfc594d41f8752d4e334", "size"...
"""Basic Network packet types. Defines and Implements Basic Network packet types , such as Ethertnet and LLDP. """ # System imports from copy import deepcopy from enum import IntEnum # Local source tree imports from pyof.foundation.base import GenericStruct from pyof.foundation.basic_types import ( BinaryData, F...
{ "content_hash": "8a11a59dba4acebdb88fd55cc986cd06", "timestamp": "", "source": "github", "line_count": 792, "max_line_length": 94, "avg_line_length": 35.253787878787875, "alnum_prop": 0.6019125389491781, "repo_name": "kytos/python-openflow", "id": "ae6b1d05d44dca6f641d2e32d358f9b1aa5327f8", "size"...
from dronekit import * from dronedirect import DroneDirect # Libraries for UDS socket import socket import sys import math import json # Create a UDS socket sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) # Connect the socket to the port where the server is listening server_address = '/tmp/bci-data.sock' pr...
{ "content_hash": "71646218d9caff5a8adcaddd4ceabfb8", "timestamp": "", "source": "github", "line_count": 110, "max_line_length": 111, "avg_line_length": 32.527272727272724, "alnum_prop": 0.529346003353829, "repo_name": "Frijol/Drone-BCI", "id": "8e6676d9b778224ce17046ae665db16f38fbfd19", "size": "36...
"""Simple example of video playback. Usage:: video.py <filename> See the Programming Guide for a partial list of supported video formats. """ __docformat__ = 'restructuredtext' __version__ = '$Id$' import sys import pyglet if len(sys.argv) < 2: print(__doc__) sys.exit(1) source = pyglet.media.load(sy...
{ "content_hash": "8bb56f80bb165849c17dda0fb857fe43", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 72, "avg_line_length": 17.394736842105264, "alnum_prop": 0.686838124054463, "repo_name": "bitcraft/pyglet", "id": "a583a329a0233bee7c08b56ee6845d8f2bea213f", "size": "2398"...
from tempest_lib import exceptions as lib_exc from tempest.api.identity import base from tempest.common.utils import data_utils from tempest import test class TokensV3TestJSON(base.BaseIdentityV3AdminTest): @test.idempotent_id('0f9f5a5f-d5cd-4a86-8a5b-c5ded151f212') def test_tokens(self): # Valid us...
{ "content_hash": "6035bdf398579d36445689f830c07493", "timestamp": "", "source": "github", "line_count": 133, "max_line_length": 79, "avg_line_length": 46.30075187969925, "alnum_prop": 0.5808704124715817, "repo_name": "NexusIS/tempest", "id": "951bc78dd92d6a159100270c37174187b272b676", "size": "6794...
"""Django Celery Integration.""" # :copyright: (c) 2009 - 2012 by Ask Solem. # :license: BSD, see LICENSE for more details. from __future__ import absolute_import import os VERSION = (3, 0, 11) __version__ = ".".join(map(str, VERSION[0:3])) + "".join(VERSION[3:]) __author__ = "Ask Solem" __contact__ = "ask@celerypr...
{ "content_hash": "5c598ab54ed46523284fd5ebe1fd1225", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 75, "avg_line_length": 27, "alnum_prop": 0.677037037037037, "repo_name": "planorama/django-celery", "id": "ed1cde7381ee7cfea895c2373f74815bf4826518", "size": "675", "bina...
import os import signal import sys import traceback import threading from typing import Optional try: import PyQt5 except Exception: sys.exit("Error: Could not import PyQt5 on Linux systems, you may try 'sudo apt-get install python3-pyqt5'") from PyQt5.QtGui import QGuiApplication from PyQt5.QtWidgets import...
{ "content_hash": "293bceaf4b20798f13e738de6587fb33", "timestamp": "", "source": "github", "line_count": 336, "max_line_length": 143, "avg_line_length": 38.61309523809524, "alnum_prop": 0.5917989825805458, "repo_name": "fujicoin/electrum-fjc", "id": "0fa9095b130313ec1f625e794be57a288a5bd011", "size"...
from flask import Flask, request, url_for, render_template, flash, redirect, abort from jinja2 import evalcontextfilter, Markup, escape from flask_mail import Mail, Message from raven.contrib.flask import Sentry, Client from projects_controller import ProjectsController from redirects_controller import RedirectsControl...
{ "content_hash": "50743c10b51a084ab11f17245b01c25b", "timestamp": "", "source": "github", "line_count": 188, "max_line_length": 137, "avg_line_length": 32.547872340425535, "alnum_prop": 0.6554992645857166, "repo_name": "teslaworksumn/teslaworks.net", "id": "c699ed6a5e8a729b18fefd63cb3ec9494e4e611e", ...
from distutils.core import setup version = "0.7.1" setup(name="riemann-sumd", version=version, description="Python agent for scheduling event generating processes and sending the results to Riemann", author="Brian Hatfield", author_email="bmhatfield@gmail.com", url="https://github.com/bm...
{ "content_hash": "549430537a58313de1210a8fd700591b", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 110, "avg_line_length": 38.875, "alnum_prop": 0.5712754555198285, "repo_name": "crashlytics/riemann-sumd", "id": "89b9c9c13bd56effca48e605c22105ef61ec7dc2", "size": "955", ...
import os import unittest import collections from wordpress_xmlrpc import Client from wordpress_xmlrpc.compat import ConfigParser class WordPressTestCase(unittest.TestCase): def setUp(self): config = ConfigParser() with open('wp-config.cfg', 'r') as f: config.readfp(f) ...
{ "content_hash": "0d3895659b1f6b7e0fa4ec638043cd5e", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 66, "avg_line_length": 31.466666666666665, "alnum_prop": 0.590042372881356, "repo_name": "maxcutler/python-wordpress-xmlrpc", "id": "d95f10be9e8f582e18ec6e7e2d1e507a625a1202"...
import os import subprocess from ajenti.api import * from ajenti.plugins.main.api import SectionPlugin from ajenti.plugins.services.api import ServiceMultiplexor from ajenti.ui import on from ajenti.ui.binder import Binder from ajenti.util import platform_select from reconfigure.configs.base import Reconfig from reco...
{ "content_hash": "67c76ef51b2cc0c34a6878228134abf2", "timestamp": "", "source": "github", "line_count": 193, "max_line_length": 140, "avg_line_length": 32.170984455958546, "alnum_prop": 0.6131422129167338, "repo_name": "lupyuen/RaspberryPiImage", "id": "21e8f13669d69ecb1d41b05940ca1f0df3c4149c", "s...
from threading import Event,Thread import threading import time def conn_mysql(): print('%s waiting...' %threading.current_thread().getName()) e.wait() print('%s start to connect mysql....' %threading.current_thread().getName()) time.sleep(2) def check_mysql(): print('%s checking ...'%threading.cur...
{ "content_hash": "f313dcd82f09b14328aceb566ccc9137", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 80, "avg_line_length": 26.608695652173914, "alnum_prop": 0.6290849673202614, "repo_name": "5StevenWu/Coursepy", "id": "97b468c92973213b95cbeb0b089d6bbcb4760f80", "size": "6...
""" This module provides common parsing regular expressions and functinos which occur across multiple log formats. End users should never need to reference this module. """ from __future__ import ( unicode_literals, absolute_import, print_function, division, ) from lars import datatypes as dt str...
{ "content_hash": "d93c6d41dabb985f703547809fd8519f", "timestamp": "", "source": "github", "line_count": 196, "max_line_length": 82, "avg_line_length": 34.56122448979592, "alnum_prop": 0.6668142899320934, "repo_name": "waveform80/lars", "id": "2320875483ba6bb2e4981283cfb42f0d04d992ec", "size": "8032...
__all__ = [ "BadYamlError", "MultipleDocumentsInFpYaml", "HttpFetchError", "AbortedFetchError", ] class Error(Exception): """Base-class for exceptions in this module.""" class BadYamlError(Error): """Raise when the mapreduce.yaml file is invalid.""" class MultipleDocumentsInFpYaml(BadYamlErro...
{ "content_hash": "9789c5454d10d42f800cfc904dfa65d6", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 65, "avg_line_length": 24.92, "alnum_prop": 0.6966292134831461, "repo_name": "Letractively/lakshmi", "id": "7cd4f2af5f09a33aa54b88301b1e37f389857a1d", "size": "1226", "bi...
import program as mips import tkinter as tk import conversion as conv import instruction as ins from tkinter import filedialog import time class MIPSApplication(tk.Frame): def __init__(self, master = None): tk.Frame.__init__(self, master) self.pack() self.create_widgets() # default configuration of window ...
{ "content_hash": "7d06ee57f964cde6e05120c1645fd223", "timestamp": "", "source": "github", "line_count": 241, "max_line_length": 101, "avg_line_length": 31.609958506224068, "alnum_prop": 0.6720924127067471, "repo_name": "rosshays/mips-simulation", "id": "d6f2a5ed9733f97e6b969638857c2d1043a14b42", "s...
from .cz_eru_scraper import CZ_ERU_Scraper class ScraperFactory(object): """docstring for ScraperFactory""" def __init__(self): super(ScraperFactory, self).__init__() def getScraper(country, source_name, url): if country == 'CZ' and source_name == 'ERU': return CZ_ERU_Scraper(url)
{ "content_hash": "86fe602ab80db8d1760be78338c86c55", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 46, "avg_line_length": 29.3, "alnum_prop": 0.6962457337883959, "repo_name": "Open-Power-System-Data/renewable_power_plants", "id": "34683d36a35699ab2c632b819f3c519593a3c7ff",...
import matplotlib.pyplot as plt from matplotlib.pyplot import triplot from mpl_toolkits.mplot3d import Axes3D from pycrest.mesh import Mesh2d def plot_triangulation(tri: Mesh2d, standalone=True, *args, **kwargs): figure = plt.figure() if standalone else None triplot(tri.vertices[:, 0], tri.vertices[:, 1], tr...
{ "content_hash": "185302847ef07417f44cbd7b9872a816", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 82, "avg_line_length": 33.63636363636363, "alnum_prop": 0.6418918918918919, "repo_name": "Andlon/crest", "id": "6cc4dbbfdd4b53123ada04b2e051698fcbeaf958", "size": "740", ...
""" Classes and functions for Symmetric Diffeomorphic Registration """ from __future__ import print_function import abc from dipy.utils.six import with_metaclass import numpy as np import numpy.linalg as npl import scipy as sp import nibabel as nib import dipy.align.vector_fields as vfu from dipy.align import floatin...
{ "content_hash": "8f5703225bc95f9bf709b6a9dbcb380d", "timestamp": "", "source": "github", "line_count": 1721, "max_line_length": 93, "avg_line_length": 42.19174898314933, "alnum_prop": 0.6071723682036028, "repo_name": "oesteban/dipy", "id": "fb86cdaf9493c12d8183ee445fbbbc3ba845da9f", "size": "72612...
''' Exodus Add-on This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the h...
{ "content_hash": "49bece9897d940b373a186a5ebb82bf0", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 118, "avg_line_length": 37.2972972972973, "alnum_prop": 0.49082125603864735, "repo_name": "TheWardoctor/Wardoctors-repo", "id": "360fb25ffe7f03a06c96e4d66d102af447391878", ...
''' ''' # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License");...
{ "content_hash": "04e6c249193832ac3ab788727177365f", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 102, "avg_line_length": 36.97959183673469, "alnum_prop": 0.7472406181015453, "repo_name": "vmamidi/trafficserver", "id": "633970cc360eae79f04acedf6b6bbd37e148b523", "size":...
from setuptools import setup setup( name='UUTracking', version='0.1', description='Monitor framework', packages=['UUTrack', 'UUTrack.View', 'UUTrack.View.Monitor', 'UUTrack.Model', 'UUTrack.Model.Cameras', 'UUTrack.Controller', ...
{ "content_hash": "2fb3da77974a77f47561176893b819c3", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 83, "avg_line_length": 33.758620689655174, "alnum_prop": 0.5914198161389173, "repo_name": "aquilesC/UUTrack", "id": "1efad9ed0539a80a308bc7dd437160ef677ec37d", "size": "979...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('allmychanges', '0002_auto_20160216_0839'), ] operations = [ migrations.AddField( model_name='issue', name='importance', ...
{ "content_hash": "60e53e2efa5dd5d3d6be1bcd27be5d1d", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 76, "avg_line_length": 22.77777777777778, "alnum_prop": 0.6073170731707317, "repo_name": "AllMyChanges/allmychanges.com", "id": "7a7a00a9cd8eaa6f1a70b1b3944553324a79ec15", ...
""" Features of waveforms (e.g waveform_snr). :copyright: Copyright 2014-2020 by the Elephant team, see `doc/authors.rst`. :license: Modified BSD, see LICENSE.txt for details. """ from __future__ import division, print_function, unicode_literals import warnings import neo import numpy as np __all__ = [ "wavefo...
{ "content_hash": "cf0a641aea56e182148820f730ea8919", "timestamp": "", "source": "github", "line_count": 129, "max_line_length": 78, "avg_line_length": 31.62015503875969, "alnum_prop": 0.6388820789409169, "repo_name": "JuliaSprenger/elephant", "id": "84e32272d2b2916d2dd6f780eba66bc2ed4beed3", "size"...
import unittest from os.path import abspath, basename, dirname, join from robot.utils.asserts import assert_equals, assert_true from robot.result.testsuite import TestSuite from robot.result.testcase import TestCase from robot.result.keyword import Keyword from robot.result.message import Message from robot.result.exe...
{ "content_hash": "d440354978f4cb4d812c7ce860e040d8", "timestamp": "", "source": "github", "line_count": 398, "max_line_length": 94, "avg_line_length": 47.178391959798994, "alnum_prop": 0.5718698407626351, "repo_name": "kyle1986/robortframe", "id": "dee3b96bc8b87e577709f54111462b45c7b47f5e", "size":...
import tests.model_control.test_ozone_custom_models_enabled as testmod testmod.build_model( ['Fisher'] , ['LinearTrend'] , ['Seasonal_DayOfMonth'] , ['MLP'] );
{ "content_hash": "7e2a53872a42a312dc16bd0155e40b94", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 88, "avg_line_length": 40.25, "alnum_prop": 0.7142857142857143, "repo_name": "antoinecarme/pyaf", "id": "94117ab76ea06826bc1486d2126b0cdce8ffe639", "size": "161", "binary"...
def run_async(func): """ run_async(func) function decorator, intended to make "func" run in a separate thread (asynchronously). Returns the created Thread object E.g.: @run_async def task1(): do_something @run_async def task2(): do_something_too t1 = task1() t2 = task2() ....
{ "content_hash": "4ca157caa815f040bdc230d7d3fb4926", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 64, "avg_line_length": 18.12727272727273, "alnum_prop": 0.645937813440321, "repo_name": "ActiveState/code", "id": "b856ec32bf83be880e5f5843b50e6bf47647fc48", "size": "1020"...
import logging import json import datetime import math from django.http import HttpResponse from django.shortcuts import render, get_object_or_404 from expenses.forms import ExpenseForm, SignupForm from expenses.models import Expense, Balance from django.core import serializers from django.db import IntegrityError fro...
{ "content_hash": "89321f025216f7e4ef75d390bce9eb96", "timestamp": "", "source": "github", "line_count": 201, "max_line_length": 134, "avg_line_length": 32.208955223880594, "alnum_prop": 0.6244979919678715, "repo_name": "deanproxy/register", "id": "d6e44412e71e83c4bd8b45d8d5d4ad8f63a443cc", "size": ...
import argparse import tokenize from difflib import unified_diff from io import BytesIO from pathlib import Path from token import NAME, OP from typing import Dict, List, Optional, Set def main() -> None: args = create_parser().parse_args() build_files: Set[Path] = { fp for folder in args.fold...
{ "content_hash": "7cd4310f343e7bfabd00aa8461fdd08c", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 95, "avg_line_length": 31.17094017094017, "alnum_prop": 0.6048807238826432, "repo_name": "benjyw/pants", "id": "623963bfc7f741385cb455881d0c91e28b74681f", "size": "3802", ...
AUTH_USER_MODEL = 'backend.ChinoUser' AUTHENTICATION_BACKENDS = [ 'backend.models.ChinoRemoteUserBackend', ] # PUT YOUR CHINO DATA HERE. CHINO_ID = '...' CHINO_KEY = '...' CHINO_URL = 'https://api.dev.chino.io/' # production URL: #CHINO_URL = 'https://api.chino.io/' CHINO_APPLICATION_ID = '...' CHINO_APPLICATI...
{ "content_hash": "22615c00ef9d6578226888c971f82edf", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 44, "avg_line_length": 19.88235294117647, "alnum_prop": 0.6597633136094675, "repo_name": "chinoio/chino-django", "id": "3ae143da9a29f88ecb25c76942a7e9558836e27a", "size": "...
""" Copyright (C) 2018, Zato Source s.r.o. https://zato.io Licensed under LGPLv3, see LICENSE.txt for terms and conditions. """ from __future__ import absolute_import, division, print_function, unicode_literals # Originally part of Zato - open-source ESB, SOA, REST, APIs and cloud integrations in Python # https://za...
{ "content_hash": "4003fee22706a074c6a0ce7c0c29ce62", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 129, "avg_line_length": 30.684684684684683, "alnum_prop": 0.6588373458602467, "repo_name": "zatosource/zato-enclog", "id": "ab6e7cb362cf73fb01f76c81762582b3bcfe6afd", "siz...
""" The Plaid API The Plaid REST API. Please see https://plaid.com/docs/api for more details. # noqa: E501 Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 from plaid.model_utils import ( # noqa: F401 ApiTypeError, ModelComposed, ModelNormal...
{ "content_hash": "c39803e38b2522a40c4b015b33e98218", "timestamp": "", "source": "github", "line_count": 237, "max_line_length": 649, "avg_line_length": 47.69198312236287, "alnum_prop": 0.5984251968503937, "repo_name": "plaid/plaid-python", "id": "f323bf6120667c3cc0321012c42b29518b03350b", "size": "...
import keyword import _jsre as re from browser import html letters = 'abcdefghijklmnopqrstuvwxyz' letters += letters.upper()+'_' digits = '0123456789' builtin_funcs = """abs|dict|help|min|setattr| all|dir|hex|next|slice| any|divmod|id|object|sorted| ascii|enumerate|input|oct|staticmethod| bin|eval|int|open|str| bool...
{ "content_hash": "e4d29403e4dbd6cd1db14b5dcccf51a7", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 76, "avg_line_length": 29.655172413793103, "alnum_prop": 0.45271317829457364, "repo_name": "jonathanverner/brython", "id": "5316a6d5ddb6e251a315b6731d9d53d95f0db858", "size...
"""Test Atlas Data Lake.""" import os import sys sys.path[0:0] = [""] from test import IntegrationTest, client_context, unittest from test.crud_v2_format import TestCrudV2 from test.utils import ( OvertCommandListener, TestCreator, rs_client_noauth, rs_or_single_client, ) # Location of JSON test spe...
{ "content_hash": "5e3ae595e0f3101dec67a332debd6905", "timestamp": "", "source": "github", "line_count": 108, "max_line_length": 86, "avg_line_length": 29.25925925925926, "alnum_prop": 0.6525316455696203, "repo_name": "mongodb/mongo-python-driver", "id": "4fa38435a3cf65435d8f8fbd9305f6927c152119", "...
import unittest from MyHearthStone.utils import constants __author__ = 'fyabc' class TestConstants(unittest.TestCase): def setUp(self): self.orig_C = constants.C.copy() def tearDown(self): constants.C = self.orig_C def testLoadArgConfig(self): constants.load_arg_config({ ...
{ "content_hash": "79f94f0afd3ff6570192576f43602ee2", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 76, "avg_line_length": 27.933333333333334, "alnum_prop": 0.6217183770883055, "repo_name": "fyabc/MiniGames", "id": "eda0637de2914a1fb658c9e44863996acbef9388", "size": "882"...
""" Client side of the conductor RPC API. """ import random import oslo_messaging as messaging from ironic.common import exception from ironic.common import hash_ring from ironic.common.i18n import _ from ironic.common import release_mappings as versions from ironic.common import rpc from ironic.conductor import man...
{ "content_hash": "3ab9377309d2e540e587e34e00ba5f87", "timestamp": "", "source": "github", "line_count": 926, "max_line_length": 79, "avg_line_length": 46.87257019438445, "alnum_prop": 0.6358630540963967, "repo_name": "NaohiroTamura/ironic", "id": "af7c286a406a8914b4575f05c0cc115a89344219", "size": ...
class Dog: # The init method is called to create an object # We give default values for the fields if none # are provided def __init__(self, name="", height=0, weight=0): # self allows an object to refer to itself # It is like how you refer to yourself with my # We will take the...
{ "content_hash": "9257085433aaafd7948f8fb94b9244f8", "timestamp": "", "source": "github", "line_count": 208, "max_line_length": 89, "avg_line_length": 26.552884615384617, "alnum_prop": 0.6027521274669564, "repo_name": "alirsamar/pycourse", "id": "9c70ce85643563e00dfff6ba91c07e8dc72aa24e", "size": "...
from tests.test_helper import * import os class TestSetup(unittest.TestCase): def test_packages_includes_all_packages(self): with open('setup.py', 'r') as f: setup_contents = f.read() packages_line = re.findall('packages=.*', setup_contents) packages_from_setup = re.findall('"(....
{ "content_hash": "0586790ec2ad92ab4d026cc612145b8f", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 117, "avg_line_length": 56.42857142857143, "alnum_prop": 0.6489451476793249, "repo_name": "felixonmars/braintree_python", "id": "9b78fc554e1386476601ec49edca8ece2e5f5552", ...
import sys import re sys.path.append("../util") import Util import UnsupportedLanguageException from chunkingConstants import * # Types of elements on our version stacks FUNC = "Function" SBLOCK = "Block" GENERIC = "Generic" LINEINDEX = 0 LABELINDEX = 1 #Redo with a polymorphic solution for the languages class sco...
{ "content_hash": "ac898896deac546578f34a18f1a359af", "timestamp": "", "source": "github", "line_count": 137, "max_line_length": 106, "avg_line_length": 40.87591240875913, "alnum_prop": 0.6614285714285715, "repo_name": "Yagniksuchak/CodeParser", "id": "24546af7012bb4a0693b4b89de5fca661f96c949", "siz...
import luigi luigi.namespace("mynamespace") class Foo(luigi.Task): p = luigi.Parameter() class Bar(Foo): task_namespace = "othernamespace" # namespace override luigi.namespace()
{ "content_hash": "7a26d890028af8bd05d86a75ee9a3a5b", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 59, "avg_line_length": 14.846153846153847, "alnum_prop": 0.7098445595854922, "repo_name": "cpcloud/luigi", "id": "4d8439d91c1c6114d1bf8175b0e9e49c43034629", "size": "768", ...
"""fix polymorphic_type Revision ID: 51063fb35c12 Revises: Create Date: 2014-11-26 14:41:55.789000 """ # revision identifiers, used by Alembic. revision = '51063fb35c12' down_revision = None branch_labels = None depends_on = None from alembic import op import sqlalchemy as sa def upgrade(): update_pmtype(['l...
{ "content_hash": "3457112d189364418fa337de21ad1ee1", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 78, "avg_line_length": 23.612903225806452, "alnum_prop": 0.6844262295081968, "repo_name": "clld/nts", "id": "474339adc52f733f718c9a893e55218285e6a254", "size": "732", "bi...
''' Created on 24 Aug 2017 Queue via stacks @author: igoroya ''' from chapter3 import utils class QueueV2(object): def __init__(self): self._input_stack = utils.Stack() self._output_stack = utils.Stack() # Add this to avoid making twice the 2 stack movement when peek & remove self...
{ "content_hash": "eb29002fceefaf62ca4e6b1273320209", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 80, "avg_line_length": 26.705128205128204, "alnum_prop": 0.5530484877580413, "repo_name": "igoroya/igor-oya-solutions-cracking-coding-interview", "id": "9ddc461015311ca06e711...
"""Build an index mapping word -> list of occurrences""" import sys import re import collections WORD_RE = re.compile(r'\w+') index = collections.defaultdict(list) # <1> with open(sys.argv[1], encoding='utf-8') as fp: for line_no, line in enumerate(fp, 1): for match in WORD_RE.finditer(line): ...
{ "content_hash": "24aeebe2029d414580304f420f40bcf4", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 56, "avg_line_length": 28.571428571428573, "alnum_prop": 0.6283333333333333, "repo_name": "fluentpython/example-code", "id": "8d3ae587f823a84bed5f2f7262cff2b0ed078d14", "si...
import tests.model_control.test_ozone_custom_models_enabled as testmod testmod.build_model( ['Difference'] , ['MovingMedian'] , ['Seasonal_Second'] , ['LSTM'] );
{ "content_hash": "7e82252d213956cb2a1e8cbf2ffccb71", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 90, "avg_line_length": 40.75, "alnum_prop": 0.7177914110429447, "repo_name": "antoinecarme/pyaf", "id": "b8f1d757e1e8b91c7921b95c2c41e9b4cbe0229b", "size": "163", "binary"...
from __future__ import print_function import glob import os import sys import unittest if __name__ == '__main__': suite = unittest.TestSuite() cur_dir = os.path.dirname(os.path.realpath(__file__)) for testname in glob.glob(os.path.join(cur_dir, '*_test.py')): print('Adding Test: ' + testname) module = _...
{ "content_hash": "a0775ec6e12bb8801751391f8d5c1820", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 74, "avg_line_length": 29.789473684210527, "alnum_prop": 0.6890459363957597, "repo_name": "scheib/chromium", "id": "3df776ff32d2b1b12a692cb6cd85a75a3c24883c", "size": "756"...
""" DocuSign REST API The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign. # noqa: E501 OpenAPI spec version: v2.1 Contact: devcenter@docusign.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pp...
{ "content_hash": "6f02a0f5c7cb0a2faa755a8acf153773", "timestamp": "", "source": "github", "line_count": 1173, "max_line_length": 554, "avg_line_length": 39.40920716112532, "alnum_prop": 0.6530599000584074, "repo_name": "docusign/docusign-python-client", "id": "1a646ceaf2b5beef6597778de397d228ff11ceb7...
"""Set of basic operations/utilities that are used by repacakging tool. These functions were mostly imported from build/scripts/common/chromium_utils and build/scripts/common/slave_utils. """ import errno import os import re import shutil import subprocess import sys import time import zipfile CREDENTIAL_ERROR_MESS...
{ "content_hash": "51576c855c7e849dc8717af9b2617c0a", "timestamp": "", "source": "github", "line_count": 499, "max_line_length": 80, "avg_line_length": 36.92585170340681, "alnum_prop": 0.6661782264191902, "repo_name": "Samsung/ChromiumGStreamerBackend", "id": "517f22714d74286670720a303b03d4d0e194b60c"...
""" Using Flask-Restless with jQuery ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This provides a simple example of using Flask-Restless on the server to create ReSTful API endpoints and [jQuery][0] on the client to make API requests. This requires the following Python libraries to be installed: * Fl...
{ "content_hash": "2e4c702f5d9e1c26e1787228f236cbca", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 75, "avg_line_length": 27.5, "alnum_prop": 0.6813852813852814, "repo_name": "ternaris/flask-restless", "id": "496af92c6bc886f55fe3fd5ceee0480b04cd0974", "size": "2310", "...
"""Regression test for trailing-whitespace (C0303).""" # pylint: disable=mixed-line-endings, print-statement __revision__ = 0 print 'some trailing whitespace' print 'trailing whitespace does not count towards the line length limit' print 'windows line ends are ok' print 'but trailing whitespace o...
{ "content_hash": "1138a3d8d9685ebfc89fa9587dd0c76d", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 91, "avg_line_length": 42.125, "alnum_prop": 0.712166172106825, "repo_name": "Titulacion-Sistemas/PythonTitulacion-EV", "id": "2eecb11ba4d3ecd96aecad75d5345c9789c39c7e", "si...
import tensorflow as tf import numpy as np import os from scipy.io import loadmat class VGG_Model(object): def __init__(self): self.param_path = os.path.join(os.getcwd(), "model", "vgg-face.mat") self.data = loadmat(self.param_path) self.meta = self.data['meta'] ...
{ "content_hash": "7d049a50816c5e9b7f913d83c7203291", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 106, "avg_line_length": 44.02597402597402, "alnum_prop": 0.48436578171091443, "repo_name": "xhchrn/gegan", "id": "48e0534d77f95dbbc61a9527e4c3d525de14725f", "size": "3414",...
from nose import tools import subprocess import tempfile import os import shutil import sys import data_packager as pkg TESTDIR = os.path.dirname(os.path.realpath(__file__)) BASEDIR = os.path.dirname(os.path.dirname(TESTDIR)) FIXTURE = os.path.join(TESTDIR, 'test-fixture-package') FIXTURE_ALTPATH = 'alt_resources' EN...
{ "content_hash": "09fd1d5e12cf6d79466cf7d8e3f10d0a", "timestamp": "", "source": "github", "line_count": 208, "max_line_length": 181, "avg_line_length": 36.9375, "alnum_prop": 0.5812833528569569, "repo_name": "ethanrowe/python-data-packager", "id": "77755712841496fd13aacfbf825d68a6bc2e30bc", "size":...
""" HTML PRE-based UI implementation """ from urwid import util from urwid.main_loop import ExitMainLoop from urwid.display_common import AttrSpec, BaseScreen # replace control characters with ?'s _trans_table = "?" * 32 + "".join([chr(x) for x in range(32, 256)]) _default_foreground = 'black' _default_background =...
{ "content_hash": "8c82ae99fb053787d7a5098baa20985f", "timestamp": "", "source": "github", "line_count": 234, "max_line_length": 91, "avg_line_length": 31.705128205128204, "alnum_prop": 0.5507480792559644, "repo_name": "DarkPurpleShadow/ConnectFour", "id": "b6785b5f1acef9a4e5d7beb0159d9a9572ffb20c", ...
from django.apps import AppConfig class UsersConfig(AppConfig): name = 'tempo.users' verbose_name = "Users" def ready(self): """Override this to put in: Users system checks Users signal registration """ pass
{ "content_hash": "dc622f658fa5d3ce44ecf9dbd0365069", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 37, "avg_line_length": 20.846153846153847, "alnum_prop": 0.5867158671586716, "repo_name": "EliotBerriot/tempo", "id": "ca32c65a2e2f68b50e16606361264180f096af49", "size": "2...
import _thread import time class shadowManager: def __init__(self, MQTTClient): if MQTTClient is None: raise ValueError("MQTT Client is none") self._mqttClient = MQTTClient self._subscribe_mutex = _thread.allocate_lock() def getClientID(self): return self._mqttCli...
{ "content_hash": "ea862469f9b8e1b6efe419351a164042", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 104, "avg_line_length": 43.836363636363636, "alnum_prop": 0.6710908336789714, "repo_name": "Xykon/pycom-micropython-sigfox", "id": "a84631786915212189397b523fcd1d26a4368c03",...
from django.db import models from people.models import User from utils.behaviors import Permalinkable class UserGroup(Permalinkable): name = models.CharField(max_length=255, unique=True) webpage_url = models.URLField(max_length=255, blank=True) meetup_url = models.URLField(max_length=255, blank=True) ...
{ "content_hash": "ebab77afeb9888b9999e0be7bb481dc0", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 100, "avg_line_length": 36.25, "alnum_prop": 0.7379310344827587, "repo_name": "WebCampZg/conference-web", "id": "09d35d36dbc97425775ab7ccae0b75c8d7f90ac1", "size": "580", ...
""" Tests for plotting. """ import unittest from os.path import abspath, curdir, join from pathlib import Path import pyensembl from agfusion import database, model data = pyensembl.EnsemblRelease(84, "mouse") db = database.AGFusionDB(abspath(join(curdir, "agfusion.mus_musculus.84.db"))) db.build = "mus_musculus_84"...
{ "content_hash": "9ca4e30e24f908b21020510af3e85913", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 84, "avg_line_length": 29.0625, "alnum_prop": 0.657347670250896, "repo_name": "murphycj/AGFusion", "id": "68588644096020fc09e1bd763f1b63715d5707ba", "size": "1395", "bina...
"""Tests for email output plugin.""" from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals from absl import app from future.builtins import range from grr_response_core import config from grr_response_core.lib import utils from grr_response_core.lib.rdfvalues i...
{ "content_hash": "6dd4dc661846e6917df4db8aa5403bed", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 78, "avg_line_length": 35.81, "alnum_prop": 0.6984082658475286, "repo_name": "dunkhong/grr", "id": "cdbd9f5d2a138e6f7e18d25ab3b7e8c7bff6fca6", "size": "3603", "binary": ...
"""Verify that all OSF Storage files have Glacier backups and parity files, creating any missing backups. TODO: Add check against Glacier inventory Note: Must have par2 installed to run """ from __future__ import division import gc import os import math import thread import hashlib import logging import pyrax from...
{ "content_hash": "beea3e7da367cfefd2a73908e6f637a6", "timestamp": "", "source": "github", "line_count": 224, "max_line_length": 99, "avg_line_length": 32.00892857142857, "alnum_prop": 0.6443514644351465, "repo_name": "zachjanicki/osf.io", "id": "9d266e7d39f61b942b4a872ac3408884cf661f16", "size": "7...
from typing import Dict, List, Optional, Union from azure.core.exceptions import HttpResponseError import msrest.serialization from ._azure_digital_twins_management_client_enums import * class CheckNameRequest(msrest.serialization.Model): """The result returned from a database check name availability request. ...
{ "content_hash": "5b46f4161c67db21b4642d01b5abcc64", "timestamp": "", "source": "github", "line_count": 1554, "max_line_length": 208, "avg_line_length": 40.30759330759331, "alnum_prop": 0.652479325648967, "repo_name": "Azure/azure-sdk-for-python", "id": "204072a793129ec9ba037666fd3272897aa08394", "...
class Student(object): def __init__(self, name): self.name = name def __call__(self, *args, **kwargs): print('My name is %s,' % self.name) s = Student('Kobe') s()
{ "content_hash": "6de24357283d6ba729312fa42603998a", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 43, "avg_line_length": 19, "alnum_prop": 0.531578947368421, "repo_name": "wuchengang/PythonLearing", "id": "fb004e90bab4e7c329533792c4f3f6507c1ad743", "size": "239", "bin...
import logging import re import os import subprocess from edalize.edatool import Edatool logger = logging.getLogger(__name__) class Veriblelint(Edatool): argtypes = ["vlogdefine", "vlogparam"] @classmethod def get_doc(cls, api_ver): if api_ver == 0: return { "descri...
{ "content_hash": "2eda3709f0226fada0cd5cc99b6eaa35", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 96, "avg_line_length": 34.01, "alnum_prop": 0.5016171714201706, "repo_name": "lowRISC/edalize", "id": "58c02e50979219ced3497149a9aeccb8896b4233", "size": "3543", "binary...
""" Component to interface with various switches that can be controlled remotely. For more details about this component, please refer to the documentation at https://home-assistant.io/components/switch/ """ import asyncio from datetime import timedelta import logging import os import voluptuous as vol from homeassis...
{ "content_hash": "764a48093d0dd560c2291f2105e9beab", "timestamp": "", "source": "github", "line_count": 179, "max_line_length": 79, "avg_line_length": 29.921787709497206, "alnum_prop": 0.6708364451082898, "repo_name": "LinuxChristian/home-assistant", "id": "a53c6c5c01f21d6e3cfb1bf4baa511379066ed15", ...
"""Command line utility for querying the Logitech Harmony.""" import argparse import logging import pprint import sys from harmony import auth from harmony import client as harmony_client def login_to_logitech(args): """Logs in to the Logitech service. Args: args: argparse arguments needed to login. ...
{ "content_hash": "42d29a31bb9ce46c2e58c9de5f4df8e3", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 80, "avg_line_length": 31.790123456790123, "alnum_prop": 0.6722330097087379, "repo_name": "petele/pyharmony", "id": "2624c6c566d054bff522a4ac7e9ae882bdb0a0bd", "size": "259...
__author__ = 'Georgios Rizos (georgerizos@iti.gr)' import os import inspect import multiprocessing import reveal_user_classification ######################################################################################################################## # Configure path related functions. ##########################...
{ "content_hash": "62df74e6c9bce3975d3122ece6da202a", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 120, "avg_line_length": 38.58620689655172, "alnum_prop": 0.4075067024128686, "repo_name": "MKLab-ITI/reveal-user-classification", "id": "40194fad39c84fd5d6f20b4d6b97d2b4da651...
"""The tests the MQTT alarm control panel component.""" import copy import json import pytest from homeassistant.components import alarm_control_panel from homeassistant.const import ( STATE_ALARM_ARMED_AWAY, STATE_ALARM_ARMED_CUSTOM_BYPASS, STATE_ALARM_ARMED_HOME, STATE_ALARM_ARMED_NIGHT, STATE_A...
{ "content_hash": "16eefebd76ba32ba36bea04acede923a", "timestamp": "", "source": "github", "line_count": 638, "max_line_length": 88, "avg_line_length": 33.126959247648905, "alnum_prop": 0.6535131298793471, "repo_name": "pschmitt/home-assistant", "id": "aa6452fd9c882568d70bb628e73d7f00d1ac81a5", "siz...
"""Invoke tasks. To run a task, run ``$ invoke <COMMAND>``. To see a list of commands, run ``$ invoke --list``. """ import os import sys import code import platform import subprocess import logging from invoke import task, run from website import settings logging.getLogger('invoke').setLevel(logging.CRITICAL) HERE ...
{ "content_hash": "dfcb555247fb4b17032b364b6cd316dd", "timestamp": "", "source": "github", "line_count": 876, "max_line_length": 125, "avg_line_length": 29.269406392694062, "alnum_prop": 0.6354524180967238, "repo_name": "cosenal/osf.io", "id": "9b3b0e6dc13792cae18da767f3abe289e84a4601", "size": "256...
import inspect from datetime import datetime from flask import current_app from notifications_utils.clients.zendesk.zendesk_client import ( NotifySupportTicket, ) from app import zendesk_client from app.celery.broadcast_message_tasks import send_broadcast_event from app.config import QueueNames from app.dao.dao_u...
{ "content_hash": "76491497ffaa76e95270cf2417bd7131", "timestamp": "", "source": "github", "line_count": 141, "max_line_length": 126, "avg_line_length": 41.255319148936174, "alnum_prop": 0.6948598934158501, "repo_name": "alphagov/notifications-api", "id": "fead6821ebcf842535ee888dbc243f703925dd31", ...
__author__ = 'Vimalkumar Velayudhan' __email__ = 'vimalkumarvelayudhan@gmail.com' __version__ = '1.3.2' import os.path pkg_dir = os.path.abspath(os.path.dirname(__file__)) theme_path = os.path.split(pkg_dir)[0]
{ "content_hash": "53dfedc177d09d4628c81d84bd32bae4", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 52, "avg_line_length": 26.625, "alnum_prop": 0.676056338028169, "repo_name": "aristotle-mdr/user-documentation", "id": "fdf261144409e54a26130e7c5cf04fecd1f531b9", "size": "2...
import datetime import random import re import irc.bot import irc.strings from irc.client import ip_quad_to_numstr from random_replies import hello, thanks, unknown_cmd from utils import write_to_destination TEXT = ( "Hi, I am reviewbot. Type something like this: " "'Pls add to review list <your_patch>' " ...
{ "content_hash": "357fdec323d6416730e8fdf7bd596792", "timestamp": "", "source": "github", "line_count": 135, "max_line_length": 78, "avg_line_length": 35.05925925925926, "alnum_prop": 0.521233889710543, "repo_name": "redhat-openstack/rdo-infra", "id": "cfc48b1cd045da36a471d0722dbb696be1dda918", "si...
import sys major = sys.version_info.major minor = sys.version_info.minor python_version = (major, minor) def is_python_2(): return python_version[0] == 2 def is_python_3(): return python_version[0] == 3
{ "content_hash": "0f33e9d89f218353c8c0e1498c9fa431", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 33, "avg_line_length": 19.454545454545453, "alnum_prop": 0.6822429906542056, "repo_name": "FranDepascuali/wikiquotes-python-api", "id": "b90a89dc3916d0755614e395ca36b1ff1a1b2...
from scenario_one import scenario_one from scheduler import scheduler from simulation import run_scenario # Scenario 3: Same as scenario 2, but now we let the leases # expire before the server comes back. def scenario_three(reporter): job = scenario_one(reporter) scheduler.add_relative(120, lambda: job.lose_maste...
{ "content_hash": "6e584603cd677ddb67de3101a420bbb4", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 68, "avg_line_length": 32.6875, "alnum_prop": 0.7533460803059273, "repo_name": "youtube/doorman", "id": "529f57f9b9827ff7c12d7ef29b11331fa9ccae37", "size": "1123", "binar...
""" The temp module provides a NamedTemporaryFile that can be reopened in the same process on any platform. Most platforms use the standard Python tempfile.NamedTemporaryFile class, but Windows users are given a custom class. This is needed because the Python implementation of NamedTemporaryFile uses the O_TEMPORARY f...
{ "content_hash": "d61ecb13c4779fc74f4985d0d2d3a665", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 83, "avg_line_length": 33.7972972972973, "alnum_prop": 0.6397441023590564, "repo_name": "reinout/django", "id": "5fbb91b9ee92e032d232e51befed3caedd71e829", "size": "2501", ...
from __future__ import unicode_literals from django import forms from mezzanine.blog.models import BlogPost from mezzanine.blog.models import BlogCategory from mezzanine.core.models import CONTENT_STATUS_DRAFT from mezzanine.core.forms import TinyMceWidget class PostForm(forms.ModelForm): class Meta: mod...
{ "content_hash": "b19b2dcb9e811623f002cd2486587306", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 86, "avg_line_length": 29.03448275862069, "alnum_prop": 0.6389548693586699, "repo_name": "SISTEMAsw/TAMP", "id": "b2c5ac8dd890017da72466f042d937955d1fc2f2", "size": "842", ...
from __future__ import print_function import re import logging import sys import os import codecs from ycmd.completers.completer import Completer from ycmd import responses from ycmd import utils from ycmd import identifier_utils identifier_utils.FILETYPE_TO_IDENTIFIER_REGEX['tex'] = re.compile( r"(?:\\[@a-zA-Z]+)|(?...
{ "content_hash": "82bff70fa99b124d7fda9c23f497d843", "timestamp": "", "source": "github", "line_count": 397, "max_line_length": 123, "avg_line_length": 33.36272040302267, "alnum_prop": 0.5385428463571159, "repo_name": "Cocophotos/vim-ycm-latex-semantic-completer", "id": "5bd2fd668dc353682cf75f1f26327...
from os import getpid from os.path import isfile, isdir, join from static_aid import config, utils from static_aid.DataExtractor import DataExtractor def test_is_running(): extractor = DataExtractor() utils.remove_file_or_dir(config.PID_FILE_PATH) assert extractor.is_running() == False, "No PID file" ...
{ "content_hash": "65f13fb0a88a0aaa6cf7f0c9d8cf8edf", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 79, "avg_line_length": 33.61224489795919, "alnum_prop": 0.6939890710382514, "repo_name": "helrond/staticAid", "id": "9a32b7fd264fb37391694400d9b816c431cba8d3", "size": "167...
"""An I/O event loop for non-blocking sockets. Typical applications will use a single `IOLoop` object, in the `IOLoop.instance` singleton. The `IOLoop.start` method should usually be called at the end of the ``main()`` function. Atypical applications may use more than one `IOLoop`, such as one `IOLoop` per thread, o...
{ "content_hash": "cf74d9d82f12372774369b6b946c1b86", "timestamp": "", "source": "github", "line_count": 1044, "max_line_length": 93, "avg_line_length": 39.23180076628353, "alnum_prop": 0.5916304507056008, "repo_name": "zguangyu/tornado", "id": "d61831766586cebe2c7a3e228caf73816050cae1", "size": "41...
import functools import warnings import paddle from paddle.distribution.beta import Beta from paddle.distribution.categorical import Categorical from paddle.distribution.dirichlet import Dirichlet from paddle.distribution.distribution import Distribution from paddle.distribution.exponential_family import ExponentialFa...
{ "content_hash": "7faf615ec1e9deb1469c0cc0fb3ee502", "timestamp": "", "source": "github", "line_count": 230, "max_line_length": 130, "avg_line_length": 30.38695652173913, "alnum_prop": 0.6126770639576478, "repo_name": "PaddlePaddle/Paddle", "id": "cf8857629893becfaee8cb69136cdd8142fb3132", "size": ...
from filer.test_settings import *
{ "content_hash": "778f546c9f71ed9491db5843892cc670", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 33, "avg_line_length": 34, "alnum_prop": 0.7941176470588235, "repo_name": "pbs/django-filer", "id": "781dbc486d25114e22e96a972d2b8ba8b13ec1ac", "size": "57", "binary": fal...
""" This module gathers tree-based methods, including decision, regression and randomized trees. Single and multi-output problems are both handled. """ # Authors: Gilles Louppe <g.louppe@gmail.com> # Peter Prettenhofer <peter.prettenhofer@gmail.com> # Brian Holt <bdholt1@gmail.com> # Noel Da...
{ "content_hash": "0fd5e1b240656a78a5d64d638993fa89", "timestamp": "", "source": "github", "line_count": 1769, "max_line_length": 79, "avg_line_length": 41.23289994347089, "alnum_prop": 0.592424013929066, "repo_name": "glemaitre/scikit-learn", "id": "420292881f7db8b73ea57419bc2b1df96693f909", "size"...
from zerver.lib.test_classes import WebhookTestCase class SlackWebhookTests(WebhookTestCase): STREAM_NAME = "slack" URL_TEMPLATE = "/api/v1/external/slack?stream={stream}&api_key={api_key}" WEBHOOK_DIR_NAME = "slack" def test_slack_channel_to_topic(self) -> None: expected_topic = "channel: g...
{ "content_hash": "fc60f18f23bb1a169b1f58011df71290", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 99, "avg_line_length": 39.698412698412696, "alnum_prop": 0.6353458616553379, "repo_name": "hackerkid/zulip", "id": "e86dfe5f8068c19a93cc38468437e0d9f549a234", "size": "2501...
"""Tests for the Open-Meteo integration.""" from unittest.mock import AsyncMock, MagicMock, patch from open_meteo import OpenMeteoConnectionError from pytest import LogCaptureFixture from homeassistant.components.open_meteo.const import DOMAIN from homeassistant.config_entries import ConfigEntryState from homeassista...
{ "content_hash": "3c4dfdba8bcc582bbd9e88a7cb14007f", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 70, "avg_line_length": 33.48529411764706, "alnum_prop": 0.7408871321914801, "repo_name": "w1ll1am23/home-assistant", "id": "38619bc09db592e6bb4902e1ba4ea21459982f20", "size...
"""Module containing data providers for TextProperty. """ from soc.modules.seeder.logic.providers.string import StringProvider from soc.modules.seeder.logic.providers.string import RandomPhraseProvider import random __authors__ = [ '"Felix Kerekes" <sttwister@gmail.com>', ] # pylint: disable=W0223 class TextPr...
{ "content_hash": "29e6de542e323a1f17468d59c70bc6ed", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 74, "avg_line_length": 28.390625, "alnum_prop": 0.693450742982939, "repo_name": "SRabbelier/Melange", "id": "191ab39936bb1821da03bd675ad9a3c3fc8a95ff", "size": "2422", "b...
""" The Pipelines module contains the base definition for a generic Pipelines commands. """ from qds_sdk.actions import * import json from qds_sdk.qubole import Qubole from qds_sdk.resource import Resource from argparse import ArgumentParser log = logging.getLogger("qds_quest") # Pattern matcher for s3 path _URI_RE =...
{ "content_hash": "9ff23a7599b08afba14a5ec1ce6da908", "timestamp": "", "source": "github", "line_count": 836, "max_line_length": 280, "avg_line_length": 37.29545454545455, "alnum_prop": 0.5093813143461946, "repo_name": "qubole/qds-sdk-py", "id": "ffe6f64d31816c40b93eed239603e49225c67840", "size": "3...