text
stringlengths
4
1.02M
meta
dict
from dtreeviz.utils import * import numpy as np import pandas as pd import graphviz from pathlib import Path from sklearn import tree from graphviz.backend import run, view import matplotlib.pyplot as plt from dtreeviz.shadow import * from numbers import Number import matplotlib.patches as patches from mpl_toolkits.mp...
{ "content_hash": "0444097d6cd37a66719732c993eb0e47", "timestamp": "", "source": "github", "line_count": 1167, "max_line_length": 175, "avg_line_length": 38.54070265638389, "alnum_prop": 0.5619094203704116, "repo_name": "parrt/AniML", "id": "bf925007fbf715facf431890c125a1b499e23ac4", "size": "44977"...
from re import findall, sub from .default_recipe_parser import recipe_parser def use_schema_org(html): if 'http://schema.org/Recipe' in str(html): return True return False class schema_org_recipe_parser(recipe_parser): def datetime_or_content(self, el): if el: if el.has_attr...
{ "content_hash": "de9eb3a6bc12ad7d2b09e257669d79ff", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 75, "avg_line_length": 31.099009900990097, "alnum_prop": 0.5278573702642471, "repo_name": "scttcper/hangry-py", "id": "7fc76dbd06982cce896223005e3336d6f72e1fe0", "size": "...
from highcharts.views.bar import HighChartsBarView # noqa from highcharts.views.line import HighChartsLineView # noqa from highcharts.views.area import HighChartsAreaView # noqa
{ "content_hash": "809c6174e7526e62721400b8cb4bd0ab", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 60, "avg_line_length": 60.333333333333336, "alnum_prop": 0.8342541436464088, "repo_name": "vivek8943/django-highcharts", "id": "0a34164cb17f43f1ad83539f56dadb61b43b03c2", "s...
from nose.tools import * from tictactoe.ai_strategies.easy import Easy from tictactoe.game_board import GameBoard def easy_strategy_makes_any_opening_move_test(): ai = Easy("X", "O") board = GameBoard() move = ai.make_move(board) assert_equal(True, move in list(range(0, 9))) def easy_strategy_makes_mo...
{ "content_hash": "ff47dccbe657311ae3c1ec38bb7a0411", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 57, "avg_line_length": 29.130434782608695, "alnum_prop": 0.6268656716417911, "repo_name": "rickerbh/tictactoe_py", "id": "5fafd2cc86fc794c471809424b92edfe213a2f85", "size":...
from xml.etree import ElementTree import json import os import shutil from contextlib import contextmanager import logging from copy import deepcopy import validictory import build_steps import build_steps_local import build_steps_predicates from xcode import XcodeProject LOG = logging.getLogger(__name__) @contextm...
{ "content_hash": "eda608c9e0db9558331e484a7b0265ac", "timestamp": "", "source": "github", "line_count": 455, "max_line_length": 182, "avg_line_length": 47.74285714285714, "alnum_prop": 0.6826865534226396, "repo_name": "mnaughto/trigger-statusbar", "id": "aabe67a6ce3fae762b01518426100a3027c27f6b", "...
""" This is a simple Python GTK+3 TreeView selection snippet. See: http://python-gtk-3-tutorial.readthedocs.org/en/latest/treeview.html """ from gi.repository import Gtk as gtk # Countries, population (as in 2015) and continent. DATA_LIST = [("China", 1370130000, "Asia"), ("India", 1271980000, "Asia"), ...
{ "content_hash": "2278e7b07fed76381796efc1bfb1f1f2", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 188, "avg_line_length": 38.18181818181818, "alnum_prop": 0.6365079365079365, "repo_name": "jeremiedecock/snippets", "id": "01fb3e7a735eb66d632850369d68dcc665fcb565", "size"...
from typing import TYPE_CHECKING from azure.core.credentials import AccessToken, AzureKeyCredential from azure.core.paging import ItemPaged from azure.core.pipeline.policies import BearerTokenCredentialPolicy from azure.core.polling import LROPoller from azure.core.tracing.decorator import distributed_trace from ._ap...
{ "content_hash": "8614f0de8f5ed4848140bbf01563a768", "timestamp": "", "source": "github", "line_count": 356, "max_line_length": 119, "avg_line_length": 49.68539325842696, "alnum_prop": 0.6490841248303935, "repo_name": "Azure/azure-sdk-for-python", "id": "e1ef95afca493be7d266ca072915f8b490376df1", "...
""" ========================================================= SVM Tie Breaking Example ========================================================= Tie breaking is costly if ``decision_function_shape='ovr'``, and therefore it is not enabled by default. This example illustrates the effect of the ``break_ties`` parameter fo...
{ "content_hash": "b820184659f66c01d879e67bace01140", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 82, "avg_line_length": 32.803030303030305, "alnum_prop": 0.5879907621247114, "repo_name": "vinayak-mehta/scikit-learn", "id": "e12460b494c024e0a1d7643a1f49552d0a63d693", "s...
"""Keep track of geo-located stations.""" from astropy.time import Time from sqlalchemy import Column, Float, String, BigInteger, ForeignKey, func from . import MCDeclarativeBase, NotNull from . import mc, cm_utils class StationType(MCDeclarativeBase): """ Table to track/denote station type data categories ...
{ "content_hash": "40559002ddef9a51553c10e70188a762", "timestamp": "", "source": "github", "line_count": 212, "max_line_length": 94, "avg_line_length": 32.2122641509434, "alnum_prop": 0.5889588519548983, "repo_name": "HERA-Team/Monitor_and_Control", "id": "d64be11cb13bbc061df8e3712f494a4f3446c98b", ...
"""Utility to compile possibly incomplete Python source code.""" import sys import string import traceback def compile_command(source, filename="<input>", symbol="single"): r"""Compile a command and determine whether it is incomplete. Arguments: source -- the source string; may contain \n characters ...
{ "content_hash": "3f8c700a79ca70ba4e08276986a47e59", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 79, "avg_line_length": 33.104651162790695, "alnum_prop": 0.6578854935019318, "repo_name": "MalloyPower/parsing-python", "id": "080e00b87ebc1674c7df83e06a84370ac1026613", "s...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('api', '0002_auto_20170712_1744'), ] operations = [ migrations.RemoveField( model_name='userinfo', name='integer_id', ...
{ "content_hash": "e201919370c43993a3d0233da40dd1d1", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 73, "avg_line_length": 23, "alnum_prop": 0.5612648221343873, "repo_name": "wangjinyu/api_server", "id": "e5a6622784052846eba58c1f84895d24bd519592", "size": "579", "binary...
import m5 from m5.objects import * from m5.defines import buildEnv from m5.util import addToPath import os, optparse, sys # Get paths we might need config_path = os.path.dirname(os.path.abspath(__file__)) config_root = os.path.dirname(config_path) addToPath(config_root+'/configs/common') addToPath(config_root+'/config...
{ "content_hash": "deb759ebb564fccd5f2c1e8890ccfc09", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 76, "avg_line_length": 25.684931506849313, "alnum_prop": 0.7344, "repo_name": "samueldotj/TeeRISC-Simulator", "id": "27d56a31da756a7339ef6890a3d0b09755aeb432", "size": "345...
import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "Linking_Charities.settings") try: from django.core.management import execute_from_command_line except ImportError: # The above import may fail for some other reason. Ensure that the # is...
{ "content_hash": "c4008e0a87f59353ce9b0c351675540d", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 81, "avg_line_length": 37.76190476190476, "alnum_prop": 0.6242118537200504, "repo_name": "linkingcharities/linkingcharities", "id": "96ae664aa583a19c17aa6470f7fe268dd9f8438e"...
from setuptools import setup setup( name="pep518_twin_forkbombs_second", version="238", py_modules=["pep518_twin_forkbombs_second"], )
{ "content_hash": "b715daae54c8750c70c8af8c3b8083f6", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 48, "avg_line_length": 21.142857142857142, "alnum_prop": 0.6959459459459459, "repo_name": "pypa/pip", "id": "c14c1cfb0259789ab547e61517c6d6a26568b23f", "size": "148", "bin...
import socket import sys # Create a TCP/IP socket sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) port = sys.argv[1] # Bind the socket to the port server_address = ('localhost', int(port)) print sys.stderr, 'starting up on %s port %s' % server_address sock.bind(server_address) raw_input("click any key to sh...
{ "content_hash": "3f8a63759a210c3206d9e61382d4370c", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 62, "avg_line_length": 23.642857142857142, "alnum_prop": 0.7250755287009063, "repo_name": "radiovisual/zaport", "id": "7b8e04ec404065223449c849ca013172d2b36418", "size": "3...
from temboo.core.choreography import Choreography from temboo.core.choreography import InputSet from temboo.core.choreography import ResultSet from temboo.core.choreography import ChoreographyExecution import json class ListLocations(Choreography): def __init__(self, temboo_session): """ Create a...
{ "content_hash": "66c032b3b1aba7cd410fed3ad2d7aca1", "timestamp": "", "source": "github", "line_count": 106, "max_line_length": 264, "avg_line_length": 49.34905660377358, "alnum_prop": 0.6855285796214873, "repo_name": "lupyuen/RaspberryPiImage", "id": "5e7887f57566f2b81f7c0b27815002bb402c157f", "si...
"""Module to handle /pkgs""" import logging import urllib from google.appengine.api import memcache from google.appengine.ext import blobstore from google.appengine.ext.webapp import blobstore_handlers from simian.auth import gaeserver from simian.mac import models from simian.mac.common import auth from simian.ma...
{ "content_hash": "5962d0e962e42ada97c40999b8f2432b", "timestamp": "", "source": "github", "line_count": 148, "max_line_length": 79, "avg_line_length": 33.317567567567565, "alnum_prop": 0.6779557899006287, "repo_name": "alexandregz/simian", "id": "048d547002924483106c58492329c3fed0adcc7d", "size": "...
"""The component for STIEBEL ELTRON heat pumps with ISGWeb Modbus module.""" from datetime import timedelta import logging from pystiebeleltron import pystiebeleltron import voluptuous as vol from homeassistant.components.modbus import ( CONF_HUB, DEFAULT_HUB, DOMAIN as MODBUS_DOMAIN, ) from homeassistant...
{ "content_hash": "36c618a7acef8397ba181bb96b58d74c", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 80, "avg_line_length": 28.271428571428572, "alnum_prop": 0.6796361798888327, "repo_name": "mezz64/home-assistant", "id": "84a39e3c87598cbcf19613ec7776e79f01933f01", "size":...
""" # 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...
{ "content_hash": "ce4b8b95b3e1119bef07554fbab493df", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 65, "avg_line_length": 47.791666666666664, "alnum_prop": 0.6102877070619006, "repo_name": "OBIGOGIT/etch", "id": "73e3a00315767d38caf9ef20b2252fdf34fe8bba", "size": "1147",...
import os from django.core.management.base import BaseCommand from poetry.apps.corpus.models import Poem class Command(BaseCommand): help = 'Automatic markup dump for Django' def add_arguments(self, parser): parser.add_argument('--out', action='store', ...
{ "content_hash": "aa8bb0094294965474143b8f0ed6823a", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 93, "avg_line_length": 35.225806451612904, "alnum_prop": 0.48717948717948717, "repo_name": "IlyaGusev/PoetryCorpus", "id": "1fa85471713deecdd060ab2fb59c15a4d2acf487", "size...
import codecs import sys import getopt import os from learning.PageManager import PageManager import json import time import logging logger = logging.getLogger("landmark") # logging.basicConfig(level=logging.INFO) # logger = logging.getLogger("landmark") # handler = logging.FileHandler('landmark.log') # handler.setLev...
{ "content_hash": "f1517cfd7918c07f035caa19a68d7c3f", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 173, "avg_line_length": 34.43877551020408, "alnum_prop": 0.5466666666666666, "repo_name": "usc-isi-i2/landmark-extraction", "id": "c8024ed2ca0dd7f00e42ebffe28d0ab66f41364d", ...
import datetime from django import template from django.core.urlresolvers import reverse as urlreverse from django.conf import settings from django.db.models import Q from django.utils.safestring import mark_safe from ietf.ietfauth.utils import user_is_person, has_role from ietf.doc.models import BallotDocEvent, Ball...
{ "content_hash": "c8ddb3929ef410f8f5feafdb73c59d97", "timestamp": "", "source": "github", "line_count": 187, "max_line_length": 128, "avg_line_length": 34.57754010695187, "alnum_prop": 0.559851531085679, "repo_name": "mcr/ietfdb", "id": "29f0b79e7273539a543d8edc13923fcfa460be2d", "size": "8139", ...
import unittest from base_test_class import BaseTestCase from selenium.webdriver.common.by import By import sys class VariousPagesTest(BaseTestCase): def test_user_status(self): driver = self.driver driver.get(self.base_url + "user") def test_calendar_status(self): driver = self.drive...
{ "content_hash": "db37b925200b1757b7065a8b2d3e5148", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 96, "avg_line_length": 31.806451612903224, "alnum_prop": 0.6987829614604463, "repo_name": "rackerlabs/django-DefectDojo", "id": "0e2275d61ac59cf9bd51e49f73a9343e6e6f73ed", ...
from __future__ import absolute_import from datetime import timedelta from django.http import HttpResponse from django.test import TestCase from django.test.client import RequestFactory from django.contrib.auth.models import AnonymousUser from django.contrib.auth import get_user_model from django.contrib.sessions.bac...
{ "content_hash": "a295d88783bd489d57a8f314ca426850", "timestamp": "", "source": "github", "line_count": 292, "max_line_length": 191, "avg_line_length": 51.39383561643836, "alnum_prop": 0.7265276204437929, "repo_name": "uhuramedia/django-experiments", "id": "5a09c2540906d68f040c5975d57c4bff68ba0dad", ...
from __future__ import absolute_import, division, print_function, unicode_literals from c7n.manager import resources from c7n.query import QueryResourceManager @resources.register('step-machine') class StepFunction(QueryResourceManager): """AWS Step Functions State Machine""" class resource_type(object): ...
{ "content_hash": "625908f45c350292d4644b17483ef68f", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 82, "avg_line_length": 32.25, "alnum_prop": 0.6651162790697674, "repo_name": "jdubs/cloud-custodian", "id": "f637ca4c66443e3a13e6d5236d32dc48fc06cf0f", "size": "1235", "b...
import os import sys import argparse import logging logger = logging.getLogger() from counterpartylib.lib import log log.set_logger(logger) from counterpartylib import server from counterpartylib.lib import config from counterpartycli.util import add_config_arguments, bootstrap from counterpartycli.setup import gener...
{ "content_hash": "5a2d8ed298335ac3f692d0649ce90a8d", "timestamp": "", "source": "github", "line_count": 175, "max_line_length": 187, "avg_line_length": 59.52571428571429, "alnum_prop": 0.6304118268215417, "repo_name": "CounterpartyXCP/counterparty-cli", "id": "9248dacb4ec290f65fff157385a2b53cbe14ae71...
from lxml import etree from xml.etree.ElementTree import iterparse # coding: utf-8 from sqlalchemy import Table, Column,Integer,String,Float , DateTime, create_engine,MetaData,or_ from sqlalchemy.orm import mapper, sessionmaker # import loadText as lt import os import pprint import re import os import sys import ...
{ "content_hash": "df11e9f573cd52e63fe9423116e8af53", "timestamp": "", "source": "github", "line_count": 379, "max_line_length": 107, "avg_line_length": 24.947229551451187, "alnum_prop": 0.5032258064516129, "repo_name": "ygenc/ygenc.github.io", "id": "9a3a8938fca807487c1380eaa5a0f1e8c834025e", "size...
import os import subprocess import signal import struct import csv try: import pandas except ImportError: pandas = None from wlauto import Instrument, Parameter, Executable from wlauto.exceptions import InstrumentError, ConfigError from wlauto.utils.types import list_of_numbers class EnergyProbe(Instrument):...
{ "content_hash": "619a6d4fcb9da9acb0957c171b5e81ea", "timestamp": "", "source": "github", "line_count": 129, "max_line_length": 125, "avg_line_length": 47.689922480620154, "alnum_prop": 0.5832249674902471, "repo_name": "jimboatarm/workload-automation", "id": "6fc229ee28cf13aa87655a5292521c1a536bc50f"...
from mongoengine.connection import get_db class query_counter(object): """ Query_counter contextmanager to get the number of queries. """ def __init__(self): """ Construct the query_counter. """ self.counter = 0 self.db = get_db() def __enter__(self): """ On every with bl...
{ "content_hash": "4e01255d02684f578907cafc801a4215", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 75, "avg_line_length": 29.06779661016949, "alnum_prop": 0.5440233236151604, "repo_name": "colinhowe/mongoengine", "id": "20620eba3cdfce08087c91c01989ea0f2b045aa2", "size": ...
from django.test import SimpleTestCase from corehq.apps.users.admin import CustomUserAdmin class CustomUserAdminTest(SimpleTestCase): def test_fieldsets(self): """ Test that the value of CustomUserAdmin.fieldsets, dynamically calculated by removing fields from UserAdmin, matches ...
{ "content_hash": "43237152143e14f111cd56187fea5b10", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 85, "avg_line_length": 39.583333333333336, "alnum_prop": 0.6378947368421053, "repo_name": "dimagi/commcare-hq", "id": "28063745a3868710d069fb87016a43a71318e315", "size": "9...
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('questions', '0053_related_name'), ('tasks', '0031_related_name'), ] operations = [ migrations.AddField( model_name='task', name='catalogs', field...
{ "content_hash": "9e4acbb35a2a3645b0699fd2e902c7ad", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 225, "avg_line_length": 32.11764705882353, "alnum_prop": 0.6282051282051282, "repo_name": "rdmorganiser/rdmo", "id": "e72ba4213277b239a27eaf8a199d3b79b5e7a002", "size": "59...
import tensorflow as tf import tensorflow_transform as tft from tensorflow.keras.callbacks import TensorBoard from tensorflow_hub import KerasLayer from tensorflow.keras.layers import Dense from tensorflow.keras.models import Sequential from tfx_bsl.tfxio import dataset_options from config import ( HUB_URL, H...
{ "content_hash": "df293312802fb2925bad0ec351da6f37", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 83, "avg_line_length": 31.676190476190477, "alnum_prop": 0.6268791340950091, "repo_name": "GoogleCloudPlatform/mlops-on-gcp", "id": "74d8daaaf435ce624ea1437b2700536f65ac59cb...
''' Bokeh Application Handler to look for Bokeh server lifecycle callbacks in a specified Python module. ''' #----------------------------------------------------------------------------- # Boilerplate #----------------------------------------------------------------------------- from __future__ import annotations i...
{ "content_hash": "356b1222b245c7f6fddbfd01e822d34f", "timestamp": "", "source": "github", "line_count": 132, "max_line_length": 111, "avg_line_length": 35.81060606060606, "alnum_prop": 0.4482758620689655, "repo_name": "bokeh/bokeh", "id": "ed88b030654f25f378892451b7f0957f4b8bdf3e", "size": "5058", ...
import cgi import random import shlex import logging import traceback import oembed import jinja2 from operator import attrgetter from urlparse import urlparse, urlunparse import pymongo from pylons import tmpl_context as c, app_globals as g from pylons import request from paste.deploy.converters import asint from Bea...
{ "content_hash": "01626e35016df3dc27659345c9ac2633", "timestamp": "", "source": "github", "line_count": 457, "max_line_length": 113, "avg_line_length": 36.11159737417943, "alnum_prop": 0.5922559534630067, "repo_name": "heiths/allura", "id": "c65c504c0488bfb1d3c2e631468aa2cee9ccc7d5", "size": "17373...
""" test_romannumeral ---------------------------------- Tests for `romannumeral` module. """ import unittest from romannumeral import RomanNumeral from romannumeral import ParseError from romannumeral import OutOfRangeError class TestRomannumeral(unittest.TestCase): def setUp(self): pass def te...
{ "content_hash": "af2a6e9b24572b2cf2840a8da3eb3a97", "timestamp": "", "source": "github", "line_count": 128, "max_line_length": 74, "avg_line_length": 28.765625, "alnum_prop": 0.5760456273764258, "repo_name": "jay3686/romannumeral", "id": "c76802f2f79ee70c0d3a1d61fe181dd2b9dd40bb", "size": "3729", ...
"""Tests boosted_trees prediction kernels.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from google.protobuf import text_format from tensorflow.core.kernels.boosted_trees import boosted_trees_pb2 from tensorflow.python.framework import test_util from t...
{ "content_hash": "3b9e11bc28e3c1217107be0b1f6f61f4", "timestamp": "", "source": "github", "line_count": 902, "max_line_length": 80, "avg_line_length": 29.446784922394677, "alnum_prop": 0.503708444712172, "repo_name": "eaplatanios/tensorflow", "id": "54f33f336015cc9cb50658941b8e157cc1b94df9", "size"...
"""Example code for Service : ReportDefinitionService Operation: mutate (ADD) API Reference: https://github.com/yahoojp-marketing/sponsored-search-api-documents/blob/201901/docs/en/api_reference/services/ReportDefinitionService.md Generated by 'api_reference_example_generator.py' using code template 'examples/sample_t...
{ "content_hash": "dcc0790864a37113feba4e42144dd190", "timestamp": "", "source": "github", "line_count": 166, "max_line_length": 152, "avg_line_length": 25.548192771084338, "alnum_prop": 0.5201603395425607, "repo_name": "becomejapan/yahooads-python-lib", "id": "9c2114384b5217d56898f991e5f1c9cc14ceb96d...
from __future__ import absolute_import import celery import kombu import os import platform as _platform from celery import datastructures from celery import platforms from celery.utils.text import pretty from celery.utils.imports import qualname from .defaults import find SETTINGS_INFO = """%s %s""" BUGREPORT_INF...
{ "content_hash": "544a5574adb90c9955a6252d202f8b47", "timestamp": "", "source": "github", "line_count": 110, "max_line_length": 77, "avg_line_length": 32.763636363636365, "alnum_prop": 0.5979467258601554, "repo_name": "couchbaselabs/celery", "id": "00a97a82ff33929bd5be6c71c091aef6fd479d1a", "size":...
"""Wrapper for signalfd(2) system call. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import errno import logging import os import ctypes from ctypes import ( c_int, c_void_p, c_uint32, c_uint64...
{ "content_hash": "0f8d592dd0b474d31488104bd9a7a9f3", "timestamp": "", "source": "github", "line_count": 188, "max_line_length": 79, "avg_line_length": 33.62765957446808, "alnum_prop": 0.5472951597595698, "repo_name": "Morgan-Stanley/treadmill", "id": "bb5d65dda49a3b80cacdeb8777c33f059b2d2a10", "siz...
""" Samsara ~~~~~~~ Samsara service package """ from setuptools import setup, find_packages setup( name='samsara_sdk', version='', url='https://github.com/samsara/samsara', author='Samsara Developers', author_email='samsara.systems+info@gmail.com', description="A Python Client fo...
{ "content_hash": "3445bee51c93edd788f4b9accd20a5f3", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 62, "avg_line_length": 20.243243243243242, "alnum_prop": 0.6662216288384513, "repo_name": "samsara/samsara", "id": "5b7dddedc2a604043b20fc11c9cff3a1bf056c01", "size": "773"...
import pandas as pd import json import numpy as np class NpEncoder(json.JSONEncoder): def default(self, obj): """ Converts the dictionary's values into a JSON serializable data type """ if isinstance(obj, np.integer): return int(obj) elif isi...
{ "content_hash": "89a864012915a7994109dfd36592b5eb", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 95, "avg_line_length": 36.73737373737374, "alnum_prop": 0.49546329392356336, "repo_name": "KarrLab/kinetic_datanator", "id": "1de0421c470a38956bfbd2a47bd89371544e0123", "si...
from decimal import * import getpass import math import os import os.path import platform import sys import time from jsonrpc import ServiceProxy, json BASE_FEE=Decimal("0.001") def check_json_precision(): """Make sure json library being used does not lose precision converting BTC values""" n = Decimal("20000...
{ "content_hash": "2ccfd6d13baa62be6f0d5dee5272be71", "timestamp": "", "source": "github", "line_count": 252, "max_line_length": 111, "avg_line_length": 38.69444444444444, "alnum_prop": 0.6185006665982976, "repo_name": "tinybike/catchcoin", "id": "cb2f2dd506a75607d0b38bfe97c9259e77600b79", "size": "...
import abc import logging from django.db import models from django.utils import timezone from framework import sentry from osf.exceptions import ValidationValueError, ValidationTypeError from osf.utils.datetime_aware_jsonfield import DateTimeAwareJSONField from osf.utils.fields import NonNaiveDateTimeField from osf.ut...
{ "content_hash": "d0b20b72246401db2a53ada3600c0110", "timestamp": "", "source": "github", "line_count": 268, "max_line_length": 108, "avg_line_length": 35.48134328358209, "alnum_prop": 0.5985908087075402, "repo_name": "Johnetordoff/osf.io", "id": "b650878fbb48cc28a6362eabc232d47daaf5a403", "size": ...
from __future__ import absolute_import import six from time import time from sentry.exceptions import InvalidConfiguration from sentry.ratelimits.base import RateLimiter from sentry.utils.hashlib import md5_text from sentry.utils.redis import get_cluster_from_options class RedisRateLimiter(RateLimiter): window...
{ "content_hash": "9b4e11ee48e82deb03b0a9abbee9f821", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 95, "avg_line_length": 28, "alnum_prop": 0.6215986394557823, "repo_name": "JackDanger/sentry", "id": "e7aaeea90eec21e56476ac45b90befd1de7c5dc5", "size": "1176", "binary":...
"""Constants for Owlet component.""" SENSOR_OXYGEN_LEVEL = "oxygen_level" SENSOR_HEART_RATE = "heart_rate" SENSOR_BASE_STATION = "base_station_on" SENSOR_MOVEMENT = "movement"
{ "content_hash": "be807533f3c309c0d18281824c54e7ef", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 39, "avg_line_length": 29.5, "alnum_prop": 0.7344632768361582, "repo_name": "Cinntax/home-assistant", "id": "f145100dbc41bd43aa9a140f178ee61c8e75f09a", "size": "177", "bin...
import sys import wmi import ctypes import time #For Development DEBUG = True FAIL_SILENTLY = False #For Code ONE_TIME_ALERT_ONLY = True ShouldStartCharging = True ShouldStopCharging = True connect_charger = """Battery Level < 40% Charging State : Disconnected *** CONNECT CHARGER ***""" disconnect_charger = """Bat...
{ "content_hash": "2c28a6257d0678e6271dd916dc8303ef", "timestamp": "", "source": "github", "line_count": 106, "max_line_length": 75, "avg_line_length": 26.70754716981132, "alnum_prop": 0.6114447191805016, "repo_name": "nitred/batterylevelalert", "id": "44d10fc344a1e59c4ab43be50eed0eb2d500251b", "siz...
from django.http import HttpResponse from django.shortcuts import render_to_response from ac_example.forms import ExampleForm def example(request): valid = False if request.GET: form = ExampleForm(request.GET) if form.is_valid(): valid = True else: form = ExampleForm() ...
{ "content_hash": "03cbd94bf25e55e24dc12f527161c7b1", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 79, "avg_line_length": 26.733333333333334, "alnum_prop": 0.6708229426433915, "repo_name": "henriquebastos/django-autocomplete", "id": "a7e9e20eaeb3744c0c3f60c4213a24319cd3362...
""" Installs and configures nova """ import os import uuid import logging import platform import socket from packstack.installer import basedefs, processors, utils, validators from packstack.installer.exceptions import ScriptRuntimeError from packstack.modules.shortcuts import get_mq from packstack.modules.ospluginu...
{ "content_hash": "1fc020145fa12fe0a2fc4e96840c0614", "timestamp": "", "source": "github", "line_count": 674, "max_line_length": 79, "avg_line_length": 41.253709198813056, "alnum_prop": 0.5701852184858839, "repo_name": "yuw726/openstack-packstack", "id": "04ad0c16a3af3da74f36625fa240877513886068", "...
"""Public forms.""" from urllib.parse import urljoin, urlparse from flask import redirect, request, url_for from flask_wtf import FlaskForm from wtforms import HiddenField, PasswordField, StringField from wtforms.validators import DataRequired from personal_website.user.models import User def is_safe_url(target): ...
{ "content_hash": "5b2397d3719700cb8b77bc6314b6334c", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 85, "avg_line_length": 30.350649350649352, "alnum_prop": 0.6281557552417629, "repo_name": "arewellborn/Personal-Website", "id": "55ed90217c93f48bd30723d03934ad019b9a925a", ...
from itertools import product from distutils.version import LooseVersion import operator import pytest from numpy import nan import numpy as np import pandas as pd from pandas import (Series, Categorical, DataFrame, isna, notna, bdate_range, date_range, _np_version_under1p10, C...
{ "content_hash": "97756c3ba4f78df10cb1939cfe5e3d4b", "timestamp": "", "source": "github", "line_count": 2256, "max_line_length": 79, "avg_line_length": 36.82225177304964, "alnum_prop": 0.5316416077812955, "repo_name": "louispotok/pandas", "id": "b9c7b837b8b817e8bfc1dd84e18c99ee0a88d4c5", "size": "8...
'''This tutorial does NOT require trigonometry, but if you know some, you can automatically generate some fancier shapes like regular polygons and stars, as illustrated here, after importing some trig from the math module. (And you can copy in the part before main and use the functions.) ''' from graphics import * fr...
{ "content_hash": "dbbf01ca04a6ecdcb6d00324df211400", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 79, "avg_line_length": 35.01298701298701, "alnum_prop": 0.6450296735905044, "repo_name": "hwheeler01/comp150", "id": "6fce9b37e3985952abb3be5acaca7285572e9581", "size": "26...
"""This pip smoke test verifies dependency files exist in the pip package. This script runs bazel queries to see what python files are required by the tests and ensures they are in the pip package superset. """ from __future__ import absolute_import from __future__ import division from __future__ import print_functio...
{ "content_hash": "e470f7567a6d76167d2f4f1c37b8a91e", "timestamp": "", "source": "github", "line_count": 178, "max_line_length": 128, "avg_line_length": 41.80898876404494, "alnum_prop": 0.7037086804622413, "repo_name": "girving/tensorflow", "id": "45106b35fc2e2c5bb981b178785ebf3089582c4d", "size": "...
_male_start_hi = ['https://media.giphy.com/media/dzaUX7CAG0Ihi/giphy-downsized.gif', 'https://media.giphy.com/media/oJiCqvIqPZE3u/giphy.gif'] _female_start_hi = ['https://media.giphy.com/media/a1QLZUUtCcgyA/giphy-downsized.gif', 'https://media.giphy.com/media/EPJZhOrStSpz2/giphy-d...
{ "content_hash": "7f56036ef04ee2e2b9bdf3cf8b44eddc", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 86, "avg_line_length": 40.375, "alnum_prop": 0.6455108359133127, "repo_name": "mayukh18/BlindChat", "id": "c8688fee36421aa99493fb5277e4da3899d3b2bc", "size": "646", "bina...
from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import from future import standard_library standard_library.install_aliases() from builtins import * import logging import emission.storage.timeseries.abstract_timeseries as est...
{ "content_hash": "74dda49e463f37253f5a0f0c08f2ac0c", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 113, "avg_line_length": 44.285714285714285, "alnum_prop": 0.7064516129032258, "repo_name": "shankari/e-mission-server", "id": "3eb81c7ace07d472f74736aef826474837546f73", "s...
""" Copyright (c) 2016, Jose Dolz .All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the f...
{ "content_hash": "c97d891361794d5270f996c6fe1d1645", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 95, "avg_line_length": 30.822222222222223, "alnum_prop": 0.6398702235039654, "repo_name": "josedolz/LiviaNET", "id": "2bbf33c46f6886279972559af098cd9be5284764", "size": "27...
"""File comparison methods for different file formats. This module provides a main file comparison method, :meth:`file_cmp()`, that compares two files and returns True if they are equivalent, False otherwise. The comparison is made differently depending on the file format. For instance, two Newick files are considered...
{ "content_hash": "f792fe411e79d1fe8960b19c2d823144", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 110, "avg_line_length": 35.68852459016394, "alnum_prop": 0.6871841984382178, "repo_name": "Ensembl/ensembl-compara", "id": "bd758c35d56d3ad2144e28a64caf0e86d2fe9f7a", "size...
from django.views.generic import ListView from haystack.query import SearchQuerySet from haystack.utils.geo import Point, D from ..models import Store from ..utils import caching_geo_lookup class DistanceSearchView(ListView): template_name = 'stores/store_search.html' distance = 25 def get_location(self...
{ "content_hash": "35505e1cbcce03ff6f105bc98edea843", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 72, "avg_line_length": 32, "alnum_prop": 0.6195652173913043, "repo_name": "nikdoof/vapemap", "id": "2de0a70ebdf4b2a83dbc12d5638b55b6c5761098", "size": "1472", "binary": f...
import T2 import sys from prompt_toolkit import prompt from prompt_toolkit.contrib.completers import WordCompleter bird_person = T2.Hand("Bird Person", "bp@gmail.com") rick = T2.Hand("Rick Sanches", "rs@gmail.com") morty = T2.Hand("Morty", "mr@gmail.com") b1 = T2.Book("Coders at Work: Reflections on the Craft of Pro...
{ "content_hash": "1088ee814b4f6e6d5b9a6125c92a2dc0", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 88, "avg_line_length": 29.19607843137255, "alnum_prop": 0.5936870382807253, "repo_name": "kvantos/intro_to_python_class", "id": "bed1bbaf730db271792e28e3ef5c7256236e9265", ...
""" QUOTE函数返回列所对应的原生SQL表达式。 Ref: https://www.sqlite.org/lang_corefunc.html """ from sqlite4dummy.tests.basetest import BaseUnittest from datetime import datetime, date import unittest class Unittest(BaseUnittest): def setUp(self): self.connect_database() def test_all(self): cursor = ...
{ "content_hash": "0e8b94c5d3cb16e88a3d6b80ced552f7", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 71, "avg_line_length": 27.03076923076923, "alnum_prop": 0.4632896983494593, "repo_name": "MacHu-GWU/sqlite4dummy-project", "id": "6a0a9698cbab91a25dcb4564f2fd0d4a756554ee", ...
from __future__ import print_function import copy import numpy import theano from theano import Variable, Constant from theano import tensor from theano.compile import SharedVariable from theano.sandbox.cuda.type import CudaNdarrayType try: # We must do those import to be able to create the full doc when nvcc ...
{ "content_hash": "603753ba55c4496d11edc4141950ffce", "timestamp": "", "source": "github", "line_count": 250, "max_line_length": 94, "avg_line_length": 35.344, "alnum_prop": 0.6420325939339068, "repo_name": "rizar/attention-lvcsr", "id": "17501cc6cb50fa24ce0fe81b81ee059fb889188e", "size": "8836", ...
import os import pwd from st2common import log as logging from st2common.models.system.action import RemoteAction from st2common.util.shell import quote_unix __all__ = [ 'ParamikoRemoteCommandAction', ] LOG = logging.getLogger(__name__) LOGGED_USER_USERNAME = pwd.getpwuid(os.getuid())[0] class ParamikoRemoteC...
{ "content_hash": "5177133ee4bf0ab194f82c228231821f", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 88, "avg_line_length": 30.15, "alnum_prop": 0.5530679933665008, "repo_name": "punalpatel/st2", "id": "b3bda0251e992cf8de9771896d7a17663975ad49", "size": "1986", "binary":...
from cdefs.heap import Heap ## # @brief Gets a list of historical/logged file sources, ExternalDataListener will know the first timestamp for the events # it's processing, this class will ask them to read the data and depending on whether there is any data of interest # ( for instance it could have data but of se...
{ "content_hash": "3877c52adbe0d13ed977ba80fdd9908d", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 207, "avg_line_length": 63.85333333333333, "alnum_prop": 0.6915848820212989, "repo_name": "ashesh-0/trade-analysis", "id": "ac705e902dd7830e67ad4ed683255b38ee9732fa", "size...
from CTFd.models import Teams, Users from CTFd.utils import set_config from tests.helpers import ( create_ctfd, destroy_ctfd, login_as_user, login_with_mlc, register_user, ) def test_oauth_not_configured(): """Test that OAuth redirection fails if OAuth settings aren't configured""" app = c...
{ "content_hash": "f4cce2e00a989b905841356e839e46b2", "timestamp": "", "source": "github", "line_count": 110, "max_line_length": 113, "avg_line_length": 35.06363636363636, "alnum_prop": 0.613689395903552, "repo_name": "LosFuzzys/CTFd", "id": "15e09852e2fa2eb9adbb8c1d0e71669c9b7d947a", "size": "3904"...
from datetime import date from dateutil.easter import easter from dateutil.relativedelta import relativedelta as rd, FR from holidays.constants import JAN, MAR, APR, MAY, AUG, OCT, NOV, DEC from holidays.constants import MON, TUE, THU, WEEKEND from holidays.holiday_base import HolidayBase class Hungary(HolidayBase)...
{ "content_hash": "27d657c33006a4a15898477edcfd65c0", "timestamp": "", "source": "github", "line_count": 148, "max_line_length": 79, "avg_line_length": 31.513513513513512, "alnum_prop": 0.5405231560891939, "repo_name": "ryanss/holidays.py", "id": "91e72170418fd32a756931dbf33032f21aecd9f0", "size": "...
from django.contrib import admin from .models import CertificateMonitor, DomainMonitor, IpMonitor, IndicatorAlert, IndicatorTag, CertificateSubscription, DomainSubscription, IpSubscription from profiles.models import Profile def subscription_owner(obj): if type(obj) == CertificateMonitor: owner = Profile.o...
{ "content_hash": "e079165f48dee924af0c17ff88b1a8a6", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 155, "avg_line_length": 37.15909090909091, "alnum_prop": 0.7620795107033639, "repo_name": "LindaTNguyen/RAPID", "id": "d5004f9a81ae25172962f90c015a5710ff0d0a36", "size": "1...
def deprecation_warning(): print(""" ============================================================================= *** DEPRECATION WARNING *** Cookiecutter data science is moving to v2 soon, which will entail using the command `ccds ...` rather than `cookiecutter ...`. The cookiecutter command will continue to wo...
{ "content_hash": "f06aa523533c6f1193d6d8caaf11a48b", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 81, "avg_line_length": 35, "alnum_prop": 0.5909090909090909, "repo_name": "drivendata/cookiecutter-data-science", "id": "2bd49c083d871e53c199dfe0aa6f9ba410d8303f", "size": ...
from django import template from django.template.defaultfilters import stringfilter from django.utils.html import urlize as urlize from django.utils.safestring import mark_safe register = template.Library() @register.filter(is_safe=True, needs_autoescape=True) @stringfilter def urlize_newtab(value, autoescape=True):...
{ "content_hash": "380f0f4ba6a5a48124381edeb23009c0", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 81, "avg_line_length": 37.733333333333334, "alnum_prop": 0.7632508833922261, "repo_name": "pbanaszkiewicz/amy", "id": "ed2a7e04824876b77dcae3a8045dda8ad8b8b63e", "size": "5...
"""Contains convenience wrappers for creating variables in TF-Slim. The variables module is typically used for defining model variables from the ops routines (see slim.ops). Such variables are used for training, evaluation and inference of models. All the variables created through this module would be added to the MO...
{ "content_hash": "5fc60f69fb4e4e866246ff775ae18f2c", "timestamp": "", "source": "github", "line_count": 276, "max_line_length": 80, "avg_line_length": 35.14855072463768, "alnum_prop": 0.6836408617668281, "repo_name": "nathansilberman/models", "id": "d58bb5328d9a20fdfb0a2330156af68e2e977aa5", "size"...
from beltac import * from beltacreader import load from inserter import insert,version_imported,reject,setRefsDict,simple_dict_insert import urllib2 from datetime import datetime,timedelta import logging import zipfile from cStringIO import StringIO from bs4 import BeautifulSoup logger = logging.getLogger("importer") ...
{ "content_hash": "9aa3872494851290031c82841d70dfaf", "timestamp": "", "source": "github", "line_count": 110, "max_line_length": 129, "avg_line_length": 39.39090909090909, "alnum_prop": 0.5735056542810986, "repo_name": "bliksemlabs/bliksemintegration", "id": "2a8bdec5bd1ad5111c6e522e53d86a6046d96cbd",...
import itertools import json import re import subprocess import xml.etree.ElementTree as ET from collections import defaultdict from dataclasses import dataclass, field from pathlib import Path from typing import Set RESULT = Path(__file__).parent / "../corpus/aosp.json" DOWNLOADS = Path(__file__).parent / "../repos" ...
{ "content_hash": "e558bc0f32ac9523d01d531b4cf9e78e", "timestamp": "", "source": "github", "line_count": 572, "max_line_length": 108, "avg_line_length": 30.286713286713287, "alnum_prop": 0.57486723620411, "repo_name": "googlefonts/aosp-test-texts", "id": "dd2b0a99c1f9c88b5732276bfd676959fb9a93ca", "...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import sys from thrift.Thrift import TMessageType, TApplicationException, TType def process_main(twisted=False): """Decorator for process method.""" def _decorat...
{ "content_hash": "d28bca8725bd3bb010ac977275144ebd", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 79, "avg_line_length": 38.38095238095238, "alnum_prop": 0.586848635235732, "repo_name": "soumith/fbthrift", "id": "7299c8fd2c846bdf3955f3eb639f0a51dc7e532b", "size": "4816...
import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "djangoisfsite.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
{ "content_hash": "05880bec7a41db36831495a58d7fdd92", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 77, "avg_line_length": 26, "alnum_prop": 0.717948717948718, "repo_name": "letuananh/intsem.fx", "id": "6502be787353cc0b8f07048bfbafbac96cfa06ee", "size": "256", "binary": ...
import errno import os from contextlib import contextmanager from pants.base.exceptions import TaskError from pants.task.task import QuietTaskMixin, Task from pants.util.dirutil import safe_open from pants.util.meta import classproperty class ConsoleTask(QuietTaskMixin, Task): """A task whose only job is to prin...
{ "content_hash": "d2073a9d0c271a83b95f52bbd241ebd2", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 104, "avg_line_length": 37.433734939759034, "alnum_prop": 0.5947859671709044, "repo_name": "wisechengyi/pants", "id": "8ebc24a6583e92303436068ec74e4d2cc3722e3f", "size": "3...
import json import requests from hanlder import RequestHandler as BaseRequestHandler import tornado.web from ..utils import deal_errors, get_local_time from .forms import BlogWriterForm class RequestHandler(BaseRequestHandler): def q(self, query_string, query_variables={},headers={}): sid = self.get_sec...
{ "content_hash": "ec998aebcb44eb1c120bead216666f1a", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 100, "avg_line_length": 24.267857142857142, "alnum_prop": 0.5342163355408388, "repo_name": "nuanri/hiblog", "id": "7b439a13bf2a49997d7235ce2774aa1317bb8fc8", "size": "2735...
import platform from support import Group from support import meta_service from clastic import Application from clastic import render_basic PORT = 8888 META_PORT = 8889 def home_handler(): return 'Welcome to SuPPort!' def main(): app = Application([('/', home_handler, render_basic)]) meta_app = meta_s...
{ "content_hash": "c1fa596a9a7fe0080b117ccd43c6f07f", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 59, "avg_line_length": 23.272727272727273, "alnum_prop": 0.5768229166666666, "repo_name": "paypal/support", "id": "33af43dca6093a23c8355f9685fe578ab52c20bf", "size": "769",...
""" Unit tests for pyspark.sql; additional tests are implemented as doctests in individual modules. """ import os import sys import pydoc import shutil import tempfile import pickle import functools import time import datetime import py4j if sys.version_info[:2] <= (2, 6): try: import unittest2 as unittes...
{ "content_hash": "65d7e1c7fcc50da158aa39473656fa88", "timestamp": "", "source": "github", "line_count": 1207, "max_line_length": 100, "avg_line_length": 43.34051367025683, "alnum_prop": 0.5859458632818474, "repo_name": "pronix/spark", "id": "f465e1fa209419478f10b6d7944a008e0f1f72ba", "size": "53147...
from trex_stl_lib.api import * from trex_stl_lib.utils import parsing_opts, text_tables import threading import tempfile import select from distutils import spawn from subprocess import Popen import subprocess # defines a generic monitor writer class CaptureMonitorWriter(object): def deinit(self): # by de...
{ "content_hash": "c48845a61d6e4ec1fed27e216c336f4f", "timestamp": "", "source": "github", "line_count": 655, "max_line_length": 172, "avg_line_length": 33.966412213740455, "alnum_prop": 0.5084501977705861, "repo_name": "kisel/trex-core", "id": "5673adc74bc83cc7e4371e9db32f2480de2ad902", "size": "22...
import copy import os import re import shutil import tempfile import unittest from functools import partial from pathlib import Path import pytest import requests import yaml from huggingface_hub import ( DatasetCard, DatasetCardData, EvalResult, ModelCard, ModelCardData, metadata_eval_result,...
{ "content_hash": "9031b42e907a075e4772932245aab29c", "timestamp": "", "source": "github", "line_count": 923, "max_line_length": 113, "avg_line_length": 34.360780065005414, "alnum_prop": 0.5912659624783225, "repo_name": "huggingface/huggingface_hub", "id": "f035226811d061b57db526c3117679fa7766505b", ...
from django.test import TestCase from user_contacts.models import ( Person, Phone) class PersonTest(TestCase): def test_unicode(self): person = Person() first_name = "fred" last_name = "smith" person.first_name = first_name person.last_name = last_name expec...
{ "content_hash": "1af9e458ba58f7c4f913d974fcbd55a3", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 53, "avg_line_length": 24.642857142857142, "alnum_prop": 0.5942028985507246, "repo_name": "Victory/realpython-tdd", "id": "2d1f8fc7c55a92c8d1b8d54e68804548c64e7cfa", "size"...
import arcpy from arcpy.sa import * import os def init(input_shp): #arcpy.env.workspace = arcpy.env.scratchFolder arcpy.CheckOutExtension('Spatial') arcpy.AddMessage(arcpy.CheckExtension('Spatial')) # adding new shapefile to ArcMap mxd = arcpy.mapping.MapDocument("CURRENT") df = a...
{ "content_hash": "32db66aa704362187fdbb88991cd115d", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 79, "avg_line_length": 32.666666666666664, "alnum_prop": 0.710204081632653, "repo_name": "mdragunski/BottleNcr", "id": "ad101983da039c3d744a32283ad2ebf85aeb8a9d", "size": "...
""" SymPy is a Python library for symbolic mathematics. It aims to become a full-featured computer algebra system (CAS) while keeping the code as simple as possible in order to be comprehensible and easily extensible. SymPy is written entirely in Python and does not require any external libraries, except optionally for...
{ "content_hash": "4a0776defa533d53f256825ce9c90d97", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 75, "avg_line_length": 30.682539682539684, "alnum_prop": 0.743921365752716, "repo_name": "kmacinnis/sympy", "id": "b81cea2b36ad0ec3e43c67181f9b92d8ebd1257d", "size": "1933"...
from ..parsers import RegisterParser def test_parse_register_proper_data(Request): parser = RegisterParser() test_data = { 'email': 'test_email', 'password': 'test_password', } data = parser.parse_args(req=Request(test_data)) assert data == test_data def test_parse_register_mis...
{ "content_hash": "2b8de38e0c39a342851d6ab3df68058a", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 71, "avg_line_length": 29.217391304347824, "alnum_prop": 0.6488095238095238, "repo_name": "kszarlej/libkeep", "id": "44e2e856ce528f54a14c3afdffb07d806c0f1a70", "size": "672...
from __future__ import unicode_literals from django.db import migrations, models def load_data(apps, schema_editor): AccountType = apps.get_model("profiles", "AccountType") AccountType.objects.get_or_create( name="GITHUB", display_name="Github", social_auth_provider_name="github", ...
{ "content_hash": "93e7e0ebf7e56fcd498f45fd7d23a47c", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 86, "avg_line_length": 28.38235294117647, "alnum_prop": 0.6435233160621762, "repo_name": "noisy/steemprojects.com", "id": "0e9362c775464cf324fe4b2876dca0d70f3d40d6", "size"...
""" Python Interchangeable Virtual Instrument Library Copyright (c) 2016 Alex Forencich 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 righ...
{ "content_hash": "d01ea40720a1dcb2fa15d06f722478ad", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 86, "avg_line_length": 39.19047619047619, "alnum_prop": 0.7545565006075334, "repo_name": "Diti24/python-ivi", "id": "13904508d6be7e8e0af2d6c949d5824e776dfef7", "size": "164...
from threading import Event import os from sys import exc_info import netrc import errno from offlineimap.repository.Base import BaseRepository from offlineimap import folder, imaputil, imapserver, OfflineImapError from offlineimap.folder.UIDMaps import MappedIMAPFolder from offlineimap.threadutil import ExitNotifyThr...
{ "content_hash": "040af6d6c6a9390032265b72b35c5b7b", "timestamp": "", "source": "github", "line_count": 462, "max_line_length": 95, "avg_line_length": 38.18614718614719, "alnum_prop": 0.593583493934928, "repo_name": "frioux/offlineimap", "id": "60d5a08f666eb345e6dcf63ca2d340f19c23c528", "size": "18...
""" The setup script for Flask-OpenAPI. """ from setuptools import find_packages from setuptools import setup with open('README.rst') as f: readme = f.read() setup( name='Flask-OpenAPI', version='0.1.0a1', author='Remco Haszing', author_email='remcohaszing@gmail.com', description='Generate ...
{ "content_hash": "5a80fa00ef7d00a77a6bc5b1a0d38572", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 67, "avg_line_length": 21.037037037037038, "alnum_prop": 0.6267605633802817, "repo_name": "remcohaszing/flask-openapi", "id": "92bdb0f3e0c26089c385e328328164a9628a6edf", "s...
from __future__ import print_function from __future__ import absolute_import from __future__ import division import compas_rhino from compas.geometry import add_vectors from compas.artists import PrimitiveArtist from compas.colors import Color from .artist import RhinoArtist class CircleArtist(RhinoArtist, Primitive...
{ "content_hash": "e1236ff6499742f88bb5878c64740131", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 107, "avg_line_length": 34.20253164556962, "alnum_prop": 0.5684678016284234, "repo_name": "compas-dev/compas", "id": "48755a94bf7d86282e9069c6e4699b2b81884857", "size": "27...
"""The tests for Roller shutter platforms."""
{ "content_hash": "7ca625ffb1150ae72deec0a581783df6", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 45, "avg_line_length": 46, "alnum_prop": 0.717391304347826, "repo_name": "Julian/home-assistant", "id": "4fc6ddee8a9e6afdc57fbda698c8df2d68025057", "size": "46", "binary":...
from django.core.management.base import BaseCommand from django.utils.translation import ugettext_lazy from onadata.apps.logger.models.instance import Instance from onadata.apps.viewer.models.parsed_instance import xform_instances,\ datetime_from_str from onadata.libs.utils.common_tags import DELETEDAT, ID class...
{ "content_hash": "5353fdaff9f0f11fe51512c505b43a4d", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 78, "avg_line_length": 38.76, "alnum_prop": 0.6150670794633643, "repo_name": "piqoni/onadata", "id": "273b80a56e63b8d1f44b36f29e118ebf6ab91635", "size": "969", "binary": ...
from shop.models.productmodel import Product from shop.views import ShopDetailView class ProductDetailView(ShopDetailView): """ This view handles displaying the right template for the subclasses of Product. It will look for a template at the normal (conventional) place, but will fallback to using ...
{ "content_hash": "c434d22488b96b0eccd4e2a37166c738", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 76, "avg_line_length": 39.421052631578945, "alnum_prop": 0.7156208277703605, "repo_name": "ojii/django-shop", "id": "39be2b61257c71964db948eb3cae8d355121589a", "size": "773...
from conf import settings from core import accounts from core import logger #transaction logger def make_transaction(log_obj,account_data,tran_type,amount,**others): ''' deal all the user transactions :param account_data: user account data :param tran_type: transaction type :param amount: transact...
{ "content_hash": "c0f5e401dfc05a9d189bc767826801fa", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 117, "avg_line_length": 42.611111111111114, "alnum_prop": 0.622555410691004, "repo_name": "dianshen/python_day", "id": "1144e04a82ae3f3a2ca6d00601b65757ec5d1cbb", "size": "...
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('zerver', '0041_create_attachments_for_old_messages'), ] operations = [ migrations.AlterField( model_name='attachment', name='file_name', field=models.Tex...
{ "content_hash": "36cfb6157881b26bbc50ba4acdd61c23", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 63, "avg_line_length": 22.5, "alnum_prop": 0.5888888888888889, "repo_name": "timabbott/zulip", "id": "84f1da7717a342d19a0ed2674d94540d88eb5c77", "size": "360", "binary": ...
import os from setuptools import setup, find_packages # Setup version VERSION = '0.6.0' # Read description with open('README.rst', 'r') as readme: README_TEXT = readme.read() def write_version_py(): filename = os.path.join( os.path.dirname(__file__), 'tornadowebapi', 'version.py') ...
{ "content_hash": "e43155a1333b26a5b7eca38112e2192f", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 49, "avg_line_length": 21.3, "alnum_prop": 0.6150234741784038, "repo_name": "simphony/tornado-webapi", "id": "352f37ca90e7be09ddefdcac13d47a5ec8ba0f20", "size": "852", "b...
""" Build index by path into a content-keyed data store. """ # import binascii # from nlhtree import NLHLeaf # from xlattice import SHA1_BIN_NONE, SHA2_BIN_NONE # from xlcrypto import ( # AES_BLOCK_BYTES, addPKCS7Padding, stripPKCS7Padding) __all__ = ['__version__', '__version_date__', ] __version__ ...
{ "content_hash": "829cfca06d157054fb640fba59b1a48b", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 58, "avg_line_length": 22.6875, "alnum_prop": 0.6446280991735537, "repo_name": "jddixon/bindex", "id": "920c2a3103ca8a675fae3542be89686dee9d8582", "size": "386", "binary"...
from netforce.model import Model, fields, get_model import time import re from netforce.access import get_active_company, get_active_user, check_permission_other class SplitProduction(Model): _name = "split.production" _transient = True _fields = { "order_id": fields.Many2One("production.order", "...
{ "content_hash": "d8d4c68fcb8df3ef0b3838525376dcc8", "timestamp": "", "source": "github", "line_count": 508, "max_line_length": 128, "avg_line_length": 42.47047244094488, "alnum_prop": 0.533117033603708, "repo_name": "nfco/netforce", "id": "921aed028b5b3c1bed3479dc5b38adedc9daa296", "size": "22680"...
import dependency_manager import logging import mock import subprocess import unittest from battor import battor_error from battor import battor_wrapper from devil.utils import battor_device_mapping from devil.utils import find_usb_devices import serial from serial.tools import list_ports class DependencyManagerMoc...
{ "content_hash": "e41fab7141cd0516d3a20b342bd83957", "timestamp": "", "source": "github", "line_count": 361, "max_line_length": 80, "avg_line_length": 38.337950138504155, "alnum_prop": 0.7119219653179191, "repo_name": "benschmaus/catapult", "id": "3e48a3362dc90775d2ad07b03770f325c351f918", "size": ...
import proto # type: ignore __protobuf__ = proto.module( package="google.ads.googleads.v12.resources", marshal="google.ads.googleads.v12", manifest={"AdScheduleView",}, ) class AdScheduleView(proto.Message): r"""An ad schedule view summarizes the performance of campaigns by AdSchedule criteria....
{ "content_hash": "12c28b95bcd8b334b7fc4feb9bee1f80", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 84, "avg_line_length": 26.692307692307693, "alnum_prop": 0.6657060518731989, "repo_name": "googleads/google-ads-python", "id": "3d5bd07f8ebb62526fceb70bb155338cde2d80fb", "...
from oslo_config import fixture from oslotest import base from aodh import service class TestNotifierBase(base.BaseTestCase): def setUp(self): super(TestNotifierBase, self).setUp() conf = service.prepare_service(argv=[], config_files=[]) self.conf = self.useFixture(fixture.Config(conf))...
{ "content_hash": "aa0e986ed893a6c79015426e786937a4", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 64, "avg_line_length": 25.076923076923077, "alnum_prop": 0.7116564417177914, "repo_name": "openstack/aodh", "id": "74e87e45e3d1fc96b0cfeb26ea7623496b2aba9f", "size": "937",...
from io import ( BytesIO, StringIO, ) import random import string import numpy as np from pandas import ( Categorical, DataFrame, concat, date_range, read_csv, to_datetime, ) from ..pandas_vb_common import ( BaseIO, tm, ) class ToCSV(BaseIO): fname = "__test__.csv" ...
{ "content_hash": "1b022c51f946752fb474e8133f9f415b", "timestamp": "", "source": "github", "line_count": 528, "max_line_length": 88, "avg_line_length": 29.240530303030305, "alnum_prop": 0.5370814171902325, "repo_name": "jorisvandenbossche/pandas", "id": "153cad403dcc3594ae0e89585277c531ece4469d", "s...
import os import re import random import time import threading from concurrent.futures import ThreadPoolExecutor from eutester.euca.euca_ops import Eucaops from eutester.aws.ec2.euinstance import EuInstance from eutester.utils.eutestcase import EutesterTestCase from eutester.aws.ec2.ec2ops import EC2ops class Instan...
{ "content_hash": "8fe8155e16dc4acd740996018178ac0a", "timestamp": "", "source": "github", "line_count": 492, "max_line_length": 128, "avg_line_length": 54.90243902439025, "alnum_prop": 0.6066563009033022, "repo_name": "nephomaniac/eutester", "id": "0cbfd8c42a41931237b77154256a6706fe1d9963", "size":...