text
stringlengths
4
1.02M
meta
dict
import struct from .errors import * # # Protocol-related constants # MOIRA_PORT = 775 MOIRA_PROTOCOL_VERSION = 2 MOIRA_PROTOCOL_CHALLENGE = "\0\0\0\066\0\0\0\004\001\001\001\001server_id\0parms\0host\0user\0\0\0\0\001\0\0\0\0\001\0\0\0\0\001\0\0\0\0\001\0" # You don't want to know why those two strings looks the way ...
{ "content_hash": "19a9df43afb3a012498815c8dc9e45b8", "timestamp": "", "source": "github", "line_count": 121, "max_line_length": 214, "avg_line_length": 33.19834710743802, "alnum_prop": 0.5767986059248195, "repo_name": "vasilvv/pymoira", "id": "f116277a7cc67c65a554b1e69a1550b1c0691caa", "size": "414...
def extractEnkirostranslationsHomeBlog(item): ''' Parser for 'enkirostranslations.home.blog' ''' vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or "preview" in item['title'].lower(): return None tagmap = [ ('arafoo kenja', 'Arafoo Kenja no Isekai Seikatsu...
{ "content_hash": "ff50996e96d47e0d7cdcc35b9171e233", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 104, "avg_line_length": 31.857142857142858, "alnum_prop": 0.624813153961136, "repo_name": "fake-name/ReadableWebProxy", "id": "da1aea4ac72b55e3e07b4cff29a670873b7894a3", "s...
from __future__ import unicode_literals from django.db import models, migrations import filer.fields.image import filer.fields.file class Migration(migrations.Migration): dependencies = [ ('cms_lab_publications', '0001_initial'), ] operations = [ migrations.AlterModelOptions( ...
{ "content_hash": "453deb7cfb7496ee6ea6fd804c8c5781", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 291, "avg_line_length": 48.83720930232558, "alnum_prop": 0.6552380952380953, "repo_name": "mfcovington/djangocms-lab-publications", "id": "d02cbc38be8990dc0f0d20036654c5dd100...
import os import sys import copy import time import tarfile import base64 sys.path.append('../../') from externals.simple_oss import SimpleOss from batchcompute import ( Client, JobDescription, TaskDag, TaskDescription, ResourceDescription, ) import config as cfg def upload_worker(bucket, local_dir, oss_path): ...
{ "content_hash": "79579e65c9e0eb93debd1c9b3aab852e", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 79, "avg_line_length": 29.1875, "alnum_prop": 0.6102783725910065, "repo_name": "luzhijun/Optimization", "id": "e0bf678e83d8531ee8061d21eb3b2790dd55bf3a", "size": "2802", ...
from typing import TYPE_CHECKING import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpR...
{ "content_hash": "1ce62ff28105bef0f05ee183cca0d77a", "timestamp": "", "source": "github", "line_count": 585, "max_line_length": 262, "avg_line_length": 49.873504273504274, "alnum_prop": 0.6407663833287633, "repo_name": "Azure/azure-sdk-for-python", "id": "82bffe37fd93e305632795ae452b6f7f0e09bf88", ...
""" Telegram platform for notify component. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/notify.telegram/ """ import logging import urllib from homeassistant.components.notify import ( ATTR_TITLE, DOMAIN, BaseNotificationService) from homeassistan...
{ "content_hash": "2478359f0c51bfd92eeecf9efb077f28", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 79, "avg_line_length": 30.338709677419356, "alnum_prop": 0.6406166932482722, "repo_name": "justyns/home-assistant", "id": "b26306405c18f2fb61fd1feb475f0792e60ce151", "size"...
"""Parallelization utility optimizer.""" from __future__ import absolute_import __all__ = ['split_data', 'split_and_load', 'clip_global_norm', 'check_sha1', 'download'] import os import sys import hashlib import uuid import warnings import collections import weakref import requests import numpy as np fro...
{ "content_hash": "9ac99025e9cad11ca3c793cadbd3af34", "timestamp": "", "source": "github", "line_count": 462, "max_line_length": 108, "avg_line_length": 37.20779220779221, "alnum_prop": 0.5795229784758581, "repo_name": "reminisce/mxnet", "id": "81a8dbaa486bb06170e3bf2dde40c1cf24cec051", "size": "180...
''' Given a table-oriented text data file, a descriptive XML file and an outputFile name convert the text data file into a netCDF file. Created on Feb 27, 2017 @author: cyoung ''' import sys from gov.noaa.gmd.table_2_netcdf.TableDataDesc import TableDataDesc from gov.noaa.gmd.table_2_netcdf.TableDataSet i...
{ "content_hash": "5769f0ff7091b89bea8b8e73ebc348b6", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 84, "avg_line_length": 32.89473684210526, "alnum_prop": 0.6728, "repo_name": "charles-g-young/Table2NetCDF", "id": "31042d56e39aa7a4010186977af3908aecca4307", "size": "1250...
"""trydjango19 URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.9/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class...
{ "content_hash": "3bf9e77109980b1afe4565b44c0423b5", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 82, "avg_line_length": 40.4, "alnum_prop": 0.7112211221122112, "repo_name": "codingforentrepreneurs/try-django-19", "id": "c0237862eda5c33888ec7eebf79c5e2ef9ce1fde", "size"...
from typing import Callable, Dict, Optional, Sequence, Tuple, Union import warnings from google.api_core import gapic_v1, grpc_helpers import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore from goog...
{ "content_hash": "6b80f931c95c6dd5eb5a70952f0399f0", "timestamp": "", "source": "github", "line_count": 767, "max_line_length": 94, "avg_line_length": 43.13689700130378, "alnum_prop": 0.6174212657921779, "repo_name": "googleapis/python-tasks", "id": "107bb94b5e40116c1789f24ae7e3e2366dd5913e", "size...
from django.db import migrations from django.db.models import Count, Q from wagtail.core.models import Page as RealPage def ancestor_of_q(page): paths = [ page.path[0:pos] for pos in range(0, len(page.path) + 1, page.steplen)[1:] ] q = Q(path__in=paths) return q def create_default_w...
{ "content_hash": "9dcea9f17aa69a14a736b03880c8e98a", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 165, "avg_line_length": 41.23863636363637, "alnum_prop": 0.6643703499586663, "repo_name": "jnns/wagtail", "id": "73e8f1eb1d7857ba70ec115ebeacecf9d9843ffc", "size": "3653", ...
import os, sys, json, yaml import optparse if __name__ == '__main__': parser = optparse.OptionParser() parser.add_option('--output', dest='output', default=None, help='output JSON filename') parser.add_option('--class-names', dest='class_names', help='YAML metadata for class names') parser.add_option('--debug-comm...
{ "content_hash": "0471c04345727ffa30282d1fc37cc904", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 110, "avg_line_length": 36.48148148148148, "alnum_prop": 0.6873096446700507, "repo_name": "xsmart/opencvr", "id": "ba9b38e3df45304ef9988ca94d756591d5a9c1b9", "size": "1091"...
""" Cells Service Manager """ import datetime import time from oslo.config import cfg from nova.cells import messaging from nova.cells import state as cells_state from nova.cells import utils as cells_utils from nova import context from nova import exception from nova import manager from nova.openstack.common import ...
{ "content_hash": "daa39c324b5182d52b66375b1214e3a9", "timestamp": "", "source": "github", "line_count": 377, "max_line_length": 78, "avg_line_length": 43.777188328912466, "alnum_prop": 0.5948254968492487, "repo_name": "DirectXMan12/nova-hacking", "id": "f776c542e4aebb0dfd3ee097fa590389039c1c4d", "s...
"""Implementation of __array_function__ overrides from NEP-18.""" import collections import functools import os from numpy.core._multiarray_umath import ( add_docstring, implement_array_function, _get_implementing_args) from numpy.compat._inspect import getargspec ARRAY_FUNCTION_ENABLED = bool( int(os.enviro...
{ "content_hash": "86d347cae2cfa2ac1b042da44d81aa3e", "timestamp": "", "source": "github", "line_count": 204, "max_line_length": 79, "avg_line_length": 35.76960784313726, "alnum_prop": 0.6516376593120461, "repo_name": "seberg/numpy", "id": "cb550152ebede227848a8b503bedc26d3fec331f", "size": "7297", ...
"""Script for running all test files (except memory leaks tests).""" import os import sys from psutil.tests import unittest from psutil.tests import VERBOSITY def get_suite(): HERE = os.path.abspath(os.path.dirname(__file__)) testmodules = [os.path.splitext(x)[0] for x in os.listdir(HERE) ...
{ "content_hash": "4c6eb7f321aeef75f27560910e275620", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 74, "avg_line_length": 28.870967741935484, "alnum_prop": 0.6435754189944134, "repo_name": "jules185/IoT_Hackathon", "id": "88bcd6208900eeb0563bc7ed93c07d06bc403796", "size"...
"""The Ironic Service API.""" import logging import sys from oslo.config import cfg from six.moves import socketserver from wsgiref import simple_server from ironic.api import app from ironic.common.i18n import _LI from ironic.common import service as ironic_service from ironic.openstack.common import log CONF = cf...
{ "content_hash": "af0f9d0706ce07c866b55dd699fc03ce", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 67, "avg_line_length": 26.244444444444444, "alnum_prop": 0.6689246401354784, "repo_name": "debayanray/ironic_backup", "id": "14c5dbdb3ec149c9f10f2acbe14cf6891a792e2e", "siz...
"""consent file validation results Revision ID: e9a549d1882d Revises: 6de7e8a83d66, 1db87855f77c Create Date: 2021-06-09 16:35:26.683816 """ from alembic import op import sqlalchemy as sa import rdr_service.model.utils from rdr_service.participant_enums import PhysicalMeasurementsStatus, QuestionnaireStatus, OrderS...
{ "content_hash": "a62b83edfb49e1936bd75c0318a35295", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 125, "avg_line_length": 38.94805194805195, "alnum_prop": 0.735245081693898, "repo_name": "all-of-us/raw-data-repository", "id": "664c7c9a46682142fd46f539768074ed82accaf0", ...
from .common import *
{ "content_hash": "49ff64c7550820cfccb80266786a46d8", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 21, "avg_line_length": 21, "alnum_prop": 0.7619047619047619, "repo_name": "abirafdirp/inventory", "id": "1e2ec17cd85897f3c46e5026e75c1765f6d69db3", "size": "46", "binary":...
"""The following code should emit a raising-non-exception. Previously, it didn't, due to a bug in the check for bad-exception-context, which prevented further checking on the Raise node. """ # pylint: disable=import-error, too-few-public-methods, useless-object-inheritance from missing_module import missing class Ex...
{ "content_hash": "4d1bf9c152777cb3079a64616f193210", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 82, "avg_line_length": 32, "alnum_prop": 0.7596153846153846, "repo_name": "ruchee/vimrc", "id": "7961c52206690ac50be57a2bcbcb745b3d89ef89", "size": "416", "binary": false...
__all__ = ["staff"] # Selenium WebDriver from selenium import webdriver from selenium.common.exceptions import NoSuchElementException #from selenium.webdriver.common.keys import Keys from gluon import current from s3 import s3_debug from tests import * # ------------------------------------------------------------...
{ "content_hash": "6c5ad2814c7984de59f6e3bd55393f8c", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 79, "avg_line_length": 23.367088607594937, "alnum_prop": 0.5471289274106176, "repo_name": "flavour/cedarbluff", "id": "748388e71cf7922fa476fb2bc7164aac9188afb7", "size": "1...
import numpy import h5py import matplotlib.pyplot as plt from basemapInterp2D import basemapInterp2D inImageFileName = '../syntheticCuspVortex/image001.h5' outFolder= '.' h5File = h5py.File(inImageFileName, 'r') bounds = h5File["bounds"][...] inImageData = h5File["data"][...] inMask = numpy.array(h5File["mask"][......
{ "content_hash": "fe5e1f19dd2679f1c7a218e4e2284d80", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 89, "avg_line_length": 28.114285714285714, "alnum_prop": 0.6808943089430894, "repo_name": "gabyx/acciv", "id": "651d61ca336cde28d7d18b9a68aed3eba699c8b1", "size": "1986", ...
from functools import update_wrapper from django.http import Http404, HttpResponseRedirect from django.contrib.admin import ModelAdmin, actions from django.contrib.admin.forms import AdminAuthenticationForm from django.contrib.auth import logout as auth_logout, REDIRECT_FIELD_NAME from django.contrib.contenttypes impor...
{ "content_hash": "9af229c9de5dc680c2b13dd00f276536", "timestamp": "", "source": "github", "line_count": 452, "max_line_length": 121, "avg_line_length": 41.38274336283186, "alnum_prop": 0.5609730018711574, "repo_name": "edisonlz/fruit", "id": "b7f643b7f46688abff39e1e98993face94f58d97", "size": "1870...
""" Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this ...
{ "content_hash": "6faee70fb535ab8f0ea4cdd99eeef284", "timestamp": "", "source": "github", "line_count": 182, "max_line_length": 95, "avg_line_length": 35.85164835164835, "alnum_prop": 0.724904214559387, "repo_name": "alexryndin/ambari", "id": "9d4d6a2c8ec9afc4b8ccd7505386b1818732bbc4", "size": "654...
from __future__ import print_function try: # Python 3 import http.client as httplib except ImportError: # Python 2 import httplib import json import struct import re import base64 import sys import os import os.path settings = {} ##### Switch endian-ness ##### def hex_switchEndian(s): """ Switches the endian...
{ "content_hash": "aad3d6d0a26201a6261ee3c2858ab1b4", "timestamp": "", "source": "github", "line_count": 149, "max_line_length": 90, "avg_line_length": 28.812080536912752, "alnum_prop": 0.6671325413463778, "repo_name": "dagurval/bitcoinxt", "id": "d73fcb9d5740a4b78a500d6383b19f3ccecd39c7", "size": "...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from .constants import MSG_REMOVED from .removed_message import RemovedMessage from .server_message_parser import ServerMessageParser __all__ = ['RemovedMessageParser'] class RemovedMessageParser(ServerMessa...
{ "content_hash": "29affa172e0b567790a3c8f66f30062f", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 59, "avg_line_length": 26.529411764705884, "alnum_prop": 0.7516629711751663, "repo_name": "foxdog-studios/pyddp", "id": "bfcc184f305d7a510d9c98e0d3e07d4a42489023", "size": ...
""" calc.py Implements a very simple calculator """ import math def sum(a, b): return a + b def sub(a, b): return a - b def div(a, b): if b == 0: raise ValueError return 0 return a / b def exp(a, b): return math.pow(a, b) def fibonacci(i): if i < 0: raise Value...
{ "content_hash": "d6a9228e9cd13d0f55c4e656111f56e7", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 83, "avg_line_length": 14.75609756097561, "alnum_prop": 0.547107438016529, "repo_name": "albarji/qatest", "id": "cfaaca4c0f32bdb32547e7d635cb0fba41ae5890", "size": "605", ...
from django_bulk_update.helper import bulk_update as bulk_update_helper from django.core.management import BaseCommand from casexml.apps.phone.models import SyncLogSQL, LOG_FORMAT_SIMPLIFIED, \ properly_wrap_sync_log class Command(BaseCommand): """ Forces a 412 for a given user by creating bad state in t...
{ "content_hash": "dca8d7f120bdcbbb945e7b65f6380917", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 75, "avg_line_length": 32.86206896551724, "alnum_prop": 0.6411332633788038, "repo_name": "dimagi/commcare-hq", "id": "c78e19e2df2a73f6395fbb06e88e9c600e848b4d", "size": "95...
import subprocess import os import argparse parser = argparse.ArgumentParser() parser.add_argument('--bucket', type=str, default='') parser.add_argument('--user_name', type=str, default='') parser.add_argument('--cluster_name', type=str, default='') parser.add_argument('--dataproc_version', type=str, default='') pars...
{ "content_hash": "3bb55c025108a3aca793209bcf307104", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 151, "avg_line_length": 59.44444444444444, "alnum_prop": 0.642456608811749, "repo_name": "epam/DLab", "id": "ebf69905a3bdbac574d401eded9b205b063b7a5d", "size": "4514", "b...
import bpy import os import time import struct from mathutils import Vector from subprocess import Popen, PIPE from time import localtime, strftime # Global constants FORMAT_VERSION = 1 DEFAULT_PART_NAME = 'default' PART_NAME_LENGTH = 32 def cutName(name, maxLength): """ Cuts given name to be exactly maxLength ...
{ "content_hash": "9c669016938520d411ef80e1acda8212", "timestamp": "", "source": "github", "line_count": 256, "max_line_length": 95, "avg_line_length": 31.58984375, "alnum_prop": 0.617410659082478, "repo_name": "creepydragon/revision1", "id": "9b5aa37236cb07c5b970a9c429d942319c52710e", "size": "8178...
import re import sys import os import os.path import logging from shutil import copy from datetime import datetime from mako.template import Template from mako.lookup import TemplateLookup #: Location within source directory to cache compiled mako modules MAKO_MODULES_DIR = '.mako_modules' #: Paths to ignore when b...
{ "content_hash": "3c0dce0dbb4097d02f8baa837678450e", "timestamp": "", "source": "github", "line_count": 199, "max_line_length": 97, "avg_line_length": 35.231155778894475, "alnum_prop": 0.5662530309513621, "repo_name": "lukecyca/woodcut", "id": "394a9e20d7c370e6c356434d67d198a979432351", "size": "70...
"""github_explorer URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') ...
{ "content_hash": "4e6b21a2a97af88658f3e7d016f0b443", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 79, "avg_line_length": 38.833333333333336, "alnum_prop": 0.7006437768240343, "repo_name": "navierula/DivHacks2017", "id": "23d981045ca32efdecf5b9fbeec6f898c8ce3161", "size"...
def _check_for_script(data): for key, value in data.items(): if value: if isinstance(value, dict): if _check_for_script(value): return True elif isinstance(value, str): if "<script>" in value: return True ...
{ "content_hash": "08e4ee540a7e6041bcdd5869bea4f5ac", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 47, "avg_line_length": 35.666666666666664, "alnum_prop": 0.4392523364485981, "repo_name": "DOAJ/doaj", "id": "5e598fa3ebec8cacadbc9f4d53cdf172ec6b1f1f", "size": "535", "b...
from openpnm.algorithms import ReactiveTransport from openpnm.utils import logging, Docorator, GenericSettings docstr = Docorator() logger = logging.getLogger(__name__) @docstr.get_sectionsf('NernstPlanckSettings', sections=['Parameters']) @docstr.dedent class NernstPlanckSettings(GenericSettings): r""" Param...
{ "content_hash": "562daa45f63aad42356c51028aa79aff", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 79, "avg_line_length": 33.206896551724135, "alnum_prop": 0.6147455867082036, "repo_name": "TomTranter/OpenPNM", "id": "817f68bc6877e4de980f7c33dc9a8afe0636f47b", "size": "2...
"""Nsxv Mock Test terms for nsxv.py""" INET_TERM="""\ term permit-mail-services { destination-address:: MAIL_SERVERS protocol:: tcp destination-port:: MAIL_SERVICES action:: accept } """ INET6_TERM="""\ term test-icmpv6 { protocol:: icmpv6 icmp-type:: echo-request echo-reply actio...
{ "content_hash": "abb43b27542a78fc4efee3b7f469817c", "timestamp": "", "source": "github", "line_count": 126, "max_line_length": 54, "avg_line_length": 18.182539682539684, "alnum_prop": 0.6137058053251855, "repo_name": "sneakywombat/capirca", "id": "df109d16ea56ff7bcf287a22789a673c0648359d", "size":...
import os import tempfile import time from unittest import mock from urllib.request import urlopen import pytest from requests.structures import CaseInsensitiveDict from httpie.downloads import ( parse_content_range, filename_from_content_disposition, filename_from_url, get_unique_filename, ContentRangeError,...
{ "content_hash": "1f0d92f9aa3c48dcaea607eadd0d3814", "timestamp": "", "source": "github", "line_count": 268, "max_line_length": 100, "avg_line_length": 38.007462686567166, "alnum_prop": 0.5322010602788141, "repo_name": "jakubroztocil/httpie", "id": "9b6d38f980286bc89e8980dc15998733f3e14c15", "size"...
import sys import gdb import os import os.path pythondir = '/tmp/jenkins-GCC-6-build_build-toolchain-mac-143_20170216_1487268977/install-native/share/gcc-arm-none-eabi' libdir = '/tmp/jenkins-GCC-6-build_build-toolchain-mac-143_20170216_1487268977/install-native/arm-none-eabi/lib/thumb/v6-m' # This file might be load...
{ "content_hash": "f56506ee244feee8eb13c897e5bd27bb", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 123, "avg_line_length": 41.111111111111114, "alnum_prop": 0.7135135135135136, "repo_name": "ChangsoonKim/STM32F7DiscTutor", "id": "cd8244ac373a66181a03f33057e917e3dd7a0a9b", ...
"""A factory-pattern class which returns models.""" import autoconverter import change_gan models_map = { 'autoconverter': autoconverter, 'change_gan': change_gan, } def get_model(model_name): if model_name not in models_map: raise ValueError('Name of dataset unknown %s' % model_name) return...
{ "content_hash": "59d299d7cb07cedf0dcab8d6b73fa306", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 67, "avg_line_length": 22.933333333333334, "alnum_prop": 0.6947674418604651, "repo_name": "shygiants/ChangeGAN", "id": "28e2a2ff2a619b9d4505f6320d69af6af5ad0e06", "size": "...
""" This module test for counterpartyd compability with Ethereum's Smart Contracts. """ """ import os import pytest from pyethereum import tester import serpent import logging logger = logging.getLogger(__name__) logging.basicConfig(level=logging.DEBUG, format='%(message)s') logger = logging.getLogger() # customize V...
{ "content_hash": "c5d8af943ad09cc0cce6ce7baa8308e9", "timestamp": "", "source": "github", "line_count": 620, "max_line_length": 132, "avg_line_length": 28.866129032258065, "alnum_prop": 0.5909370285522714, "repo_name": "gotcha/testcounter", "id": "a8b84b3d53c12755e2d20947af4943c1696a7689", "size": ...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('feedback', '0001_squashed_0010_auto_20170205_2230'), ] operations = [ migrations.AlterField( model_name='discussion', name='...
{ "content_hash": "90305fa32e27748aa990bc4e1d316e1d", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 154, "avg_line_length": 33.17391304347826, "alnum_prop": 0.6277850589777195, "repo_name": "PeteAndersen/swarfarm", "id": "5cc882187bc8b97ca99ff4ab38224af142ad0c08", "size":...
from __future__ import division, absolute_import, print_function import os import math import pytest import numpy as np from numpy.testing import assert_raises, assert_equal from . import util def _path(*a): return os.path.join(*((os.path.dirname(__file__),) + a)) class TestIntentInOut(util.F2PyTest): # ...
{ "content_hash": "0b149576987d76d0d32fa0faa780f383", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 64, "avg_line_length": 25.866666666666667, "alnum_prop": 0.6533505154639175, "repo_name": "tynn/numpy", "id": "d695de61b75cd9e7052fcc37772acf1389a82247", "size": "776", "...
from flask import Blueprint, request, jsonify, g from flask_restful import Api, Resource from horse import models from .schemas.user import user_schema, users_schema, user_action_schema users_bp = Blueprint('users_api', __name__) users_api = Api(users_bp) class User(Resource): def get(self, user_pk): us...
{ "content_hash": "a6355e282c56ede084b4a5214566ee75", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 78, "avg_line_length": 27.150537634408604, "alnum_prop": 0.6376237623762376, "repo_name": "pragmaticcoders/horse", "id": "ddde29de1f1fb60a44b3f8167e82f9a8523fbb9c", "size":...
import os import re import sys import urllib import urllib2 import shlex from django.template.loader import render_to_string from django.conf import settings from file_system import File from subprocess import check_call, CalledProcessError class TemplateProcessor: @staticmethod def process(resource): ...
{ "content_hash": "22df2b1fff45145d687aae8caf0fe85c", "timestamp": "", "source": "github", "line_count": 342, "max_line_length": 125, "avg_line_length": 38.30994152046784, "alnum_prop": 0.5665547244695467, "repo_name": "m-thielen/hyde", "id": "83e4aae8552a84aa5b316a362a9c023519e72099", "size": "1310...
from PyQt4.QtCore import QRect from PyQt4.QtGui import QApplication, QPixmap def getScreenDimensions(): """Returns the posx, posy, width and height of the monitor as a QRect.""" return QRect(QApplication.desktop().x(), QApplication.desktop().y(), QApplication.desktop().width(...
{ "content_hash": "7817632794943bc139a52d278a7cf626", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 79, "avg_line_length": 33.3, "alnum_prop": 0.6716716716716716, "repo_name": "Catgroove/ninjapic", "id": "b2291a429466dc5668b34d5196d30a848a681d5c", "size": "999", "binary...
"""Create / interact with Google Cloud Datastore transactions.""" from google.cloud.datastore.batch import Batch class Transaction(Batch): """An abstraction representing datastore Transactions. Transactions can be used to build up a bulk mutation and ensure all or none succeed (transactionally). Fo...
{ "content_hash": "f55bb60ece8a6ff821e71c660e44519b", "timestamp": "", "source": "github", "line_count": 210, "max_line_length": 79, "avg_line_length": 29.928571428571427, "alnum_prop": 0.5971360381861576, "repo_name": "ammarkhann/FinalSeniorCode", "id": "6108bd80647a6c9b787307d9adc987094b1407b8", "...
""" Contains functionality to use a Zigbee device as a switch. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/switch.zigbee/ """ import voluptuous as vol from homeassistant.components.switch import SwitchDevice from homeassistant.components.zigbee impor...
{ "content_hash": "dc0f3f0d74f78c3ea1636baef8dc0251", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 74, "avg_line_length": 26.428571428571427, "alnum_prop": 0.7481081081081081, "repo_name": "PetePriority/home-assistant", "id": "81fb8348c4e2e8f54e1d99ccfee3b04fd7b5a77d", "...
from django.conf.urls.defaults import patterns, url urlpatterns = patterns('', (r'^missing_redirect_uri/?$', 'myresource.apps.oauth2.views.missing_redirect_uri'), (r'^authorize/?$', 'myresource.apps.oauth2.views.authorize'), (r'^authorize/aadhaar/?$', 'myresource.app...
{ "content_hash": "35e265fafebd5f8630d93b9edaf79f94", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 98, "avg_line_length": 53.25, "alnum_prop": 0.5938967136150235, "repo_name": "pingali/aadhaar-oauth2-server", "id": "22693cd021be3ec5a33ba1db7e2c5555a157a281", "size": "449"...
import sys import os import shlex # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.insert(0, os.path.abspath('.')) # --...
{ "content_hash": "fb92087b1c2ab81d97e0bd470b12d731", "timestamp": "", "source": "github", "line_count": 289, "max_line_length": 80, "avg_line_length": 32.3598615916955, "alnum_prop": 0.7045551753635586, "repo_name": "dwrpayne/zulip", "id": "b837884828c873ac208768a4ae882c855413f426", "size": "9787",...
from __future__ import absolute_import from flask.ext.script import Manager from flask.ext.celery import install_commands as install_celery_commands from myapp import create_app app = create_app() manager = Manager(app) install_celery_commands(manager) if __name__ == "__main__": manager.run()
{ "content_hash": "7f458133a4ecbd1a3c7ed3d194ec8952", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 72, "avg_line_length": 25.083333333333332, "alnum_prop": 0.7441860465116279, "repo_name": "ask/flask-celery", "id": "44573ec5c074599b23745b0d65c42e6a1256721a", "size": "323...
import pickle import pickletools from test import support from test.pickletester import AbstractPickleTests from test.pickletester import AbstractPickleModuleTests import unittest class OptimizedPickleTests(AbstractPickleTests, AbstractPickleModuleTests): def dumps(self, arg, proto=None): return pickletoo...
{ "content_hash": "7690d688cc2785131f459060cffdcceb", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 81, "avg_line_length": 43.51960784313726, "alnum_prop": 0.5582338364496509, "repo_name": "yotchang4s/cafebabepy", "id": "6bf9d182767f4b4efc194f859a3964b95e6ecd98", "size":...
""" Will measure the distance from one subjects rois to all other subjects in mm on specified surfaces. Usage: ciftify_postPINT2_sub2sub [options] <concatenated-pint> <output_sub2sub.csv> Arguments: <concatenated-pint> The concatenated PINT outputs (csv file) <output_sub2sub.csv> The outputfile name O...
{ "content_hash": "eba3a839aa61de353b8bef7bd85deb07", "timestamp": "", "source": "github", "line_count": 138, "max_line_length": 120, "avg_line_length": 36.289855072463766, "alnum_prop": 0.6731230031948882, "repo_name": "edickie/ciftify", "id": "230a1944c61a005f89420012697d67298b7a6d69", "size": "50...
import logging from holmes.facters import Facter from holmes.utils import _ class JSFacter(Facter): @classmethod def get_fact_definitions(cls): return { 'page.js': { 'title': _('JS'), 'description': lambda value: list(value), 'unit': 'js', ...
{ "content_hash": "67b7d35b99a880c8223d977eda101077", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 75, "avg_line_length": 28.27, "alnum_prop": 0.4591439688715953, "repo_name": "marcelometal/holmes-api", "id": "0d7e125153b080bd81bffd037b97cfb3ecbb3d3a", "size": "2870", ...
""" Indexers for FeedApp, FeedBrand, FeedCollection, FeedShelf, FeedItem for feed homepage and curation tool search. """ from amo.utils import attach_trans_dict import mkt.carriers import mkt.feed.constants as feed import mkt.regions from mkt.search.indexers import BaseIndexer from mkt.translations.utils import format...
{ "content_hash": "e08988935ee975abb8dec6c6f7054bd9", "timestamp": "", "source": "github", "line_count": 321, "max_line_length": 78, "avg_line_length": 35.30529595015577, "alnum_prop": 0.49360275302214773, "repo_name": "andymckay/zamboni", "id": "1503c03aa515be3d81048545e23d505294c63c19", "size": "1...
"""Policy Network with naive board encoding""" import os from src.learn.bots.CommonLearn import CommonLearn import src.learn.bots.utils as utils class Learn(CommonLearn): def handle_data(self, data): boards = data[data.columns[3:-2]].as_matrix() y = utils.policy_output(data['move']) boa...
{ "content_hash": "5895f85778a002f0869bdcfbfe34746f", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 53, "avg_line_length": 23.133333333333333, "alnum_prop": 0.5951008645533141, "repo_name": "nathbo/GO_DILab", "id": "079ca96a429c56a18b77d78656fa339423c100c9", "size": "694"...
from unittest.mock import Mock, patch from pyramid.config import Configurator from opentelemetry import trace from opentelemetry.instrumentation.propagators import ( TraceResponsePropagator, get_global_response_propagator, set_global_response_propagator, ) from opentelemetry.instrumentation.pyramid import...
{ "content_hash": "5246ddc8d817a2772bef4a61f52d628f", "timestamp": "", "source": "github", "line_count": 235, "max_line_length": 118, "avg_line_length": 38.727659574468085, "alnum_prop": 0.6411383364465444, "repo_name": "open-telemetry/opentelemetry-python-contrib", "id": "d3a4fa91db1697e1a9e541d3353d...
""" Django settings for IrrigatorPro Web Site """ import os import re import sys ### # Where am I? ### TEST_RUNNER = 'uga.test_runner.ManagedModelTestRunner' ABSOLUTE_PROJECT_ROOT = os.path.abspath( os.path.join( os.path.dirname(__file__), ...
{ "content_hash": "25c3d8265737b3ee85fd215631eb371c", "timestamp": "", "source": "github", "line_count": 449, "max_line_length": 131, "avg_line_length": 29.621380846325167, "alnum_prop": 0.6765413533834587, "repo_name": "warnes/irrigatorpro", "id": "b7267566a839d028fadae7ea56ad430ab75c8239", "size":...
from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('statmaps', '0003_collection_journal_name'), ] operations...
{ "content_hash": "27ad062b339fdcbb04c0b7ebff29425b", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 111, "avg_line_length": 28, "alnum_prop": 0.6564625850340136, "repo_name": "NeuroVault/NeuroVault", "id": "e05ce510e0cc392790b59cd61668e71591171e60", "size": "612", "bina...
"""Limited version of os module: only keep what is more or less relevant in a browser context """ import abc import sys error = OSError name = 'posix' linesep = '\n' from posix import * import posixpath as path sys.modules['os.path'] = path from os.path import (curdir, pardir, sep, pathsep, defpath, extsep, altsep,...
{ "content_hash": "f4636b326dd0d683e8e883614057a33a", "timestamp": "", "source": "github", "line_count": 139, "max_line_length": 80, "avg_line_length": 27.928057553956833, "alnum_prop": 0.639361154044307, "repo_name": "kikocorreoso/brython", "id": "9e736a6a4898ab591bf8af3c5ea4b57e3db9f543", "size": ...
import sys from . import main if __name__ == '__main__': sys.exit(main())
{ "content_hash": "f8d958c4c9a9e31f29eb7e016ae5ac94", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 26, "avg_line_length": 15.2, "alnum_prop": 0.5789473684210527, "repo_name": "davidfoerster/schema-matching", "id": "dbb189cc5f482b54b34718d46251d49fbbd7ba6e", "size": "76", ...
"Test posix functions" from test import support # Skip these tests if there is no posix module. posix = support.import_module('posix') import errno import sys import time import os import platform import pwd import shutil import stat import tempfile import unittest import warnings _DUMMY_SYMLINK = os.path.join(temp...
{ "content_hash": "bcaa162b8976a444d292cf35ccc86cde", "timestamp": "", "source": "github", "line_count": 1249, "max_line_length": 122, "avg_line_length": 41.30264211369095, "alnum_prop": 0.583616027293698, "repo_name": "ms-iot/python", "id": "77e5b0c4fdf6fba9059cf6e0d9ce0d0799f3b459", "size": "51587...
from auto_gen import * from workflow import DBWorkflow from vistrail import DBVistrail from log import DBLog from id_scope import IdScope
{ "content_hash": "03df4caed3efc412883f40398cac858f", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 31, "avg_line_length": 27.6, "alnum_prop": 0.8333333333333334, "repo_name": "CMUSV-VisTrails/WorkflowRecommendation", "id": "51ea32492afd6d98bd2c7948a90ac590290963d8", "size...
from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'VideoCode' db.create_table(u'video_videocode', ( (u'id', self.gf('dja...
{ "content_hash": "7c0e0f3b3e8e79ccfe0f73ba635cfddd", "timestamp": "", "source": "github", "line_count": 120, "max_line_length": 195, "avg_line_length": 72.95833333333333, "alnum_prop": 0.5466590519703027, "repo_name": "OlegPshenichniy/upfavor-mezzanine", "id": "2e2594346f9c836c3c376dbeab32f17064308af...
from __future__ import unicode_literals from django.core.files.storage import FileSystemStorage from django.views.generic import TemplateView from yepes.apps import apps from yepes.views import ListView Configuration = apps.get_model('thumbnails', 'Configuration') SourceFile = apps.get_class('thumbnails.files', 'Sou...
{ "content_hash": "208fde6c44fd2c471e55e55ce0681724", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 81, "avg_line_length": 32.31818181818182, "alnum_prop": 0.7011251758087201, "repo_name": "samuelmaudo/yepes", "id": "3b59f458385ac0eb41585efe7423fd40263bcb76", "size": "144...
import datetime from jsonfield import JSONField from django.db import models from django.contrib.auth.models import User from django.db import IntegrityError from django.core.urlresolvers import reverse class UserProfile(models.Model): user = models.OneToOneField(User) group = models.CharField(max_length=255...
{ "content_hash": "afc56e8a5703ea3acfa6d29085d4ea5a", "timestamp": "", "source": "github", "line_count": 266, "max_line_length": 217, "avg_line_length": 39.330827067669176, "alnum_prop": 0.6250238960045881, "repo_name": "oskgeek/xmccamp", "id": "ec89c1e1635695908a773cd6ed263e1ac19d372d", "size": "10...
class FunctionApproximator(object): """Map states and actions using a function.""" def __init__(self, n_actions: int) -> None: super(FunctionApproximator, self).__init__() self.n_actions = n_actions self.thetas = [] self.features_shape = (0) def summed_thetas(self, state, ac...
{ "content_hash": "235b5581eccae6381009f666fb69cb48", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 52, "avg_line_length": 33.23076923076923, "alnum_prop": 0.6180555555555556, "repo_name": "arnomoonens/DeepRL", "id": "2c642a68aabe9e8e475910e8e20ae5904e88634e", "size": "45...
""" Goes over a list of docker images, downloads them in a VM, running boot2docker then downloads a script and executes it on them. Filters out the results and saves them in a file. In this version, both the address of the VM and of the script are hardcoded on local IPs. """ from subprocess import Popen, PIPE, Timeout...
{ "content_hash": "caf48eef702749bde453d838ac390021", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 190, "avg_line_length": 31.821052631578947, "alnum_prop": 0.6705259675818723, "repo_name": "paradoxengine/docker-tester", "id": "da67abe42fd9a677d74d9dfd08e6622594b0fd3a", ...
""" This implements the high-level functions for SLIP-39, also called "Shamir Backup". See https://github.com/satoshilabs/slips/blob/master/slip-0039.md. """ import hmac from collections import defaultdict from hashlib import pbkdf2_hmac from typing import Dict, Iterable, List, Optional, Set, Tuple from .i18n import...
{ "content_hash": "ac0f3c26798f4e65b76c9e908d65dbaa", "timestamp": "", "source": "github", "line_count": 592, "max_line_length": 166, "avg_line_length": 31.366554054054053, "alnum_prop": 0.6081102913457914, "repo_name": "pooler/electrum-ltc", "id": "6ab1d776c7971fa1d657bd066202bea2d0508907", "size":...
class TextOutput(object): """Wrapper for text output whose repr is the text itself. This avoids `repr(output)` adding quotation marks around already-rendered text. """ def __init__(self, output): self.output = output def __repr__(self): return self.output class HtmlOutput: ...
{ "content_hash": "6c9e1795e319293130c8b6b79faf7bb7", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 86, "avg_line_length": 23.95, "alnum_prop": 0.6137787056367432, "repo_name": "lresende/toree-gateway", "id": "4c776d0d5429c9dcbe144605bc209cf529ba8510", "size": "1062", "...
r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from tests import IntegrationTestCase from tests.holodeck import Request from twilio.base.exceptions import TwilioException from twilio.http.response import Response class BindingTestCase(IntegrationTestCase): ...
{ "content_hash": "f2b4523682e6128c5261a0bae123f690", "timestamp": "", "source": "github", "line_count": 209, "max_line_length": 167, "avg_line_length": 41.311004784689, "alnum_prop": 0.5418114431318045, "repo_name": "twilio/twilio-python", "id": "20e21915b01a855485af41b500b660f986ce3adc", "size": "...
import socket import sys # ----------- Config ---------- IP_VERSION = 'IPv4' PORT = 3333 # ------------------------------- if IP_VERSION == 'IPv4': family_addr = socket.AF_INET elif IP_VERSION == 'IPv6': family_addr = socket.AF_INET6 else: print('IP_VERSION must be IPv4 or IPv6') sys.exit(1) try: ...
{ "content_hash": "20ad3c7abe2afa69369ae511099e2fa0", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 88, "avg_line_length": 25.795454545454547, "alnum_prop": 0.5488986784140969, "repo_name": "krzychb/rtd-test-bed", "id": "7c3676d9f63018ea2f3aa6f3ae571897d17efe14", "size": ...
from pyPanair.postprocess import ffmf_converter if __name__ == '__main__': print("converting ffmf to csv file") ffmf_converter.write_ffmf() print("success!")
{ "content_hash": "ddb00e264528b2d0a6e545f0cce37aa7", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 47, "avg_line_length": 29.5, "alnum_prop": 0.6440677966101694, "repo_name": "SaTa999/pyPanair", "id": "25d91b41fccdaa047a6c74fbb9b5029e1a4fb4fa", "size": "177", "binary": ...
from django.contrib.auth.backends import ModelBackend from website.models import Contributor class CustomAuthentication (ModelBackend): def authenticate(self, username=None, password=None): try: user = Contributor.objects.get (username=username) if user.password == password: ...
{ "content_hash": "ad3ed91786783ad9be2e972d5408cdd5", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 62, "avg_line_length": 27.8, "alnum_prop": 0.6223021582733813, "repo_name": "UKS-Tim3/Issuebox", "id": "6428ca37755f9c17f3dd375ef19798b2c82250a7", "size": "834", "binary"...
from django.conf.urls import url from . import views urlpatterns = [ url(r'^$', views.login, name='login'), url(r'^user_login/$', views.user_login, name='user_login'), ]
{ "content_hash": "291dd24305c9ac9fe1aaa4043e93b09f", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 63, "avg_line_length": 22.5, "alnum_prop": 0.6444444444444445, "repo_name": "CMPUT404W16T01/CMPUT404-project-socialdistribution", "id": "8cdcf785ea7095b597c3f72445f495cbaf04cb...
""" Django settings for Mastering Masteries project. For more information on this file, see https://docs.djangoproject.com/en/dev/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/dev/ref/settings/ """ from __future__ import absolute_import, unicode_literals import...
{ "content_hash": "764f2ca50046adc9bfa00d3e5bf98c09", "timestamp": "", "source": "github", "line_count": 297, "max_line_length": 114, "avg_line_length": 34.831649831649834, "alnum_prop": 0.618753020782987, "repo_name": "bobcosc/masteringmastery", "id": "9572a8a3195977be04d3855992aaaa3a6bd50460", "si...
""" MoinMoin - Support Package This package collects small third party utilities in order to reduce the necessary steps in installing MoinMoin. Each source file is copyrighted by its respective author. We've done our best to assure those files are freely redistributable. @copyright: 20...
{ "content_hash": "34bc15ff564f3d7df5c21da28dacbe76", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 67, "avg_line_length": 37.36363636363637, "alnum_prop": 0.7128953771289538, "repo_name": "Glottotopia/aagd", "id": "cdf81f65a58a9d74872cadab3506a49c4b05b781", "size": "441"...
import sqlite3 as sqlite class database: def __init__(self, dbname): self.con = sqlite.connect(dbname) def __del__(self): self.con.close() def dbcommit( self ): self.con.commit() def insertData( self, query ): result = self.con.execute( query ) self.con.commit() return result def getNames( self, t...
{ "content_hash": "6fec4679876a77e062114c63bae3bf93", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 208, "avg_line_length": 41.064516129032256, "alnum_prop": 0.6784498559832417, "repo_name": "rickardo10/distributed-db-app", "id": "13882e8d1852bc96214c60dadfe312a9c57289e8", ...
from core.himesis import Himesis import uuid class Hlayer0rule1(Himesis): def __init__(self): """ Creates the himesis graph representing the DSLTrans rule layer0rule1. """ # Flag this instance as compiled now self.is_compiled = True ...
{ "content_hash": "0f50c3a53c9f197de02d8bfa49ac3f2c", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 239, "avg_line_length": 37.329787234042556, "alnum_prop": 0.5246508976916501, "repo_name": "levilucio/SyVOLT", "id": "a665f6616c0c280a7983d8820659ef0cefae9a4f", "size": "35...
from __future__ import absolute_import # import jinja2 from jinja2.ext import Extension from .templatetags.promotions_tags import promo_ballance class PromotionsExtension(Extension): def __init__(self, environment): super(PromotionsExtension, self).__init__(environment) environment.filters["prom...
{ "content_hash": "4f37636c5c3d5a5f1aa03b918261da98", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 62, "avg_line_length": 26.533333333333335, "alnum_prop": 0.7512562814070352, "repo_name": "phani00/tovp", "id": "222cde4c39ddd09b510bcd96dca0885f4a63bc55", "size": "398", ...
from diffusion import * from work import DiffusionTensorTest from registration import BSplineDeformableRegistration, AffineRegistration
{ "content_hash": "60f8e570eaff5be8620838633ee0edf2", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 74, "avg_line_length": 45.333333333333336, "alnum_prop": 0.8897058823529411, "repo_name": "christianbrodbeck/nipype", "id": "d73af3300a98d8b075cdff571d6036a537ff3b50", "size...
import sys if len(sys.argv) < 2: print("Usage: %s <binary>" % (sys.argv[0])) sys.exit(-1) with open(sys.argv[1], "rb") as file_handle: binary_content = file_handle.read() file_handle.close() with open("%s.asm" % (sys.argv[1]), "w") as output_asm_file: output_asm_file.write("bits 32\n\n") ...
{ "content_hash": "d7fbcb68662689ea2c2cda63f2fb04dc", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 73, "avg_line_length": 30.705882352941178, "alnum_prop": 0.5842911877394636, "repo_name": "Ge0/okita", "id": "2b073f866e52b0791b6b5cc58a9813382c6e9922", "size": "545", "b...
from jsonrpc import ServiceProxy access = ServiceProxy("http://127.0.0.1:9939") pwd = raw_input("Enter wallet passphrase: ") access.walletpassphrase(pwd, 60)
{ "content_hash": "da5ae1649991abe44eca7358f5bcef99", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 46, "avg_line_length": 39.5, "alnum_prop": 0.759493670886076, "repo_name": "Faucetcoin/faucetcoin", "id": "ad38d06f0090dd9a0365aac0b65d097676c2d741", "size": "158", "binar...
from django.shortcuts import render # Create your views here. def page(request, num="1"): pass
{ "content_hash": "27d81ffcab76caf28d41523a4927642c", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 35, "avg_line_length": 20, "alnum_prop": 0.72, "repo_name": "domenicosolazzo/practice-django", "id": "1a48f9fe1024ca5b68910751dee2743bc1abb0ff", "size": "100", "binary": f...
from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import from __future__ import print_function import unittest import sys import time from system_test import TestCase, Qdrouterd, main_module, Process, TIMEOUT, Logger, TestTimeout from subprocess import PIPE, STDOU...
{ "content_hash": "76c7d58b052f10ddad6cbc4c6c1f7799", "timestamp": "", "source": "github", "line_count": 1252, "max_line_length": 155, "avg_line_length": 44.685303514377, "alnum_prop": 0.5079362242162084, "repo_name": "ganeshmurthy/qpid-dispatch", "id": "1ed68f1c3559887a1dd608f981c2f2c9f39eeede", "s...
from mitmproxy.tools.console import palettes class TestPalette: def test_helptext(self): for i in palettes.palettes.values(): assert i.palette(False) for i in palettes.palettes.values(): assert i.palette(True)
{ "content_hash": "0f7eb06b9eff57c2699bb3f7e1c1c5a1", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 44, "avg_line_length": 28.444444444444443, "alnum_prop": 0.65234375, "repo_name": "mitmproxy/mitmproxy", "id": "05d3c274d46fc478b5f470f28d05e5c8c92defaa", "size": "256", "...
import sys import tkinter import unittest _tk_unavailable = None def check_tk_availability(): """Check that Tk is installed and available.""" global _tk_unavailable if _tk_unavailable is None: _tk_unavailable = False if sys.platform == 'darwin': # The Aqua Tk implementations o...
{ "content_hash": "dd42a6e250894df46a20b571a888619c", "timestamp": "", "source": "github", "line_count": 133, "max_line_length": 80, "avg_line_length": 33.11278195488722, "alnum_prop": 0.5792461398728429, "repo_name": "paweljasinski/ironpython3", "id": "fcd9ffc1ca469ea9794c505f2a19e925bc1229cc", "si...
"""Presubmit script for changes affecting Source/platform. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for more details about the presubmit API built into depot_tools. """ import difflib import os import re import sys USE_PYTHON3 = True RUNTIMEENABLED_NAME = re.compile(r'\s*name\s*:\s...
{ "content_hash": "ba0ac9f8058e396590a327b21505fe06", "timestamp": "", "source": "github", "line_count": 129, "max_line_length": 96, "avg_line_length": 36.49612403100775, "alnum_prop": 0.6497451146983857, "repo_name": "ric2b/Vivaldi-browser", "id": "018410a68206bfe6b731a83d16769aa93f3e474e", "size":...
from openerp.osv import osv, fields from openerp.tools.float_utils import float_round as round class account_invoice_line(osv.osv): _inherit = "account.invoice.line" _columns = { 'move_id': fields.many2one('stock.move', string="Move line", help="If the invoice was generated from a stock.picking, refer...
{ "content_hash": "62dbc3c3082cd4c6aca2d93b5c439df9", "timestamp": "", "source": "github", "line_count": 166, "max_line_length": 205, "avg_line_length": 71.43975903614458, "alnum_prop": 0.5217977907074796, "repo_name": "diogocs1/comps", "id": "de085e32e30bda1aff27584e1f2168bb689f06c7", "size": "1289...
from hanlp.common.vocab_tf import VocabTF from hanlp.metrics.chunking.chunking_f1_tf import ChunkingF1_TF from hanlp.metrics.chunking.sequence_labeling import get_entities class BMES_F1_TF(ChunkingF1_TF): def __init__(self, tag_vocab: VocabTF, from_logits=True, suffix=False, name='f1', dtype=None, **kwargs): ...
{ "content_hash": "8cb85170efe65ee39ebc2efefe69eb66", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 108, "avg_line_length": 35.16279069767442, "alnum_prop": 0.6064814814814815, "repo_name": "hankcs/HanLP", "id": "9b67b93d4f02b75397e36cdfb6fb85926c67f927", "size": "1578", ...
import os.path from .. import * @skip_if('objc' not in test_features, 'skipping objective c++ tests') class TestObjCxx(IntegrationTest): def __init__(self, *args, **kwargs): super().__init__(os.path.join('languages', 'objcxx'), *args, **kwargs) def test_build(self): self.build(executable('pr...
{ "content_hash": "a78d89bc069de6977522bae0abb7b477", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 78, "avg_line_length": 31.214285714285715, "alnum_prop": 0.5995423340961098, "repo_name": "jimporter/bfg9000", "id": "8f70c132bbec9cbbee9b9dcda2f7f8bd4991204f", "size": "43...
from .pylibmount import *
{ "content_hash": "65056093efcbe6a73000a11907df99a2", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 25, "avg_line_length": 13.5, "alnum_prop": 0.7407407407407407, "repo_name": "Shihta/enter-docker", "id": "09104e2e2133862e683eac65676aa788a02fc62c", "size": "27", "binary"...
"""Tests of parameters.""" from absl.testing import parameterized import tensorflow as tf from tensorflow_compression.python.layers import parameters class ParameterTest: def test_initial_value_is_reproduced(self): initial_value = tf.random.uniform(self.shape, dtype=tf.float32) parameter = self.cls(initia...
{ "content_hash": "2aac8b632ce9e02f7cc5f2df3a52de9a", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 76, "avg_line_length": 37.5, "alnum_prop": 0.7101754385964912, "repo_name": "tensorflow/compression", "id": "ef161657891d2e14f452528e7d39f4549bfd49b4", "size": "3527", "b...
import _plotly_utils.basevalidators class HovertextsrcValidator(_plotly_utils.basevalidators.SrcValidator): def __init__( self, plotly_name="hovertextsrc", parent_name="densitymapbox", **kwargs ): super(HovertextsrcValidator, self).__init__( plotly_name=plotly_name, par...
{ "content_hash": "3488c46db976f703cb69a24e0a7e93ee", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 79, "avg_line_length": 33.785714285714285, "alnum_prop": 0.6046511627906976, "repo_name": "plotly/python-api", "id": "41b8e5c6f2ea3a2b360b0ec557eb790b927fcb71", "size": "47...
from slackclient import SlackClient from flask import Flask, request, Response from bs4 import BeautifulSoup import requests import json import os import time app = Flask(__name__) API_URL = "https://criclive-api.herokuapp.com/" def getHTML(url): html_doc = requests.get(url).json() return html_doc def score...
{ "content_hash": "7a4472718a26f059252d354eb8aa57bc", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 161, "avg_line_length": 29.50769230769231, "alnum_prop": 0.5615224191866528, "repo_name": "shubh1m/Slack-Criclive", "id": "b262d807b0111e4b9e56edbb6d38cb08964ffe5f", "size"...
from flask import Flask from flask import render_template from flask import request from algorithm import * import yaml app = Flask(__name__) import logging logging.basicConfig(filename='example.log',level=logging.DEBUG) @app.route('/') def hello_world(): return 'Hello, World!' @app.route('/compute', methods=...
{ "content_hash": "6e58f6cd0bd0bf154ecf56f470529a51", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 63, "avg_line_length": 25.055555555555557, "alnum_prop": 0.6400591278640059, "repo_name": "CagataySurkultay/HW1", "id": "66e8bcd59536633f0bd14237cf7eb0bb2502fd86", "size": ...
"""Cache lines from files. This is intended to read lines from modules imported -- hence if a filename is not found, it will look down the module search path for a file by that name. """ import sys import os __all__ = ["getline", "clearcache", "checkcache"] def getline(filename, lineno, module_globals=None): li...
{ "content_hash": "ff6c2163326e1d2cac02e434cc759252", "timestamp": "", "source": "github", "line_count": 132, "max_line_length": 79, "avg_line_length": 29.272727272727273, "alnum_prop": 0.5427018633540373, "repo_name": "jjuanda/mechanize", "id": "f49695ac1cec88c87b428e9d18a7324ffc79ce9a", "size": "3...
import abc class EntityChangeProcessor(object): """ An entity change processor gets notified whenever there is a change to an entity so that it can perform related actions. This may happen out of band (ie. on a queue or batch job), thus changes may not be applied immediately. """ @abc.abstra...
{ "content_hash": "9647cb7a6457673e9520f4daa34b6f32", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 74, "avg_line_length": 34.1948051948052, "alnum_prop": 0.6961640714014432, "repo_name": "4bic/grano", "id": "9963b3d4e02755765424c17fa31c9c2ddfd4381a", "size": "2633", "b...
import sys import functools from typing import Any, Callable, IO, Mapping, Sequence, TypeVar, Text def get_mapping_type_str(x: Mapping[Any, Any]) -> str: container_type = type(x).__name__ if not x: if container_type == 'dict': return '{}' else: return container_type + '...
{ "content_hash": "83e7f0c2a54967c86fdd03b21e700440", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 92, "avg_line_length": 34.42857142857143, "alnum_prop": 0.508298755186722, "repo_name": "mahim97/zulip", "id": "36bce2194f29a79e465aa126a53d312e2c782279", "size": "2893", ...
from django.conf import settings from django.conf.urls import include, url from django.conf.urls.static import static from django.contrib import admin urlpatterns = [ # Examples: url(r'^$', 'newsletter.views.home', name='home'), url(r'^contact/$', 'newsletter.views.contact', name='contact'), url(r'^ab...
{ "content_hash": "267ac8ef43c45f82c2e213c77834fc7b", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 79, "avg_line_length": 35.15, "alnum_prop": 0.7041251778093883, "repo_name": "arshinator/trydjango-website", "id": "7a13d5b8916764697a1216503221d205f500b904", "size": "703"...
"""Tests for grr.parsers.ie_history.""" import datetime import os import StringIO from grr.lib import flags from grr.lib import test_lib from grr.parsers import ie_history class IEHistoryTest(test_lib.GRRBaseTest): """Test parsing of chrome history files.""" def testBasicParsing(self): """Test we can par...
{ "content_hash": "4ee79aa487cb87e8ed7476e864a14c0d", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 75, "avg_line_length": 30.627450980392158, "alnum_prop": 0.647247119078105, "repo_name": "destijl/grr", "id": "a47aae6bc0b25fa5c58c95a9dc91930c6251ec66", "size": "1584", ...
import argparse import datetime import os import shutil import sys import unittest sys.path.append("..") os.environ['LANGUAGE'] = 'en' import entrymgr class EntryMgrFakeJournalTestCase(unittest.TestCase): def setUp(self): entrymgr.ensure_directory_exists("tests/fakejournal") os.chdir("tests/fake...
{ "content_hash": "df00a3e4f2223439a59175baaa23c903", "timestamp": "", "source": "github", "line_count": 207, "max_line_length": 80, "avg_line_length": 37.72463768115942, "alnum_prop": 0.6542451018056089, "repo_name": "jpds/entrymgr", "id": "de7384801e1020ad078c7de87dcd7de1dfe1170a", "size": "9265",...
from __future__ import unicode_literals from django.db import models, migrations try: from urllib.parse import urlparse except: from urlparse import urlparse def populate_domain(apps, schema_editor): threads = apps.get_model('askapp', 'Thread') for thread in threads.objects.all(): if thread.l...
{ "content_hash": "05c5f1d8c75b26ee88e93a6138d069c7", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 72, "avg_line_length": 24.074074074074073, "alnum_prop": 0.6584615384615384, "repo_name": "BanzaiTokyo/akihabara-tokyo", "id": "ba5c048c2ae8f70d9caceb84a295d82dccfad554", "...