text
stringlengths
4
1.02M
meta
dict
class OutlineCodeItem(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.""" def __init__(self): """ Attributes: swaggerTypes (dict): The key is attribute name and the value is attribute type. attributeMa...
{ "content_hash": "824bb49341d4e0d6203441b88abc05a5", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 97, "avg_line_length": 28.782608695652176, "alnum_prop": 0.5468277945619335, "repo_name": "sohail-aspose/Aspose_Tasks_Cloud", "id": "5ee5af422aa14fee51a03757a3be53fa56d30ef0"...
import socket import sys # client_socket_socket = None try: client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) client_socket.settimeout(.150) # print "client connected" except socket.error, (code,message): if client_socket: client_socket.close() print "Could not open socket...
{ "content_hash": "627ba5b0771d7985619390dfc0770fee", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 163, "avg_line_length": 35.729729729729726, "alnum_prop": 0.6232980332829047, "repo_name": "slremy/testingpubsub", "id": "5f14eaa030c0d5e9e0746f0884eb8ceb8cc5d2c6", "size":...
"""Meetup API wrapper.""" from datetime import datetime import json import logging import redis import requests __all__ = 'APIWrapper', _logger = logging.getLogger(__name__) class APIWrapper: """Wrapper around the meetup.com API.""" def __init__(self, api_key): self.api_key = api_key def _g...
{ "content_hash": "cb11d04b3674af30472cdf4348dbb846", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 78, "avg_line_length": 27.055555555555557, "alnum_prop": 0.5039014373716633, "repo_name": "NYCPython/nycpython.com", "id": "9bdfed59583670c0df835293a78bf402190630a8", "size...
import numpy as np import pandas as pd from scipy.stats import skew, kurtosis from matplotlib import pyplot, animation from flowstats import cluster class DataSet(object): """ A single multi-variate data set """ def __init__(self, parameter_count): if not isinstance(parameter_count, int): ...
{ "content_hash": "2cd869650cfbfe020f1250bba3b0e510", "timestamp": "", "source": "github", "line_count": 455, "max_line_length": 80, "avg_line_length": 29.665934065934067, "alnum_prop": 0.5272632982664098, "repo_name": "whitews/dpconverge", "id": "bedb36fb51f5d3533a8b0fc266af608d6ed91d19", "size": "...
import argparse import inspect import json import sys from ast import literal_eval import six from validation import ValidationException class ConfigOption(object): def __init__(self, default=None, description='', validators=None): self.default = default self.description = description self.type = type self....
{ "content_hash": "beda7cb088397ea682d378c3252741a7", "timestamp": "", "source": "github", "line_count": 110, "max_line_length": 136, "avg_line_length": 27.318181818181817, "alnum_prop": 0.6895174708818635, "repo_name": "systocrat/bread", "id": "60c03fc636d13fc6595c96496733f15e8acf99bc", "size": "30...
from __future__ import print_function, division, absolute_import import time import os import pytest from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys from tests.web.frontend.models import IndexPage, SearchPage pytestmark = pytest.mark.uses_web @pytest.fixture() def page(dri...
{ "content_hash": "4d9dd931572dd7d5a2f73018b5b9e77e", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 64, "avg_line_length": 27.515625, "alnum_prop": 0.6740488358886996, "repo_name": "sdss/marvin", "id": "a2b0fe902d91e2e8e1c61ef11e8e7a675c4da3e3", "size": "1992", "binary"...
import math import sys from typing import Dict, List, Optional import torch import torch.nn as nn from torch import Tensor from fairseq import search, utils from fairseq.data import data_utils from fairseq.models import FairseqIncrementalDecoder from fairseq.ngram_repeat_block import NGramRepeatBlock class Sequence...
{ "content_hash": "eff57fd8ce8eb1b00f82d6dd8f214dfd", "timestamp": "", "source": "github", "line_count": 992, "max_line_length": 110, "avg_line_length": 39.921370967741936, "alnum_prop": 0.5491894348770264, "repo_name": "pytorch/fairseq", "id": "7d323d85e7c9ca9325c77f12c3a95d259459ede7", "size": "39...
from __future__ import print_function import os import sys import signal import subprocess import argparse import time import math import random from multiprocessing import Process from functools import reduce import numpy as np import pickle import unittest import six import paddle import paddle.fluid as fluid from...
{ "content_hash": "6e030c9877d4167f955270956f5c40a9", "timestamp": "", "source": "github", "line_count": 193, "max_line_length": 96, "avg_line_length": 35.865284974093264, "alnum_prop": 0.5443513435423288, "repo_name": "baidu/Paddle", "id": "f0f13a9d49c5b84521aa3e00bdcabe0c494853a7", "size": "7535",...
"""This file contains a syslog parser in plaso.""" import datetime import logging from plaso.lib import event from plaso.lib import lexer from plaso.lib import text_parser from plaso.lib import timelib from plaso.lib import utils class SyslogLineEvent(event.TextEvent): """Convenience class for a syslog line event...
{ "content_hash": "32bd1408163c570baaa8a8a91c64e52a", "timestamp": "", "source": "github", "line_count": 208, "max_line_length": 78, "avg_line_length": 34.08653846153846, "alnum_prop": 0.6334273624823695, "repo_name": "iwm911/plaso", "id": "757be7b9faadf5b5a1bb10de432395af65bdca20", "size": "7788", ...
from Board import Board from Board import Card from copy import deepcopy from BestFirstSolitaire import BestFirstSolitaire from Solitaire import find import unittest class TestBestFirstSolitaire(unittest.TestCase): def setUp(self): self.sol = BestFirstSolitaire() self.cards = [Card(color, num) for ...
{ "content_hash": "97d9aef5e974f6c34e43e0c3b6ec1b0b", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 70, "avg_line_length": 39.1375, "alnum_prop": 0.6026828489300543, "repo_name": "davidxk/SolitaireBot", "id": "25abff8e8932d42c213ed1aebc044de3dc3dbc89", "size": "3131", "...
import dota2api import joblib import time api = dota2api.Initialise(api_key='') my_id = 76561197997856332 private_id = 4294967295 # a private profile player's 32-bit Steam ID hist = api.get_match_history(account_id=my_id)#, matches_requested=1) print(len(hist['matches'])) cur_smid = hist['matches'][0]['match_seq_num'...
{ "content_hash": "da0e10351849123c92e105e448c72396", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 83, "avg_line_length": 36.89090909090909, "alnum_prop": 0.5243962543124692, "repo_name": "syhw/dota2_stats", "id": "1fc10d2489652773477838028b00da3416705849", "size": "2029...
from __future__ import print_function import math from fontTools.misc.transform import Transform """ This is a more sophisticated approach to performing math on transformation matrices. Traditionally glyphMath applies the math straight to the elements in the matrix. By decomposing the matrix into offset, ...
{ "content_hash": "36b9704c090e769e98a884494dd871d0", "timestamp": "", "source": "github", "line_count": 363, "max_line_length": 195, "avg_line_length": 35.256198347107436, "alnum_prop": 0.5937646507266761, "repo_name": "typesupply/fontMath", "id": "e8db0b7e58ef010aad71df63dce95003484dcd9d", "size":...
from django.utils import timezone import mock import pytest from addons.wiki.tests.factories import NodeWikiFactory from api.base.settings.defaults import API_BASE from api_tests import utils as test_utils from osf.models import Guid from osf_tests.factories import ( ProjectFactory, AuthUserFactory, Commen...
{ "content_hash": "71cf6d5751e55adf101c6f89a2d771c4", "timestamp": "", "source": "github", "line_count": 497, "max_line_length": 100, "avg_line_length": 35.85311871227364, "alnum_prop": 0.5963297603681463, "repo_name": "chennan47/osf.io", "id": "d80977fa5f05a47cca462aee356d926a37ba8e1a", "size": "17...
"""Contains User class""" from .base_user import BaseUser class User(BaseUser): """User class""" USERNAME_FIELD = 'username' EMAIL_FIELD = 'email' PASSWORD_FIELD = 'password' def __init__(self): """Initialize class attributes""" # set all attributes to None because we will validat...
{ "content_hash": "97a1a4a13330accccfe3e8d5767bd4ea", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 70, "avg_line_length": 24.74418604651163, "alnum_prop": 0.5789473684210527, "repo_name": "gr1d99/shopping-list", "id": "7614cfd8d1b00fdaeeb95e4df253cd24fc9478c0", "size": "...
from PyQt4 import QtSql, QtCore import numpy as np import pickle, re, os import acq4.Manager import acq4.util.DataManager as DataManager import collections import acq4.util.functions as functions import acq4.util.advancedTypes as advancedTypes def quoteList(strns): """Given a list of strings, return a single strin...
{ "content_hash": "961b2c77ffa4a6edb69d713d4f9c058d", "timestamp": "", "source": "github", "line_count": 568, "max_line_length": 187, "avg_line_length": 39.95070422535211, "alnum_prop": 0.5334479111581174, "repo_name": "mgraupe/acq4", "id": "3f2917958ff5e02196c6737d902fef97d750ac0a", "size": "22716"...
from tweepy import StreamListener import json, time, sys class TWaiter(StreamListener): # see Tweepy for more info def __init__(self, api = None, label = 'default_collection'): self.api = api or API() self.counter = 0 self.label = label self.output = open(label + '.' + time.s...
{ "content_hash": "a95621b1421e3e20397a274bc3341eee", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 92, "avg_line_length": 35.142857142857146, "alnum_prop": 0.5632984901277585, "repo_name": "marciw/sentiment", "id": "382f85021022ece036d3bf69a9346692b57b4f46", "size": "192...
import SimpleXMLRPCServer from SimpleXMLRPCServer import SimpleXMLRPCServer import cluster_constants from cluster_constants import * import utils from utils import * import os import subprocess import re def main(): print ("init") server = SimpleXMLRPCServer(('0.0.0.0', int(SLAVE_DAEMON_PORT))) server.regi...
{ "content_hash": "e443518df3e48db5ebe36084175cdbae", "timestamp": "", "source": "github", "line_count": 305, "max_line_length": 106, "avg_line_length": 28.18032786885246, "alnum_prop": 0.597324025596277, "repo_name": "Infosys/High-Availability-Hadoop", "id": "57c442034aed4f43263073ad1e9f653cd014a3c1"...
import logging import tkinter as tk from copy import deepcopy from pathlib import Path from typing import TYPE_CHECKING, Any, Dict, List, Optional, Set, Tuple from PIL import Image from PIL.ImageTk import PhotoImage from core.api.grpc.wrappers import Interface, Link from core.gui import appconfig from core.gui import...
{ "content_hash": "06911c3da0cb24a6c2f83f4b2ca8b91b", "timestamp": "", "source": "github", "line_count": 852, "max_line_length": 88, "avg_line_length": 39.005868544600936, "alnum_prop": 0.5471669725874884, "repo_name": "pexip/os-core-network", "id": "e3225a4df73c9ce2859289405fb471916ab85d4a", "size"...
import logging from nose.tools import assert_equal from liboozie import conf from liboozie.types import WorkflowAction, Coordinator from liboozie.utils import config_gen from oozie.tests import MockOozieApi from useradmin.models import User import desktop.conf as desktop_conf from desktop.lib.test_utils import refor...
{ "content_hash": "e7afa4251477aec277b01e4e0b031b49", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 123, "avg_line_length": 34.06930693069307, "alnum_prop": 0.6599825632083697, "repo_name": "kawamon/hue", "id": "db5ea9b2595ae779f926cb1f2a61a1afbab8b131", "size": "4233", ...
import os from subprocess import call from jawaf.conf import settings from jawaf.management.base import BaseCommand class Command(BaseCommand): """Run py.test framework, set up test databases.""" def handle(self, **options): """Convenience for running alembic commands.""" alembic_cmd = [ ...
{ "content_hash": "f2988d5f30eb30fc18de3d21b6fb4db9", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 78, "avg_line_length": 30.88235294117647, "alnum_prop": 0.6323809523809524, "repo_name": "danpozmanter/jawaf", "id": "be0add32cb5c95d8b72043a3629aceeea35c0b57", "size": "52...
import orange, math, orngTest, orngStat, random, orngMisc ################################################################## # The orngEnsemble with CHANGED Random Forest Classifier voting!!! ################################################################## # This function is built-in in Python 2.3, # but we ...
{ "content_hash": "539d40a85d298af27fb75f01b20111f4", "timestamp": "", "source": "github", "line_count": 440, "max_line_length": 165, "avg_line_length": 36.79090909090909, "alnum_prop": 0.5589943167778602, "repo_name": "xflows/textflows", "id": "fb6314d004bf5e9d0d7a2d458d28f5d3845cc50e", "size": "16...
from cinder.volume import configuration from cinder.volume import driver from cinder.volume.drivers.netapp import options as na_opts SSC_VSERVER = 'fake_vserver' SSC_VOLUMES = ('volume1', 'volume2') SSC_VOLUME_MAP = { SSC_VOLUMES[0]: { 'pool_name': SSC_VOLUMES[0], }, SSC_VOLUMES[1]: { 'pool...
{ "content_hash": "50781245f7fc0ed7e3b4c21cdf40f300", "timestamp": "", "source": "github", "line_count": 120, "max_line_length": 67, "avg_line_length": 27.75, "alnum_prop": 0.5864864864864865, "repo_name": "Nexenta/cinder", "id": "e104f9098ed19f8a940d006aaff9b73467afc8c8", "size": "3964", "binary"...
import tests.model_control.test_ozone_custom_models_enabled as testmod testmod.build_model( ['Fisher'] , ['MovingMedian'] , ['Seasonal_Second'] , ['ARX'] );
{ "content_hash": "5067abf39b67ed60f7c74e25ca46cf5d", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 85, "avg_line_length": 39.5, "alnum_prop": 0.7088607594936709, "repo_name": "antoinecarme/pyaf", "id": "ee885fcb4f76657b2552daeb8326be835b6b80da", "size": "158", "binary":...
""" TODO: add comments """ import os import shutil from tow.modules import load_module from tow.dockerfile import Dockerfile from tow.attrs import process_attrs from tow import templates import subprocess import sys import json import collections TOW_VOLUME = "/tow" def project_paths(): current_dir = os.getcwd(...
{ "content_hash": "278dafbf3a9f16c695e13a9b321dc429", "timestamp": "", "source": "github", "line_count": 200, "max_line_length": 106, "avg_line_length": 37.665, "alnum_prop": 0.5446701181468206, "repo_name": "yurinnick/tow", "id": "1ceb2c860027384a3ac65ce0691b9aa3412bff06", "size": "7533", "binary...
import os import sys from distutils.core import Command, setup from distutils.command.build_ext import build_ext from traceback import print_exc cython_available = False try: from Cython.Distutils import build_ext from Cython.Distutils.extension import Extension cython_available = True except ImportError,...
{ "content_hash": "d7c6d323052b3edd9e48d373d03c6dfa", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 110, "avg_line_length": 29.576923076923077, "alnum_prop": 0.6644993498049415, "repo_name": "methane/meinheld-zeromq", "id": "067259c087935f35cdb29624662da30e81432f06", "siz...
import random from battlesnake.plugins.contrib.arena_master.puppets import outbound_commands as ai_commands # This is the maximum number of tics that a unit can be speed 0.0 with # a destination before we try to assign a new one. MAX_IDLE_COUNTER = 25 def get_logical_roam_destination(puppet, edge_padding=8): ""...
{ "content_hash": "eee584fe0cdf12233b1a8d7ceefbfdef", "timestamp": "", "source": "github", "line_count": 165, "max_line_length": 93, "avg_line_length": 37.339393939393936, "alnum_prop": 0.6406427527998702, "repo_name": "gtaylor/btmux_battlesnake", "id": "f1bd7511743d438153966f656d174bd2c1fe4df7", "s...
""" Client for interacting with Nexus. """ import base64 from datetime import datetime import hashlib import json import logging from subprocess import Popen, PIPE import time import urllib import urlparse import yaml import token_utils as token_utils from utils import ( read_openssh_public_key, read_o...
{ "content_hash": "1d133fc58c7baee686233d9ddfccffcd", "timestamp": "", "source": "github", "line_count": 236, "max_line_length": 163, "avg_line_length": 40.978813559322035, "alnum_prop": 0.5889773549788027, "repo_name": "kbase/auth", "id": "171d62f8b56cded2489c440937d6196b042c6f25", "size": "9671", ...
from rlib.unroll import unrolling_iterable class AbstractNode(object): pass def _get_all_child_fields(clazz): cls = clazz field_names = [] while cls is not AbstractNode: if hasattr(cls, "_child_nodes_"): field_names += cls._child_nodes_ # pylint: disable=protected-access ...
{ "content_hash": "27c1099784f7bb9619e0d9ded364a52d", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 88, "avg_line_length": 37.76, "alnum_prop": 0.5651483050847458, "repo_name": "SOM-st/PySOM", "id": "0ef3e080be238ab2eedc6ad77af425a582bec339", "size": "3776", "binary": ...
""" Copyright 2020 Google LLC Copyright 2020 PerfectVIPs Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed t...
{ "content_hash": "84d763972d79a5abfc2ac8fe29a1e2e5", "timestamp": "", "source": "github", "line_count": 437, "max_line_length": 100, "avg_line_length": 49.006864988558355, "alnum_prop": 0.587551363466567, "repo_name": "chipsalliance/Surelog", "id": "26f49aa23831585c9005c7607d6fc180b259c910", "size"...
""" Just for some quick testing. """ import requests ''' #res = requests.post('http://127.0.0.1:8089/swarm', {"locust_count": 10, "hatch_rate": 2}) #print(res.content) def get_results(): res = requests.get('http://127.0.0.1:8089/stats/requests/csv').content.decode('utf-8') lines = res.split('\n')[1:] data = [] ...
{ "content_hash": "dc3b0f62cd8eac01f82645ff6e48f055", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 135, "avg_line_length": 22.483333333333334, "alnum_prop": 0.6434395848776872, "repo_name": "utarsuno/urbtek", "id": "96892ebe534adef687f25a8f0956f926c0bcce3e", "size": "136...
__VERSION__="ete2-2.2rev1056" # -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'show_newick.ui' # # Created: Tue Jan 10 15:56:56 2012 # by: PyQt4 UI code generator 4.7.2 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui class Ui_Newick(object):...
{ "content_hash": "15f6716f8f3d1cccba3fa79531557be9", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 148, "avg_line_length": 61.44186046511628, "alnum_prop": 0.7072293716881151, "repo_name": "csc8630Spring2014/Clusterizer", "id": "1b0aa042a5d563405ac7eb2fac228932fe7dbd16", ...
""" .. py:currentmodule:: FileFormat.Results.PhirhozEmittedCharacteristic .. moduleauthor:: Hendrix Demers <hendrix.demers@mail.mcgill.ca> Read PhirhozEmittedCharacteristic file from MCXRay. """ # Script information for the file. __author__ = "Hendrix Demers (hendrix.demers@mail.mcgill.ca)" __version__ = "" ...
{ "content_hash": "beeafed2f3c83e9ca8801e5f2411a37a", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 122, "avg_line_length": 31.369565217391305, "alnum_prop": 0.6212751212751213, "repo_name": "drix00/pymcxray", "id": "f67af212e5a739af2b1f679c62549da96ee68e52", "size": "290...
import re from collections import OrderedDict import prestodb from query_designer.models import Query import time from threading import Thread import sys from django.db import connections, ProgrammingError from django.conf import settings from aggregator.models import Variable, Dimension from .utils import GRANULA...
{ "content_hash": "da83766c2d4a75f411c0ec31917bee4e", "timestamp": "", "source": "github", "line_count": 705, "max_line_length": 139, "avg_line_length": 36.66950354609929, "alnum_prop": 0.5564753210583321, "repo_name": "dipapaspyros/bdo_platform", "id": "17571901035808652138f1655649e55fe10a5396", "s...
from gluon import * from s3 import * from s3layouts import * try: from .layouts import * except ImportError: pass import s3menus as default class S3MainMenu(default.S3MainMenu): """ Custom Application Main Menu: The main menu consists of several sub-menus, each of which can be cust...
{ "content_hash": "ddece8ab66d58b61d1a21831d171f877", "timestamp": "", "source": "github", "line_count": 484, "max_line_length": 93, "avg_line_length": 42.13636363636363, "alnum_prop": 0.39501814259095813, "repo_name": "devinbalkind/eden", "id": "98a5a22a440b59a39d4efef2008cba60581c12a2", "size": "2...
import logging import foursquare from logging.handlers import RotatingFileHandler from flask import Flask, render_template,request,jsonify,json from flask.ext.bootstrap import Bootstrap import os tmpl_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'templates') app = Flask(__name__,template_folder=tmpl_...
{ "content_hash": "77b9b907bbc255a9851fe2fea71c47bd", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 210, "avg_line_length": 29.73913043478261, "alnum_prop": 0.7426900584795322, "repo_name": "firetix/BoringFriends", "id": "e4173677fbd13a8068a8c862a0441a464fecebe8", "size":...
from vistrails.db.domain import DBWorkflow, DBAdd, DBDelete, DBAction, DBAbstraction, \ DBModule, DBConnection, DBPort, DBFunction, DBParameter, DBGroup from vistrails.db.services.action_chain import getActionChain, getCurrentOperationDict, \ getCurrentOperations, simplify_ops from vistrails.db import Vistrails...
{ "content_hash": "e3b82867cfa2a65972d30880db1dbbdc", "timestamp": "", "source": "github", "line_count": 1597, "max_line_length": 96, "avg_line_length": 44.69693174702567, "alnum_prop": 0.518065031310853, "repo_name": "celiafish/VisTrails", "id": "5b453fd48385d4f2201599e64c1fa44121c684f8", "size": "...
import testtools from neutronclient.common import exceptions from neutronclient.neutron import v2_0 as neutronV20 class CLITestArgs(testtools.TestCase): def test_empty(self): _mydict = neutronV20.parse_args_to_dict([]) self.assertEqual({}, _mydict) def test_default_bool(self): _spec...
{ "content_hash": "e3e3467fa1e7db6b1b8bd9ec7aa7797a", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 78, "avg_line_length": 40.407766990291265, "alnum_prop": 0.567275348390197, "repo_name": "neumerance/deploy", "id": "054d533b2a111427100c0ec3cac91369b70f0c8a", "size": "48...
from time import sleep from flask import jsonify from arps_old.models import User from arps_old.restserver import app def __fields_as_dict(o, fields): return {field: getattr(o, field) for field in fields} @app.route('/api/v1.0/users', methods=['GET', 'POST']) def api_users(): def __to_json(user): r...
{ "content_hash": "7191656acbda1f0dce308c7dbb45d03e", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 72, "avg_line_length": 25.863636363636363, "alnum_prop": 0.6572934973637962, "repo_name": "sumpfgottheit/arps", "id": "78ac61da0c7f0a75037ff7430fcb624d643e9a12", "size": "5...
import numpy as np from dimod.binary_quadratic_model import BinaryQuadraticModel from dimod.constrained import ConstrainedQuadraticModel from typing import Tuple __all__ = ['random_multi_knapsack'] def random_multi_knapsack(num_items: int, num_bins: int, seed: int...
{ "content_hash": "9883746a7460e2c783ef5458a972e9fd", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 99, "avg_line_length": 34.41891891891892, "alnum_prop": 0.6101295641931684, "repo_name": "dwavesystems/dimod", "id": "c9584dd3846d10279477cfe6c6281eb3f297c706", "size": "31...
from . import consumer from . import exceptions from . import interfaces from . import producer from . import records __all__ = ['client', 'consumer', 'exceptions', 'producer', 'records']
{ "content_hash": "f62187f6c2a60a04f3925557e4084269", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 24, "avg_line_length": 21.181818181818183, "alnum_prop": 0.5793991416309013, "repo_name": "dnguyen0304/clare", "id": "a0951f441920efd6dc0b3a349a77c4fa03f245d5", "size": "25...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import copy import json import logging import os import readline import sys from getpass import getpass def load_config(config_file, silent=False, default_config=None, default_config_file=None): if defau...
{ "content_hash": "eeeed9e226e825df9f8ced4ff854f488", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 90, "avg_line_length": 26.56637168141593, "alnum_prop": 0.583944037308461, "repo_name": "reinforceio/tensorforce-benchmark", "id": "58c65b1871f30848ff1b363076d78425b1b0cdc5"...
from ksvd_wrapper import KSVD
{ "content_hash": "575aec3559025f8aaa130f6e3510efd5", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 29, "avg_line_length": 30, "alnum_prop": 0.8333333333333334, "repo_name": "guker/pyksvd", "id": "03d13f7fc53e4ba82b7fe9b139ea91d28c15acdf", "size": "30", "binary": false, ...
""" Copyright (c) 2012 wong2 <wonderfuly@gmail.com> 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, publis...
{ "content_hash": "dd9f0cf606d0f06ef9294fd7ce40367b", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 70, "avg_line_length": 38.125, "alnum_prop": 0.7885245901639344, "repo_name": "wangjun/xiaohuangji", "id": "2a583476eba3a9e4125fff2ceb76eeae47f7d4c5", "size": "1281", "bi...
from heapq import heappush, heappop from sys import maxint # Represent each node as a list, ordering the elements so that a heap of nodes # is ordered by f = g + h, with h as a first, greedy tie-breaker and num as a # second, definite tie-breaker. Store the redundant g for fast and accurate # calculations. F, H, NUM...
{ "content_hash": "03a2b6e86cad403258467031d79ddf0d", "timestamp": "", "source": "github", "line_count": 129, "max_line_length": 79, "avg_line_length": 34.72093023255814, "alnum_prop": 0.549899531145345, "repo_name": "MadeInPierre/RobotOS", "id": "43cb7a5c668297a5bae98e8efba717a5ec6d98a4", "size": "...
import os import sys import unittest # Hack to support the usage of `coverage` sys.path.append(os.path.abspath(".")) import lbuild class BuildLogTest(unittest.TestCase): def setUp(self): self.repo = lbuild.repository.Repository(".") self.repo.name = "repo" self.module1 = lbuild.module....
{ "content_hash": "dc0839069bad52328cf219602084cf12", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 73, "avg_line_length": 29.902173913043477, "alnum_prop": 0.613958560523446, "repo_name": "dergraaf/library-builder", "id": "134fb6f84a79e8efec0f3c852f9fdb6775ef612b", "size...
from __future__ import print_function # Form implementation generated from reading ui file 'acq4/analysis/modules/MosaicEditor/MosaicEditorTemplate.ui' # # Created by: PyQt4 UI code generator 4.11.4 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.Q...
{ "content_hash": "89bcb9282cc67293d450cadf9476a6ee", "timestamp": "", "source": "github", "line_count": 141, "max_line_length": 113, "avg_line_length": 53.191489361702125, "alnum_prop": 0.7062666666666667, "repo_name": "meganbkratz/acq4", "id": "b272fa799f6cad87d9c68639c1ae02288f95dbf8", "size": "7...
import unittest import smtplib import mock from nose.tools import * # flake8: noqa (PEP8 asserts) import sendgrid from framework.email.tasks import send_email, _send_with_sendgrid from website import settings from tests.base import fake from osf_tests.factories import fake_email # Check if local mail server is runn...
{ "content_hash": "7d1ccde15c2d323d1d4e0edff82ce0ef", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 89, "avg_line_length": 33.675, "alnum_prop": 0.6117297698589458, "repo_name": "caseyrollins/osf.io", "id": "1ed14f35c003edfbf555acaf3fc33fc6e4c9fb1a", "size": "2718", "bi...
from msrest.serialization import Model class PublicIPAddressSku(Model): """SKU of a public IP address. :param name: Name of a public IP address SKU. Possible values include: 'Basic', 'Standard' :type name: str or ~azure.mgmt.network.v2017_10_01.models.PublicIPAddressSkuName """ _attrib...
{ "content_hash": "41625b93f734fdc9931a6e9932b01452", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 74, "avg_line_length": 26.210526315789473, "alnum_prop": 0.6204819277108434, "repo_name": "AutorestCI/azure-sdk-for-python", "id": "0adb0b21dcf35ac76236158114b2f2945234c488",...
import zstackwoodpecker.test_state as ts_header TestAction = ts_header.TestAction def path(): return dict(initial_formation="template1", \ path_list=[[TestAction.stop_vm, "vm1"], \ [TestAction.reinit_vm, "vm1"], \ [TestAction.start_vm, "vm1"], \ ...
{ "content_hash": "9a52bc05fff67792ea6366b2f8967585", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 85, "avg_line_length": 51.57142857142857, "alnum_prop": 0.4709141274238227, "repo_name": "zstackorg/zstack-woodpecker", "id": "52ef1a1ff5d490e139cdf9dadac7b4e5a64fe2cd", "s...
import os import subprocess import mock import unittest2 as unittest from quantum.rootwrap import filters from quantum.rootwrap import wrapper class RootwrapTestCase(unittest.TestCase): def setUp(self): super(RootwrapTestCase, self).setUp() self.filters = [ filters.RegExpFilter("/bi...
{ "content_hash": "235fee96225112c239fde59a0fd14ad9", "timestamp": "", "source": "github", "line_count": 166, "max_line_length": 78, "avg_line_length": 42.6566265060241, "alnum_prop": 0.6040107329473238, "repo_name": "FreescaleSemiconductor/quantum", "id": "fdede5877e54f0e95888a9cb0dd67fed8e1d9892", ...
from bears.css.CSSAutoPrefixBear import CSSAutoPrefixBear from coalib.testing.LocalBearTestHelper import verify_local_bear good_file = """ .example { display: -webkit-box; display: -ms-flexbox; display: flex; } """ bad_file = """ .example { display: flex; } """ CSSAutoPrefixBearTest = verify_local_b...
{ "content_hash": "880ca5e98feef205918873025bd1aff9", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 68, "avg_line_length": 22.857142857142858, "alnum_prop": 0.5875, "repo_name": "IPMITMO/statan", "id": "15893760e6dbcd585a201e5bf3e46095092523ce", "size": "480", "binary":...
import os from twilio.rest import Client # Find your credentials at twilio.com/console # To set up environmental variables, see http://twil.io/secure api_key_sid = os.environ['TWILIO_API_KEY'] api_key_secret = os.environ['TWILIO_API_KEY_SECRET'] client = Client(api_key_sid, api_key_secret) compositionHook = client.vi...
{ "content_hash": "761a1ea69f62beffc16217488b9c3e89", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 69, "avg_line_length": 36.16129032258065, "alnum_prop": 0.5057983942908117, "repo_name": "TwilioDevEd/api-snippets", "id": "89886c3f83783045d7d0373eda1283b5d376038e", "size...
"""Tests the text output of Google C++ Testing and Mocking Framework. SYNOPSIS gtest_output_test.py --build_dir=BUILD/DIR --gengolden # where BUILD/DIR contains the built gtest_output_test_ file. gtest_output_test.py --gengolden gtest_output_test.py """ __author__ = 'wan@google.com (Zha...
{ "content_hash": "f2ac26d782680dbb070f3501b6835526", "timestamp": "", "source": "github", "line_count": 319, "max_line_length": 79, "avg_line_length": 34.84639498432602, "alnum_prop": 0.6555415617128464, "repo_name": "FabianHahn/libstore", "id": "63763b95b91709f1d0d4ce5f2d3cc00d6be231e5", "size": "...
import math from .utils import clip orientations = [(1, 0), (0, 1), (-1, 0), (0, -1)] def turn_heading(heading, inc, headings=orientations): return headings[(headings.index(heading) + inc) % len(headings)] def turn_right(heading): return turn_heading(heading, -1) def turn_left(heading): return turn_...
{ "content_hash": "294ec99401020970eecb64e7748fbd05", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 76, "avg_line_length": 25.647058823529413, "alnum_prop": 0.6456422018348624, "repo_name": "andres-root/AIND", "id": "ef0774649df6011f668447a617e974ed69cd3332", "size": "117...
import sys, os sys.path.insert(0,os.path.realpath(os.path.abspath('../'))) import hpe3parclient # 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, ...
{ "content_hash": "f89329349d16a3873ff0858c1aba1cb6", "timestamp": "", "source": "github", "line_count": 276, "max_line_length": 100, "avg_line_length": 32.07971014492754, "alnum_prop": 0.7042014908515924, "repo_name": "hp-storage/python-3parclient", "id": "25d01c7975eb4b8ab656177c9772c3e029663ba8", ...
import functools import inspect import os import re import sys import threading from collections import OrderedDict import six # noinspection PyUnresolvedReferences from cheap_repr import cheap_repr, find_repr_function from snoop.utils import my_cheap_repr, NO_ASTTOKENS, ArgDefaultDict, iscoroutinefunction, \ tru...
{ "content_hash": "aac4fc9e06897ddbd880da84be5057c5", "timestamp": "", "source": "github", "line_count": 306, "max_line_length": 106, "avg_line_length": 33.90522875816993, "alnum_prop": 0.566843373493976, "repo_name": "alexmojaki/executing", "id": "1125ff9057928d9d2d224d4f04b92ccef037cf30", "size": ...
""" Takes an OSM way ID and turns it into a string that is readable and e.g. OsmAnd can parse it as well. """ import json import sys import threading import urllib.parse import urllib.request from typing import Dict from typing import cast def query_turbo(query: str) -> str: """Send query to overpass turbo.""" ...
{ "content_hash": "975a02b2ffebb062db3c59ba1e91ce4f", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 93, "avg_line_length": 27.934959349593495, "alnum_prop": 0.6059371362048894, "repo_name": "vmiklos/vmexam", "id": "afff55b3736a6ce19b869e66d29258bcd749afc2", "size": "3619...
from __future__ import unicode_literals, print_function import os import json import logging import datetime from six import StringIO import glob import re from io import BytesIO from botocore.vendored.requests.structures import CaseInsensitiveDict from botocore.response import StreamingBody from gcdt.gcdt_awsclient ...
{ "content_hash": "c4dc8a179691ab227ebfe2a3989cce00", "timestamp": "", "source": "github", "line_count": 254, "max_line_length": 80, "avg_line_length": 36.318897637795274, "alnum_prop": 0.5835230352303523, "repo_name": "glomex/gcdt", "id": "a147c02e39db6da52cefedf14969968507ad090e", "size": "9249", ...
"""Translation methods for generating localized strings. To load a locale and generate a translated string:: user_locale = tornado.locale.get("es_LA") print user_locale.translate("Sign out") `tornado.locale.get()` returns the closest matching locale, not necessarily the specific locale you requested. You can...
{ "content_hash": "2555e62968163c94bcdb4303d5c47105", "timestamp": "", "source": "github", "line_count": 496, "max_line_length": 117, "avg_line_length": 43.104838709677416, "alnum_prop": 0.5652478952291862, "repo_name": "interactiveinstitute/watthappened", "id": "66e9ff6d8a149e316cb1acf3ada43d11b9efea...
""" Helper functions for creating Form classes from Django models and database field objects. """ from __future__ import unicode_literals from collections import OrderedDict import warnings from django.core.exceptions import ValidationError, NON_FIELD_ERRORS, FieldError from django.forms.fields import Field, ChoiceF...
{ "content_hash": "1d50d65e8fda9d8d9539d2a440b24354", "timestamp": "", "source": "github", "line_count": 1263, "max_line_length": 129, "avg_line_length": 42.358669833729216, "alnum_prop": 0.5898801846763491, "repo_name": "zedr/django", "id": "a0b47e64b48f92d5301f46a5f26d6eea238356a4", "size": "53499...
import linkr # flake8: noqa: F401 import util.templating from test.backend.test_case import LinkrTestCase from uri.link import LinkAddURI class TestTemplating(LinkrTestCase): _multiprocess_can_split_ = True def test_get_config(self): self.assertIsNotNone(util.templating.get_config()['config']) ...
{ "content_hash": "3326575439ab0a5bdafa9da783505a16", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 79, "avg_line_length": 34.392857142857146, "alnum_prop": 0.6552440290758048, "repo_name": "LINKIWI/linkr", "id": "0bd980731136842f8d5214135dc162ffd0f8fe8c", "size": "963", ...
from __future__ import print_function from utils.DiffTimer import DiffTimer ############################################################################################################### class Progress(object): header = u'' dot_point = 10 line_point = 1000 point = 0 upper_bound = 0 prev = 0 percent_mode = Fa...
{ "content_hash": "b6ae712936e17a99ed3ebfb02d62dacd", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 111, "avg_line_length": 23.274509803921568, "alnum_prop": 0.5939342881213142, "repo_name": "irblsensitivity/irblsensitivity", "id": "e9e7fea1a262d24e92c704df7d78c675a16164bc...
"""Persistent identifier fetchers.""" from __future__ import absolute_import from invenio_pidstore.fetchers import FetchedPID from .providers import DepositProvider def deposit_fetcher(record_uuid, data): """Fetch a deposit identifier. :param record_uuid: Record UUID. :param data: Record content. ...
{ "content_hash": "eb03e7322c8a7992f0a49dd6b60a35a9", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 75, "avg_line_length": 27.181818181818183, "alnum_prop": 0.6839464882943144, "repo_name": "inveniosoftware/invenio-deposit", "id": "42f7d60bfc2150e51bf677875008c7ab9d4cbf5c",...
import os import math import numpy as np def read_terra_hst(filename, header_only=False, rshl_in=None, header_in=None, nr_in=None): """Read an optionally gzip compressed hst file from TERRA Returns numpy arrays containing data from the formatted hst (history) file written by TERRA. All...
{ "content_hash": "d783eefdc9d8c74bc49d0e28ac09b411", "timestamp": "", "source": "github", "line_count": 241, "max_line_length": 80, "avg_line_length": 35.18257261410788, "alnum_prop": 0.5498289892676023, "repo_name": "andreww/theia_tools", "id": "851ac5ec90729cc23ef1152b0ff0b08b6707b569", "size": "...
from django.contrib import admin from iswift.folderlist.models import company_tree from iswift.folderlist.models import folder_tree from iswift.folderlist.models import user_storage admin.site.register(folder_tree) admin.site.register(company_tree) admin.site.register(user_storage)
{ "content_hash": "2722212a5cbd7413688590dccf4cbf5f", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 49, "avg_line_length": 28.6, "alnum_prop": 0.8356643356643356, "repo_name": "gotostack/iSwift", "id": "d179ce2cf7200fffe4f4d809854624d5b928cc16", "size": "859", "binary":...
import torch from torch.distributions import Normal, Categorical class MixtureNormal(object): def __init__(self, pi, loc, scale): super(MixtureNormal, self).__init__() self.pi = pi self.loc = loc self.scale = scale self.normal_pd = Normal(self.loc, self.scale) self...
{ "content_hash": "a4535381d0e7632e359249290d657c06", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 66, "avg_line_length": 32.07692307692308, "alnum_prop": 0.5959232613908872, "repo_name": "qsheeeeen/Self-Driving-Car", "id": "2db88e1cd7f79adb2be260a6ccc1b519e3e372ef", "si...
from . import core as ac from . import web_api from .arg_parser import parse_args def main(): args = parse_args() ac.dbInit() if args.webui: web_api.start() if args.version: print("Anicolle Server: v0.2.3")
{ "content_hash": "64de3348dcce1054e4d3f68b15dbd059", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 40, "avg_line_length": 20.083333333333332, "alnum_prop": 0.6141078838174274, "repo_name": "chienius/anicolle", "id": "8df7ed79b39fb9e696b3173c3c275bbce825cd2f", "size": "28...
import unittest import pipeline_xml as pxml import version class TestXML(unittest.TestCase): def test_simplest_xml(self): p = pxml.Pipeline() p.source = pxml.Reader('foo') xml = p.xml() self.assertEqual(xml.getroot().attrib['version'], version.as_string()) self.assertEqual...
{ "content_hash": "0051491890f54178ae26f74983164a68", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 78, "avg_line_length": 32.648148148148145, "alnum_prop": 0.6063528077141237, "repo_name": "DougFirErickson/PDAL", "id": "db8d19dd416fdd815879ff1270f2947e25f1fb52", "size": ...
from django.db import models from .utils.network.client import NetworkClient from .utils.network.errors import NetworkClientError class NetworkLocation(models.Model): """ ``NetworkLocation`` stores information about a network address through which an instance of Kolibri can be accessed, which can be used...
{ "content_hash": "7362f41f610070d301c454a550ae225e", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 120, "avg_line_length": 41.138888888888886, "alnum_prop": 0.6806212018906145, "repo_name": "DXCanas/kolibri", "id": "7d01fd6addfbe834ae09249b213a42da8098f2e7", "size": "148...
""" Module used to perform integration testing on lostromos, by attempting multiple create/update/delete commands via kubectl. """ import os import requests import signal import subprocess from time import sleep from unittest import TestCase _LOSTROMOS_EXE = os.path.join(os.path.dirname(os.path.abspath(__file__)), "...
{ "content_hash": "3667c4dd9edf4fc19d9119547f984be2", "timestamp": "", "source": "github", "line_count": 322, "max_line_length": 119, "avg_line_length": 39.13354037267081, "alnum_prop": 0.5951908578684232, "repo_name": "wpdrush21/lostromos", "id": "16eef073c529af29170af6da5e416b572ebdb1ad", "size": ...
""" sqlalchemy-geonames ------------------- """ from __future__ import print_function from setuptools import setup, find_packages appname = 'sqlalchemy-geonames' pkgname = appname.lower().replace('-', '_') metadata_relpath = '{}/metadata.py'.format(pkgname) # Get package metadata. We use exec here instead of import...
{ "content_hash": "7757f6c2cf33900e80c757b9512168a3", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 71, "avg_line_length": 26.442622950819672, "alnum_prop": 0.5778053316800992, "repo_name": "jmagnusson/sqlalchemy-geonames", "id": "6428b22f633b9107b0aaf1d13846a582e100807c", ...
from base import SqoopClient from connection import Connection from connector import Connector from framework import Framework from job import Job from submission import Submission
{ "content_hash": "42098aef0d3fd0e7ba31a4e9d76e629e", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 33, "avg_line_length": 30.166666666666668, "alnum_prop": 0.8674033149171271, "repo_name": "yongshengwang/builthue", "id": "3b3495c4313db667ea2b4139f7ad72b644b15076", "size":...
from AlgorithmImports import * ### <summary> ### In this algortihm, we fetch a list of tickers with corresponding dates from a file on Dropbox. ### We then create a fine fundamental universe which contains those symbols on their respective dates.### ### </summary> ### <meta name="tag" content="download" /> ### <meta ...
{ "content_hash": "f2385092101a97b38c30d9d539de2028", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 121, "avg_line_length": 40.139240506329116, "alnum_prop": 0.6127404604225797, "repo_name": "JKarathiya/Lean", "id": "c308adb9f90eb8f992abcb65e2b39da23b1ee992", "size": "385...
from share import ShareAnalysisBase from share2 import ShareAnalysis2 from ..core.corrections import TurbulenceCorrection from ..core.turbine import Relaxation from ..core.analysis import Analysis from ..configuration.inner_range_configuration import InnerRangeDimension from ..core.path_builder import PathBuilder from ...
{ "content_hash": "d3e72820fe6b588d2f5e7949d11154cb", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 113, "avg_line_length": 39.45454545454545, "alnum_prop": 0.6214614878209348, "repo_name": "peterdougstuart/PCWG", "id": "a4782c2ce2ee93d3a90564d833d7536d6a7c6bea", "size": ...
"""Example of a HTTP request handler that supports requests via a HTTP proxy.""" # # In order to run this sample, you will need to have a proxy available to # relay your requests to Splunk. One way to do this is to run the tiny-proxy.py # script included in this directory and then run this script using whatever # port...
{ "content_hash": "39a9b2e4ee404072c75dd9f4227af836", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 85, "avg_line_length": 33.60526315789474, "alnum_prop": 0.6503523884103367, "repo_name": "sullivanmatt/splunk-sdk-python", "id": "aa15db88dc33a23a445102849186336ffe5a372a", ...
"""Upgrader for Python scripts from pre-1.0 TensorFlow to 1.0 TensorFlow.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import argparse import ast import collections import os import shutil import sys import tempfile import traceback class APIChangeSp...
{ "content_hash": "477dd667ede56f3b2a6bb30a7080c40d", "timestamp": "", "source": "github", "line_count": 668, "max_line_length": 81, "avg_line_length": 37.01347305389221, "alnum_prop": 0.598948432760364, "repo_name": "HKUST-SING/tensorflow", "id": "39ba22c44727a686028aea57b8981497212fa674", "size": ...
import re from rpython.rlib import debug from rpython.jit.tool.oparser import pure_parse from rpython.jit.metainterp import logger from rpython.jit.metainterp.typesystem import llhelper from StringIO import StringIO from rpython.jit.metainterp.optimizeopt.util import equaloplists from rpython.jit.metainterp.history imp...
{ "content_hash": "338f40c65cc55520d0934d24f8e96ddf", "timestamp": "", "source": "github", "line_count": 243, "max_line_length": 103, "avg_line_length": 32.91769547325103, "alnum_prop": 0.5488186023252907, "repo_name": "jptomo/rpython-lang-scheme", "id": "c787f452a273aa1f6be5df58980cbfe7a2492ad7", "...
import numpy as np from astropy.coordinates.baseframe import frame_transform_graph from astropy.coordinates.matrix_utilities import matrix_transpose from astropy.coordinates.transformations import DynamicMatrixTransform from .fk4 import FK4NoETerms from .fk5 import FK5 from .utils import EQUINOX_B1950, EQUINOX_J2000 ...
{ "content_hash": "e4d457b0bf7d0640b7329c8a22610fe5", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 78, "avg_line_length": 40.698412698412696, "alnum_prop": 0.7250390015600624, "repo_name": "lpsinger/astropy", "id": "169eced23a83cc24cfad6735570ea31b23e5646c", "size": "263...
from .video_out import VideoOut from .television import Television
{ "content_hash": "2917a6067438dc898d0d47d831381508", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 34, "avg_line_length": 33.5, "alnum_prop": 0.835820895522388, "repo_name": "Hexadorsimal/pynes", "id": "624bfa18c2f935ae5a8585e96429f96c57a32f20", "size": "67", "binary": ...
""" this script extracts commit info. the commits are memorized only if one ore more java files are commited. the log file is extracted by the following command: git log --pretty=format:"commit:%H%nauthor:%an%ndate:%at" --name-only > log_(project_name).txt this script is called by auto_top.sh input: log_(project_name...
{ "content_hash": "b737eda6e68f8c3c6575728e92571c64", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 95, "avg_line_length": 29.129032258064516, "alnum_prop": 0.6439645625692137, "repo_name": "hideshis/scripts_for_research", "id": "712b07958301fe0d2dce49858533f95d3a68d604", ...
from __future__ import unicode_literals from django.db import models, migrations import uuid def gen_uuid(apps, schema_editor): WooeyJob = apps.get_model('wooey', 'WooeyJob') for obj in WooeyJob.objects.all(): obj.uuid = uuid.uuid4() obj.save() class Migration(migrations.Migration): de...
{ "content_hash": "9d2f3f624a0d55e2bbfea9fdb38196a5", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 50, "avg_line_length": 21.434782608695652, "alnum_prop": 0.6369168356997972, "repo_name": "waytai/Wooey", "id": "5b94230501eb4fab999886b6c123abbd721125cf", "size": "517", ...
import logging import time try: from statsd import statsd statsd_installed = True except: statsd_installed = False from worker import executors from common import config log = logging.getLogger(__name__) def bind(t): def f(cls): executors.bindings[t] = cls return cls return f ...
{ "content_hash": "5cdceba0ae4c79ce012484451e487a37", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 66, "avg_line_length": 25.184615384615384, "alnum_prop": 0.5821624923640807, "repo_name": "Unix4ever/spike", "id": "6bbed08cfa7064d72ddeea90d1183b8ecb0c1091", "size": "1637...
''' :mod:`ophyd.controls.cas.pv` - CAS process variables ==================================================== .. module:: ophyd.controls.cas.pv :synopsis: Epics process variables used in the channel access server, :class:`caServer` ''' from __future__ import print_function import time import threading import logg...
{ "content_hash": "e61ec79e060172166a8d67d97446cbb7", "timestamp": "", "source": "github", "line_count": 678, "max_line_length": 94, "avg_line_length": 30.169616519174042, "alnum_prop": 0.5435834759227572, "repo_name": "ericdill/ophyd", "id": "ffafc0122384ea233ec3feb6f1c862b8e496eac3", "size": "2047...
from __future__ import print_function import logging import six import threading import time class RefCount(object): """Thread-safe counter""" def __init__(self, count=1): self._lock = threading.Lock() self._count = count def incr(self): with self._lock: self._count +...
{ "content_hash": "7674ced327fdbc2da9a1f8bd64477615", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 79, "avg_line_length": 24.556818181818183, "alnum_prop": 0.6057380842202684, "repo_name": "opentracing/opentracing-python", "id": "e591a656711b8a83bea16d2749d3c089dca814b9", ...
from bs4 import BeautifulSoup import json import requests def ExtractJSONAPNS(fileloc): file = open(fileloc, 'r') extractedJSON = json.JSONDecoder().decode(file.read()) file.close() apndict = dict() apncount = 0 ''' for geojson: for key in extractedJSON["features"]: properties = key['properties'] parc...
{ "content_hash": "1f0d859d42e9dd5420178255e72e446c", "timestamp": "", "source": "github", "line_count": 157, "max_line_length": 151, "avg_line_length": 23.738853503184714, "alnum_prop": 0.6458277434934263, "repo_name": "starvagrant/address-api", "id": "ccb187fcd87d95be8aad9abfb1613117c17a84c5", "si...
import operator from django.contrib.admin.views.decorators import staff_member_required from django.core.urlresolvers import reverse from django.db import models from django.shortcuts import redirect, get_object_or_404 from django.template import RequestContext from django.views.generic import ListView, CreateView, Re...
{ "content_hash": "1e26e888db9744296816b2bc0caa0ae9", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 74, "avg_line_length": 29.28048780487805, "alnum_prop": 0.6259891711786756, "repo_name": "armstrong/armstrong.apps.images", "id": "36dfe540b14ff9a91438a58daa52c619bde73423", ...
""" =========================================== Sparse coding with a precomputed dictionary =========================================== Transform a signal as a sparse combination of Ricker wavelets. This example visually compares different sparse coding methods using the :class:`sklearn.decomposition.SparseCoder` esti...
{ "content_hash": "8fef616e5307ed120363ad080ea4fd1b", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 78, "avg_line_length": 40.07, "alnum_prop": 0.6231594709258798, "repo_name": "idlead/scikit-learn", "id": "beeafc1bfbb9869713836ec0b523f9345b18bb6c", "size": "4007", "bi...
''' Management of APT/YUM package repos =================================== Package repositories for APT-based and YUM-based distros can be managed with these states. Here is some example SLS: .. code-block:: yaml base: pkgrepo.managed: - humanname: CentOS-$releasever - Base - mirrorlist: h...
{ "content_hash": "17f5002dd72c4c61d1e43f6261c0b09d", "timestamp": "", "source": "github", "line_count": 499, "max_line_length": 94, "avg_line_length": 34.811623246492985, "alnum_prop": 0.5894306602958954, "repo_name": "smallyear/linuxLearn", "id": "4238eee4e1851ecfbe01bc16770436f4139796fb", "size":...
"""Tests for the SHA-1 hasher implementation.""" import unittest from plaso.analyzers.hashers import sha1 from tests import test_lib as shared_test_lib from tests.analyzers.hashers import test_lib class SHA1Test(test_lib.HasherTestCase): """Tests the SHA-1 hasher.""" @shared_test_lib.skipUnlessHasTestFile([u'...
{ "content_hash": "b14381849f4b2bca6decf9671c44de78", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 79, "avg_line_length": 31.341463414634145, "alnum_prop": 0.7214007782101167, "repo_name": "dc3-plaso/plaso", "id": "5cae85a8fc352a8f13d9ecb2123ebb614863e36a", "size": "1312...
import os from ingenico.connect.sdk.factory import Factory from ingenico.connect.sdk.merchant.tokens.delete_token_params import DeleteTokenParams class DeleteTokenExample(object): def example(self): with self.__get_client() as client: query = DeleteTokenParams() query.mandate_can...
{ "content_hash": "31bd67b34ddc41aec3730c8a146ebd5c", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 100, "avg_line_length": 44.40909090909091, "alnum_prop": 0.6161719549641761, "repo_name": "Ingenico-ePayments/connect-sdk-python3", "id": "3b421fc4b5fde8ea7be1a149ab32375a152...
from django.db import models from django.db.models import Q from django.contrib.auth.models import User from colorful.fields import RGBColorField class CellCountInstance(models.Model): TISSUE_TYPE = ( ('Blood film', 'Blood film'), ('Bone marrow', 'Bone marrow')) user = models.ForeignKey(User)...
{ "content_hash": "ea302940577aca716f76e7697670a665", "timestamp": "", "source": "github", "line_count": 212, "max_line_length": 97, "avg_line_length": 42.825471698113205, "alnum_prop": 0.5804604031280978, "repo_name": "haematologic/cellcountr", "id": "3163e4c643373c3975234df4395943ce1596e540", "siz...
"""Fichier contenant le masque <nv_ident_salle>.""" from primaires.interpreteur.masque.masque import Masque from primaires.interpreteur.masque.fonctions import * from primaires.interpreteur.masque.exceptions.erreur_validation \ import ErreurValidation class NvIdent(Masque): """Masque <nv_ident_salle>...
{ "content_hash": "0625c0194e550c37b73a139e9bf5c168", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 78, "avg_line_length": 31.526315789473685, "alnum_prop": 0.5904284919309961, "repo_name": "stormi/tsunami", "id": "817e563fcd1aca8d395d4ccc94149dea881c01aa", "size": "3370"...
""" This file tests a couple of distinct examples from 'Aircraft Structures,' by Peery. These cases have known results, and the output from SectionProperties is compared for accuracy. These examples represent a more rigourous 'proof' against a 'real' problem. Only results that have values in the reference material...
{ "content_hash": "12ed5896a88ce311f95efd68d695ae4f", "timestamp": "", "source": "github", "line_count": 242, "max_line_length": 83, "avg_line_length": 32.38429752066116, "alnum_prop": 0.6603292076049508, "repo_name": "robbievanleeuwen/section-properties", "id": "91cb9a220e9e6d1bf9320ba5195e7a569766b5...
""" Tests that dialects are properly handled during parsing for all of the parsers defined in parsers.py """ import csv from io import StringIO import pytest from pandas.errors import ParserWarning from pandas import DataFrame import pandas.util.testing as tm @pytest.fixture def custom_dialect(): dialect_name...
{ "content_hash": "faa2879be90c9ebe7f474f9980025e1d", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 88, "avg_line_length": 28.430555555555557, "alnum_prop": 0.6277479237909135, "repo_name": "toobaz/pandas", "id": "dc10352bc64601eed125711fbaedd0a9ff1b02ed", "size": "4094"...
"""indavant URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.8/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-ba...
{ "content_hash": "f37164a4c52ed1aa5505d79b33b0f447", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 98, "avg_line_length": 47.17391304347826, "alnum_prop": 0.667741935483871, "repo_name": "eprivalov/sendec", "id": "eafe67969fa1f05ae22dabc1117427ff1151e63f", "size": "2170"...
""" WSGI config for django_web_app project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANG...
{ "content_hash": "d0d857e51253da794aaf270545949739", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 78, "avg_line_length": 25.3125, "alnum_prop": 0.7679012345679013, "repo_name": "cloudfoundry/python-buildpack", "id": "ea38ccd21f12ac8eded39d1cfdf6026cfc7087cc", "size": "4...
from tests import TestMinion class TestExample(TestMinion): def test_func(self, __salt__): assert __salt__['example.func']() def util_func(self, __salt__): assert __salt__['example.util_func']() == "I'm helping"
{ "content_hash": "1d21749baba07b9320d4b73ceff06150", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 63, "avg_line_length": 26.555555555555557, "alnum_prop": 0.602510460251046, "repo_name": "yagnik/saltstack-template", "id": "00a98a75c071d0e0f358aa8fedccf90461032a8f", "size...
from genty import genty, genty_dataset from app.master.build_request_handler import BuildRequestHandler from test.framework.base_unit_test_case import BaseUnitTestCase @genty class TestBuildRequestHandler(BaseUnitTestCase): @genty_dataset( no_subjobs=([], True), one_subjob=(['some subjob'], False...
{ "content_hash": "a385fcfe33dc34f906d4b428328a4fc4", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 101, "avg_line_length": 41.42307692307692, "alnum_prop": 0.7056638811513464, "repo_name": "Medium/ClusterRunner", "id": "cf23f715f242da322aef282984e8f520fd40b3d3", "size": ...
""" The :mod:`sklearn.pipeline` module implements utilities to build a composite estimator, as a chain of transforms and estimators. """ # Author: Edouard Duchesnay # Gael Varoquaux # Virgile Fritsch # Alexandre Gramfort # Lars Buitinck # Licence: BSD from collections import defaultdict...
{ "content_hash": "58163b424bd2038164211b6c531d1d75", "timestamp": "", "source": "github", "line_count": 525, "max_line_length": 89, "avg_line_length": 36.90095238095238, "alnum_prop": 0.5959841015846797, "repo_name": "mblondel/scikit-learn", "id": "86d0e624cb54b58f58817c0d8d3eddfb0f5a9fd3", "size":...
from catch_lured_pokemon import CatchLuredPokemon from catch_visible_pokemon import CatchVisiblePokemon from evolve_pokemon import EvolvePokemon from incubate_eggs import IncubateEggs from move_to_fort import MoveToFort from move_to_map_pokemon import MoveToMapPokemon from nickname_pokemon import NicknamePokemon from p...
{ "content_hash": "dede2803569f407489b7efbedf351217", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 56, "avg_line_length": 43.63157894736842, "alnum_prop": 0.873341375150784, "repo_name": "AbelIngrand/PokemonGo-Bot", "id": "538673cfe7f38754704a5885fdde08f83bebaf8f", "size...