text
stringlengths
4
1.02M
meta
dict
from django.conf import settings from django.core.files.uploadedfile import SimpleUploadedFile from mock import patch from nose.tools import eq_ import amo import amo.tests from mkt.comm.forms import CommAttachmentForm @patch.object(settings, 'MAX_REVIEW_ATTACHMENT_UPLOAD_SIZE', 1024) class TestReviewAppAttachment...
{ "content_hash": "a8e31d166490aa2637f681d0b79956f0", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 69, "avg_line_length": 30.649122807017545, "alnum_prop": 0.6187750429307384, "repo_name": "ngokevin/zamboni", "id": "0306b2b6dba5319a44ef0c117f656ab266eda3ef", "size": "174...
"""incertitude geonames loader is a working example of creating a simple geocoder for possibly ambiguous input queries. Usage: incertitude.py <mapping_file.json> <geonames_file_path> <settings_file.json> <host:port> incertitude.py (-h | --help) incertitude.py --version Options: -h --help Show this screen....
{ "content_hash": "ace7f5b9fc72d9729bab8d36ee40d2d3", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 90, "avg_line_length": 29.428571428571427, "alnum_prop": 0.5631067961165048, "repo_name": "ClipCard/incertitude", "id": "75ca0dd82524ec6c5bae43f3be907c1fe99caf2d", "size": ...
from django.utils.translation import gettext_lazy as _ import horizon from openstack_dashboard.dashboards.admin import dashboard class ShareSnapshots(horizon.Panel): name = _("Share Snapshots") slug = 'share_snapshots' permissions = ( 'openstack.services.share', ) dashboard.Admin.register(Sh...
{ "content_hash": "436c910a1d6683633e4bd357b9fd0910", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 58, "avg_line_length": 23.857142857142858, "alnum_prop": 0.7365269461077845, "repo_name": "openstack/manila-ui", "id": "71e693bcc733b3f34502b78f0f9ab520c8bc168a", "size": "...
import os import sys import re import platform import shutil import traceback import time import json from Utils.WAAgentUtil import waagent import Utils.HandlerUtil as Util from web_console.web_console_handler import WebConsoleHandler # Global variables definition EXTENSION_SHORT_NAME = 'SteppingStone' def install(...
{ "content_hash": "fff679ea8fbbfab6bbecb0dc1c6f527b", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 120, "avg_line_length": 36.2970297029703, "alnum_prop": 0.6099290780141844, "repo_name": "Snesha/azure-linux-extensions", "id": "5070aef882bf35dc7c735abbc98bdfe8be7c923a", ...
from django import forms from external_push.models import GenericPushTarget, BrewersFriendPushTarget, BrewfatherPushTarget, ThingSpeakPushTarget, GrainfatherPushTarget from django.core import validators import fermentrack_django.settings as settings from django.forms import ModelForm class GenericPushTargetModelFor...
{ "content_hash": "a046a439c9ffaa57409a2107eaeee54c", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 142, "avg_line_length": 35.05263157894737, "alnum_prop": 0.7184684684684685, "repo_name": "thorrak/fermentrack", "id": "1f83115a743ec5cf0977b09f9685a258d938a4a9", "size": "...
import os import slack import logging from datetime import datetime logger = logging.getLogger(__name__) def case_not_found(channel_id, user_id, case): """ Informs the user of their case could not be found. Parameters ---------- channel_id : str unique string used to idenify a Slack chan...
{ "content_hash": "315a53466714370aa2994ddedab8382a", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 91, "avg_line_length": 32.78048780487805, "alnum_prop": 0.6294642857142857, "repo_name": "GoogleCloudPlatform/professional-services", "id": "b22089eaaaccc91f7f2b2933dfba71df9...
import sys import os import argparse import shutil import subprocess import platform fips_dir = os.path.normpath(os.path.dirname(os.path.abspath(__file__)) + '/..') # find the path of rt.jar jre_paths = subprocess.check_output(['java', 'GetRT'], cwd=fips_dir+'/tools').decode("utf-8") if platform.system() == 'Windows':...
{ "content_hash": "d9aa2122a7fd8215370e3df360b86361", "timestamp": "", "source": "github", "line_count": 208, "max_line_length": 119, "avg_line_length": 32.66826923076923, "alnum_prop": 0.623252391464312, "repo_name": "floooh/fips", "id": "7d73ba07170c88558885ca65ced3dc890076e2c7", "size": "7456", ...
"""Set of functions for encapsulating data according to the PEM format. PEM (Privacy Enhanced Mail) was an IETF standard for securing emails via a Public Key Infrastructure. It is specified in RFC 1421-1424. Even though it has been abandoned, the simple message encapsulation it defined is still widely used to...
{ "content_hash": "5fe98e6349cb923a5feecd61a0b56c6b", "timestamp": "", "source": "github", "line_count": 142, "max_line_length": 90, "avg_line_length": 37.014084507042256, "alnum_prop": 0.6092085235920852, "repo_name": "chronicwaffle/PokemonGo-DesktopMap", "id": "149d8eea2e2e7f473102ae4f9185d9ce8c4572...
"""Soft Nearest Neighbors Loss. FaceNet: A Unified Embedding for Face Recognition and Clustering https://arxiv.org/abs/1902.01889 """ from typing import Any, Callable, Union import tensorflow as tf from tensorflow_similarity.algebra import build_masks from tensorflow_similarity.distances import Distance, dist...
{ "content_hash": "c9dfc9ee974c45366825d66cd3fa3f94", "timestamp": "", "source": "github", "line_count": 118, "max_line_length": 106, "avg_line_length": 33.83050847457627, "alnum_prop": 0.6698396793587175, "repo_name": "tensorflow/similarity", "id": "572cbe195fefd27b401da3ada7a3b1db15471bde", "size"...
"""Helpers for evaluating the log likelihood of pianorolls under a model.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import time from magenta.models.coconet import lib_tfutil from magenta.models.coconet import lib_util import numpy as np from scipy....
{ "content_hash": "94dc1025f69cacfcc697bfa108334ce7", "timestamp": "", "source": "github", "line_count": 301, "max_line_length": 80, "avg_line_length": 32.55813953488372, "alnum_prop": 0.6457142857142857, "repo_name": "adarob/magenta", "id": "8761159540c0c8a9d2690a43018f03d1aa5ed50a", "size": "10385...
from django.urls import include, path from rest_framework import routers from feeds.viewsets import CategoryViewSet, SubscriptionViewSet, ItemViewSet router = routers.DefaultRouter() router.register(r'categories', CategoryViewSet, base_name='category') router.register(r'subscriptions', SubscriptionViewSet, base_nam...
{ "content_hash": "674c8e1ae6c25bfab1d2e71feba1f5a6", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 80, "avg_line_length": 29.933333333333334, "alnum_prop": 0.7861915367483296, "repo_name": "jochenklar/reader2", "id": "d741499db01a7e899e2b1fdfce7e6a8d8a20666f", "size": "4...
{ '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" é uma expressão opcional como "field1=\'newvalue\'". Não é possível atualizar ou excluir os resultados de uma junção', '# of International Staff': '# De equipe internacional', '# of National S...
{ "content_hash": "74341fc5f944f974e0fbd66225fe4ba1", "timestamp": "", "source": "github", "line_count": 4817, "max_line_length": 994, "avg_line_length": 60.760224205937305, "alnum_prop": 0.753760053573503, "repo_name": "flavour/cert", "id": "af84e70a79837dea70740b6de0d9ac4743b47425", "size": "29709...
"""Illustrates a generic association which persists association objects within individual tables, each one generated to persist those objects on behalf of a particular parent class. This configuration has the advantage that each type of parent maintains its "Address" rows separately, so that collection size for one ty...
{ "content_hash": "55d9d28642416e5ed7aec9223acc0d47", "timestamp": "", "source": "github", "line_count": 131, "max_line_length": 78, "avg_line_length": 26.221374045801525, "alnum_prop": 0.6197962154294032, "repo_name": "zzzeek/sqlalchemy", "id": "5b83e6e68f36fcc6d8d584d9f8440e30e617d1ce", "size": "3...
import collections from contextlib import closing import errno import logging import os import re import socket import ssl import sys import typing # noqa: F401 from tornado.escape import to_unicode, utf8 from tornado import gen, version from tornado.httpclient import AsyncHTTPClient from tornado.httputil import HTTP...
{ "content_hash": "bb9a67c01703248ad43562b04d55e09b", "timestamp": "", "source": "github", "line_count": 834, "max_line_length": 88, "avg_line_length": 37.10191846522782, "alnum_prop": 0.6125133309633843, "repo_name": "TeamSPoon/logicmoo_workspace", "id": "eadd4ed3034cb0b0cbeeb540e7770df7a187fd31", ...
from __future__ import absolute_import from mayavi.filters.metadata import *
{ "content_hash": "f627474d66ed74673a7aa1a45c01a802", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 38, "avg_line_length": 38.5, "alnum_prop": 0.7922077922077922, "repo_name": "enthought/etsproxy", "id": "821154455e8342cf8f08350dac88cb6979093d5f", "size": "92", "binary":...
from ._config_loader import config, logger from ._utils import app_path, camel2under, root_urlconf_path import os import re import shutil RESERVED_PARAMS = ( 'class_name', 'template_create_from', 'template_dir_choice', 'urls_to_edit', 'url_pattern', 'url_name', ) class BaseViewAdder(object): ...
{ "content_hash": "b1de2a0a0cb179e6afd3e2150e55528e", "timestamp": "", "source": "github", "line_count": 359, "max_line_length": 75, "avg_line_length": 30.367688022284124, "alnum_prop": 0.5059622087690332, "repo_name": "yakxxx/django-addview", "id": "90e90ccb0bc592e3e69fcdfe28f346493c43bc5a", "size"...
def grade(tid, answer): if answer.lower().find("baconont") != -1: return { "correct": True, "message": "It's a cool song. If you disagree I'm docking 6000 ponts >:)" } return { "correct": False, "message": "Man, this article is so long . . ." }
{ "content_hash": "c19d5e0667feca71b01b7aa187054c61", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 103, "avg_line_length": 62, "alnum_prop": 0.6330645161290323, "repo_name": "EasyCTF/easyctf-2015", "id": "c68006f5af7922862f2e72ea65786f870f767b57", "size": "248", "binary...
import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "example_dropin.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
{ "content_hash": "a8ed1092916c5719c8431c5382ca3d57", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 78, "avg_line_length": 26.11111111111111, "alnum_prop": 0.7148936170212766, "repo_name": "adamziel/django_translate", "id": "8798b02c3ca9bc6c9d02b418e8cafd698fa051a0", "size...
"""Validate the source attributes in the downloaded checklists. Validation Tests: Source: 1. the checklist is a dict. SourceSubmittedBy: 1. submitted_by is a string. 2. submitted_by is set. 3. submitted_by does not have leading/trailing whitespace. SourceName: 1. source i...
{ "content_hash": "58d9a364a8c41d4177126f9d253b37c7", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 79, "avg_line_length": 37.12658227848101, "alnum_prop": 0.6065461984316399, "repo_name": "StuartMacKay/checklists_scrapers", "id": "60e166ce41d524262138a9b87c285960dfb0eca3",...
from __future__ import unicode_literals import copy import json import os.path import yaml from lib.util import Util import logging from projecthandler.models import Project import lib.nemo.nemo_external_parser as Parser from lib.nemo.nemo_parser import NemoParser from lib.nemo.nemo_rdcl_graph import NemoRdclGraph ...
{ "content_hash": "7cc931acc26739b33ed287435864d9f5", "timestamp": "", "source": "github", "line_count": 205, "max_line_length": 129, "avg_line_length": 31.068292682926828, "alnum_prop": 0.5906735751295337, "repo_name": "superfluidity/RDCL3D", "id": "8748494ce8d980c583b7d9b8688b7dc666a089d4", "size"...
from fred.clients.categories import CategoriesClient from fred.clients.releases import ReleasesClient from fred.clients.tags import TagsClient from fred.clients.sources import SourcesClient from fred.clients.eseries import ESeriesClient import fred.config as c import weakref ## Establish Federal Reserve Economic Data ...
{ "content_hash": "bce19a735f3aaff6320d3faaecc2acf9", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 123, "avg_line_length": 54.976190476190474, "alnum_prop": 0.7223906453009961, "repo_name": "avelkoski/FRB", "id": "e0faa36a5bc4f0d3ececf12b7e3caba7b64530bc", "size": "2309"...
""" This is an implementation of decimal floating point arithmetic based on the General Decimal Arithmetic Specification: http://speleotrove.com/decimal/decarith.html and IEEE standard 854-1987: http://en.wikipedia.org/wiki/IEEE_854-1987 Decimal floating point has finite precision with arbitrarily large bou...
{ "content_hash": "4658e5819c246cc2d3ac4813a4f32686", "timestamp": "", "source": "github", "line_count": 6434, "max_line_length": 100, "avg_line_length": 35.68542119987566, "alnum_prop": 0.5518858885017421, "repo_name": "MalloyPower/parsing-python", "id": "6318a49ce706f0a4c1a809d57cac03875b031262", ...
value = 1 def get_value(): return value
{ "content_hash": "e0b1f06fe6d97cb1213e119f9c873538", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 16, "avg_line_length": 11.25, "alnum_prop": 0.6222222222222222, "repo_name": "Hasimir/pyjs", "id": "7358ac1faa5848415ff7662a887a828dfcc74ee2", "size": "237", "binary": fal...
''' Created on 2016. 11. 19 Updated on 2016. 01. 09 ''' from __future__ import print_function import os import shutil import codecs import cgi import re from dateutil import parser as dateparser from commons import VersionUtil from pytz import timezone from utils import Progress from bs4 import BeautifulSoup class Bu...
{ "content_hash": "023ce755159de1db68cd586910624ec9", "timestamp": "", "source": "github", "line_count": 428, "max_line_length": 160, "avg_line_length": 28.983644859813083, "alnum_prop": 0.6237001209189843, "repo_name": "irblsensitivity/irblsensitivity", "id": "43c0b1f7b6baf9c447ae9724db90fda0592f60b3...
import tempfile from django.core.files.uploadedfile import InMemoryUploadedFile # noqa from django import http from django.utils import http as utils_http from mox import IsA # noqa from openstack_horizon import api from openstack_horizon.dashboards.project.containers import forms from openstack_horizon.dashboards...
{ "content_hash": "b2bb04e4767e07503a11350ab6beddda", "timestamp": "", "source": "github", "line_count": 518, "max_line_length": 79, "avg_line_length": 45.47490347490348, "alnum_prop": 0.5734844625573102, "repo_name": "mrunge/openstack_horizon", "id": "c9dacbc7d65ce86524a9b0bfa5ea1f90d471291a", "siz...
from django.conf.urls import url from . import views urlpatterns = [ url( regex=r'^register/$', view=views.RegisterView.as_view(), name='register' ), url( regex=r'^login/$', view=views.LoginView.as_view(), name='login' ), url( regex=r'^logou...
{ "content_hash": "5968b4ae158dcfb51ebb20d5aea30708", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 42, "avg_line_length": 18.178571428571427, "alnum_prop": 0.5088408644400786, "repo_name": "Nikola-K/django-template", "id": "00f91847ec0dab1a2bf5a1b1c6c17d890e894b5f", "siz...
import os import json import random import subprocess # import flask web microframework from flask import Flask from flask import request from flask import abort # import from the 21 Developer Library from two1.lib.wallet import Wallet from two1.lib.bitserv.flask import Payment app = Flask(__name__) wallet = Wallet(...
{ "content_hash": "1d3467c402982b6db7fb04684e023114", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 99, "avg_line_length": 20.967741935483872, "alnum_prop": 0.6184615384615385, "repo_name": "jgarzik/playground21", "id": "39d67dac59de39903d2c5ebcdc5d9a4bd80e3f8c", "size": ...
from logging import getLogger from rester.http import HttpClient from rester.struct import DictWrapper from testfixtures import log_capture import collections import re import traceback Failure = collections.namedtuple("Failure", "errors output") class TestCaseExec(object): logger = getLogger(__name__) def...
{ "content_hash": "4705abad4608826f681d831d11ff6474", "timestamp": "", "source": "github", "line_count": 214, "max_line_length": 145, "avg_line_length": 42.23364485981308, "alnum_prop": 0.5525558751936269, "repo_name": "baiyunping333/Rester", "id": "5f3c7d77e51d67f49ab08d15d537a69354345ef6", "size":...
import traceback from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.ovirt import ( check_sdk, create_connection, get_dict_of_struct, ovirt_full_argument_spec, ) ANSIBLE_METADATA = {'status': 'preview', 'supported_by': 'community', 'v...
{ "content_hash": "b852fac18603f6632b376506d9817b97", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 127, "avg_line_length": 28.83132530120482, "alnum_prop": 0.6435436690346845, "repo_name": "nwiizo/workspace_2017", "id": "2a11ad75280bd8e89fef8135b0b075c0d6f447e7", "size":...
__all__ = ['NDN', 'Closure', 'ContentObject', 'Interest', 'Key', 'Name'] import sys as _sys try: from pyndn.NDN import * from pyndn.Closure import * from pyndn.ContentObject import * from pyndn.Interest import * from pyndn.Key import * from pyndn.Name import * from pyndn import NameCrypto except ImportError: ...
{ "content_hash": "1213d9c8205dadca7aa2ceab06f5b7cf", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 72, "avg_line_length": 20.571428571428573, "alnum_prop": 0.7013888888888888, "repo_name": "cawka/packaging-PyNDN", "id": "aad14d619a04b1f1b19edfe07381a35e30ae4f4c", "size":...
from io import BytesIO from urllib.parse import urlparse,parse_qs import requests from PIL import Image from openpyxl import load_workbook from bs4 import BeautifulSoup import matplotlib.pyplot as plt import matplotlib.cbook as cbook from openpyxl.drawing.image import Image as Image2 def Init(username, departId): ...
{ "content_hash": "66bcb38a9603982f6376cae998266589", "timestamp": "", "source": "github", "line_count": 130, "max_line_length": 402, "avg_line_length": 34.59230769230769, "alnum_prop": 0.6041805648209918, "repo_name": "user5111/ESS-SDK-for-Human", "id": "cc563c3a0606926b22c715d0ed2f13a796349741", "...
from __future__ import unicode_literals from datetime import datetime, timedelta from uuid import UUID from flask import after_this_request, g, session from oauthlib.oauth2 import FatalClientError, InvalidClientIdError from indico.core.db import db from indico.modules.oauth import logger, oauth from indico.modules.o...
{ "content_hash": "614471293b2cac7431eab8c41def3578", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 109, "avg_line_length": 36.76190476190476, "alnum_prop": 0.6873056994818653, "repo_name": "mic4ael/indico", "id": "3597fd4a1074a18b1457659a47f6f34e8139f672", "size": "4074...
""" ================================================== Generalized Relevance Learning Vector Quantization ================================================== This example shows how GRLVQ projects and classifies. The plot shows the target class of each data point (big circle) and which class was predicted (smaller circle...
{ "content_hash": "89a09cb9b0892dc1ff6be5b46de6f28e", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 87, "avg_line_length": 33.05714285714286, "alnum_prop": 0.6153846153846154, "repo_name": "MrNuggelz/sklearn-glvq", "id": "1da2c47d2364dff8352e78d858b75b12fce9750c", "size":...
from __future__ import annotations import os import procrunner import pytest cpp_tests = [ # Paths are under /build/ "tests/algorithms/spatial_indexing/tst_collision_detection", "tests/algorithms/spot_prediction/tst_reeke_model", ] @pytest.mark.parametrize( "executable", cpp_tests, ids=[p.replace("...
{ "content_hash": "26797e184cb7340e740e90e3bf13e1c3", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 82, "avg_line_length": 27.14814814814815, "alnum_prop": 0.679399727148704, "repo_name": "dials/dials", "id": "e4c33b0ba2b2eecf9cef3a064334b2b47f894b5d", "size": "733", "b...
def __load(): import imp, os, sys try: dirname = os.path.dirname(__loader__.archive) except NameError: dirname = sys.prefix path = os.path.join(dirname, 'PIL._imaging.pyd') #print "py2exe extension module", __name__, "->", path mod = imp.load_dynamic(__name__, path) ## mod.fro...
{ "content_hash": "01c23433516c142c74fa13257b2ce103", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 58, "avg_line_length": 29, "alnum_prop": 0.5804597701149425, "repo_name": "nawarian/PHPBot", "id": "b17de0a0f6b724e9c9e15766d9967329961ee47a", "size": "349", "binary": fa...
from cached_property import cached_property from decimal import Decimal, ROUND_HALF_UP from frozendict import frozendict def round_currency(dec): """ Correctly rounds the decimal value as per usual currency rules. e.g.: Decimal('12.9699999999') becomes Decimal('12.97') """ return dec.quantize(Decim...
{ "content_hash": "c2efc4826e8b53b418229aad15f6981d", "timestamp": "", "source": "github", "line_count": 156, "max_line_length": 88, "avg_line_length": 25.506410256410255, "alnum_prop": 0.6059311384770043, "repo_name": "sjkingo/python-auspost-pac", "id": "1011a52197403427a771032288c50c81d7ad1151", "...
from __future__ import generators def run(test): for i in range(10): test.check(i)
{ "content_hash": "fdaed88d493a146a8ea42d436dc67d20", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 33, "avg_line_length": 20.2, "alnum_prop": 0.5841584158415841, "repo_name": "QQuick/Transcrypt", "id": "23f88106ce9280f695b4d897c72f87cc07c09b29", "size": "101", "binary":...
import flask from web_site.web.siteroot.controller import mod as siteroot_module def _build_app(config_to_use, template_folder='web/templates', static_folder='web/static'): app = flask.Flask(__name__, template_folder=template_folder, ...
{ "content_hash": "12d65b95497e6ea8a40bfd41e9b7f602", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 67, "avg_line_length": 31.12, "alnum_prop": 0.589974293059126, "repo_name": "MadDonkeySoftware/pyDuesPal", "id": "a1b4d5e64f0b807c2f6c2b58dc3fd0abe73ae472", "size": "778", ...
import pytest from pybind11_tests import local_bindings as m def test_load_external(): """Load a `py::module_local` type that's only registered in an external module""" import pybind11_cross_module_tests as cm assert m.load_external1(cm.ExternalType1(11)) == 11 assert m.load_external2(cm.ExternalTyp...
{ "content_hash": "341e37297159af9d35affd823eea8f3a", "timestamp": "", "source": "github", "line_count": 226, "max_line_length": 107, "avg_line_length": 34.42035398230089, "alnum_prop": 0.6563825684535287, "repo_name": "allison-group/indigo-bondorder", "id": "b3dc3619c5d466d9f4364f1d147161db6018f230",...
""" Copyright 2017-present, Airbnb Inc. 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.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, sof...
{ "content_hash": "b5378791afdc54d92fdb91a294ccd03f", "timestamp": "", "source": "github", "line_count": 290, "max_line_length": 99, "avg_line_length": 35.282758620689656, "alnum_prop": 0.6112197028928851, "repo_name": "airbnb/streamalert", "id": "e97a615fe1848d9a7cceea6721ce9befcd9431fc", "size": "...
from django.conf.urls import patterns, url urlpatterns = patterns('', url(r'^$', 'ucenter.views.userInfo', name='ucenter_userInfo'), url(r'^userInfo/$', 'ucenter.views.userInfo', name='ucenter_userInfo'), url(r'^userEdit/$', 'ucenter.views.userEdit', name='ucenter_userEdit'), url(r'^loginHistory/', ...
{ "content_hash": "3c9004474f42c64a195d534f7bf2f84f", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 125, "avg_line_length": 57.05555555555556, "alnum_prop": 0.6728334956183057, "repo_name": "kendazheng/wizcloud2", "id": "d3ecfb0ff0818b578a1f268553835106264ec0fd", "size": ...
""" decorator """ import time import traceback import functools from threading import Thread def clock(ms=True): def decorator(func): @functools.wraps(func) def wrapper(*args, **kwargs): st, st_c = time.time(), time.clock() ret = func(*args, **kwargs) print 'ru...
{ "content_hash": "6ba77a2a46c95c555e0db304b6a34dc0", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 116, "avg_line_length": 28.595744680851062, "alnum_prop": 0.5446428571428571, "repo_name": "baixuexue123/note", "id": "3cc6a1fdea9c28dc6653724edfc685859e726940", "size": "1...
""" Command-line interface to the Stackops Automation API. """ from __future__ import print_function import argparse import glob import imp import itertools import os import pkgutil import sys import logging import six from automationclient import client from automationclient import exceptions as exc import automat...
{ "content_hash": "4dc2e2bcb6cf1383075c328c567cd917", "timestamp": "", "source": "github", "line_count": 515, "max_line_length": 79, "avg_line_length": 40.58058252427185, "alnum_prop": 0.5187329537298435, "repo_name": "StackOps/python-automationclient", "id": "c77dba7ac4f39bc8e496f0b92e30e5717af11c18"...
""" Created on Thu Dec 11 13:55:17 2014 @author: sm1fg This is the main module to construct a magnetohydrostatic solar atmosphere, given a specified magnetic network of self-similar magnetic flux tubes and save the output to gdf format. To select an existing configuration change the import as model_pars, set Nxyz, x...
{ "content_hash": "9ed03424f7b2cf7b55c046559587d7ce", "timestamp": "", "source": "github", "line_count": 294, "max_line_length": 104, "avg_line_length": 41.61224489795919, "alnum_prop": 0.4974660781428805, "repo_name": "Cadair/pysac", "id": "eec28e614262f3792d2cf32923e0678de8f41ae3", "size": "12258"...
import node as n import pytest def test_init_Node(): '''Verify that new Nodes are instantiated correctly.''' t = n.Node(1) assert isinstance(t, n.Node) assert (t.next, None) assert (t.data, 2)
{ "content_hash": "5f8798f5180bd4eebc96cb31b16f7a5e", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 59, "avg_line_length": 19.636363636363637, "alnum_prop": 0.6388888888888888, "repo_name": "jacquestardie/data-structures", "id": "a4c132ab78d365f2329412897120ccbe8c68ed0b", ...
import os import sys def main(): os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mycustomapi.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv) if __name__ == "__main__": main()
{ "content_hash": "19702546a2685e1baccffc00e2910764", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 75, "avg_line_length": 19.76923076923077, "alnum_prop": 0.688715953307393, "repo_name": "regulusweb/django-oscar-api", "id": "5de2d30ce1040d748d766ef4d4dc1c57450f2d8b", "si...
import m5 from m5.objects import * def init_fs(system, membus, cpus=1): system.pc = Pc() # Constants similar to x86_traits.hh IO_address_space_base = 0x8000000000000000 pci_config_address_space_base = 0xc000000000000000 interrupts_address_space_base = 0xa000000000000000 APIC_range_size = 1 << ...
{ "content_hash": "4c84e4ba2a372ae16555c6e730938ab1", "timestamp": "", "source": "github", "line_count": 153, "max_line_length": 85, "avg_line_length": 40.80392156862745, "alnum_prop": 0.5897805542207272, "repo_name": "Nirvedh/CoarseCoherence", "id": "53a6a949e4de9e58da3882030bf7f25f15f38073", "size...
import dbutils '''获取域名管理信息 返回值: True/False ''' def get_service(): _columns = ('id', 'domain_name', 'username', 'password', 'function') _sql = 'select * from service_manage' _count, _rt_list = dbutils.execute_sql(_sql, fetch=True) _rt = [] for _list in _rt_list: _rt.append(dict(zip(_columns,...
{ "content_hash": "6065f9ab09baaec0dcc8a2e23a6035af", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 103, "avg_line_length": 29.41025641025641, "alnum_prop": 0.6259808195292066, "repo_name": "51reboot/actual_09_homework", "id": "da73d2706a7e379dbd73747f7009e43c6bd60e96", "...
""" Django settings for api project. Generated by 'django-admin startproject' using Django 1.11.1. For more information on this file, see https://docs.djangoproject.com/en/1.11/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/ref/settings/ """ import os # ...
{ "content_hash": "b8307ef850664f4a6a533f90c51d4252", "timestamp": "", "source": "github", "line_count": 138, "max_line_length": 91, "avg_line_length": 25.094202898550726, "alnum_prop": 0.6832226393300607, "repo_name": "recadoc/recadoc-api", "id": "61ae27c5518e0334341b2d27580ef2bb57ee3e2a", "size": ...
from django.shortcuts import render_to_response from tumblog.models import * def create(request, blogslug): blog = Blog.objects.get(slug=blogslug) return render_to_response('tumblog/admin_create.html', {'blog': blog})
{ "content_hash": "b37c26e16c253ad401a9c9a0efa5b51f", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 74, "avg_line_length": 37.833333333333336, "alnum_prop": 0.748898678414097, "repo_name": "lygaret/django-tumblog", "id": "51ed47e693b8c96597dbccaa7cc3f0b1d51d1277", "size": ...
from pycryptics.grammar.cfg import generate_grammar from pycryptics.grammar.memo_chart import MemoChart from nltk import parse def generate_clues(constraints): g = generate_grammar(constraints.phrases) parser = parse.EarleyChartParser(g, chart_class=MemoChart) clues = parser.nbest_parse(constraints.phrase...
{ "content_hash": "a96c7edf29625d3b78724173b96ce711", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 62, "avg_line_length": 33.25, "alnum_prop": 0.7644110275689223, "repo_name": "rdeits/cryptics", "id": "9d849b17164984aaf7efe34a19fc313a6dfb672c", "size": "399", "binary":...
import pandas as pd from pandas_profiling import ProfileReport def test_issue351(): data = pd.DataFrame(["Jan", 1]).set_index(0) profile = ProfileReport(data, progress_bar=False) assert profile.get_description()["variables"]["0"]["type"] == "Unsupported"
{ "content_hash": "0cec55da8f40ac832c022332e7394e1c", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 79, "avg_line_length": 30, "alnum_prop": 0.7, "repo_name": "JosPolfliet/pandas-profiling", "id": "ce2936b6a2d5d1aca8fcde0b8cd7d16ad64fb875", "size": "270", "binary": false...
"""Support for Brunt Blind Engine covers.""" import logging from brunt import BruntAPI import voluptuous as vol from homeassistant.components.cover import ( ATTR_POSITION, PLATFORM_SCHEMA, SUPPORT_CLOSE, SUPPORT_OPEN, SUPPORT_SET_POSITION, CoverDevice, ) from homeassistant.const import ATTR_A...
{ "content_hash": "030af91517392632a75de99784266606", "timestamp": "", "source": "github", "line_count": 179, "max_line_length": 84, "avg_line_length": 29.40223463687151, "alnum_prop": 0.6146684400532016, "repo_name": "postlund/home-assistant", "id": "373c33394413c8fbfcd6768a94ba05f9d23fb250", "size...
__source__ = 'https://leetcode.com/problems/permutations/' # https://github.com/kamyu104/LeetCode/blob/master/Python/permutations.py # Time: O(n!) //n factorial # Space: O(n) # Math/Brute Force Search # # Description: Leetcode # 46. Permutations # # Given a collection of numbers, return all possible permutations. # # ...
{ "content_hash": "131a6c4704d96f79380ae1a0d459d26a", "timestamp": "", "source": "github", "line_count": 439, "max_line_length": 135, "avg_line_length": 33.428246013667426, "alnum_prop": 0.5758773424190801, "repo_name": "JulyKikuAkita/PythonPrac", "id": "329227fa570872b60dd8046f5b4774ff79d1d1ac", "s...
import os #------------------------------------------------------------------------------ # xbmc related #------------------------------------------------------------------------------ import xbmc, xbmcaddon __settings__ = xbmcaddon.Addon(id='plugin.video.mrknow') __icon__ = xbmcaddon.Addon(id='plugin.video.mrknow')...
{ "content_hash": "158a1becc5bdd0614e144c475ea904e0", "timestamp": "", "source": "github", "line_count": 202, "max_line_length": 104, "avg_line_length": 31.04950495049505, "alnum_prop": 0.5988520408163265, "repo_name": "rysson/filmkodi", "id": "37539299473b5a66e7ff09abad23f6a99c86aa3e", "size": "629...
import os exp_dir = os.path.dirname(__file__) mgra_path = os.environ.get('MGRA_PATH', None) if mgra_path is None: mgra_path = "indel_mgra" configuration = { "experiment_name": "Chimp 2000", "experiment_info": """ 6 genomes are taken as input: Chimpanzee, Mouse, Rat, Dog, Opossum. Chimpanze...
{ "content_hash": "fa0ed53b7b387ac2f6632f7c14634a7d", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 97, "avg_line_length": 36.395348837209305, "alnum_prop": 0.4792332268370607, "repo_name": "aganezov/gos-asm", "id": "86fa42b072608441ff32b49c1a5ef7183dc71f98", "size": "158...
import unittest import time if False: mldb_wrapper = None from mldb import mldb, MldbUnitTest, ResponseException class ConstOptimTest(MldbUnitTest): @classmethod def setUpClass(self): ds = mldb.create_dataset({ "id": "sample", "type": "sparse.mutable" }) for num in range(0,2000): ...
{ "content_hash": "8b2766f239565499eb7ec9e3410f1691", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 124, "avg_line_length": 31.851063829787233, "alnum_prop": 0.5938543754175016, "repo_name": "mldbai/mldb", "id": "388dfd55b475d7406597495eef9af9cf3991fdb3", "size": "1642", ...
''' Created by auto_sdk on 2014-12-17 17:22:51 ''' from top.api.base import RestApi class ItemsInventoryGetRequest(RestApi): def __init__(self,domain='gw.api.taobao.com',port=80): RestApi.__init__(self,domain, port) self.banner = None self.cid = None self.end_modified = None self.fields = None s...
{ "content_hash": "a596031dc478da54df5b7085e40002e0", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 55, "avg_line_length": 26.041666666666668, "alnum_prop": 0.664, "repo_name": "CooperLuan/devops.notes", "id": "e484ea7ef381ea6558cce6f8631abaa7fe34caac", "size": "625", "...
# -*- coding: UTF-8 -*- from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.utils.translation import ugettext as _ try: CONFERENCE = settings.CONFERENCE_CONFERENCE except AttributeError: raise ImproperlyConfigured('Current conference not set (CONFERENCE_CONFEREN...
{ "content_hash": "d18e9c3251fb3341dc95f52c35595e00", "timestamp": "", "source": "github", "line_count": 197, "max_line_length": 127, "avg_line_length": 41.71573604060914, "alnum_prop": 0.7190313944998783, "repo_name": "artcz/epcon", "id": "937641cfde5bf8ce2f4df5055b3db27f021552a1", "size": "8218", ...
from pythonforandroid.toolchain import CythonRecipe class CymunkRecipe(CythonRecipe): version = 'master' url = 'https://github.com/tito/cymunk/archive/{version}.zip' name = 'cymunk' depends = [('python2', 'python3crystax')] recipe = CymunkRecipe()
{ "content_hash": "1a80a144f5dadce9d3c8890fa3313449", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 64, "avg_line_length": 22.416666666666668, "alnum_prop": 0.7026022304832714, "repo_name": "wexi/python-for-android", "id": "c9733e3e7ce2ce057ff52dfcd666eb2b0e24a135", "size...
import requests import sys s = requests.Session() s.headers.update({'Client-ID': 'CLIENT_ID'}) channel_response = s.get('https://mixer.com/api/v1/channels/{}'.format(sys.argv[1])) viewers = channel_response.json()['viewersTotal'] print("You have {} viewers...".format(viewers))
{ "content_hash": "c86a55cf0cee143e424b36d31b901045", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 84, "avg_line_length": 28.1, "alnum_prop": 0.7046263345195729, "repo_name": "WatchBeam/developers", "id": "014483d55a4bb4f8e4824039a1b655ec148105db", "size": "281", "bina...
from multiconf import mc_config, ConfigItem, RepeatableConfigItem, ConfigBuilder, MC_REQUIRED from multiconf.decorators import nested_repeatables, named_as, required from multiconf.envs import EnvFactory from .utils.tstclasses import ItemWithName ef = EnvFactory() pprd = ef.Env('pprd') prod = ef.Env('prod') def te...
{ "content_hash": "d7d4ee667d089c9bedab25c03144abfa", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 93, "avg_line_length": 28.378048780487806, "alnum_prop": 0.5857327030511388, "repo_name": "lhupfeldt/multiconf", "id": "91967d8c1f7964754edceb792bf1426fba6bbc96", "size": "...
from django.conf.urls import include, patterns, url from . import views # These views all start with user ID. user_patterns = patterns('', url(r'^summary$', views.user_summary, name='lookup.user_summary'), url(r'^purchases$', views.user_purchases, name='lookup.user_purchases'), url(r'^activity$',...
{ "content_hash": "fe3306ff4c409449de2f3c9c59ce56dd", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 73, "avg_line_length": 34.22222222222222, "alnum_prop": 0.6441558441558441, "repo_name": "jinankjain/zamboni", "id": "6da75cd4d447c178229c3aaef846e0f27e16e02b", "size": "15...
""" Django settings for Gravitas project. Generated by 'django-admin startproject' using Django 1.10.5. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ import o...
{ "content_hash": "8e5995c88fa690c25426e24207b28e88", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 91, "avg_line_length": 26.92361111111111, "alnum_prop": 0.6935775083827702, "repo_name": "Sirikam/Gravitas", "id": "8bd45cb5e7f90be59d4828b546b6088904149d52", "size": "387...
from mutagen.mp3 import MP3 from muzicast.collection.formats._id3 import ID3File extensions = [".mp3", ".mp2"] class MP3File(ID3File): format = "MP3" Kind = MP3 info = MP3File
{ "content_hash": "fc789e967e40e198d1e9764ffb286c2f", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 52, "avg_line_length": 18.7, "alnum_prop": 0.6951871657754011, "repo_name": "nikhilm/muzicast", "id": "a82532d6ffcbed7ef6fbdce68ead9d9638654e49", "size": "441", "binary":...
"""Test label RPCs. RPCs tested are: - getaddressesbylabel - listaddressgroupings - setlabel """ from collections import defaultdict from test_framework.test_framework import BitcoinTestFramework from test_framework.util import assert_equal, assert_raises_rpc_error from test_framework.wallet_util import t...
{ "content_hash": "4e78b1ac137b0f6b2d73ad2c2ffe3b30", "timestamp": "", "source": "github", "line_count": 186, "max_line_length": 88, "avg_line_length": 38.166666666666664, "alnum_prop": 0.6000845189463304, "repo_name": "Bitcoin-ABC/bitcoin-abc", "id": "8bb0bd6db749637c0dad9d543ed2de9c57c26bc6", "siz...
from neutron.openstack.common import importutils from neutron.openstack.common import jsonutils from neutron.openstack.common import log as logging from neutron.plugins.mlnx.common import comm_utils from neutron.plugins.mlnx.common import exceptions zmq = importutils.try_import('eventlet.green.zmq') LOG = logging.get...
{ "content_hash": "d1979fa8c08c8901a47f32ce50e8ba1b", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 76, "avg_line_length": 39.74803149606299, "alnum_prop": 0.5239698890649762, "repo_name": "vbannai/neutron", "id": "924be790f459b2eabda2ffea7a98ee78f5e0b7aa", "size": "5686...
from __future__ import unicode_literals from __future__ import absolute_import from django.utils.translation import ugettext as _ """Base classes for different plugin objects. * BasePlugin: Create a wiki_plugin.py with a class that inherits from BasePlugin. * PluginSidebarFormMixin: Mix in this class in the form th...
{ "content_hash": "4e6d3ee5fbe228ce96fc881bb63dd4a5", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 102, "avg_line_length": 32.01449275362319, "alnum_prop": 0.6301493888637393, "repo_name": "skbly7/serc", "id": "cfed95032100de93453b2b096d7abc36b6a52170", "size": "2209", ...
r""" path ==== Types for handling paths. """ from os import path from ..modules.classes import CustomType class PathBase(CustomType): """The base class for several path types. Args: func (callable): The function to process the value. ret : The expected return value from func. The values that ail the expe...
{ "content_hash": "f0f3e76d157890d3d61820ddaa268ff2", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 181, "avg_line_length": 37.44186046511628, "alnum_prop": 0.7086956521739131, "repo_name": "Laufire/ec", "id": "8e66c37417d0e5688a687f240dc95d016a74afff", "size": "1610", ...
"""The data range path specification implementation.""" from dfvfs.lib import definitions from dfvfs.path import factory from dfvfs.path import path_spec class DataRangePathSpec(path_spec.PathSpec): """Class that implements the data range path specification. Attributes: range_offset (int): start offset of t...
{ "content_hash": "715c1ab93a6ff252f1502ae718561478", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 80, "avg_line_length": 33.744680851063826, "alnum_prop": 0.7112232030264817, "repo_name": "dc3-plaso/dfvfs", "id": "5963c530761e61a4be57be9278eb0c7180509f95", "size": "1610...
import sensor, image, time sensor.reset() sensor.set_pixformat(sensor.GRAYSCALE) sensor.set_framesize(sensor.QVGA) sensor.skip_frames(time = 2000) clock = time.clock() while(True): clock.tick() # Gamma, contrast, and brightness correction are applied to each color channel. The # values are scaled to the ...
{ "content_hash": "89b12e3fbe60758af967b4519314cb90", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 87, "avg_line_length": 29.5, "alnum_prop": 0.711864406779661, "repo_name": "iabdalkader/openmv", "id": "7c735fd1bf73d510afa9cb61b0a66d0d9befd673", "size": "636", "binary"...
import csv import os import shutil import itertools def delete_dirs(ls_dir): for dirs in ls_dir: print("removing " + dirs) shutil.rmtree(dirs, ignore_errors=True) def test_data_dirs(ls_dir): for dir in ls_dir: if not os.path.exists(dir): os.makedirs(dir) ...
{ "content_hash": "76a92fc02205e63608177a3a25cef8f5", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 74, "avg_line_length": 25.671232876712327, "alnum_prop": 0.5939167556029883, "repo_name": "McKenzieKohn/scopus_spider", "id": "b261456adaefc1ffe3c987002dcde84551ad903a", "s...
''' Nosvideo urlresolver plugin Copyright (C) 2013 Vinnydude This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is d...
{ "content_hash": "1f389b5a4a9b52c9e7e569683c1da513", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 92, "avg_line_length": 37.509803921568626, "alnum_prop": 0.6534239414532148, "repo_name": "mrknow/filmkodi", "id": "025426cdf7c5673896848cca8ab4d2e85d1de7f1", "size": "1913...
import time class DateObject: def getYear(self): return time.localtime(time.time())[0] def getMonth(self): return time.localtime(time.time())[1] def getDay(self): return time.localtime(time.time())[2] def getDetailedAge(self, dobMonth, dobYear, dobDay = None, curMonth = None...
{ "content_hash": "aea414d0bf35f1701b1fea06f1f9e693", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 122, "avg_line_length": 29.9375, "alnum_prop": 0.4900835073068894, "repo_name": "silly-wacky-3-town-toon/SOURCE-COD", "id": "f354a1a24128d13870d1734d0ff0e75e89312849", "siz...
from msrest.serialization import Model class WinRMConfiguration(Model): """Describes Windows Remote Management configuration of the VM. :param listeners: The list of Windows Remote Management listeners :type listeners: list[~azure.mgmt.compute.v2015_06_15.models.WinRMListener] """ _attribut...
{ "content_hash": "f1371607971482d9bdf92ee61c584d89", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 69, "avg_line_length": 29.61111111111111, "alnum_prop": 0.6697936210131332, "repo_name": "AutorestCI/azure-sdk-for-python", "id": "efc18d734d09fb8af513d1815997048c96a3abef", ...
from django.views.generic import ListView, DetailView from apps.tasks.models import Task class TasksIndexPage(ListView): model = Task class TaskPage(DetailView): model = Task
{ "content_hash": "3e2de488684f9cf1b2e90f0942b646e5", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 53, "avg_line_length": 17.09090909090909, "alnum_prop": 0.7606382978723404, "repo_name": "PyNSKOrg/pynsk.ru", "id": "bac177ffa8c76aadc32f61d64a2670f345b11a7e", "size": "203...
''' A simple test-case that ensures the forward and backward passes of the fast, cythonized factorization machine match the forward and backward passes of the slow, autodiff version. ''' from __future__ import print_function import numpy as np import torch import torch.nn.functional as F from fmpytorch.second_order.s...
{ "content_hash": "15ac7e575125bccda6bf1826e7abe777", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 107, "avg_line_length": 30.8, "alnum_prop": 0.6191749427043545, "repo_name": "jmhessel/fmpytorch", "id": "3baee29351768937878d4c0b690f328ec7274128", "size": "2618", "bina...
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 'DepthSounding' db.create_table('depth_range_depthsounding', ( ...
{ "content_hash": "55d379cf9d18da38599ad94988eb0471", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 121, "avg_line_length": 37.57142857142857, "alnum_prop": 0.6045627376425855, "repo_name": "Alwnikrotikz/marinemap", "id": "06c39b43722f546ce30ed26bb1255a489cee439f", "size"...
import os import sys import vstruct.qt as vs_qt import envi.expression as e_expr import envi.qt.config as e_q_config import vqt.cli as vq_cli import vqt.main as vq_main import vqt.colors as vq_colors import vqt.qpython as vq_python import vqt.application as vq_app import vivisect.cli as viv_cli import vivisect.base ...
{ "content_hash": "e15ed5a743e24348122b9ca7932ed6c5", "timestamp": "", "source": "github", "line_count": 739, "max_line_length": 138, "avg_line_length": 37.48443843031123, "alnum_prop": 0.6249954875275261, "repo_name": "atlas0fd00m/vivisect", "id": "b18a38e043b315cda55ffed7436d29b156348efa", "size":...
import ctypes import json import locale import multiprocessing import os import platform import textwrap import sys from contextlib import redirect_stdout from datetime import datetime from io import StringIO from subprocess import check_output, PIPE, CalledProcessError import llvmlite.binding as llvmbind from llvmlite...
{ "content_hash": "22eaf1c66e867d1ee229bba22c376a2d", "timestamp": "", "source": "github", "line_count": 633, "max_line_length": 85, "avg_line_length": 37.96998420221169, "alnum_prop": 0.5492822966507177, "repo_name": "IntelLabs/numba", "id": "abc74538de358d689e3f37c7a66c20d08f931433", "size": "2403...
""" This script is responsible for generating .gclient-xwalk in the top-level source directory from DEPS.xwalk. User-configurable values such as |cache_dir| are fetched from .gclient instead. """ import logging import optparse import os import pprint CROSSWALK_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(...
{ "content_hash": "6962c099f84d390afda9c7c6960b8fa9", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 79, "avg_line_length": 30.56451612903226, "alnum_prop": 0.6559366754617414, "repo_name": "TheDirtyCalvinist/spacewalk", "id": "340f56f8651c7b864746f1ba25a4a1deacb578c0", "s...
import glass # Import app configs import configs app = glass.Application( name="Hello", client_id=configs.CLIENT_ID, client_secret=configs.CLIENT_SECRET ) @app.subscriptions.login def login(user): print "user : %s" % user.token user.timeline.post(html="Hello <b>World</b>") if __name__ == '__main...
{ "content_hash": "84cc72d139e8c30b1e3f2fc2c72580f9", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 49, "avg_line_length": 18.526315789473685, "alnum_prop": 0.6534090909090909, "repo_name": "SamyPesse/glass.py", "id": "6aa376cab65dad09a7fc66801ae522aade4f08d5", "size": "3...
import plugins import subprocess class Plugin(plugins.BasePlugin): __name__ = 'asterisk' def run(self, config): ip = config.get(__name__, 'sbcip') p = subprocess.Popen("sudo asterisk -rx 'core show calls' | grep 'active' | cut -f1 -d ' '", stdout=subprocess.PIPE, shell=True) p = p.com...
{ "content_hash": "efb09ace863aa6a2abdc71a93256d955", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 157, "avg_line_length": 43.90909090909091, "alnum_prop": 0.6055900621118012, "repo_name": "vfuse/nixstatsagent", "id": "b6317f472ebab9ccafe5bec2a548f6f0bf0683e8", "size": "...
import array import corepy.arch.x86.isa as x86 import corepy.spre.spe as spe import corepy.arch.x86.lib.util as util __doc__ = """ """ # ------------------------------------------------------------ # 'Type' Classes # ------------------------------------------------------------ # Type classes implement the operato...
{ "content_hash": "9bce1a3132f7975434559255221c48e3", "timestamp": "", "source": "github", "line_count": 592, "max_line_length": 98, "avg_line_length": 30.846283783783782, "alnum_prop": 0.620338426154099, "repo_name": "matthiaskramm/corepy", "id": "b26b4a74b177a2b80626fe31de605fed37731e9d", "size": ...
import pytest from raiden.tests.utils.transfer import ( direct_transfer, ) from raiden.transfer.state_change import ( ActionTransferDirect, ReceiveTransferDirect, ) from raiden.transfer.events import ( EventTransferReceivedSuccess, EventTransferSentSuccess, ) from raiden.tests.utils.log import ( ...
{ "content_hash": "1de9396e38ea0d79730524aeb4e920cf", "timestamp": "", "source": "github", "line_count": 158, "max_line_length": 92, "avg_line_length": 28.79746835443038, "alnum_prop": 0.66, "repo_name": "tomashaber/raiden", "id": "667247fc8243875300b230a44256b8b52988b6a4", "size": "4574", "binary...
from sklearn2sql_heroku.tests.regression import generic as reg_gen reg_gen.test_model("SVR_poly" , "freidman1" , "db2")
{ "content_hash": "4f499368807995b7ce49e052d4411792", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 66, "avg_line_length": 30.5, "alnum_prop": 0.7459016393442623, "repo_name": "antoinecarme/sklearn2sql_heroku", "id": "97e3e48986897a2550317575c2d2112ebf209457", "size": "122...
""" Sahana Eden Automated Test - HRM001 Create Volunteer Certificate @copyright: 2011-2012 (c) Sahana Software Foundation @license: MIT 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 ...
{ "content_hash": "0f577d119b30dd494f5ce42357848c28", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 110, "avg_line_length": 40.838235294117645, "alnum_prop": 0.594526467410875, "repo_name": "waidyanatha/sambro-eden", "id": "f4e8ac5cbec1cdf841190c10a312e3b2e0346271", "size...
import yyafl.fields from yyafl.util import flatatt, smart_unicode from yyafl.exception import IncompatibleWidget class Widget(object): is_hidden = False def __init__(self, attrs = None): self.field = None if attrs is not None: self.attrs = attrs.copy() else: ...
{ "content_hash": "04ac7b16182078198f15ffe88b1c0fbe", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 108, "avg_line_length": 30.476744186046513, "alnum_prop": 0.5978634109118657, "repo_name": "miracle2k/yyafl", "id": "64f0246a33d79966feb1e86a5ccd94e92610d074", "size": "398...
import os, base64 from PIL import Image from six import BytesIO from indicoio.utils.preprocessing import data_preprocess from .indico_image_base import ImageTest, DIR class ResizeTests(ImageTest): """ test image resizing """ def test_min_axis_resize(self): test_image = os.path.normpath(os.p...
{ "content_hash": "b0bc40ce6ac5d1c8a359f5987b396cad", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 76, "avg_line_length": 29.15, "alnum_prop": 0.6946826758147513, "repo_name": "IndicoDataSolutions/IndicoIo-python", "id": "ef5377cab3134d230c22eb023a255013cb7d1118", "size"...
import json import webob from nova import test from nova.api.openstack import accounts from nova.auth.manager import User from nova.tests.api.openstack import fakes def fake_init(self): self.manager = fakes.FakeAuthManager() def fake_admin_check(self, req): return True class AccountsTest(test.TestCase):...
{ "content_hash": "a908c51d6ecc47c3bed358ab1a798e7a", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 76, "avg_line_length": 38.255319148936174, "alnum_prop": 0.6170745272525028, "repo_name": "30loops/nova", "id": "707a2599fef4c78f2873cb213f932d938c0b8b42", "size": "4227", ...
"""BIG-IP® auth module REST URI ``http://localhost/mgmt/tm/auth/`` GUI Path ``System --> Users`` REST Kind ``tm:auth:*`` """ from f5.bigip.resource import OrganizingCollection from f5.bigip.tm.auth.password_policy import Password_Policy from f5.bigip.tm.auth.user import Users class Auth(OrganizingCol...
{ "content_hash": "b6fda063bcddbf95383b6a4722aa2955", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 60, "avg_line_length": 20.36, "alnum_prop": 0.6247544204322201, "repo_name": "wojtek0806/f5-common-python", "id": "9ce3ee526ca9704cc66d7fef66632cba914cf054", "size": "1114"...
import getopt import os import re import sys def usage(): print >> sys.stderr, """ Usage: python test_harness-script.py [ -c config_file ] [ -o scriptfile ] [ -t gtestfile ] [ -p path_to_gtestfile ] where: config_file: test_harness config file; default: test_harness.conf scriptfile: script...
{ "content_hash": "88bdd38b1270a3e1a7a46fc269482437", "timestamp": "", "source": "github", "line_count": 192, "max_line_length": 112, "avg_line_length": 33.53125, "alnum_prop": 0.4507611059335197, "repo_name": "Vovkasquid/compassApp", "id": "c0462ec73180f9c6dde75b060423b3424f298cdc", "size": "7243",...
__author__ = "Osman Baskaya" """ Preprocess and create a file that contains all information to be needed for constructing different test sets """ import sys import os from bs4 import BeautifulSoup from collections import defaultdict as dd from nltk.corpus.reader import BracketParseCorpusReader from itertools import ...
{ "content_hash": "f5dd6aa55d571b31e4a0e8a301b1f7de", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 90, "avg_line_length": 39.09803921568628, "alnum_prop": 0.5509027081243731, "repo_name": "osmanbaskaya/induction-disambiguation-dataset-generator", "id": "7dd2caebdbadde0a74...
from sqlalchemy import exc from sqlalchemy import FLOAT from sqlalchemy import ForeignKey from sqlalchemy import ForeignKeyConstraint from sqlalchemy import Index from sqlalchemy import inspect from sqlalchemy import INTEGER from sqlalchemy import Integer from sqlalchemy import MetaData from sqlalchemy import Numeric f...
{ "content_hash": "596ce099a58a78f706df9e94e1893b2c", "timestamp": "", "source": "github", "line_count": 680, "max_line_length": 79, "avg_line_length": 32.188235294117646, "alnum_prop": 0.5598044590643275, "repo_name": "wujuguang/sqlalchemy", "id": "6c36c0a6bb7f57c41d93c37936ac4f908fdb5ac9", "size":...
"""Support for Gogogate2 garage Doors.""" from __future__ import annotations import logging from ismartgate.common import ( AbstractDoor, DoorStatus, TransitionDoorStatus, get_configured_doors, ) from homeassistant.components.cover import ( DEVICE_CLASS_GARAGE, DEVICE_CLASS_GATE, SUPPORT_...
{ "content_hash": "7d991e3af92335988ee687a31547f9b7", "timestamp": "", "source": "github", "line_count": 122, "max_line_length": 82, "avg_line_length": 28.59016393442623, "alnum_prop": 0.6427752293577982, "repo_name": "FreekingDean/home-assistant", "id": "073c48e55b836d1fb72b518cb0078b17427169be", "...
import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "gfysound.settings.local") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
{ "content_hash": "83d8a8df552c31d292d8bc241b6f9641", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 78, "avg_line_length": 26.11111111111111, "alnum_prop": 0.7148936170212766, "repo_name": "alex-jerez/gfysound", "id": "6c866ef6b11889fe1996290186c6edc28a5c7a4b", "size": "25...
import os from restlib.response import Response from catalogService import errors from catalogService.rest.models import userData from catalogService import storage from catalogService.rest.api.base import BaseController from catalogService.rest.middleware.response import XmlStringResponse, XmlResponse class UsersCon...
{ "content_hash": "003e039c8a68f7b900103f851ac35da6", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 122, "avg_line_length": 36.93103448275862, "alnum_prop": 0.5849673202614379, "repo_name": "sassoftware/catalog-service", "id": "fd08fd3c6f7f1f371d0754bc3762763c305afa15", ...
__all__ = ['nitro_service', 'options']
{ "content_hash": "013325a8b9c28b526a3cfea0c63a91af", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 38, "avg_line_length": 20, "alnum_prop": 0.55, "repo_name": "mahabs/nitro", "id": "51a721cb6e5bf018f568b989b5fc2fab54f290ca", "size": "40", "binary": false, "copies": "1...
import load_synth_extract from microbes import studytreelist if __name__ == "__main__": from stephen_desktop_conf_TEMP import * synthottolid="372049" #studytreelist = ["713_1287"] print "loading synthottolid:",synthottolid print "loading studytreelist:",studytreelist for i in studytr...
{ "content_hash": "4f960524aa7fa756194c8718429009ee", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 123, "avg_line_length": 34.18181818181818, "alnum_prop": 0.6449468085106383, "repo_name": "OpenTreeOfLife/gcmdr", "id": "fdb347c0f59a52117409369c336dcc703f3dff75", "size": ...
import matplotlib import socket if socket.gethostname() != 'arch': matplotlib.use('Agg') import matplotlib.pyplot as plt import numpy as np import io import tensorflow as tf from matplotlib.patches import Circle from matplotlib.patches import Patch # Keep colors consistent class_colors = [None, '#ff0000', '#00ff00...
{ "content_hash": "619d08c97b5be9c94f2dfc48f5ac3738", "timestamp": "", "source": "github", "line_count": 194, "max_line_length": 285, "avg_line_length": 37.53092783505155, "alnum_prop": 0.6162615025408598, "repo_name": "rpp0/lora-phy-fingerprinting", "id": "ad6327421fc7a5cc721f6ef9fcd3a08727a208bd", ...