text
stringlengths
4
1.02M
meta
dict
""" Copyright (c) 2015-2020 Raj Patel(raj454raj@gmail.com), StopStalk 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 ...
{ "content_hash": "28beda2d7ef7d3d2f4a867605c4ea7e9", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 282, "avg_line_length": 50.03703703703704, "alnum_prop": 0.7050333086602517, "repo_name": "stopstalk/stopstalk-deployment", "id": "88c8420aa0fa00164c79bc88f264ab71aa7ebf92", ...
from __future__ import unicode_literals import logging import uuid import pytz from datetime import datetime, timedelta import ldap from django.apps import apps from django.conf import settings from django.contrib.auth import get_user_model from django.contrib.auth.models import Group from django.core.exceptions impo...
{ "content_hash": "2a0b5c04fa57bbf5db8a0f5d14c7a18f", "timestamp": "", "source": "github", "line_count": 777, "max_line_length": 216, "avg_line_length": 58.83268983268983, "alnum_prop": 0.5741911491260692, "repo_name": "marchete/django-adldap-sync", "id": "2563e12e1c9855437f41070ce40de3e692eaeb56", ...
"""Tests for open_spiel.python.algorithms.psro_v2.best_response_oracle.""" from absl.testing import absltest from absl.testing import parameterized from open_spiel.python import policy from open_spiel.python.algorithms import best_response from open_spiel.python.algorithms.psro_v2 import best_response_oracle import p...
{ "content_hash": "070dc65d408c1db5f9caf67c669e3aad", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 78, "avg_line_length": 39.38709677419355, "alnum_prop": 0.6945126945126945, "repo_name": "deepmind/open_spiel", "id": "3e458e02d64454d0b3573e4d08967a1b117a0b7a", "size": "3...
from nltk.sentiment.vader import SentimentIntensityAnalyzer class SentimentAnalyzer: def __init__(self): self.analyzer = SentimentIntensityAnalyzer() def __call__(self, string): return self.analyzer.polarity_scores(string) if __name__ == '__main__': analyzer = SentimentAnalyzer() str...
{ "content_hash": "7c47c343fac1cae02960854032d969e0", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 59, "avg_line_length": 27.214285714285715, "alnum_prop": 0.6692913385826772, "repo_name": "kiyomaro927/stdbt", "id": "5216f4687d82e137be4810046567238da3b378de", "size": "38...
from __future__ import division, unicode_literals """ Classes for reading/manipulating/writing VASP input files. All major VASP input files. """ __author__ = "Shyue Ping Ong, Geoffroy Hautier, Rickard Armiento, " + \ "Vincent L Chevrier" __copyright__ = "Copyright 2011, The Materials Project" __version__ = "1.1"...
{ "content_hash": "40a951cd192ad1548140965b1fa95626", "timestamp": "", "source": "github", "line_count": 1480, "max_line_length": 82, "avg_line_length": 37.7722972972973, "alnum_prop": 0.547466146718423, "repo_name": "yanikou19/pymatgen", "id": "88251f8fde5b30e35880729aee2ccbb0c8f15482", "size": "55...
from mongoengine import connect, DoesNotExist from flask import Flask, abort, redirect, url_for from Entry import Entry app = Flask(__name__) @app.route("/") def hello(): return "main" @app.route("/<url>/report") def report(url): return "report" @app.route("/<url>/<key>") def admin(url, key): return "ad...
{ "content_hash": "ac0e6a98ac77e08bdb62b05498500fba", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 49, "avg_line_length": 20.862068965517242, "alnum_prop": 0.6198347107438017, "repo_name": "bpospichil/imort.al", "id": "0c680421d1980983297f04de6af6bd3b69bc0b74", "size": "...
import networkx as nx __author__ = 'Ralf Kistner' def pairs(lst, circular=False): i = iter(lst) first = prev = item = i.next() for item in i: yield prev, item prev = item if circular: yield item, first def graph_components(graph): components = list(nx.connected_component...
{ "content_hash": "8c2754c4a9ed8c2322e63cf3543da62b", "timestamp": "", "source": "github", "line_count": 121, "max_line_length": 75, "avg_line_length": 26.58677685950413, "alnum_prop": 0.6052222567609574, "repo_name": "wallarelvo/TopoPRM", "id": "72e47413af89b395d877b95e3f0069b0b7050fb1", "size": "3...
import requests from allauth.socialaccount.providers.oauth2.views import (OAuth2Adapter, OAuth2LoginView, OAuth2CallbackView) from allauth.socialaccount.models import SocialAccount, SocialLogin from alla...
{ "content_hash": "cb52757054c801570a110e4cf0e3d5ff", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 77, "avg_line_length": 42.48571428571429, "alnum_prop": 0.5877605917955615, "repo_name": "Suite5/DataColibri", "id": "f6efc74a550d69d65c1b12e678a591575d8b7c21", "size": "14...
import unittest2 class FuelException(Exception): """Base Exception To correctly use this class, inherit from it and define a 'message' property. That message will get printf'd with the keyword arguments provided to the constructor. """ message = "An unknown exception occurred" def __init...
{ "content_hash": "9c826a8260b787ec141e2ece22f6a98f", "timestamp": "", "source": "github", "line_count": 175, "max_line_length": 79, "avg_line_length": 27.885714285714286, "alnum_prop": 0.6770491803278689, "repo_name": "eayunstack/fuel-ostf", "id": "0ca15612142813fd23ae52963df8b59df64747d7", "size":...
from .logresponse import LogResponse class GetCursorTimeResponse(LogResponse): """ The response of the get_cursor_time API from log. :type header: dict :param header: GetCursorTimeResponse HTTP response header :type resp: dict :param resp: the HTTP response body """ def __init__(sel...
{ "content_hash": "2e0e5d6e3b0b4fd03345d667404b74af", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 61, "avg_line_length": 25.107142857142858, "alnum_prop": 0.6187766714082503, "repo_name": "wjo1212/aliyun-log-python-sdk", "id": "3d5c5eec45e7b043fbfe39f19cda8eb968ba66f4", ...
""":mod:`numpy.ma..mrecords` Defines the equivalent of :class:`numpy.recarrays` for masked arrays, where fields can be accessed as attributes. Note that :class:`numpy.ma.MaskedArray` already supports structured datatypes and the masking of individual fields. .. moduleauthor:: Pierre Gerard-Marchant """ # We should ...
{ "content_hash": "251cd00dd43e236d973524d00f9a446c", "timestamp": "", "source": "github", "line_count": 772, "max_line_length": 82, "avg_line_length": 34.51424870466321, "alnum_prop": 0.5539876149371364, "repo_name": "simongibbons/numpy", "id": "bdce8b3bd76afc0b72d16be587700074e0a6632c", "size": "2...
from wherehows.common import Constant from com.ziclix.python.sql import zxJDBC from org.slf4j import LoggerFactory import sys, json import urllib2 import time class ElasticSearchIndex(): def __init__(self, args): self.logger = LoggerFactory.getLogger('jython script : ' + self.__class__.__name__) se...
{ "content_hash": "e0608911a85e41befb499c11e07e6679", "timestamp": "", "source": "github", "line_count": 592, "max_line_length": 152, "avg_line_length": 40.39358108108108, "alnum_prop": 0.5126500230000418, "repo_name": "theseyi/WhereHows", "id": "a98dad2a016b8fad7925ebd0aa7cc56aad746787", "size": "2...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Keywords', fields=[ ('id', models.AutoField(verbose_name='ID', serializ...
{ "content_hash": "c392084f1953b2f93b81cd5d544e5fe0", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 114, "avg_line_length": 29.604166666666668, "alnum_prop": 0.494018296973962, "repo_name": "AutomatedTester/petulant-meme", "id": "701a8eb98b00f24d14ec0aded0b4950efbbb2a9f", ...
''' Created on Oct 29, 2015 @author: ev0l ''' import tornado.gen from bson import ObjectId from handlers import BaseHandler class LikeOrNotHandler(BaseHandler): ''' 点赞 ''' @tornado.gen.coroutine def post(self): user = str(self.get_secure_cookie("user")) pic_id = ObjectId(self.get...
{ "content_hash": "8b31fd07b2da69e720b77a1edb462ea4", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 64, "avg_line_length": 24.678571428571427, "alnum_prop": 0.5788712011577424, "repo_name": "evolsnow/tornado-web", "id": "195c534fa049dd050a72968d23744bec1176aa2b", "size": ...
from datetime import datetime import logging import sqlparse from past.builtins import basestring import pandas as pd from sqlalchemy import ( Column, Integer, String, ForeignKey, Text, Boolean, DateTime, ) import sqlalchemy as sa from sqlalchemy import asc, and_, desc, select from sqlalchemy.sql.expression i...
{ "content_hash": "1abed8502ecfa93ae73272705f269abb", "timestamp": "", "source": "github", "line_count": 716, "max_line_length": 86, "avg_line_length": 36.59217877094972, "alnum_prop": 0.5464503816793893, "repo_name": "massgov/incubator-superset", "id": "96ef575986bfdd19cdd64a8324bad261110c38a7", "s...
from ds.vortex.core import baseNode from ds.vortex.core import plug as plugs class NotEqualToNode(baseNode.BaseNode): def __init__(self, name): """ :param name: str, the name of the node """ baseNode.BaseNode.__init__(self, name) def initialize(self): baseNode.BaseNode...
{ "content_hash": "0b40b467ed3aba415b9e0b8e0509716a", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 85, "avg_line_length": 32.275, "alnum_prop": 0.6522075910147173, "repo_name": "dsparrow27/vortex", "id": "8d1846b72430b54912e9845b0fe61963bed5f89a", "size": "1291", "bina...
from pydotnet.clr.CLRApi import CLRApi def ZDateTime(datetime, zone): """ Create ZDateTime """ clr = CLRApi.get() return clr.callstatic ("com.pydotnet.common.time.ZDateTime", "Parse", str(datetime), str(zone)) def ZTime(time): """ Create ZTime """ clr = CLRApi.get() return cl...
{ "content_hash": "c8b44dfb8985a646ffe583f736e84e05", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 99, "avg_line_length": 21.444444444444443, "alnum_prop": 0.6113989637305699, "repo_name": "tr8dr/.Net-Bridge", "id": "85bf7189f6dce76ce7e02a971ffb1743a280b239", "size": "16...
import json import webob from cinder import context from cinder import db from cinder import test from cinder.tests.unit.api import fakes from cinder.tests.unit import fake_notifier def return_volume_type_encryption(context, volume_type_id): return stub_volume_type_encryption() def stub_volume_type_encryption...
{ "content_hash": "5bd3d2298674cf4b0e058e656235876b", "timestamp": "", "source": "github", "line_count": 591, "max_line_length": 79, "avg_line_length": 40.67005076142132, "alnum_prop": 0.5369029788650358, "repo_name": "saeki-masaki/cinder", "id": "8e7085c8b62ed92c075ffa99427af17f48617209", "size": "...
from .FactorSet import FactorSet, factorset_product, factorset_divide __all__ = ['FactorSet', 'factorset_divide', 'factorset_product', ]
{ "content_hash": "057d161bbec69cf339e5d77c3c7bf319", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 69, "avg_line_length": 28.333333333333332, "alnum_prop": 0.6, "repo_name": "dungvtdev/upsbayescpm", "id": "4b70b8567e8dd926cf49e0f88e72c88edc8f2c93", "size": "170", "binar...
from mgl2d.app import App from mgl2d.graphics.quad_drawable import QuadDrawable from mgl2d.graphics.screen import Screen from mgl2d.graphics.texture import Texture app = App() main_screen = Screen(800, 600, 'Quad drawable') main_screen.print_info() # Textured quad centered quad = QuadDrawable(400, 300, 200, 200) quad...
{ "content_hash": "efa4f18993a4d4e752d672e5eff74764", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 57, "avg_line_length": 22.333333333333332, "alnum_prop": 0.753731343283582, "repo_name": "maxfish/mgl2d", "id": "47e7be609510351c1b2393f6948c35a7806d036b", "size": "558", ...
from maras.database_thread_safe import ThreadSafeDatabase from shared import DB_Tests, WithAIndex from hash_tests import HashIndexTests from tree_tests import TreeIndexTests from threading import Thread import os import time import random import pytest class Test_Database(DB_Tests): _db = ThreadSafeDatabase c...
{ "content_hash": "9c14a833f196be4eacb857997e45dbc9", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 91, "avg_line_length": 27.154761904761905, "alnum_prop": 0.5155633494081543, "repo_name": "thatch45/maras_old", "id": "2ed2090d91eb911da9ab39f8d5f6de54641ba57a", "size": "2...
from CommonServerPython import * from CommonServerUserPython import * ''' IMPORTS ''' from google.cloud import storage from typing import Any, Dict import requests import traceback import urllib3 ''' GLOBALS/PARAMS ''' RFC3339_DATETIME_FORMAT = '%Y-%m-%dT%H:%M:%S.%fZ' DEMISTO_DATETIME_FORMAT = '%Y-%m-%dT%H:%M:%S' ...
{ "content_hash": "e6cb00fbd323f858550f2ef240f75af3", "timestamp": "", "source": "github", "line_count": 584, "max_line_length": 120, "avg_line_length": 32.03595890410959, "alnum_prop": 0.6404404297396975, "repo_name": "demisto/content", "id": "dd1f711837b70028dc7c51abbddd110e574ff7f3", "size": "187...
from django import forms from django.conf import settings from tukey.cloud_attribute import cloud_details import pyelasticsearch class OsdcQueryForm(forms.Form): # def __init__(self, data): # super(OsdcQueryForm, self).__init__(data) # # print self.fields.keys() # # data_items = [(k,v) for k,...
{ "content_hash": "a2ffd431850dc1cc719e3976eff902fb", "timestamp": "", "source": "github", "line_count": 903, "max_line_length": 112, "avg_line_length": 53.40420819490587, "alnum_prop": 0.7113263105507631, "repo_name": "occ-data/tukey-portal", "id": "ffc8da3ee8165008f24e977fed04a495fd5da9e4", "size"...
import os import re from citeproc import CitationStylesStyle, CitationStylesBibliography from citeproc import Citation, CitationItem from citeproc import formatter from citeproc.source.json import CiteProcJSON from osf.models import PreprintService from website.settings import CITATION_STYLES_PATH, BASE_PATH, CUSTOM_...
{ "content_hash": "682d62f9221774209e05eb464d5349c5", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 109, "avg_line_length": 27.575342465753426, "alnum_prop": 0.6517635370094387, "repo_name": "chrisseto/osf.io", "id": "bbb67c2d37aaa3161a28e4d288df53b6cba35726", "size": "20...
__project__ = "yagmail" __version__ = "0.15.277" from yagmail.error import YagConnectionClosed from yagmail.error import YagAddressError from yagmail.password import register from yagmail.sender import SMTP from yagmail.sender import logging from yagmail.utils import raw from yagmail.utils import inline
{ "content_hash": "1f0e4c8dbfbc1044f884233a9af5d916", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 45, "avg_line_length": 30.6, "alnum_prop": 0.8104575163398693, "repo_name": "kootenpv/yagmail", "id": "005ffadf151e0610bb931903485caf5163436578", "size": "306", "binary":...
from django.conf import settings import erl_auth ERL_SESSION_KEY = 'erl_auth_username' ERL_SESSION_TOKEN = 'erl_auth_token' import auth class AuthMiddleware(object): _patched = False def process_request(self, request): username = request.COOKIES.get(ERL_SESSION_KEY, None) token = request.COOK...
{ "content_hash": "8d190ee010082ae4d8563a2b7c4f71a1", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 96, "avg_line_length": 37, "alnum_prop": 0.636724960254372, "repo_name": "finder/erl_auth", "id": "bd96b6918a4ad6a62e7707171072c46a627b2187", "size": "1258", "binary": fa...
from nucleardata import *
{ "content_hash": "2853d26e79b19a5de1b8e9b5825a736a", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 25, "avg_line_length": 26, "alnum_prop": 0.8076923076923077, "repo_name": "robertsj/poropy", "id": "a03e0f0e48ef399d681ebd198f1c98e85999d11e", "size": "913", "binary": fal...
import json import sys import os import requests import datetime import re from flask import Flask, Response, jsonify, request from flask_restful import Api, Resource from session_manager import SessionManager from slackclient import SlackClient APP_CLIENT_ID = os.environ['MS_APP_CLIENT_ID'] APP_CLIENT_SECRET = os.env...
{ "content_hash": "c9d092aa2e2f67ff31d3a6715e821e3f", "timestamp": "", "source": "github", "line_count": 158, "max_line_length": 104, "avg_line_length": 34.60126582278481, "alnum_prop": 0.6014267422718127, "repo_name": "JBPennington/SlackBot", "id": "dfa9bc52e91ed52ad509dc0b457b383cfe93d9b0", "size"...
from __future__ import unicode_literals from django.db import models, migrations import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('workflow', '0004_rename_models'), ] operations = [ migrations.AlterField( model_name='comment', ...
{ "content_hash": "f64e13ea62e6a369edf5bd5220fbe5c4", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 139, "avg_line_length": 35.5, "alnum_prop": 0.5552546045503792, "repo_name": "Findspire/workflow", "id": "5055065a1d7ece921ac50d331a2a79ff619550bd", "size": "3716", "bin...
import builtins import numpy as np from numpy.testing import suppress_warnings from operator import index from collections import namedtuple __all__ = ['binned_statistic', 'binned_statistic_2d', 'binned_statistic_dd'] BinnedStatisticResult = namedtuple('BinnedStatisticResult', ...
{ "content_hash": "19b177b0d7324a779fcbd5f929622139", "timestamp": "", "source": "github", "line_count": 762, "max_line_length": 79, "avg_line_length": 41.39238845144357, "alnum_prop": 0.607812054151739, "repo_name": "matthew-brett/scipy", "id": "9b16156b02697452c8107598f762ca794466b510", "size": "3...
import os import SimpleITK import pandas as pd import cv2 import numpy as np import sys xml_paths = np.genfromtxt("/media/philipp/qnap/LIDC/preprocessing/2_get_xml_paths_unblinded_read/xml_path_lst_unblinded_read.csv",dtype=str,delimiter=",") dcm_path_lst = [] offset_x_lst = [] offset_y_lst = [] offset_z_lst = [] ...
{ "content_hash": "490a10b3934c48320fed1ecbda50f36d", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 154, "avg_line_length": 25.536231884057973, "alnum_prop": 0.684449489216799, "repo_name": "NDKoehler/DataScienceBowl2017_7th_place", "id": "e0bf48a82b824af77009c23092a18f6c5f...
import sys from os.path import dirname, abspath, join as path_join from inspect import getfile, currentframe currentdir = dirname(abspath(getfile(currentframe()))) sippydir = path_join(currentdir, 'sippy_lite') sys.path.insert(0, sippydir) from Rtp_cluster_config import read_cluster_config from Rtp_cluster import Rtp...
{ "content_hash": "b6a99b91efdf566386d85ca34c4c7ef8", "timestamp": "", "source": "github", "line_count": 185, "max_line_length": 117, "avg_line_length": 35.74594594594595, "alnum_prop": 0.5821866021472857, "repo_name": "sippy/rtp_cluster", "id": "fe6bba21e2621fd71875dc963ed7c883889deca6", "size": "8...
import __builtin__ import contextlib import copy import datetime import errno import glob import os import random import re import shutil import threading import time import uuid import eventlet from eventlet import greenthread import fixtures from lxml import etree import mock from mox3 import mox from oslo_concurren...
{ "content_hash": "767435c32f5712db52b6d9ae363f6217", "timestamp": "", "source": "github", "line_count": 13807, "max_line_length": 97, "avg_line_length": 44.13145505902803, "alnum_prop": 0.5406951649617691, "repo_name": "jeffrey4l/nova", "id": "5228f7cdb086c70b030bb0519e0004f7204bed99", "size": "609...
"""The tests for Home Assistant ffmpeg.""" import asyncio from unittest.mock import MagicMock import homeassistant.components.ffmpeg as ffmpeg from homeassistant.components.ffmpeg import ( DOMAIN, SERVICE_RESTART, SERVICE_START, SERVICE_STOP, ) from homeassistant.const import ATTR_ENTITY_ID from homeas...
{ "content_hash": "eaf6105458d834d4f6a022ecd9f4f403", "timestamp": "", "source": "github", "line_count": 192, "max_line_length": 82, "avg_line_length": 31.578125, "alnum_prop": 0.6843146956952004, "repo_name": "qedi-r/home-assistant", "id": "e0b68cd61b15d857ca57fc7158a5551fe9fe26cb", "size": "6063",...
""" Test the autocomplete mode """ from pyqode.core.api import TextHelper from pyqode.qt import QtCore from pyqode.qt.QtTest import QTest from pyqode.python import modes as pymodes from ..helpers import editor_open def get_mode(editor): return editor.modes.get(pymodes.PyAutoCompleteMode) def test_enabled(editor...
{ "content_hash": "84e2704214db8e9680552c5374985a71", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 62, "avg_line_length": 24.904761904761905, "alnum_prop": 0.6854684512428298, "repo_name": "zwadar/pyqode.python", "id": "2cdc835a0f812a516f860e1ff72673a2a74190e2", "size": ...
"""Specific, edge-case tests for the MediaFile metadata layer. """ from __future__ import division, absolute_import, print_function import os import shutil from test import _common from test._common import unittest from test.helper import TestHelper from beets.util import bytestring_path import beets.mediafile impor...
{ "content_hash": "04835551cce34c8974bb97002071a616", "timestamp": "", "source": "github", "line_count": 394, "max_line_length": 79, "avg_line_length": 34.68274111675127, "alnum_prop": 0.6247347237467984, "repo_name": "jcoady9/beets", "id": "c95556820c994b77b28f953d17451b67ff6132fb", "size": "14336"...
import _plotly_utils.basevalidators class RowValidator(_plotly_utils.basevalidators.IntegerValidator): def __init__(self, plotly_name="row", parent_name="sankey.domain", **kwargs): super(RowValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, edi...
{ "content_hash": "81d855ea1f7414ea786146885f28c8eb", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 81, "avg_line_length": 36.46153846153846, "alnum_prop": 0.5864978902953587, "repo_name": "plotly/python-api", "id": "0d5a4e71acfe0e4aae01bda52460024bdb7e9941", "size": "474...
from sparktk.propobj import PropertiesObject from sparktk.tkcontext import TkContext tc = TkContext.implicit def export_to_orientdb(self, orientdb_conf, db_name, vertex_type_column_name=None, edge_type_column_name=None, ...
{ "content_hash": "91d619d482b1b7f8d8265098efee2adc", "timestamp": "", "source": "github", "line_count": 122, "max_line_length": 129, "avg_line_length": 43.39344262295082, "alnum_prop": 0.5243672081601813, "repo_name": "rodorad/spark-tk", "id": "e1bf4ca3fa3c4e694becd470d2b50d0286b8fc40", "size": "59...
import roslib; roslib.load_manifest('tms_ts_smach') import rospy import smach import smach_ros from smach_ros import ServiceState from smach import Concurrence from tms_msg_rp.srv import * from tms_msg_ts.srv import * def main(): rospy.init_node('tms_ts_smach_executive1') sm_root = smach.StateMachine(['succ...
{ "content_hash": "7f532bc7cae9ad2d5a15061c3967a063", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 91, "avg_line_length": 30.275, "alnum_prop": 0.5276630883567299, "repo_name": "irvs/ros_tms", "id": "3ac55241f5cb79a03319ca0bdd2bf20a2ed0f06e", "size": "1234", "binary": ...
import pandas class DataHelper(object): @staticmethod def who_test_data(): filename = 'tests/data/who_tests.csv' data = pandas.read_csv(filename) return data.values.tolist()
{ "content_hash": "f707cc9cc8fb2972ebf09876d6b71f8a", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 45, "avg_line_length": 23.11111111111111, "alnum_prop": 0.6442307692307693, "repo_name": "openhealthalgorithms/openhealthalgorithms", "id": "3121059a5010fdc32835440c21b97d6a2e...
from google.appengine.ext.webapp import template register = template.create_template_register()
{ "content_hash": "1f22e0018528f89546ceef23f197eec5", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 48, "avg_line_length": 48, "alnum_prop": 0.8333333333333334, "repo_name": "deleted/kml-layer-manager", "id": "03d2fd8c96a5fabb068b4a06648264b8c227ac66", "size": "96", "bin...
def headers_as_string(headers, line_separator='\n'): """ :param headers: Dictionary with headers. :type headers: dict """ return line_separator.join( ['{}: {}'.format(k, v) for k, v in headers.items()] )
{ "content_hash": "9997a474e04323a34b5aaf5d0e884d4f", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 59, "avg_line_length": 29.5, "alnum_prop": 0.5805084745762712, "repo_name": "Team-Zeus/okapi", "id": "28e6ad266128bd3edf7be9d144c3d44641972a64", "size": "236", "binary": f...
''' Created on Oct 12, 2015 @author: mentzera ''' es_host = '<YOUR ELASTICSEARCH ENDPOINT>' #without the https - for example: search-es-twitter-demo-xxxxxxxxxxxxxxxxxxx.us-east-1.es.amazonaws.com es_port = 80 es_bulk_chunk_size = 1000 #number of documents to index in a single bulk operation
{ "content_hash": "1befd53d9be32a946c2121685dd616e9", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 145, "avg_line_length": 27, "alnum_prop": 0.7407407407407407, "repo_name": "awslabs/aws-big-data-blog", "id": "c83274fd19d983d731425c4c1e6ac62696a23bef", "size": "297", "...
from django.utils.importlib import import_module from flows import config def _get_state_store(): store_module_name = config.FLOWS_STATE_STORE store_module = import_module(store_module_name) return store_module.StateStore() state_store = _get_state_store()
{ "content_hash": "be4312e9b4a2999d1fe886c45f3b9b9e", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 51, "avg_line_length": 27.1, "alnum_prop": 0.7490774907749077, "repo_name": "maikelwever/django-flows", "id": "a318c2f9b74f2a52e0e3dc9474d6ad01e2095f43", "size": "271", "...
import os from monorail.tiles import * from monorail.koon.geo import Vec3D class TestDirection: def test_dirs( self ): a = Direction.NORTH b = Direction.SOUTH assert not (a == b) assert a <> b a = b assert a == b def test_opposite( self ): ...
{ "content_hash": "28c19c89d8b5f68aab9a631bc1bf8f04", "timestamp": "", "source": "github", "line_count": 444, "max_line_length": 81, "avg_line_length": 35.77252252252252, "alnum_prop": 0.5642510860668639, "repo_name": "koonsolo/MysticMine", "id": "6c73cce8fa180f60bd0f86b21f3647ccc6b850a6", "size": "...
""" HTTP API - Handlers """ import hashlib import hmac import posixpath import re import time from urllib.parse import parse_qs, urlencode from uuid import UUID import sentry_sdk from authlib.oauth2 import OAuth2Error from flask import current_app, g, request, session from werkzeug.exceptions import BadRequest, NotFo...
{ "content_hash": "c54d42bcdba259dcb4633e65362e7d3e", "timestamp": "", "source": "github", "line_count": 276, "max_line_length": 117, "avg_line_length": 42.82608695652174, "alnum_prop": 0.6022842639593908, "repo_name": "ThiefMaster/indico", "id": "473ef0d0dda33921958282b776b4c5666d29faa5", "size": "...
import os from setuptools import setup, find_packages # Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved. from digits.extensions.view import GROUP as DIGITS_PLUGIN_GROUP # Utility function to read the README file. def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read(...
{ "content_hash": "564a0598d6f97050c71eea1423bbc6e4", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 70, "avg_line_length": 29.6, "alnum_prop": 0.6945945945945946, "repo_name": "Deepomatic/DIGITS", "id": "4f02cc7e3576055c932841cf0350b2e1120c1d44", "size": "740", "binary"...
from indico.modules.events import event_object_url_prefixes from indico.modules.events.notes.controllers import RHCompileNotes, RHDeleteNote, RHEditNote, RHGotoNote, RHViewNote from indico.web.flask.wrappers import IndicoBlueprint _bp = IndicoBlueprint('event_notes', __name__, template_folder='templates', virtual_tem...
{ "content_hash": "31588d6e895328ff92276c1f4cbb1a48", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 120, "avg_line_length": 55.05, "alnum_prop": 0.662125340599455, "repo_name": "DirkHoffmann/indico", "id": "7377943205afa5f95cec869d15ce974ff9b9780d", "size": "1315", "bin...
import sys output = sys.argv[-1] inputs = sys.argv[1:-1] with open(output, 'w') as ofile: ofile.write('#pragma once\n') for i in inputs: with open(i, 'r') as ifile: content = ifile.read() ofile.write(content) ofile.write('\n')
{ "content_hash": "499afbbd34eb686885f63b45578ca836", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 35, "avg_line_length": 22.75, "alnum_prop": 0.5641025641025641, "repo_name": "rhd/meson", "id": "198fa98e2d42bdec6e71e0209e2c38ef0a92d899", "size": "297", "binary": false...
import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models from django.conf import settings class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'PickledGraph' db.create_table('spacing_pickledgraph', ( ('i...
{ "content_hash": "ef45142fa3cd77aa22aa9393ed8c4ec3", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 156, "avg_line_length": 44.08955223880597, "alnum_prop": 0.5829383886255924, "repo_name": "google-code-export/marinemap", "id": "96d534af97cc7639d8525182c25540627ab8f130", ...
from wtforms.widgets import TextArea class BigTextArea(TextArea): def __init__(self, *args, **kwargs): super(BigTextArea, self).__init__() self.rows = kwargs.get('rows') self.cols = kwargs.get('cols') self.css_cls = kwargs.get('css_cls') self.style_ = kwargs.get('style_') ...
{ "content_hash": "b2584afe463dc0e19621720455dc2b24", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 65, "avg_line_length": 36.333333333333336, "alnum_prop": 0.5596330275229358, "repo_name": "eltonsantos/quokka", "id": "c92bd1c9d316da880feb7ee9f724ed61dc2355a7", "size": "6...
import decimal import os import pickle import yaml import re import numpy as np import pandas as pd import pytest import sklearn.datasets import sklearn.linear_model import sklearn.neighbors import mlflow import mlflow.pyfunc from mlflow.pyfunc import PyFuncModel import mlflow.pyfunc.model import mlflow.sklearn from ...
{ "content_hash": "701a5cb47a2258af6fcbd955258f7271", "timestamp": "", "source": "github", "line_count": 940, "max_line_length": 100, "avg_line_length": 37.49574468085106, "alnum_prop": 0.6210917550927765, "repo_name": "mlflow/mlflow", "id": "c7a523b0cbb98dedac35139d2b5ad7552cbdc7f3", "size": "35246...
"""The Version integration.""" from __future__ import annotations import logging from pyhaversion import HaVersion from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant from homeassistant.helpers.aiohttp_client import async_get_clientsession from .const import ( BOARD...
{ "content_hash": "3531eeadbca698aff4f5d51d27b47c36", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 87, "avg_line_length": 28.16393442622951, "alnum_prop": 0.6717112922002328, "repo_name": "toddeye/home-assistant", "id": "22dbad36d7b72321d3c83a24a200fbd68f8f7bff", "size":...
from . import views from django.urls import path urlpatterns = [ path('', views.Membership.as_view(), name='membership'), ]
{ "content_hash": "75c0b5aa1ade509ee32a739de2f30cc2", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 60, "avg_line_length": 18.571428571428573, "alnum_prop": 0.6846153846153846, "repo_name": "proevo/pythondotorg", "id": "8d12b46c9149da4e0006dac2f66f029d90c4b9f3", "size": "1...
from __future__ import absolute_import from typing import IO, Any, Text, Union, Set, Tuple from types import FrameType import sys from six.moves import map from six.moves import range try: import simplejson except ImportError: import json as simplejson # type: ignore import re import time import subprocess imp...
{ "content_hash": "bef7597f2f82630dcb6b59d50f93db6b", "timestamp": "", "source": "github", "line_count": 1162, "max_line_length": 162, "avg_line_length": 40.63253012048193, "alnum_prop": 0.5795615800063539, "repo_name": "amyliu345/zulip", "id": "0a31eb9d7d514023687f483ab3b1c3e195d5ce4c", "size": "48...
class Result(object): def __init__(self, **kwargs ): """ """ self.__dict__.update( kwargs ) def __str__(self): return "%s %s %s" % ( self.className, self.name, self.status ) def __repr__(self): module_name = self.__class__.__module__ class_name = self.__cla...
{ "content_hash": "61d21316853b3cd36c84fd85206ef8f4", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 70, "avg_line_length": 27.333333333333332, "alnum_prop": 0.47909407665505227, "repo_name": "ramonvanalteren/jenkinsapi", "id": "219d0cc282bc8351ea7f3e50a2a622a6aa105728", "...
"""Utitilies module.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from scipy import misc import tensorflow as tf # ################### # # Network helpers # # ################### # def sample_prob(probs, rand): """Get sam...
{ "content_hash": "68481f6fca64d1af3cf8397f1b1d533a", "timestamp": "", "source": "github", "line_count": 294, "max_line_length": 94, "avg_line_length": 27.255102040816325, "alnum_prop": 0.6052664420316984, "repo_name": "blackecho/Deep-Learning-TensorFlow", "id": "fd0b87fa7cba5a3c33ed94585cd8d2fde135d9...
"""Pedersen commitment functions. In a commitment scheme the committer: * decides (or is given) a secret message v * decides a random secret r * *commits* to v by applying the public commitment scheme algorithm and producing a commitment C=Commit(r,v) * makes C public Later, when he reveals r and v, the verifier *...
{ "content_hash": "3496d4664b6ded488c29bff6f7b87376", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 106, "avg_line_length": 32.75555555555555, "alnum_prop": 0.6801221166892809, "repo_name": "fametrano/BitcoinBlockchainTechnology", "id": "552597fcd2a962fc69d575fc5bf5e9794cc9...
import sys from . import db from . import config from . import log from datetime import datetime #import db import shutil import os def get_my_master(image_id): try: ml_db = db.connect(config.get('db_host'),config.get('db_user'),config.get('db_password'),config.get('db_name')) log.logger.info('Succ...
{ "content_hash": "95050b3bc36ecb9ea338d72b7f61264a", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 119, "avg_line_length": 36.12820512820513, "alnum_prop": 0.6401703335699077, "repo_name": "AtzeDeVries/master-image-retriever", "id": "1b6f041c888e439e112611ea8ca0b8cacc4ec2b...
r = 5.0 def volume(r): volume = ((4.0 / 3.0) * (3.14) * (r)**3) print 'Problem 1:' print 'The volume of a sphere with radius of 5 is:', round(volume) volume(r) #part 2 #suppose the cover price of a book is $24.95, but bookstores get a 40% discount. Shipping costs $3 for #the first copy and 75 cents for each addi...
{ "content_hash": "c2509f6bd1a8f50cbb3f8d2ba66a2e10", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 116, "avg_line_length": 31.160714285714285, "alnum_prop": 0.6561604584527221, "repo_name": "hollylemos/think-python", "id": "56d5428f9663c5948e62a8f051ec51e13dbcfcaa", "siz...
"""Support for Amazon Web Services (AWS).""" import asyncio import logging from collections import OrderedDict import voluptuous as vol from homeassistant import config_entries from homeassistant.const import ATTR_CREDENTIALS, CONF_NAME, CONF_PROFILE_NAME from homeassistant.helpers import config_validation as cv, dis...
{ "content_hash": "55b968153db7204bd9ce8442cc5bbccb", "timestamp": "", "source": "github", "line_count": 176, "max_line_length": 88, "avg_line_length": 31.176136363636363, "alnum_prop": 0.6307636231091671, "repo_name": "fbradyirl/home-assistant", "id": "1959cc05e80e5bae68180b91c7471b2784eaf455", "si...
''' GLOBAL SETTINGS: ''' from secret import * basedir = os.path.abspath(os.path.dirname(__file__)) class BaseConfig(object): DEBUG = False TESTING = False SECRET_KEY = APP_SECRET_KEY ROOT_PATH = os.path.abspath(os.path.dirname(__file__)) UPLOAD_IMG_FOLDER = os.path.abspath(os.path.join(os.getcw...
{ "content_hash": "6754bfe53a9567e6a47dbb7e36e17d3a", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 94, "avg_line_length": 23.666666666666668, "alnum_prop": 0.5950704225352113, "repo_name": "ArielInfante/HappyHour-Flask", "id": "d104c675da4be5ecee90be508d2b87362405b194", ...
""" Copyright 2017 Ryan Wick (rrwick@gmail.com) https://github.com/rrwick/Porechop Porechop makes use of C++ functions which are compiled in cpp_functions.so. This module uses ctypes to wrap them in similarly named Python functions. This file is part of Porechop. Porechop is free software: you can redistribute it and...
{ "content_hash": "68a0d04c129818537d47ba3b8a48206a", "timestamp": "", "source": "github", "line_count": 180, "max_line_length": 161, "avg_line_length": 48.52777777777778, "alnum_prop": 0.5898111047510017, "repo_name": "lfaino/LoReAn", "id": "ee33899de845a9917ddec697c06aa1f8d4c977a1", "size": "8759"...
''' Created on 05/06/2014 @author: nikolay ''' from __builtin__ import map import sys import time import collections import logging from os.path import os from sys import maxint from autoscale.FANNWrapper import FANNWrapper from math import * fann = FANNWrapper(topology=(1, 250, 2)); for k in range(1, 1000): ...
{ "content_hash": "cde0252a4ee0d01352f41b28099fac18", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 109, "avg_line_length": 26.1, "alnum_prop": 0.6372924648786717, "repo_name": "nikolayg/MCWeb", "id": "fd58665ce5e912616c61d4297b40945c14d4ee96", "size": "783", "binary": ...
from __future__ import absolute_import # Copyright (c) 2010-2019 openpyxl ## Incomplete! from openpyxl.descriptors.serialisable import Serialisable from openpyxl.descriptors import ( Typed, Float, Integer, Set, String, Bool, ) from openpyxl.descriptors.excel import Guid, ExtensionList from open...
{ "content_hash": "35286f76de244a6ddbffae40ea4d3392", "timestamp": "", "source": "github", "line_count": 215, "max_line_length": 90, "avg_line_length": 27.50232558139535, "alnum_prop": 0.5861660747505496, "repo_name": "cloudera/hue", "id": "556470cb03774752e543d05af3afbe83b7603378", "size": "5913", ...
import socket import time import logging from pymemcache.client.base import Client, PooledClient, _check_key from pymemcache.client.rendezvous import RendezvousHash logger = logging.getLogger(__name__) class HashClient(object): """ A client for communicating with a cluster of memcached servers """ d...
{ "content_hash": "cae0b1fa2d623de35dcab5cfd0a3a961", "timestamp": "", "source": "github", "line_count": 336, "max_line_length": 79, "avg_line_length": 34.75297619047619, "alnum_prop": 0.5299306328680312, "repo_name": "ewdurbin/pymemcache", "id": "946608d62356bb3840c5ae76a5aa549958ce940f", "size": "...
from functools import partial from PyQt5.QtGui import * from PyQt5.QtCore import * from PyQt5.QtWidgets import (QHBoxLayout, QLabel, QVBoxLayout) from electroncash.plugins import hook from electroncash.i18n import _ from electroncash_gui.qt import EnterButton from electroncash_gui.qt.util import ThreadedButton, Butto...
{ "content_hash": "d1ad20e9d50f1a191efccb824bef7ba1", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 74, "avg_line_length": 32.64179104477612, "alnum_prop": 0.6392318244170097, "repo_name": "molecular/electrum", "id": "3b121ddb56641a592a24d8ec920982dfc35a94df", "size": "21...
"""Generate Doxygen documentation.""" import datetime import os import shutil import subprocess import sys from common.skia import global_constants DOXYFILE_BASENAME = 'Doxyfile' # must match name of Doxyfile in skia root DOXYGEN_BINARY = 'doxygen' WORKDIR = os.path.join(os.pardir, 'doxygen_workdir') DOXYGEN_CONF...
{ "content_hash": "2fc079df1d46ca017e4e8d8035f4a9aa", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 79, "avg_line_length": 32.25352112676056, "alnum_prop": 0.6899563318777293, "repo_name": "eunchong/build", "id": "019fbdc5b9c1b10108200e1b450fad5398da7bb0", "size": "2476",...
""" epub object to create an epub ebook """ from lxml import etree as ET # import lxml.builder as builder from lxml import html as HT # from lxml.etree import Element import os import zipfile import htmlentitydefs import re # import logging def valid_filename(strname): """ create a valid filename from give...
{ "content_hash": "bad845b03f4a3e1541f580bf3510d2ae", "timestamp": "", "source": "github", "line_count": 583, "max_line_length": 80, "avg_line_length": 30.435677530017152, "alnum_prop": 0.5287984670874661, "repo_name": "azuer88/sol_books", "id": "8132605ce97803077dd4c033083a4cc8f4edc095", "size": "1...
from distutils.core import * from distutils import sysconfig # Third-party modules - we depend on numpy for everything import numpy # Obtain the numpy include directory. This logic works across numpy versions. try: numpy_include = numpy.get_include() except AttributeError: numpy_include = numpy.get_nump...
{ "content_hash": "9dc25444d43e705a08f6aab47ade83be", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 78, "avg_line_length": 30.6, "alnum_prop": 0.5441176470588235, "repo_name": "santisiri/popego", "id": "13bd7589ed86ea4707740f3465a84f0e63fabfe6", "size": "1265", "binary"...
from itertools import chain import os import socket import sys from ledis._compat import (b, xrange, imap, byte_to_chr, unicode, bytes, long, BytesIO, nativestr, basestring, iteritems, LifoQueue, Empty, Full, urlparse, parse_qs) from ledis.exceptions import ( L...
{ "content_hash": "61aa0aaf258f42cb5001858fece753ec", "timestamp": "", "source": "github", "line_count": 590, "max_line_length": 79, "avg_line_length": 35.69661016949153, "alnum_prop": 0.5783675988794454, "repo_name": "holys-archive/ledisdb", "id": "4a393177fb1b80b4bf11633fe89cc152441a4c68", "size":...
import shutil from django.contrib.admin.models import User from projects.models import Project from rtd_tests.utils import make_test_git from rtd_tests.base import RTDTestCase class TestBuilding(RTDTestCase): """These tests run the build functions directly. They don't use celery""" fixtures = ['eric.json']...
{ "content_hash": "cbbcfe5d94a973122dd4a58f1cf93930", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 77, "avg_line_length": 27.266666666666666, "alnum_prop": 0.636919315403423, "repo_name": "Acidburn0zzz/readthedocs.org", "id": "0f58e98c4136152f0c0cad67be50f5f655de0592", "...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('heatherr', '0002_auto_20160211_0904'), ] operations = [ migrations.AlterField( model_name='slackaccount', name='bot_status',...
{ "content_hash": "f3d713db5bd6a8d4de97838b7371dfb5", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 185, "avg_line_length": 29.11111111111111, "alnum_prop": 0.6106870229007634, "repo_name": "praekeltfoundation/heatherr", "id": "cd05cd4463f86804cec9b8622de5c0d40ce1e12c", "...
from unittest import mock import uuid import paramiko from cinder import exception from cinder import ssh_utils from cinder.tests.unit import test class FakeSock(object): def settimeout(self, timeout): pass class FakeTransport(object): def __init__(self): self.active = True self.s...
{ "content_hash": "1a54378999efefa488fe8f313109a8be", "timestamp": "", "source": "github", "line_count": 395, "max_line_length": 79, "avg_line_length": 38.20253164556962, "alnum_prop": 0.5151093439363817, "repo_name": "openstack/cinder", "id": "3d4dd622547cc9ad19a222521e738c21d15d4826", "size": "156...
"""Flags for managing compute devices. Currently only contains TPU flags.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from absl import flags import tensorflow as tf from tf2_common.utils.flags._conventions import help_wrap def require_cloud_stora...
{ "content_hash": "8142676e423969807181f0353544b880", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 80, "avg_line_length": 32.236111111111114, "alnum_prop": 0.6423955191727704, "repo_name": "mlperf/training_results_v0.7", "id": "e3eab99fedd01b530e0bcaa071bfecea8743910c", ...
from ctypes import c_void_p, POINTER, sizeof, Structure, windll, WinError, WINFUNCTYPE, addressof, c_size_t, c_ulong from ctypes.wintypes import BOOL, BYTE, DWORD, HANDLE, LARGE_INTEGER LPVOID = c_void_p LPDWORD = POINTER(DWORD) SIZE_T = c_size_t ULONG_PTR = POINTER(c_ulong) # A ULONGLONG is a 64-bit unsigned integer...
{ "content_hash": "934c09afbca9ab26b7eec2c2db26485b", "timestamp": "", "source": "github", "line_count": 157, "max_line_length": 116, "avg_line_length": 35.77070063694268, "alnum_prop": 0.6404914529914529, "repo_name": "jcartledge/sublime-worksheet", "id": "0a735c47387c19c9ee0418d5192c2ac259eaebf3", ...
import pyaf.ForecastEngine as autof import pyaf.Bench.TS_datasets as tsds b1 = tsds.generate_random_TS(N = 4000 , FREQ = 'H', seed = 0, trendtype = "constant", cycle_length = 24, transform = "None", sigma = 0.1, exog_count = 0); df = b1.mPastData lEngine = autof.cForecastEngine() lEngine H = 12; lEngine.mOptions...
{ "content_hash": "c5e8efb9f6203ea97d71e73363e31b58", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 154, "avg_line_length": 26.952380952380953, "alnum_prop": 0.7420494699646644, "repo_name": "antoinecarme/pyaf", "id": "0ab050fa583cb1dec7cbd2e263b8d32bfafa5cf8", "size": "5...
from __future__ import unicode_literals import django import django.contrib.auth.models from django.db import migrations, models import django.db.models.deletion from . import IrreversibleMigration class Migration(IrreversibleMigration): dependencies = [ ('cms', '0019_set_pagenode'), ] operati...
{ "content_hash": "65bb4d589349d5faf104018a398c75f9", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 106, "avg_line_length": 31.986842105263158, "alnum_prop": 0.5717811600164542, "repo_name": "yakky/django-cms", "id": "7403485533e42fe574c222dd9f6bca32ffc8c9fd", "size": "25...
import logging import json from flask import Response from flask import jsonify from flask_restful import Resource from flask_jwt import JWT, jwt_required, current_identity from flask_injector import FlaskInjector from injector import inject from ..db.repositories.repositories_definitions import SpotsRepository logger...
{ "content_hash": "8bbc40fb87b0f192921b67cb1c6d560b", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 85, "avg_line_length": 31.774193548387096, "alnum_prop": 0.683248730964467, "repo_name": "jacekdalkowski/bike-timer", "id": "76a9f60238e308142dbb44fc1a9b31e9a06a0a0b", "siz...
import platform import getpass import pickle import os import yaml from fabkit import api, env, util, sudo from oslo_config import cfg CONF = cfg.CONF @api.task @api.hosts('localhost') def node(*options): len_options = len(options) # init env env.cmd_history = [] # for debug env.last_runs = [] ...
{ "content_hash": "8a0194e125af8aac45745025d78d3a97", "timestamp": "", "source": "github", "line_count": 199, "max_line_length": 92, "avg_line_length": 31.14572864321608, "alnum_prop": 0.515811552113585, "repo_name": "fabrickit/fabkit", "id": "cd000c245f7c307e3732949f7c6ee1fcae196886", "size": "6215...
import RPi.GPIO as GPIO import time GPIO.setwarnings(False) GPIO.setmode(GPIO.BCM) GPIO.setup(14,GPIO.OUT) state=True GPIO.output(14,False)
{ "content_hash": "58fbcc6399a8252de075344f20395e8a", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 23, "avg_line_length": 15.88888888888889, "alnum_prop": 0.7762237762237763, "repo_name": "raj808569/homeautomationIOT", "id": "e67d404cf45c32e47fece266bf35f9ec0d7468af", "si...
""" Support for ZoneMinder. For more details about this component, please refer to the documentation at https://home-assistant.io/components/zoneminder/ """ import logging import voluptuous as vol from homeassistant.const import ( CONF_HOST, CONF_PASSWORD, CONF_PATH, CONF_SSL, CONF_USERNAME, CONF_VERIFY_SSL,...
{ "content_hash": "15bb90c9f4beb62716db7b4ef97fe9a9", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 78, "avg_line_length": 30.256756756756758, "alnum_prop": 0.62751228226887, "repo_name": "tinloaf/home-assistant", "id": "8d603d04f59bc2427dc2c82d235c09d9efafd49d", "size": ...
from __future__ import unicode_literals from django.conf import settings #: Whether HTML received from the editor should be sanitized or not. TEXT_MEDIUMEDITOR_HTML_SANITIZE = getattr( settings, "TEXT_MEDIUMEDITOR_HTML_SANITIZE", True, ) #: List of allowed HTML tags which are not sanitized. By default i...
{ "content_hash": "4ea0acad5f85cc58bd44829d0084b7bf", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 78, "avg_line_length": 23.76923076923077, "alnum_prop": 0.6332254584681769, "repo_name": "RauliL/djangocms-text-mediumeditor", "id": "409da72c6b0ca6f45edb89ade8c3927255806f23...
""" OpenAPI spec version: Generated by: https://github.com/swagger-api/swagger-codegen.git Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.a...
{ "content_hash": "46824123fa3d4e765ce26e371cdeea2e", "timestamp": "", "source": "github", "line_count": 154, "max_line_length": 340, "avg_line_length": 33.27272727272727, "alnum_prop": 0.6206088992974239, "repo_name": "detiber/lib_openshift", "id": "591a4fd00b63afd4688732d2b706c6455f583eeb", "size"...
message = "Hello charm" print(message) # called string methods print(message.title()) print(message.upper()) print(message.lower()) myint1 = 7 myint2 = 20 print(myint1 + myint2) myfloat1 = 1.5 myfloat2 = 2.5 print(myfloat1 + myfloat2) #convert int to str print("Happy " + str(myint2) + " birthday")
{ "content_hash": "016071246f92d2e907d260f0d83c30f2", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 43, "avg_line_length": 15.947368421052632, "alnum_prop": 0.7062706270627063, "repo_name": "panacloud/learn-python", "id": "d7f37607e481969747d964af25ff7c5e224b7a5a", "size"...
""" SoftLayer.transports ~~~~~~~~~~~~~~~~~~~~ XML-RPC transport layer that uses the requests library. :license: MIT, see LICENSE for more details. """ # Required imports to not break existing code. from .debug import DebugTransport from .fixture import FixtureTransport from .rest import RestTransport...
{ "content_hash": "205590dd1cce1c767876206aa3506a45", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 65, "avg_line_length": 25.7, "alnum_prop": 0.7276264591439688, "repo_name": "softlayer/softlayer-python", "id": "94809ab69ada1029e53d8a5c80d588245cc18bb1", "size": "771", ...
import warnings as _warnings _warnings.resetwarnings() _warnings.filterwarnings('error') from tdi.model_adapters import RenderAdapter from tdi import html template = html.from_string(""" <anode tdi="level1"> <node tdi="-nested" tdi:overlay="ov"> <xnode tdi="a" tdi:scope="baz"></xnode> </node> <yno...
{ "content_hash": "8b074c86819c6c956a2a0a2465aa3f27", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 62, "avg_line_length": 27.476190476190474, "alnum_prop": 0.6845753899480069, "repo_name": "ndparker/tdi", "id": "3dc7321e77f1758502f9059857346f4d24b80384", "size": "599", ...
from unittest import TestCase from mock import patch import probe.controllers.braintasks as module class TestBrainTasks(TestCase): @patch("probe.controllers.braintasks.async_call") def test_register_probe(self, m_async_call): module.register_probe("name", "displayname", "category", ...
{ "content_hash": "4653c937583cbad3e4f71275f9ea4f7c", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 65, "avg_line_length": 42.55555555555556, "alnum_prop": 0.45691906005221933, "repo_name": "quarkslab/irma", "id": "3d7f208382f90c0e686c6af20440d952a445fa82", "size": "766",...
import unittest import mock class TestConnection(unittest.TestCase): @staticmethod def _get_target_class(): from google.cloud.dns._http import Connection return Connection def _make_one(self, *args, **kw): return self._get_target_class()(*args, **kw) def test_build_api_url_...
{ "content_hash": "c04858de5c054983d6f73fbb03a574ba", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 86, "avg_line_length": 36.30882352941177, "alnum_prop": 0.5990279465370595, "repo_name": "tswast/google-cloud-python", "id": "f2f034bab6953ea95d126cb6a27a003221567985", "si...
"""HTTP server base class. Note: the class in this module doesn't implement any HTTP request; see SimpleHTTPServer for simple implementations of GET, HEAD and POST (including CGI scripts). Contents: - BaseHTTPRequestHandler: HTTP request handler base class - test: test function XXX To do: - send server version - l...
{ "content_hash": "d44bcfd222dacd3943b983d6bb7e29e0", "timestamp": "", "source": "github", "line_count": 483, "max_line_length": 78, "avg_line_length": 34.12215320910973, "alnum_prop": 0.6151325769067411, "repo_name": "MalloyPower/parsing-python", "id": "4d6d058fe163ac046da3d6b7a41538c804bdfc15", "s...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import setuptools with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name="tensorboard_plugin_wit", version="1.8.1", description="What-If Tool TensorBoard plugi...
{ "content_hash": "181b850d6e4d5daa3b17875db1d0d251", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 84, "avg_line_length": 27.3, "alnum_prop": 0.6532356532356532, "repo_name": "PAIR-code/what-if-tool", "id": "07f147e4a59ec67ce4f6eb744480fe2e4d95e38c", "size": "1509", "b...
''' Created on Dec 12, 2012 @author: rafaelolaechea ''' from z3 import * from time import time METRICS_MAXIMIZE = 1 METRICS_MINIMIZE = 2 def GuidedImprovementAlgorithm(s, metrics_variables, metrics_objective_direction, verbose=False): count_paretoPoints = 0 ParetoFront = [] start_time = time() if s....
{ "content_hash": "ab15cca120aaf7c2fcc97df722d29fc9", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 131, "avg_line_length": 43.26966292134831, "alnum_prop": 0.6759283303038172, "repo_name": "gsdlab/claferMooStandalone", "id": "df229d5dbea93953d6de1fa830a847b1892b944a", "s...
from fconfig import configuration configuration.generate_config()
{ "content_hash": "704d2b591bcc6b1c2b1dbb3f30bbc52b", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 33, "avg_line_length": 22, "alnum_prop": 0.8636363636363636, "repo_name": "aicenter/roadmap-processing", "id": "5e9f059a067c13a4f058eb5077763519aad3d9b4", "size": "880", "...
import logging from django.conf import settings from horizon import exceptions __all__ = ('APIResourceWrapper', 'APIDictWrapper', 'get_service_from_catalog', 'url_for',) LOG = logging.getLogger(__name__) class APIResourceWrapper(object): """ Simple wrapper for api objects Define _attrs o...
{ "content_hash": "35b3673b1d3a76e5727e941f40e4bcdf", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 77, "avg_line_length": 32.06185567010309, "alnum_prop": 0.5807073954983922, "repo_name": "gyang/horizon", "id": "54ae3db13ab431c60fc8a863cbe8c03c2db34a2f", "size": "3919", ...
class WorkbookResponse(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.""" def __init__(self): """ Attributes: swaggerTypes (dict): The key is attribute name and the value is attribute type. attributeM...
{ "content_hash": "60f0b5df42b0f19af615221909167bec", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 97, "avg_line_length": 30.56, "alnum_prop": 0.5510471204188482, "repo_name": "farooqsheikhpk/Aspose_Cells_Cloud", "id": "7e5cdb0fd11be5db5fd46b161ff4e1b696efdb44", "size": ...
import json import socket import sys import time import asfgit.cfg as cfg import asfgit.git as git import asfgit.log as log def main(): for ref in git.stream_refs(sys.stdin): if ref.is_tag(): rname = ref.name if hasattr(ref, 'name') else "unknown" send_json({ "repo...
{ "content_hash": "5ce3b6a5f2802816585728ed121b0bcf", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 78, "avg_line_length": 33.44303797468354, "alnum_prop": 0.4651778955336866, "repo_name": "chtyim/infrastructure-puppet", "id": "65cc6c5731571d68b4071753fbfb4dfed71c5dd7", "...
import os import re import argparse from shutil import copyfile SOURCE_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'src')) DEFAULT_PLATFORM_TOOLSET = R'v142' libs = [ 'libbitcoin_cli', 'libbitcoin_common', 'libbitcoin_crypto', 'libbitcoin_node', 'libbitcoin_util', 'libb...
{ "content_hash": "233a862e024b3f2f1d83053bf8fdb13c", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 157, "avg_line_length": 41.955357142857146, "alnum_prop": 0.5967227069589275, "repo_name": "jlopp/statoshi", "id": "819fe1b7aef4b1ba5dd26e775f04e94a1a051d36", "size": "491...
from django.db import models from councils.models import Council class DataQuality(models.Model): class Meta: verbose_name_plural = "Data Quality" def __unicode__(self): return "Data quality for %s" % self.council council = models.OneToOneField( Council, primary_key=True...
{ "content_hash": "9c3596f694ebaf64e341d057ef118a0a", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 65, "avg_line_length": 24.548387096774192, "alnum_prop": 0.6990801576872536, "repo_name": "DemocracyClub/UK-Polling-Stations", "id": "1f48b67834a34dcf26a680d2e379bf86c8f6ceb4...
""" Python parse tree definitions. This is a very concrete parse tree; we need to keep every token and even the comments and whitespace between tokens. There's also a pattern matching implementation here. """ __author__ = "Guido van Rossum <guido@python.org>" import sys import warnings from io import StringIO HUG...
{ "content_hash": "59fced044491009d7f2bdb57c7e66f96", "timestamp": "", "source": "github", "line_count": 856, "max_line_length": 88, "avg_line_length": 32.53504672897196, "alnum_prop": 0.5554398563734291, "repo_name": "MalloyPower/parsing-python", "id": "f6df3a0d324e0e939e43407f8bf9a1ba990b2033", "s...
""" This module houses the Geometry Collection objects: GeometryCollection, MultiPoint, MultiLineString, and MultiPolygon """ from ctypes import byref, c_int, c_uint from django.contrib.gis.geos import prototypes as capi from django.contrib.gis.geos.geometry import GEOSGeometry from django.contrib.gis.geos.l...
{ "content_hash": "46b43b866004fef0cf685de0f7f38dce", "timestamp": "", "source": "github", "line_count": 126, "max_line_length": 113, "avg_line_length": 36.57936507936508, "alnum_prop": 0.648730744196138, "repo_name": "diego-d5000/MisValesMd", "id": "7134edb4855245db2f3c1ccaf7aba57eeb3f0fb3", "size"...