text
stringlengths
4
1.02M
meta
dict
from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, map_error, ) from azure.core...
{ "content_hash": "d56ca77cbd5fc4f7ada4221b46b8021d", "timestamp": "", "source": "github", "line_count": 846, "max_line_length": 244, "avg_line_length": 47.42316784869976, "alnum_prop": 0.6501994017946161, "repo_name": "Azure/azure-sdk-for-python", "id": "7e2959515d5bc86009e7c4833ad02c97928a59a1", "...
""" watchLogPage """ __author__ = 'Rnd495' import re import urllib import tornado.web import tornado.gen from UI.Manager import mapping from UI.Page import PageBase, NoticeAndRedirectInterruption from Pages.APIPage import get_ref_status TENHOU_REG = re.compile(r"^(?P<ref>\d{10}gm-\w{4}-\d{4,5}-\w{8})$") @mapping...
{ "content_hash": "348fbdfe6a228a0edda413592fa0bf55", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 106, "avg_line_length": 27.155172413793103, "alnum_prop": 0.5765079365079365, "repo_name": "SakuraSa/TenhouLoggerX", "id": "23543007c6f3a087a47a63d615c1a44e3005d6db", "size...
'''Generates convos from pcap files ##(srcip,destip,proto,timestamp)''' from operator import itemgetter import time from convo_util import * global sample global n_max global n_input_pcaps global label clean_names = ['p2pbox'] mal_names = ['zeus', 'waledac, gtisc-winobot'] print sys.argv[1] TIMEOUT = 2000 #standard ...
{ "content_hash": "56eae02384d4cfd43efabd1328227690", "timestamp": "", "source": "github", "line_count": 138, "max_line_length": 185, "avg_line_length": 28.71014492753623, "alnum_prop": 0.5875820292781424, "repo_name": "vansh21k/SMADES", "id": "ca3ec77b33faa8ad47c619565fb79dd6c77950ed", "size": "396...
from django.db import models from django.utils import timezone class Post(models.Model): author = models.ForeignKey('auth.User') title = models.CharField(max_length=200) text = models.TextField() created_date = models.DateTimeField( default=timezone.now) published_date = models.DateTim...
{ "content_hash": "8e78b0192e47707550de4702d628b1bb", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 44, "avg_line_length": 25.15, "alnum_prop": 0.6481113320079522, "repo_name": "artopping/nyu-python", "id": "d8eed4f71b48bd5482f40299cbfdf488d6372d96", "size": "503", "bin...
DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. 'NAME': 'utdcs-db', # Or path to database fil...
{ "content_hash": "496aff44b4cdf442046f047db1b83791", "timestamp": "", "source": "github", "line_count": 163, "max_line_length": 99, "avg_line_length": 33.11656441717791, "alnum_prop": 0.6780288995924416, "repo_name": "joshcai/utdcs", "id": "9a4e6e8ca572ca06d565dba85a4fc84270d8f9a1", "size": "5438",...
""" Server API Reference for Server API (REST/Json) OpenAPI spec version: 2.0.21 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re class CartRuleRestrictionGroupItem(object): """ NOTE: This class is auto...
{ "content_hash": "c75206833ab4385432dcd93730689e82", "timestamp": "", "source": "github", "line_count": 138, "max_line_length": 77, "avg_line_length": 26.268115942028984, "alnum_prop": 0.5282758620689655, "repo_name": "kinow-io/kinow-python-sdk", "id": "c731304ccdd536f13a6af9ad9597e765f4bbb882", "s...
import asyncio import discord from datetime import datetime from discord.ext import commands from shutil import copyfile import time import json import os import copy import subprocess try: import pymongo except ImportError: # I mean, it doesn't really matter as it can still revert to JSO...
{ "content_hash": "e6833ff809d748c73d4790b0d10a1c08", "timestamp": "", "source": "github", "line_count": 1435, "max_line_length": 222, "avg_line_length": 34.44250871080139, "alnum_prop": 0.6445928174001012, "repo_name": "corpnewt/CorpBot.py", "id": "32fd72fd130a2d3cf9f6ed8fa14a1b1b6f69b2c1", "size":...
import numpy as np # from autograd import grad # from numpy import linalg as la from sklearn import linear_model import scipy as sp import scipy.optimize import os from nltk.tokenize import RegexpTokenizer import re from collections import Counter from gensim.models import word2vec import sys w2vDir = '/fs/clip-scratc...
{ "content_hash": "11d576eeb46948e0f2f880b15d378d24", "timestamp": "", "source": "github", "line_count": 277, "max_line_length": 155, "avg_line_length": 39.35379061371841, "alnum_prop": 0.5697642418126777, "repo_name": "sidenver/ConstituentRetrofit", "id": "ba88d14ae4fa8fb5d8a93190c460f391e1ed27c2", ...
from ..excel_comparsion_test import ExcelComparisonTest from ...workbook import Workbook class TestCompareXLSXFiles(ExcelComparisonTest): """ Test file created by XlsxWriter against a file created by Excel. """ def setUp(self): self.maxDiff = None filename = 'comment10.xlsx' ...
{ "content_hash": "003916d2c8d23810e683ca79604e9465", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 74, "avg_line_length": 26.243243243243242, "alnum_prop": 0.6292481977342945, "repo_name": "seize-the-dave/XlsxWriter", "id": "3147c24078f4a82f249ae9b947f6825ac6e71cfe", "si...
from .mixins import ResourceMixin class ProductStatus(object): def __init__(self, **kwargs): self.__dict__.update(**kwargs) def __repr__(self): return '<ProductStatus %s: %s>' % ( self.productId, self.title ) def get_internal_id(self): return self.productId.s...
{ "content_hash": "f87ae6df9a52a967004cdb06d98e6c8f", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 57, "avg_line_length": 26.906976744186046, "alnum_prop": 0.5773552290406223, "repo_name": "geeknam/python-google-shopping", "id": "6cf6cb814df8a3989bc85088e35a69f93e44698b", ...
from collections import OrderedDict import os import re from typing import ( Dict, Mapping, MutableMapping, MutableSequence, Optional, Sequence, Tuple, Type, Union, cast, ) from google.api_core import client_options as client_options_lib from google.api_core import exceptions as...
{ "content_hash": "4dbca1e58ad4db7c5cb755150635b04c", "timestamp": "", "source": "github", "line_count": 9291, "max_line_length": 154, "avg_line_length": 41.466150037670864, "alnum_prop": 0.597967097715321, "repo_name": "googleapis/python-analytics-admin", "id": "fbb273ea811732e65491f8d1a90009333b62dc...
"""Script that updates the language lists in Wikimedia family files.""" # # (C) xqt, 2009-2014 # (C) Pywikibot team, 2008-2014 # # Distributed under the terms of the MIT license. # from __future__ import absolute_import, unicode_literals __version__ = '$Id$' # import codecs import re import sys from xml.etree import...
{ "content_hash": "c347e94e2bd4afb847a5a8f2638a4ea8", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 77, "avg_line_length": 31.422018348623855, "alnum_prop": 0.538978102189781, "repo_name": "h4ck3rm1k3/pywikibot-core", "id": "3c56c2847c29418186473f733bd50427867af0d3", "si...
"""Utility functions for handling MIDI data in an easy to read/manipulate format """ import midi import numpy as np import warnings import collections import copy from .instrument import Instrument from .containers import KeySignature, TimeSignature from .containers import Note, PitchBend, ControlChange from .utilit...
{ "content_hash": "8625744d163ff55065f99db5cbc02bc6", "timestamp": "", "source": "github", "line_count": 995, "max_line_length": 81, "avg_line_length": 43.210050251256284, "alnum_prop": 0.5523794017769922, "repo_name": "rafaelvalle/pretty-midi", "id": "c71ed822cc1310a3811390ca7cc2941393d8ab80", "siz...
from flask.ext.wtf import Form from wtforms import TextField, BooleanField, TextAreaField from wtforms.validators import Required, Length class LoginForm(Form): openid = TextField('openid', validators = [Required()]) remember_me = BooleanField('remember_me', default = False) class EditForm(Form): nick...
{ "content_hash": "518ff42357211474a52a5fa788ad93fa", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 102, "avg_line_length": 37.733333333333334, "alnum_prop": 0.6413427561837456, "repo_name": "mrzacarias/zaca_shortener", "id": "a0f2eb5cf56fa0a43a8cc0134548364e2c047d6a", "s...
__version__ = '1.0.0' __author__ = 'Christian Brickhouse' import re from bs4 import BeautifulSoup as soup from nltk.parse.corenlp import CoreNLPDependencyParser class Game: """An object that represents a Jeopardy game and structures related data. The Game class creates an object that structures and contain...
{ "content_hash": "d6afe404b33b6ec33768a768105d68c5", "timestamp": "", "source": "github", "line_count": 777, "max_line_length": 115, "avg_line_length": 38.85199485199485, "alnum_prop": 0.5131177951503909, "repo_name": "chrisbrickhouse/jeopardy", "id": "517f688b964a715b3fcc80f697f582cafdd91aff", "si...
from spack.package import * class Arbor(CMakePackage, CudaPackage): """Arbor is a high-performance library for computational neuroscience simulations.""" homepage = "https://arbor-sim.org" git = "https://github.com/arbor-sim/arbor.git" url = "https://github.com/arbor-sim/arbor/releases/download/v...
{ "content_hash": "cf1d3e7907122dab9efc2e8c44033ff5", "timestamp": "", "source": "github", "line_count": 106, "max_line_length": 99, "avg_line_length": 37.867924528301884, "alnum_prop": 0.6337817638266069, "repo_name": "eth-cscs/nestmc-proto", "id": "56791d87b3bfa8f2bfc8addb4174eeda5f9564ce", "size"...
import sys from Bio.Seq import Seq from Bio.SeqRecord import SeqRecord from Bio.Alphabet import generic_dna from Bio import SeqIO import numpy from scipy import misc import itertools as it import os import time import random import multiprocessing from multiprocessing import Value import Queue MATERNALF...
{ "content_hash": "40b6d47305eaa9fe510a4e7bdda2b183", "timestamp": "", "source": "github", "line_count": 401, "max_line_length": 324, "avg_line_length": 43.77805486284289, "alnum_prop": 0.7111364283679863, "repo_name": "imk1/IMKTFBindingCode", "id": "2b9a342737b84a2c8bf63a86305ba8eaebd22342", "size"...
import nltk import numpy as np import pickle from process_twt import * class NBClassifier(object): """ A Naive Bayes Classifier for sentiment analysis Attributes: feature_list: A list containing informative words stop_words: A list containing stop words is_trained: An indicator of...
{ "content_hash": "b235405f299c1fd33ed458aec45a10a2", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 87, "avg_line_length": 35.57608695652174, "alnum_prop": 0.5835624809043691, "repo_name": "qingshuimonk/bhtsa", "id": "d1f6cbf9d2281a7eb0add1522759369dcf67391c", "size": "32...
import base64 import socket import sys import time import xml.etree.ElementTree as ET from . import log class Response: """ Response objects for the DBGP module. Contains response data from a command made to the debugger. """ ns = '{urn:debugger_protocol_v1}' def __init__(self, response, cmd, ...
{ "content_hash": "34da816fbba4b8a2d60133a2b92e8522", "timestamp": "", "source": "github", "line_count": 577, "max_line_length": 79, "avg_line_length": 30.641247833622185, "alnum_prop": 0.5558823529411765, "repo_name": "Taluu/vdebug", "id": "c03ca7aad6a247f8a838073b430b8af53429b8f8", "size": "17680"...
import ntplib from time import ctime def get_current_time(): ntp_client = ntplib.NTPClient() response = ntp_client.request('pool.ntp.org') print 'Current time is', ctime(response.tx_time) if __name__ == '__main__': get_current_time()
{ "content_hash": "46673dd7fcc91f6d57ae2fa0fd53cbde", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 52, "avg_line_length": 25.2, "alnum_prop": 0.6626984126984127, "repo_name": "tutsplus/introduction-to-python", "id": "4845d6548f17b45b823d0e38326a2e27e57861c7", "size": "25...
"""The tests for the MQTT automation.""" import pytest import homeassistant.components.automation as automation from homeassistant.const import ATTR_ENTITY_ID, ENTITY_MATCH_ALL, SERVICE_TURN_OFF from homeassistant.setup import async_setup_component from tests.async_mock import ANY from tests.common import async_fire_...
{ "content_hash": "9af7eb63ecc55d6f0a325495a48d08b6", "timestamp": "", "source": "github", "line_count": 133, "max_line_length": 87, "avg_line_length": 30.548872180451127, "alnum_prop": 0.5422101895151366, "repo_name": "soldag/home-assistant", "id": "b35082ef2c6258e371ff8581b7daa1dc74883d8a", "size"...
from __future__ import unicode_literals from django.db import models # Create your models here.
{ "content_hash": "930f929a59b6e8a60a832383bfce5bb5", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 39, "avg_line_length": 19.6, "alnum_prop": 0.7653061224489796, "repo_name": "zouyapeng/instance_monitor_server", "id": "182671cae60ac172c27c4db18e54233b4129e164", "size": "1...
""" These are the user-preferences. For the network and system preferences, take a look at `Settings.py`. Use it like this example: from neo.UserPreferences import preferences print(preferences.token_style) preferences.set_theme("light") """ import json from json.decoder import JSONDecodeError from neo.S...
{ "content_hash": "9cd3211edf28a97cfbdf7bb7ecaa7031", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 103, "avg_line_length": 28.71604938271605, "alnum_prop": 0.6109200343938092, "repo_name": "hal0x2328/neo-python", "id": "3cc55eba8e22c33e38fa4c7d31af54d15bd4b361", "size": ...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('index', '0002_auto_20170914_0606'), ] operations = [ migrations.AddField( model_name='officer', name='first', fi...
{ "content_hash": "453b191e051c6c321569b278fa7f29f1", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 93, "avg_line_length": 26.217391304347824, "alnum_prop": 0.5804311774461028, "repo_name": "CPLUG/cplug.org-backend", "id": "4d5935bc2281d99225d0a283ba614e217f54cf32", "size...
import json import os import re from collections import deque from functools import partial, wraps from flask import Flask, jsonify, make_response, request from flask_compress import Compress from flask_cors import CORS from flask_restplus import Api as RestPlusAPI from flask_restplus import Resource from jsonschema i...
{ "content_hash": "2558019cdefea7d1d1418a3336cbdea3", "timestamp": "", "source": "github", "line_count": 432, "max_line_length": 120, "avg_line_length": 33.270833333333336, "alnum_prop": 0.5958394211368538, "repo_name": "malkavi/Flexget", "id": "8109d4eff52e99a9c10c765d2e6cd169476737c9", "size": "14...
from essence import World, System, Component, UnregisteredComponentError from fixtures import world import pytest def xtest_there_is_a_global_world_instance(): from essence.base import world def test_entity_shorthand(world): entity = world.create_entity() assert not entity.has(Component) assert entit...
{ "content_hash": "d7ea2498df6dc4b6f0d681c33ec4b6f8", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 72, "avg_line_length": 30.242424242424242, "alnum_prop": 0.7264529058116233, "repo_name": "chromy/essence", "id": "2db77cf2db55ca0030e20685411125a70c12ffe8", "size": "998",...
from pyramid.security import Allow, Everyone, ALL_PERMISSIONS from sqlalchemy import ( Column, DateTime, Float, ForeignKey, Index, Integer, Text, Unicode, UnicodeText ) from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import ( relationship, sc...
{ "content_hash": "de55b0f7f3de6eba88c60c1dad5ea63c", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 79, "avg_line_length": 27.5, "alnum_prop": 0.6131907308377896, "repo_name": "jaredscarr/bartrack", "id": "09c08ec281308b27c6ca2e22a6a16d09fe15b462", "size": "2805", "bin...
from pandac.PandaModules import * from direct.task.Task import Task from direct.directnotify import DirectNotifyGlobal from direct.fsm import StateData from direct.fsm import ClassicFSM, State from direct.fsm import State class Walk(StateData.StateData): notify = DirectNotifyGlobal.directNotify.newCategory('Walk')...
{ "content_hash": "72c760f6bf0c2093bb15bc30de7c68be", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 138, "avg_line_length": 37.288288288288285, "alnum_prop": 0.6731094467262624, "repo_name": "ToontownUprising/src", "id": "ca63a2b4eac5aac3497d42cb6c3ec860c8fc2712", "size"...
""" MoinMoin - Configuration for a single wiki If you run a single wiki only, you can omit the farmconfig.py config file and just use wikiconfig.py - it will be used for every request we get in that case. Note that there are more config options than you'll find in the version of this file that...
{ "content_hash": "5dc87ab788149416efde3deea1598bb3", "timestamp": "", "source": "github", "line_count": 163, "max_line_length": 95, "avg_line_length": 38.9079754601227, "alnum_prop": 0.6352885525070956, "repo_name": "dpla/zen", "id": "ea19e8279237379c8f46916afa01fc2a4d4b9d17", "size": "6792", "bi...
import os import csv import json import config # process the config file, make sure we're setup properly # ---------------------------------------- # CSV_EXISTS = False # does the CSV file exist? csv_filename = os.path.join(os.path.dirname(__file__), config.DATA_DIR + config.CSV_FILE) print(csv_filename) CSV_FILE = c...
{ "content_hash": "91979dc4b6265a44cdaa7e27b8dc451d", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 106, "avg_line_length": 29.727272727272727, "alnum_prop": 0.6031260618416582, "repo_name": "aztec8/cmi-rentals-frontend", "id": "c6d86cadbd091f7017cae37497aaf30ed35d202a", ...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('event', '0043_auto_20170819_0340'), ] operations = [ migrations.AlterField( model_name='event', name='latitude', ...
{ "content_hash": "e8ba60c8a20a07d1209499c52b3fa836", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 54, "avg_line_length": 23.434782608695652, "alnum_prop": 0.5695732838589982, "repo_name": "internship2016/sovolo", "id": "9f4cea5b2a79de2081164ff919b056026011fc0d", "size":...
from .labels import LabelsPlugin from electrum.plugin import hook class Plugin(LabelsPlugin): @hook def load_wallet(self, wallet, window): self.window = window self.start_wallet(wallet) def on_pulled(self, wallet): self.print_error('on pulled') self.window._trigger_update_...
{ "content_hash": "91c230a45e153cab91ce2f499b1c2f4c", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 45, "avg_line_length": 23.642857142857142, "alnum_prop": 0.6706948640483383, "repo_name": "cryptapus/electrum", "id": "56f1d079e08b2868995da4d53c9ccb1feab5000b", "size": "3...
""" A set of functions to get jobs from JOBS* and group them by object store """ from django.db import connection from core.libs.cache import setCacheData from core.libs.sqlcustom import fix_lob from core.schedresource.utils import get_object_stores import core.constants as const def objectstore_summary_data(hours...
{ "content_hash": "80a59713b477e258508d9612b4f39bc8", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 236, "avg_line_length": 43.94117647058823, "alnum_prop": 0.6135653726015172, "repo_name": "PanDAWMS/panda-bigmon-core", "id": "d019d78f1fe1e1bb3db347aa4cfe02d5677891d9", "...
from VideoReader import * from ArgParser import * import sys, cv2 """ usage: python PlayStereoVideo.py <path_to_data> <basename><camera_num>.avi for example: python PlayStereoVideo.py /scail/group/deeplearning/driving_data/q50_data/4-2-14-monterey/ 17N_b1.avi under this command, reader1 will load 17N_b1.avi reader...
{ "content_hash": "8b7fcc27fe80648506fb26b1ce3a4386", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 144, "avg_line_length": 36.10344827586207, "alnum_prop": 0.6876790830945558, "repo_name": "sameeptandon/sail-car-log", "id": "df45773d2f52f52c27221acc7646efa81dcec1ac", "si...
__all__ = tuple('''registerWidget getCodes getCodeNames createBarcodeDrawing createBarcodeImageInMemory'''.split()) __version__ = '0.9' __doc__='''Popular barcodes available as reusable widgets''' _widgets = [] def registerWidget(widget): _widgets.append(widget) def _reset(): _widgets[:] = [] from reportl...
{ "content_hash": "263d486c0fd5d136273d8a3582d6478f", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 130, "avg_line_length": 34.44444444444444, "alnum_prop": 0.6086848635235732, "repo_name": "Distrotech/reportlab", "id": "25d98e719baffc4a00048070ff1e2e8fff269828", "size":...
""" Tests for dtypes.py """ # Import Python 3 features for future-proofing # Deliberately do NOT import unicode_literals due to a bug in numpy dtypes: # https://github.com/numpy/numpy/issues/2407 from __future__ import absolute_import, division, print_function import unittest import mrcfile.dtypes as dtypes import m...
{ "content_hash": "ed285d64a657ecbdd1aa028266866091", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 85, "avg_line_length": 51.48453608247423, "alnum_prop": 0.6659991990388466, "repo_name": "ccpem/mrcfile", "id": "7b7988f96451e011cd2481a2849ff6d5c900b039", "size": "5128", ...
import os.path from datetime import datetime from django.contrib.auth.models import User from django.contrib.auth.views import logout as logout_view from django.core.urlresolvers import reverse from django.test.client import Client from django.test.utils import override_settings from mock import patch from nose.tools...
{ "content_hash": "dbae11078b19aa8ba4c2948005f6cab8", "timestamp": "", "source": "github", "line_count": 390, "max_line_length": 99, "avg_line_length": 40.83589743589744, "alnum_prop": 0.6270249905814391, "repo_name": "brian-yang/mozillians", "id": "b18d84906ae6686e9437b6a3ad29f17587e8444a", "size":...
import os import sys sys.path.insert(0, os.path.abspath('..')) from rtgraph.core.constants import Constants # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. # # needs_sphinx = '1.0' # Add any Sphinx extension module na...
{ "content_hash": "bfd6c191cd87fe9f2003726b1246903e", "timestamp": "", "source": "github", "line_count": 142, "max_line_length": 78, "avg_line_length": 30.08450704225352, "alnum_prop": 0.6638576779026217, "repo_name": "ssepulveda/RTGraph", "id": "2e56a21ee0064aad8337abb9489cfc89eeb27322", "size": "4...
__revision__ = "test/CacheDir/environment.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog" """ Verify that whether or not a target gets retrieved from a CacheDir is configurable by construction environment. """ import os import TestSCons test = TestSCons.TestSCons() cache = test.workpath('cache') src_...
{ "content_hash": "1540628d1d89ecd04c8335a578cb562d", "timestamp": "", "source": "github", "line_count": 145, "max_line_length": 102, "avg_line_length": 30.28965517241379, "alnum_prop": 0.6564207650273224, "repo_name": "EmanueleCannizzaro/scons", "id": "bcd0255ce3074b35a08d08fd140c1320190aef9b", "si...
""" Test lldb data formatter subsystem. """ import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil class TestDataFormatterLibcxxQueue(TestBase): mydir = TestBase.compute_mydir(__file__) def setUp(self): TestBase.setUp(self) ...
{ "content_hash": "624e6ddcf98caa3abd7bff9b2ef7fa46", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 97, "avg_line_length": 28.833333333333332, "alnum_prop": 0.6350123864574732, "repo_name": "endlessm/chromium-browser", "id": "f2f9f670c714476c246e161cdd02ec447a6f5ea3", "si...
"""Experimental API for optimizing `tf.data` pipelines.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.contrib.data.python.ops import contrib_op_loader # pylint: disable=unused-import from tensorflow.python.data.ops import dataset_ops fr...
{ "content_hash": "2e857b5a04e1c235298d414cadcf5662", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 97, "avg_line_length": 34.06060606060606, "alnum_prop": 0.7215302491103203, "repo_name": "dendisuhubdy/tensorflow", "id": "cad41bce2961f29a7591fe3d382d1ab35a6b38b4", "size"...
from wtforms import TextField, SelectField, TextAreaField from wtforms.validators import DataRequired, URL from wtforms.widgets import TextArea from ..datacenter import DatacenterCheckForm class HeaderList(object): """Custom wtform validator for headers.""" def __call__(self, form, field): try: ...
{ "content_hash": "5ef4bc89c5126cfa8d477f5221df5e36", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 210, "avg_line_length": 36.39080459770115, "alnum_prop": 0.5988629185091598, "repo_name": "madflojo/cloudroutes-service", "id": "a697af4daff7a3eecbf52c111e21de05710c3bad", ...
from wsgiref import util from pytest import raises from watson.di.container import IocContainer from watson.events.types import Event from watson.http.messages import Request, Response from watson.routing.routers import DictRouter from watson.routing.routes import RouteMatch, LiteralRoute from watson.framework.exceptio...
{ "content_hash": "aeae5384dc618ab7a5e18a0a55185b2f", "timestamp": "", "source": "github", "line_count": 126, "max_line_length": 94, "avg_line_length": 37.666666666666664, "alnum_prop": 0.623472397808681, "repo_name": "watsonpy/watson-framework", "id": "eaf24bf042bfaf938349b7961e317e9ceb0cf45d", "si...
from ...core import Expr, Integer, Tuple from ...functions import floor from ...logic import true from .matexpr import MatrixExpr def normalize(i, parentsize): if isinstance(i, slice): i = (i.start, i.stop, i.step) if not isinstance(i, (tuple, list, Tuple)): if (i < Integer(0)) == true: ...
{ "content_hash": "6e78f17ba7b59269cc6e51f6afb3cef5", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 78, "avg_line_length": 27.469026548672566, "alnum_prop": 0.5554123711340206, "repo_name": "skirpichev/omg", "id": "7d21b4e2f8c9816aeb29a75b0794c35a2f0cc479", "size": "3104...
from json import loads from qiita_db.user import User from qiita_db.software import Command, Parameters, DefaultParameters from qiita_db.processing_job import ProcessingWorkflow, ProcessingJob from qiita_db.exceptions import QiitaDBUnknownIDError def list_commands_handler_get_req(artifact_types, exclude_analysis): ...
{ "content_hash": "7afbef8a2d1f81c0768799c72690ff67", "timestamp": "", "source": "github", "line_count": 316, "max_line_length": 79, "avg_line_length": 34.629746835443036, "alnum_prop": 0.5474732705839349, "repo_name": "josenavas/QiiTa", "id": "b082f807cf94790f71ba0729d429b829f7ffddf7", "size": "112...
import six import warnings from datetime import datetime from .. import errors from .. import utils class ContainerApiMixin(object): @utils.check_resource def attach(self, container, stdout=True, stderr=True, stream=False, logs=False): params = { 'logs': logs and 1 or 0, ...
{ "content_hash": "fe5991c4114f356e924c3ef7f9202676", "timestamp": "", "source": "github", "line_count": 399, "max_line_length": 79, "avg_line_length": 37.48621553884712, "alnum_prop": 0.5472354081700875, "repo_name": "Sorsly/subtle", "id": "00fa169601b12cbbf0362818fbcf4605747f7141", "size": "14957"...
""" PyTorch MBART model.""" import copy import math import random from typing import List, Optional, Tuple, Union import torch import torch.utils.checkpoint from torch import nn from torch.nn import BCEWithLogitsLoss, CrossEntropyLoss, MSELoss from ...activations import ACT2FN from ...modeling_outputs import ( Ba...
{ "content_hash": "d811c23351f44bee6f61facaa038df3d", "timestamp": "", "source": "github", "line_count": 1894, "max_line_length": 150, "avg_line_length": 46.83368532206969, "alnum_prop": 0.6292120897827582, "repo_name": "huggingface/transformers", "id": "5e4b2cfc3a62564402a7b3fca36d17a34fd79047", "s...
"""The event extraction worker.""" import copy import os import re import time from dfvfs.analyzer import analyzer as dfvfs_analyzer from dfvfs.lib import definitions as dfvfs_definitions from dfvfs.lib import errors as dfvfs_errors from dfvfs.path import factory as path_spec_factory from dfvfs.resolver import resolv...
{ "content_hash": "f7518b0e3db33b6bab8b9655937f1b11", "timestamp": "", "source": "github", "line_count": 933, "max_line_length": 80, "avg_line_length": 35.69560557341908, "alnum_prop": 0.6733125150132117, "repo_name": "Onager/plaso", "id": "08660dee784b56834a3a34530048806c747fb800", "size": "33328",...
from flask import request, url_for def url_for_other_page(**kwargs): """Returns a URL aimed at the current request endpoint and query args.""" url_for_args = request.args.copy() if 'pjax' in url_for_args: url_for_args.pop('_pjax') for key, value in kwargs.items(): url_for_args[key] = v...
{ "content_hash": "66ff8003af02fffc85b6ebbd94b078ad", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 77, "avg_line_length": 34.36363636363637, "alnum_prop": 0.6507936507936508, "repo_name": "cburmeister/flask-bones", "id": "aeb16e9949d13589124534b2fda552c77c6c52c9", "size"...
from django.db import models class Repairs(models.Model): id = models.AutoField(primary_key = True) category = models.CharField(max_length = 255) department = models.CharField(max_length = 255) item = models.CharField(max_length = 255) address = models.CharField(max_length = 255) details = mode...
{ "content_hash": "3e160d4d56e9032d1b73db64bb1748bb", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 55, "avg_line_length": 36.94736842105263, "alnum_prop": 0.6780626780626781, "repo_name": "huaiping/pandora", "id": "a3051d73556ada58a820c9374fe51e83d0aba636", "size": "702"...
import re import os import click import pytest def test_prefixes(runner): @click.command() @click.option('++foo', is_flag=True, help='das foo') @click.option('--bar', is_flag=True, help='das bar') def cli(foo, bar): click.echo('foo=%s bar=%s' % (foo, bar)) result = runner.invoke(cli, ['++...
{ "content_hash": "9a4bece7c0e38f68ed0ce8996efe9853", "timestamp": "", "source": "github", "line_count": 331, "max_line_length": 94, "avg_line_length": 30.42296072507553, "alnum_prop": 0.5981132075471698, "repo_name": "andela-ooladayo/click", "id": "919f89854b72c16fe44cd64af42833f5d0d3b3d7", "size":...
""" This is a set of utilities for faster development with Django templates. render_to_response() and render_to_string() use RequestContext internally. The app_prefixed_loader is a template loader that loads directly from the app's 'templates' folder when you specify an app prefix ('app/template.html'). The JSONResp...
{ "content_hash": "7d98ade7ee6b1662ee547db43c3bdad1", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 134, "avg_line_length": 41.07865168539326, "alnum_prop": 0.7004923413566739, "repo_name": "stonezdj/forzdj", "id": "5cf2d994e436083f68735216dca4b550224f7e85", "size": "3680...
import numpy as np import argparse from asetk.format.qe import QECube # Define command line parser parser = argparse.ArgumentParser( description='Converts intermediate cube-like format of pp.x to Gaussian cube format.') parser.add_argument('--version', action='version', version='%(prog)s 13.10.2016') parser.add_ar...
{ "content_hash": "0f5786c4c0f2fd848ab7c2fa7466ac71", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 90, "avg_line_length": 30.076923076923077, "alnum_prop": 0.69693094629156, "repo_name": "ltalirz/asetk", "id": "65132a679e09a74623b73947ae68920286f06f63", "size": "804", ...
from beginners import * # That was well worth the effort of the licence, wasn't it? :-)
{ "content_hash": "fc6986079638fea71445c00d7c24c423", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 63, "avg_line_length": 30.666666666666668, "alnum_prop": 0.6847826086956522, "repo_name": "DarkArcher117/Block-Blaster-3000", "id": "5421a1453fc45b14a3ae4db991d83af8611ff99b",...
import unittest import time from requests.exceptions import RequestException from six.moves import xrange from .testcases import WebserverTestCase from locust.stats import RequestStats, StatsEntry, global_stats from locust.core import HttpLocust, Locust, TaskSet, task from locust.inspectlocust import get_task_ratio_d...
{ "content_hash": "eddb65fbfe5c6de36157cc225d57d36d", "timestamp": "", "source": "github", "line_count": 304, "max_line_length": 139, "avg_line_length": 37.0625, "alnum_prop": 0.5871128073133931, "repo_name": "cgoldberg/locust", "id": "ff8bcd2ec9ed66d5cc74fb7458b94c5e24596622", "size": "11267", "b...
import networkx as nx import community as co from edgesense.network.utils import extract_dpsg from datetime import datetime import logging # build the deparallelized subnetworks to use for metrics # compute the metrics by timestep on the deparallelized network # Cluster, K-Cores, PageRank, # betweennessCentralityC...
{ "content_hash": "04753d3003ce50fe459c5cb25de56a6a", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 141, "avg_line_length": 46.80246913580247, "alnum_prop": 0.6560274333948826, "repo_name": "albertocottica/microfoundations-community-management", "id": "5bd1fabbcd88966a32661...
import rospy import tf from geometry_msgs.msg import PointStamped from std_msgs.msg import Int8 class HattedHeadDetector(): def __init__(self): # Initialize hat stuff self.have_hat_center = False rospy.Subscriber('/center_of_hat', PointStamped, self.hat_callback) # TF Listener self.listener = tf.Transfor...
{ "content_hash": "bb37ce47f6b95ef82b9e6ad25eabe0a0", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 147, "avg_line_length": 30.71578947368421, "alnum_prop": 0.6710075394105551, "repo_name": "OSUrobotics/privacy-interfaces", "id": "f66d14d2cb6e534d1fb8a0422dc05f74ccf91846", ...
import os import shutil import struct import zlib from synctools import command __all__ = ['Patch'] # Taken from mutagen/_util.py bitswap = ''.join([chr(sum([((val >> i) & 1) << (7-i) for i in range(8)])) for val in range(256)]) class Patch(command.SynctoolsCommand): title = 'Length-patch OGG' desc...
{ "content_hash": "dfb08b2dcf95095fd7dba4cd04fadba8", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 80, "avg_line_length": 33.6125, "alnum_prop": 0.5399776868724433, "repo_name": "garcia/synctools", "id": "85877d03ccd872a6090c88dfcfd4dd5974816a4b", "size": "2711", "bina...
""" This module is included coefficient functions. The coeficient functions are learning rate and neighborhood function, etc. Copylight Masato MASUDA. 2017.23.AUG. """ import numpy as np import sys def alpha_func (alpha_max=0.1, alpha_min=0.01, epochs=100): return np.linspace(alpha_max, alpha_min, epochs) # return f...
{ "content_hash": "9eabd293809efafeba053621fe25657d", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 94, "avg_line_length": 31.838383838383837, "alnum_prop": 0.6294416243654822, "repo_name": "kinect110/RPSOM", "id": "33519fe68342b4998efbcee1f9cafa778dff141e", "size": "3200...
import os from optparse import OptionParser from subprocess import call, Popen, PIPE from django.core.management import call_command HAVE_JS = ['admin'] def _get_locale_dirs(resources, include_core=True): """ Return a tuple (contrib name, absolute path) for all locale directories, optionally including ...
{ "content_hash": "372233e87b1483ebbf44b4933f939d7d", "timestamp": "", "source": "github", "line_count": 166, "max_line_length": 113, "avg_line_length": 38.68674698795181, "alnum_prop": 0.582061663033323, "repo_name": "mbox/django", "id": "4b7f856b2ded626a1d548cb6a754d7714bf862f4", "size": "7169", ...
from unittest import mock from manila.scheduler.filters import base from manila import test class TestBaseFilter(test.TestCase): def setUp(self): super(TestBaseFilter, self).setUp() self.filter = base.BaseFilter() def test_filter_one_is_called(self): filters = [1, 2, 3, 4] ...
{ "content_hash": "f7808764ae80f9d3ade4fee79df07328", "timestamp": "", "source": "github", "line_count": 148, "max_line_length": 77, "avg_line_length": 33.398648648648646, "alnum_prop": 0.6210803155978151, "repo_name": "openstack/manila", "id": "ae3aa562743c3ffa03df7e71e4f4242aa7bcbffc", "size": "55...
import json import os from gcp_census.model.table import Table from gcp_census.model.view import View class FilesystemModelProvider(object): def __init__(self, model_directory): self.model_directory = model_directory def list_tables(self): for table in self.__list_files('.json'): ...
{ "content_hash": "bb995efc6dad67b28d50ab755c195d20", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 80, "avg_line_length": 38.1, "alnum_prop": 0.571522309711286, "repo_name": "ocadotechnology/gcp-census", "id": "ae7dcace332fcdc2e16e5dcd0409be8446a542df", "size": "1524", ...
""" Routers provide a convenient and consistent way of automatically determining the URL conf for your API. They are used by simply instantiating a Router class, and then registering all the required ViewSets with that router. For example, you might have a `urls.py` that looks something like this: router = route...
{ "content_hash": "0adc65002953abcbba3dbf518dc269f3", "timestamp": "", "source": "github", "line_count": 396, "max_line_length": 116, "avg_line_length": 36.56565656565657, "alnum_prop": 0.5869475138121547, "repo_name": "atombrella/django-rest-framework", "id": "87e58b015ad5855691cdbf34f6146e4ba4c181bf...
from email.utils import getaddresses from django.utils.encoding import force_unicode from django.core.mail import EmailMessage class KikiMessage(EmailMessage): """ This is similar to a django EmailMessage, but overrides recipients() to return arbitrary recipients rather than a concatenation of the to, cc, and bcc ...
{ "content_hash": "00314e3135e5f9d15bd1981339f772a7", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 163, "avg_line_length": 31.304347826086957, "alnum_prop": 0.6680555555555555, "repo_name": "melinath/django-kiki", "id": "df538d01f198651b0d3daafda68434a20a3f7c1f", "size":...
import pytest import fiona from fiona.drvsupport import supported_drivers, _driver_supports_mode from fiona.errors import DriverError from .conftest import driver_extensions from fiona.env import GDALVersion def test_bounds_point(): g = {'type': 'Point', 'coordinates': [10, 10]} assert fiona.bounds(g) == (10,...
{ "content_hash": "8763ae986b640d4a008f7c015f1b1521", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 146, "avg_line_length": 33.723076923076924, "alnum_prop": 0.5834854014598541, "repo_name": "Toblerity/Fiona", "id": "b7cb5c0231c96d59bae1a7aa8009d737be8edcad", "size": "219...
""" sphinx.util.docstrings ~~~~~~~~~~~~~~~~~~~~~~ Utilities for docstring processing. :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re import sys import warnings from typing import Dict, List, Tuple from docutils.parsers.rst.s...
{ "content_hash": "76e2a193378a511874b92b6415a71ce2", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 84, "avg_line_length": 32.780701754385966, "alnum_prop": 0.6052983676746053, "repo_name": "sonntagsgesicht/regtest", "id": "d81d7dd99dc0ce480ccb3b3be9f940f762d79fc8", "siz...
import imath import IECore import Gaffer import GafferUI import GafferUITest class GLWidgetTest( GafferUITest.TestCase ) : def testOverlayParenting( self ) : w = GafferUI.Window() g = GafferUI.GLWidget() f = GafferUI.Frame() b = GafferUI.Button() w.setChild( g ) g.addOverlay( f ) f.setChild( b ) ...
{ "content_hash": "265f0c620666d0ebf5ddbd3bff8d07bb", "timestamp": "", "source": "github", "line_count": 121, "max_line_length": 101, "avg_line_length": 22.363636363636363, "alnum_prop": 0.6570583887657059, "repo_name": "boberfly/gaffer", "id": "49455e44ab204540344b43423a5614ca36b0a919", "size": "45...
from ev3sensors import EV3ColorSensor from ev3sensors import EV3GyroSensor from ev3sensors import EV3UltrasonicSensor #HiTechnic sensors from hitechnicsensors import HiTechnicColorSensor from hitechnicsensors import HiTechnicAccelerometer from hitechnicsensors import HiTechnicCompass #NXT sensors from nxtsensors impo...
{ "content_hash": "d323bc8ab379786a5bfef24d79461ece", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 51, "avg_line_length": 31.09090909090909, "alnum_prop": 0.8976608187134503, "repo_name": "alexander-svendsen/ev3-python", "id": "ed28f2d1f1d8c6594e8c4d2e5416d9b0af1b38d1", ...
"""Tools for constructing domains for expressions. """ from sympy.polys.polyutils import parallel_dict_from_basic from sympy.polys.polyoptions import build_options from sympy.polys.polyerrors import GeneratorsNeeded from sympy.polys.domains import ZZ, QQ, RR, EX from sympy.assumptions import ask, Q from sympy.core imp...
{ "content_hash": "8fde93d298b93703a47dab8c8580d593", "timestamp": "", "source": "github", "line_count": 244, "max_line_length": 79, "avg_line_length": 26.483606557377048, "alnum_prop": 0.5496750232126276, "repo_name": "amitjamadagni/sympy", "id": "d617f8c182aefb69036b1a7cb302fce6411fd882", "size": ...
import xml.etree.ElementTree as ET class brocade_vcs(object): """Auto generated class. """ def __init__(self, **kwargs): self._callback = kwargs.pop('callback') def vcsmode_vcs_mode(self, **kwargs): """Auto Generated Code """ config = ET.Element("config") ...
{ "content_hash": "a36c5521a0b1c3bd7f33ffb8dcfbcb9f", "timestamp": "", "source": "github", "line_count": 1704, "max_line_length": 129, "avg_line_length": 42.98122065727699, "alnum_prop": 0.6172583287820863, "repo_name": "brocade/pynos", "id": "83d057d7c9a5b55667d02e30cdc336367d65c074", "size": "7326...
""" Interface for openaps device "pump" TODO: Document exceptions """ from datetime import datetime from datetime import timedelta from dateutil.parser import parse from itertools import cycle import json from cachetools import lru_cache from cachetools import ttl_cache # # Caching # # Scatter long-lived caches by ...
{ "content_hash": "facae421b7ab394b201958320b6c09f3", "timestamp": "", "source": "github", "line_count": 283, "max_line_length": 101, "avg_line_length": 29.646643109540637, "alnum_prop": 0.6537544696066746, "repo_name": "loudnate/rpi-openaps-playground", "id": "9fbd473fef129492ce34dc48141ef42e62e24d3c...
from functools import partial from ...utils import verbose from ..utils import (has_dataset, _data_path, _get_version, _version_doc, _data_path_doc) has_brainstorm_data = partial(has_dataset, name='brainstorm.bst_resting') _description = u""" URL: http://neuroimage.usc.edu/brainstorm/DatasetRest...
{ "content_hash": "d8449123132e8489dddf382e63755fe6", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 77, "avg_line_length": 32.674418604651166, "alnum_prop": 0.61067615658363, "repo_name": "adykstra/mne-python", "id": "f04da4bb17795ed2adc117989ee110fab720fa86", "size": "14...
from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError from msrestazure.azure_operation import AzureOperationPoller import uuid from .. import models class LoadBalancersOperations(object): """LoadBalancersOperations operations. :param client: Client for service req...
{ "content_hash": "1e3e435ad9f46d3f33ae7e7fe03e2cf0", "timestamp": "", "source": "github", "line_count": 393, "max_line_length": 144, "avg_line_length": 44.83460559796438, "alnum_prop": 0.6332009080590238, "repo_name": "SUSE/azure-sdk-for-python", "id": "afb0b57da42acb528aec949240187c65ab26258f", "s...
try: from io import UnsupportedOperation except ImportError: UnsupportedOperation = object() import logging import mimetypes mimetypes.init() mimetypes.types_map['.dwg']='image/x-dwg' mimetypes.types_map['.ico']='image/x-icon' mimetypes.types_map['.bz2']='application/x-bzip2' mimetypes.types_map['.gz']='applica...
{ "content_hash": "85bbf9898b9ce2dcf31d26034d7c55ea", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 102, "avg_line_length": 36.638297872340424, "alnum_prop": 0.6573751451800233, "repo_name": "sjolicoeur/Annelia", "id": "470b57b719e256b311778dd5de2f32e3786963cf", "size": "...
import os import unittest import boto3 from haascli.haas import cli from click.testing import CliRunner from moto import mock_cloudformation from utils import create_stack from haascli import ROOT_DIR class TestStackDelete(unittest.TestCase): ''' ''' def setUp(self): # create runner self.r...
{ "content_hash": "30ac149fffaf25cd43426360ca6aaf52", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 77, "avg_line_length": 34.08, "alnum_prop": 0.602112676056338, "repo_name": "vin0110/haas", "id": "3dc90bc59ab7267f54f780ba9795da635a348876", "size": "2556", "binary": fa...
import logging from chatterbot import languages from chatterbot.tagging import PosLemmaTagger class StorageAdapter(object): """ This is an abstract class that represents the interface that all storage adapters should implement. """ def __init__(self, *args, **kwargs): """ Initiali...
{ "content_hash": "df43636a51aebd2cda2ee66041c8fc16", "timestamp": "", "source": "github", "line_count": 177, "max_line_length": 162, "avg_line_length": 33.64971751412429, "alnum_prop": 0.6180322364002686, "repo_name": "gunthercox/ChatterBot", "id": "335a65fa6a012ad218036a3a7bef35e3c0847dee", "size"...
import requests def all(): r = requests.get('http://arkapi:5001/page') return r def find(path): r = requests.get('http://arkapi:5001/page/find/' + path) return r
{ "content_hash": "1173e4281df4917c9b50d7308a00e00c", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 60, "avg_line_length": 20, "alnum_prop": 0.6277777777777778, "repo_name": "allison-knauss/arkweb", "id": "7371490a82e721ba66742590b15c32a1bea06e9a", "size": "180", "binary...
"""Trace treadmill application events. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import logging import socket import sys import click from treadmill import context from treadmill import discovery from tre...
{ "content_hash": "498e7e1c7f0ab2d8ef033af196d21e68", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 72, "avg_line_length": 28.294871794871796, "alnum_prop": 0.57091073855913, "repo_name": "Morgan-Stanley/treadmill", "id": "aa1cec58033744f072e0730daedd123f4fa51a36", "size"...
""" run test suites written for nose. """ import pytest, py import inspect import sys def pytest_runtest_makereport(__multicall__, item, call): SkipTest = getattr(sys.modules.get('nose', None), 'SkipTest', None) if SkipTest: if call.excinfo and call.excinfo.errisinstance(SkipTest): # let's...
{ "content_hash": "950d00b319d897bf414518b52e6120ad", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 108, "avg_line_length": 39.875, "alnum_prop": 0.6405433646812957, "repo_name": "jeppeter/pytest", "id": "ef7b781839b9d1e4044207fb678b6d2900b5bf3f", "size": "1914", "binar...
from .knufactor import *
{ "content_hash": "7253c5cb759f616734f127e030ba12d0", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 24, "avg_line_length": 25, "alnum_prop": 0.76, "repo_name": "KnuVerse/knuverse-sdk-python", "id": "7ad7400e94faa46a877b20629f24f59d34e833d9", "size": "25", "binary": false...
''' Created on Nov, 2016 @author: hugo ''' from __future__ import absolute_import from keras.layers import Input, Dense from keras.models import Model from keras.optimizers import Adadelta from keras.models import load_model as load_keras_model from keras.callbacks import EarlyStopping, ReduceLROnPlateau from ..util...
{ "content_hash": "5ecbb1fd0496188f19b6776578c47bb8", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 142, "avg_line_length": 39.101010101010104, "alnum_prop": 0.6140532162231982, "repo_name": "hugochan/KATE", "id": "04a547c17b05e100b299b26383c85f04e823eab1", "size": "3871"...
from pyVmomi import vim, vmodl from tools import cli, service_instance def get_object(content, vimtype, name, disp=False): """ Internal method to create objects of various vCenter related classes :param content: :param vimtype: :param name: :param disp: :return: Object """ obj = No...
{ "content_hash": "0738c3dfb8cfc206b3726db130282fdf", "timestamp": "", "source": "github", "line_count": 165, "max_line_length": 81, "avg_line_length": 33.448484848484846, "alnum_prop": 0.5838014132995107, "repo_name": "vmware/pyvmomi-community-samples", "id": "15dfe108bb152e541a96685d8cb906be3a67ea8f...
""" Copyright (c) 2011 Tyler Kenendy <tk@tkte.ch> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish,...
{ "content_hash": "d1b02799194cc58b21e05d03c52dcab8", "timestamp": "", "source": "github", "line_count": 270, "max_line_length": 109, "avg_line_length": 33.1037037037037, "alnum_prop": 0.5833519803087939, "repo_name": "mcdevs/Burger", "id": "1af24d3ef6efc28843b53d51a413c75fe8cdb5b4", "size": "8983",...
"""Clash of Clans war moniting for telegram channels.""" __version__ = '0.9.1' from .__main__ import main, serverless __all__ = ['main', 'serverless']
{ "content_hash": "5af03eef761fb315887e517f9e98603e", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 56, "avg_line_length": 22, "alnum_prop": 0.6298701298701299, "repo_name": "mehdisadeghi/clashogram", "id": "628c8b084f80bc43329db3b1d0fb19bd2c183fc2", "size": "154", "bina...
"""Structured error classes in TVM. Each error class takes an error message as its input. See the example sections for for suggested message conventions. To make the code more readable, we recommended developers to copy the examples and raise errors with the same message convention. .. note:: Please also refer t...
{ "content_hash": "27914c32f037fdbbf820d54e2ddf5efa", "timestamp": "", "source": "github", "line_count": 120, "max_line_length": 89, "avg_line_length": 25.083333333333332, "alnum_prop": 0.6428571428571429, "repo_name": "Laurawly/tvm-1", "id": "9755270ec3bab6c8ae41edb67161d1208234ff9e", "size": "3795...
"""Tests for the C{pywikibot.tools.formatter} module.""" # # (C) Pywikibot team, 2015-2018 # # Distributed under the terms of the MIT license. # from __future__ import absolute_import, division, unicode_literals from pywikibot.tools import formatter from pywikibot.tools import UnicodeMixin from tests.aspects import u...
{ "content_hash": "6daa731a1258cea1f3edb1031b15ff9f", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 77, "avg_line_length": 36.09649122807018, "alnum_prop": 0.5927095990279465, "repo_name": "PersianWikipedia/pywikibot-core", "id": "4a4ebcd3f77bd96ca711993ed8a7a1bd06759439",...
## ## Copyright (c) Microsoft. All rights reserved. ## Licensed under the MIT license. See LICENSE file in the project root for full license information. ## # #USAGE: #Add Events: modify <root>src/vm/ClrEtwAll.man #Look at the Code in <root>/src/inc/genXplatLttng.py for using subroutines in this file # import os imp...
{ "content_hash": "39d0886137c53e8d5dac150561b8ce2e", "timestamp": "", "source": "github", "line_count": 807, "max_line_length": 285, "avg_line_length": 38.712515489467165, "alnum_prop": 0.589545789187286, "repo_name": "taylorjonl/coreclr", "id": "0f4033e18f219c6b8f0e8987fd908a0e3483ca9a", "size": "...
from swgpy.object import * def create(kernel): result = Static() result.template = "object/static/structure/general/shared_web_03.iff" result.attribute_template_id = -1 result.stfName("obj_n","unknown_object") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "931b8cae171c9ccede39ea02324df4b7", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 70, "avg_line_length": 23, "alnum_prop": 0.6889632107023411, "repo_name": "anhstudios/swganh", "id": "5e9f8887b4c8717f9db3ac0bed4bef2794f568c7", "size": "444", "binary": ...
""" utility functions with "chemical know-how" """ from __future__ import print_function import re,os from rdkit import RDConfig from rdkit.six.moves import xrange if not RDConfig.usePgSQL: _atomDbName = os.path.join(RDConfig.RDDataDir,'atomdb.gdb') else: _atomDbName = "::RDData" def GetAtomicData(atomDict,descr...
{ "content_hash": "1a792d3a4429318d09915b2860a68717", "timestamp": "", "source": "github", "line_count": 161, "max_line_length": 85, "avg_line_length": 28.93167701863354, "alnum_prop": 0.6358952340060111, "repo_name": "strets123/rdkit", "id": "1c9afa109173fe9d3d1eb73c99c1d0ca88abb039", "size": "4698...
import sublime from sublime_plugin import TextCommand, WindowCommand import os import re from ..git_command import GitCommand from ...common import util COMMIT_NODE_CHAR = "●" COMMIT_NODE_CHAR_OPTIONS = "●*" COMMIT_LINE = re.compile("[%s][ /_\|\-.]*([a-z0-9]{3,})" % COMMIT_NODE_CHAR_OPTIONS) class GsCompareCommitC...
{ "content_hash": "7e71ed31e8b236f522899b50bb7051ef", "timestamp": "", "source": "github", "line_count": 197, "max_line_length": 95, "avg_line_length": 37.39593908629442, "alnum_prop": 0.6135468983303923, "repo_name": "asfaltboy/GitSavvy", "id": "38bbf73af4cd31e4d2a9ad5d5cd1e62cf826e4a2", "size": "7...
import sys import os from UcsSdk import * # This script acknowledge all the existing UCSM faults via UCS Manager method "FaultAckFaults". ucsm_ip = '0.0.0.0' user = 'username' password = 'password' try: handle = UcsHandle() handle.Login(ucsm_ip,user, password) idSet = IdSet() getRsp = handle....
{ "content_hash": "028ce191afe3ba1b8c34b6104cc0faa2", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 95, "avg_line_length": 19.484848484848484, "alnum_prop": 0.6749611197511665, "repo_name": "Havate/havate-openstack", "id": "9e4cfb6ed12148e90e8186382794929d506f6cd6", "size...
""" This module contains a Google Cloud Vertex AI hook. .. spelling:: aiplatform au codepoints milli mae quantile quantiles Quantiles rmse rmsle rmspe wape prc roc Jetson forecasted Struct sentimentMax TrainingPipeline targetColumn op...
{ "content_hash": "a83555313ca4b46e2f151bf2dad409fc", "timestamp": "", "source": "github", "line_count": 1257, "max_line_length": 133, "avg_line_length": 60.17661097852029, "alnum_prop": 0.6709103408159488, "repo_name": "Acehaidrey/incubator-airflow", "id": "12c480a28d34cb3b7a66de43bbba53aeca5687b6", ...
from __future__ import unicode_literals import unittest import os from pymatgen.io.feff.outputs import LDos, Xmu test_dir = os.path.join(os.path.dirname(__file__), "..", "..", "..", "..", 'test_files') test_dir_reci = os.path.join(os.path.dirname(__file__), "..", "..", "..", "..", ...
{ "content_hash": "26370457d588e8e7849e6e3b749babc7", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 79, "avg_line_length": 36.75, "alnum_prop": 0.5891156462585034, "repo_name": "nisse3000/pymatgen", "id": "1a3bdf93fae5c1a870325a4c2db918dca0a8a4de", "size": "3050", "bina...
import sys from PyQt5.QtWidgets import QApplication, QWidget, QPushButton, QHBoxLayout app = QApplication(sys.argv) # Make widgets window = QWidget() btn1 = QPushButton("One") btn2 = QPushButton("Two") btn3 = QPushButton("Three") # Set the layout hbox = QHBoxLayout() hbox.addStretch(1) # La méthode addStretc...
{ "content_hash": "2a8e8d7a6b1e3526977ee425ee2ab63d", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 150, "avg_line_length": 36.8780487804878, "alnum_prop": 0.7473544973544973, "repo_name": "jeremiedecock/snippets", "id": "e8c2520ef0e099305dc3a71437fbb3a0a795a077", "size":...
import glob import sys import os import subprocess import re ######################################################################## ####################################################################### # Check for dependencies # # Is there a way to do this more elegantly? # 1. Run "pip install numpy" # 2. ...
{ "content_hash": "a21999b12f4e7fde97b8bb20739085c5", "timestamp": "", "source": "github", "line_count": 232, "max_line_length": 93, "avg_line_length": 32.5948275862069, "alnum_prop": 0.5462840518381381, "repo_name": "CGATOxford/CGATPipelines", "id": "fb7cfce00a7c7f9a1e9c8bbca51263f6b37ae5f0", "size...
""" TCP-Server通道类 通过调用管理类对象的process_data函数实现信息的发送。 """ import logging from libs.base_channel import BaseChannel logger = logging.getLogger('plugin') class TCPServerChannel(BaseChannel): def __init__(self, channel_params, devices_file_name, protocol, mqtt_client, network_name): BaseChannel.__init__(self...
{ "content_hash": "1685607a55e32c0a042ea8aac23ec4fc", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 106, "avg_line_length": 29.894736842105264, "alnum_prop": 0.6109154929577465, "repo_name": "lianwutech/plugin_xxx_yyy", "id": "d026a044d8c4044b7b76f7f6abe30d81521e7c50", "s...
import _plotly_utils.basevalidators class SizeValidator(_plotly_utils.basevalidators.NumberValidator): def __init__(self, plotly_name="size", parent_name="bar.outsidetextfont", **kwargs): super(SizeValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
{ "content_hash": "ca6cc5c7e29be0b4a87c1ff376996b5d", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 88, "avg_line_length": 38.142857142857146, "alnum_prop": 0.5880149812734082, "repo_name": "plotly/python-api", "id": "880154a6e75cad6088276243e1f6ad889853498a", "size": "53...
import logging from json import dumps from xml.etree.ElementTree import ElementTree from cms.utils.compat.dj import is_installed from dateutil.parser import parse from django.utils.timezone import make_aware from ..conf import settings if is_installed('django.contrib.redirects'): from django.contrib.redirects.mo...
{ "content_hash": "ead57b1098c8afed96b3053fbbb3397a", "timestamp": "", "source": "github", "line_count": 172, "max_line_length": 104, "avg_line_length": 40.41279069767442, "alnum_prop": 0.5535894115954539, "repo_name": "misli/django-cms-articles", "id": "4734d43bc7ea056dd4fde3f499dc8b0b14f87678", "s...
from runner.koan import * class AboutControlStatements(Koan): def test_if_then_else_statements(self): if True: result = 'true value' else: result = 'false value' self.assertEqual(__, result) def test_if_then_statements(self): result = 'default value' ...
{ "content_hash": "18351213f1e3114b6534fc4b74b67c62", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 84, "avg_line_length": 27.181818181818183, "alnum_prop": 0.4992833253702819, "repo_name": "bordeltabernacle/python_koans", "id": "2ed357bcb3a1fda5ae61e6ba43ce99bebad02fef", ...
import win32ui from pywin.mfc import docview from pywin import default_scintilla_encoding import scintillacon import win32con import string import os import codecs import re crlf_bytes = "\r\n".encode("ascii") lf_bytes = "\n".encode("ascii") # re from pep263 - but we use it both on bytes and strings. re_encoding_byte...
{ "content_hash": "148a607ee16aa7591451129eb5b8fb74", "timestamp": "", "source": "github", "line_count": 252, "max_line_length": 106, "avg_line_length": 33.87698412698413, "alnum_prop": 0.7083284526180157, "repo_name": "slozier/ironpython2", "id": "d472aea2e6768bb5516b71c7e6ea576d4ccec94e", "size": ...