text
stringlengths
4
1.02M
meta
dict
"""Module contains classes presenting Element and Species (Element + oxidation state) and PeriodicTable.""" import ast import json import re import warnings from collections import Counter from enum import Enum from io import open from itertools import combinations, product from pathlib import Path from typing import C...
{ "content_hash": "bfac3ee37686c0293223bf282f50c160", "timestamp": "", "source": "github", "line_count": 1582, "max_line_length": 116, "avg_line_length": 31.63653603034134, "alnum_prop": 0.5330176427101441, "repo_name": "gmatteo/pymatgen", "id": "82a4afc8208e8143ea3dd8450ec065a921d69a1c", "size": "5...
""" Examples of how to use parsedatetime with locale information provided. Locale information can come from either PyICU (if available) or from the more basic internal locale classes that are included in the `Constants` class. """ __license__ = """ Copyright (c) 2004-2006 Mike Taylor Copyright (c) 2006 Darshana Chhaj...
{ "content_hash": "e73e4db115f2b8aa9d524e14630aeb6c", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 90, "avg_line_length": 36.78787878787879, "alnum_prop": 0.6441515650741351, "repo_name": "philiptzou/parsedatetime", "id": "82165a5c0382281a0dab118f7b5ba9ccd24f4974", "size...
""" Classes for including text in a figure. """ from __future__ import division, print_function import math import numpy as np from matplotlib import cbook from matplotlib import rcParams import matplotlib.artist as artist from matplotlib.artist import Artist from matplotlib.cbook import is_string_like, maxdict from ...
{ "content_hash": "36e9a20543e525ad1ec25af3f45aa5ff", "timestamp": "", "source": "github", "line_count": 2015, "max_line_length": 209, "avg_line_length": 34.68387096774194, "alnum_prop": 0.5481484661172161, "repo_name": "lthurlow/Network-Grapher", "id": "550d97294fb5fa9af15b04d64c4e7826b9456b6e", "s...
""" (c) RIKEN 2017. All rights reserved. Author: Keitaro Yamashita This software is released under the new BSD License; see LICENSE. """ from __future__ import print_function from __future__ import unicode_literals import iotbx.phil from cctbx import sgtbx from dxtbx.model.experiment_list import ExperimentListFactory...
{ "content_hash": "977afde18f0ae942df7b5ee0055b5786", "timestamp": "", "source": "github", "line_count": 277, "max_line_length": 122, "avg_line_length": 41.624548736462096, "alnum_prop": 0.6524718126626192, "repo_name": "keitaroyam/yamtbx", "id": "583c686763498c616dc74317d649676717e6f0a5", "size": "...
from __future__ import unicode_literals from .. import Tags, Warning, register @register(Tags.compatibility) def check_1_7_compatibility(**kwargs): errors = [] errors.extend(_check_middleware_classes(**kwargs)) return errors def _check_middleware_classes(app_configs=None, **kwargs): ""...
{ "content_hash": "04e9d92aabc371f191fde8a06d223fa2", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 109, "avg_line_length": 39, "alnum_prop": 0.6168091168091168, "repo_name": "diego-d5000/MisValesMd", "id": "c44b2d77e2d3b5a61c6fa9c466ca2b0f1fbe35f6", "size": "1404", "bi...
""" This is a rework of Guilherme Polo's example to include folder icons which open and close. Polo's example is Based on bitwalk's directory browser <http://bitwalk.blogspot.com/2008/01/ttktreeview.html>.. """ import os import os.path import sys py26 = py30 = py31 = False version = sys.hexversion if version >= 0x0...
{ "content_hash": "b441b5593a5b5db8d4403465f196ba48", "timestamp": "", "source": "github", "line_count": 194, "max_line_length": 76, "avg_line_length": 29.876288659793815, "alnum_prop": 0.5771221532091098, "repo_name": "FrauBluher/PMSM", "id": "7a2d124605c5042e024f4d4ea6c555c96975cf6c", "size": "588...
class StatsPipeline(object): def process_item(self, item, spider): return item
{ "content_hash": "2954689255d2205a3ee0cc396ff24db2", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 41, "avg_line_length": 30.333333333333332, "alnum_prop": 0.6813186813186813, "repo_name": "phyng/scrapy-stats", "id": "341308bc827a4d6abc643df30cdd90e5756da3da", "size": "28...
from ansiblelint import AnsibleLintRule import re class VariableHasSpacesRule(AnsibleLintRule): id = 'EXTRA0001' shortdesc = 'Variables should have spaces after {{ and before }}' description = 'Variables should be of the form {{ varname }}' tags = ['whitespace', 'templating'] bracket_regex = re.c...
{ "content_hash": "4a18273efd062bfb8a3ae30b8fc6ae4d", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 69, "avg_line_length": 30.5, "alnum_prop": 0.667447306791569, "repo_name": "willthames/ansible-review", "id": "6c8929223de93c7316a9c41f606fc3c869063d1a", "size": "427", "...
""" Test lldb logging. This test just makes sure logging doesn't crash, and produces some output. """ from __future__ import print_function import os import time import string import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil class LogTes...
{ "content_hash": "d273d3e7dc941a3db0be43c549383b3c", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 94, "avg_line_length": 29.25263157894737, "alnum_prop": 0.595897804965815, "repo_name": "youtube/cobalt", "id": "cafbe437d84d1861503dd82b89a9b0635112c202", "size": "2779", ...
import unittest from requests_aws4auth import AWS4Auth def ss(l): '''return a sorted set of a sortable thing''' return set(sorted(l)) class AWS4Auth_Header_Test(unittest.TestCase): _default_headers_sorted_set = ss(['content-type', 'date', 'host', 'x-amz-*']) def test_expected_default_headers(self): sel...
{ "content_hash": "f6581cd328fb3e07fcdc7632305024df", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 112, "avg_line_length": 42.81481481481482, "alnum_prop": 0.6738754325259516, "repo_name": "sam-washington/requests-aws4auth", "id": "6a454717f2c23df201a233631702b1dd0a282367"...
""" celery.backends.amqp ~~~~~~~~~~~~~~~~~~~~ The AMQP result backend. This backend publishes results as messages. """ from __future__ import absolute_import from __future__ import with_statement import socket import threading import time from kombu import Exchange, Queue, Producer, Consumer from ...
{ "content_hash": "794500cdb393621c1282c17cf4843aa2", "timestamp": "", "source": "github", "line_count": 264, "max_line_length": 78, "avg_line_length": 37.35227272727273, "alnum_prop": 0.5571443058513336, "repo_name": "mozilla/firefox-flicks", "id": "6264c5e1f1e98da03487dc90d951b1fbb7d27e73", "size"...
from django.core.serializers.python import Serializer as PythonSerializer from django.core.serializers.python import Deserializer as PythonDeserializer from class_fixtures.utils.serialization import dump_class_fixtures class Serializer(PythonSerializer): """ Serialize a QuerySet (or just a list of objects) in...
{ "content_hash": "127b2ac2b53f1c1220dc287190c7adc0", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 78, "avg_line_length": 39, "alnum_prop": 0.7377622377622378, "repo_name": "jklaiho/django-class-fixtures", "id": "932e0827692563f73d1531b66d5cad47c2bb7e43", "size": "858", ...
from django.contrib import admin from polls.models import Choice, Question, Sidebar class ChoiceInline(admin.TabularInline): model = Choice extra = 3 class QuestionAdmin(admin.ModelAdmin): fieldsets = [ (None, {'fields': ['question_text']}), ('Date information', {'fields'...
{ "content_hash": "2e2ed98017f2c596cc35f589b884afad", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 78, "avg_line_length": 32.407407407407405, "alnum_prop": 0.6022857142857143, "repo_name": "dresl/python_web_grayscale_bootstrap_theme", "id": "4d1c43d3ae7f368df4b4c6b3d986e35...
DASHBOARD = 'nfv' DISABLED = {{ tacker_horizon_dashboard_disable }} ADD_INSTALLED_APPS = [ 'tacker_horizon', 'tacker_horizon.openstack_dashboard.dashboards.nfv', ]
{ "content_hash": "5a3c0f82597c55c3bd4fdcd5967a6ccf", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 56, "avg_line_length": 24.714285714285715, "alnum_prop": 0.7052023121387283, "repo_name": "jrametta/openstack-ansible-os_tacker", "id": "82bf2efd41e0a31fa2746fb145fb861bf10012...
""" Copyright 2016, Ben Langmead <langmea@cs.jhu.edu> Concrete subclass for BWA-MEM aligner. """ import os import logging import sys from subprocess import Popen from aligner import Aligner try: from Queue import Queue except ImportError: from queue import Queue # python 3.x class BwaMem(Aligner): ...
{ "content_hash": "b15a5dd10421db023a532ee08d567a8c", "timestamp": "", "source": "github", "line_count": 106, "max_line_length": 103, "avg_line_length": 38.764150943396224, "alnum_prop": 0.5748357264541251, "repo_name": "BenLangmead/qtip", "id": "981be3dbd1eb3046103d904feef102d806f809bc", "size": "4...
from typing import Dict, List, Optional import torch import torch.nn as nn from fairseq import utils from fairseq.modules import LayerNorm, MultiheadAttention from fairseq.modules.quant_noise import quant_noise from fairseq.modules.fairseq_dropout import FairseqDropout from torch import Tensor class TransformerEncod...
{ "content_hash": "3737e5ccdb41abb2cffe16cbae572c18", "timestamp": "", "source": "github", "line_count": 386, "max_line_length": 101, "avg_line_length": 41.803108808290155, "alnum_prop": 0.5885597421913733, "repo_name": "hfp/libxsmm", "id": "037d8e88aeb0e82e224fe3290ee337bb89e48e48", "size": "16314"...
import xlrd # Read xlsx file and save the header and all the cells, each a dict with value and header label # Input: xlsx file, sheet def readFile(subAttrs, excel_file, sheet): workbook = xlrd.open_workbook(excel_file) sh = workbook.sheet_by_name(sheet) header = [str(sh.cell(0, col).value).strip("\n") for...
{ "content_hash": "32785a5d5d99d5fdf0bc56a5648c5eaa", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 105, "avg_line_length": 34.77922077922078, "alnum_prop": 0.5455563853622106, "repo_name": "css-lucas/GAT", "id": "4a17caf1213869fed5ac242ef40c5507903c0592", "size": "2678",...
""" Module to emulate the minimum set of command needed to act like a modem Adrien Mistretta """ import sqlite3 import serial # WARNING: Version 0.1 is just a proof of concept. There is a lot of control # missing # Author take no respnsability, use at your own risk def sendok(): """ function t...
{ "content_hash": "e79a28498a41e352a6d53f1c26cb5c3d", "timestamp": "", "source": "github", "line_count": 218, "max_line_length": 104, "avg_line_length": 23.165137614678898, "alnum_prop": 0.5423762376237624, "repo_name": "mistretta/psame", "id": "d6832079c8f48a4d486793f9ee0205ec7e3c757c", "size": "50...
""" DocuSign REST API The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign. # noqa: E501 OpenAPI spec version: v2.1 Contact: devcenter@docusign.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pp...
{ "content_hash": "0560f6d8f928ffe3d52712c29175b2c3", "timestamp": "", "source": "github", "line_count": 363, "max_line_length": 193, "avg_line_length": 30.884297520661157, "alnum_prop": 0.5842476139505842, "repo_name": "docusign/docusign-python-client", "id": "28bcd54ea3325fb3c00d8f7dff31e7b1b84c4370...
import random from characters import guests, butler from adventurelib import when, start, Bag from rooms import rooms from sys import exit def set_up_murder(): global murderer, murder_location # Initialise rooms for r in rooms: r.people = Bag() r.at_the_time_of_the_murder = Bag() mur...
{ "content_hash": "55f5b8052830a0205ed047bb5cb3225f", "timestamp": "", "source": "github", "line_count": 153, "max_line_length": 84, "avg_line_length": 27.81045751633987, "alnum_prop": 0.6018801410105757, "repo_name": "tomviner/dojo-adventure-game", "id": "080ed0ef257cb659ff423187ea424f5dfc3cb00a", ...
from botinfo import * from time import time, mktime from datetime import datetime, timedelta # bot info and whatever who cares bot_name = "remind-bot" client = discord.Client() logger = create_logger(bot_name) bot_data = create_filegen(bot_name) # only support weeks, days and hours right now # months and years involv...
{ "content_hash": "a02e20bc4cbbd5d979f4c06a12ff6b01", "timestamp": "", "source": "github", "line_count": 200, "max_line_length": 100, "avg_line_length": 32.84, "alnum_prop": 0.6117539585870889, "repo_name": "sleibrock/discord-bots", "id": "c54bf82502c980259b5df981ccb4e89cde841adf", "size": "6614", ...
import sys, os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. sys.path.append(os.path.abspath('_themes')) sys.path.insert(0, os....
{ "content_hash": "b3dbb551e615b621874632657011feb6", "timestamp": "", "source": "github", "line_count": 256, "max_line_length": 80, "avg_line_length": 31.60546875, "alnum_prop": 0.6983067605981955, "repo_name": "stfp/flask-presst", "id": "7ed80fd0298a4c402bfe7153fa14c67a8a66f80d", "size": "8515", ...
from ggrc.models.mixins import Timeboxed from ggrc import db class RelativeTimeboxed(Timeboxed): # Frequencies and offset: # annual: # month is the 0-indexed month (0 is January) # day is the 0-indexed offset day # quarterly: # month is in [0,1,2], as the offset within the quarter # d...
{ "content_hash": "67365ffccd79aebf3bcbed9da32477a4", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 61, "avg_line_length": 35.21052631578947, "alnum_prop": 0.6831091180866966, "repo_name": "plamut/ggrc-core", "id": "ca1a7da5fb94a730d10f769f2630d6e4d99d1f95", "size": "782"...
from ccmlib.node import Node from decorator import decorator from distutils.version import LooseVersion import re, os, sys, fileinput, time, unittest, functools from cassandra import ConsistencyLevel from cassandra.query import SimpleStatement from dtest import Tester, DISABLE_VNODES def rows_to_list(rows): new...
{ "content_hash": "bcc97f9c8ecc48ce04e36432b3612b4c", "timestamp": "", "source": "github", "line_count": 207, "max_line_length": 177, "avg_line_length": 40.38164251207729, "alnum_prop": 0.6172987199425769, "repo_name": "yukim/cassandra-dtest", "id": "c7c63e1b02dccc47d7885d341bf33560b88a2544", "size"...
from subprocess import Popen from charmhelpers.core.hookenv import open_port, log from charms.reactive import when, when_not, set_state, remove_state from charmhelpers.core.hookenv import status_set @when_not('mysql.available') def waiting_for_db(): # TODO: stop service status_set('blocked', 'waiting for mysq...
{ "content_hash": "4f334e2f129dc331e12956fcf2ab3e1e", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 94, "avg_line_length": 39.06896551724138, "alnum_prop": 0.6690203000882613, "repo_name": "sastix/cms", "id": "81575bcd58046418f80882bde544e8d163fa965f", "size": "1167", "...
import html import os import re import time import uuid from collections import defaultdict from dataclasses import dataclass from itertools import zip_longest from textwrap import dedent from pants.base.build_environment import get_buildroot from pants.base.mustache import MustacheRenderer from pants.base.workunit im...
{ "content_hash": "c448c973749c7d60d1e6ca4a14e3f908", "timestamp": "", "source": "github", "line_count": 519, "max_line_length": 109, "avg_line_length": 41.5606936416185, "alnum_prop": 0.5532684283727399, "repo_name": "tdyas/pants", "id": "7b728584cb8f6bf2ed0084bdccf15af1c0bb7939", "size": "21702", ...
import copy from vitrage.evaluator.template_fields import TemplateFields from vitrage.evaluator.template_validation.content import \ template_content_validator as validator from vitrage.tests.mocks import utils from vitrage.tests.unit.evaluator.template_validation.content.base import \ ValidatorTest from vitra...
{ "content_hash": "0e212730988d4941a1f47b9c52200823", "timestamp": "", "source": "github", "line_count": 339, "max_line_length": 79, "avg_line_length": 44.11504424778761, "alnum_prop": 0.6374456703443664, "repo_name": "openstack/vitrage", "id": "23b1dabbb672adcf3338fdc9fcf785a9cc08fb30", "size": "15...
import urllib import urllib2 import cookielib from bs4 import BeautifulSoup import cookielib import re import argparse import sys import time from teseo_model import Thesis, Person, Descriptor, Department from teseo_model import University, Advisor, PanelMember from teseo_model import Base from sqlalchemy.orm import ...
{ "content_hash": "cc508ffc1916cd4ad15f6081b2394ded", "timestamp": "", "source": "github", "line_count": 253, "max_line_length": 116, "avg_line_length": 37.83399209486166, "alnum_prop": 0.5726076055160886, "repo_name": "unaguil/minotaur", "id": "bef0662d80f81e6c482117c7d1f09c78165af12d", "size": "96...
from .base import BaseProfile class ProfileMatchError(Exception): pass class QueryProfile(BaseProfile): extension = '.queryprofile' def __init__(self): self.filters = [] self.name = '' self.to_find = None def valid_profile(self, corpus_context): try: sel...
{ "content_hash": "384899a9a51f5647f31b40dca782f713", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 69, "avg_line_length": 22.583333333333332, "alnum_prop": 0.6199261992619927, "repo_name": "samihuc/PolyglotDB", "id": "0fbdee05a91eb7e4d4c384d75c3e41625fb12f66", "size": "5...
__author__ = 'Joe Linn' import unittest import pylastica from tests.base import Base class MultiMatchTest(unittest.TestCase, Base): def test_query(self): client = self._get_client() index = pylastica.index.Index(client, 'test') index.create(options=True) doc_type = index.get_doc_t...
{ "content_hash": "bcb08cd0bd24a1bf6c99f9eda8c9e282", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 103, "avg_line_length": 31.147058823529413, "alnum_prop": 0.6109537299339, "repo_name": "jlinn/pylastica", "id": "621c3681a594b02590c6a6946eb69577e1ac4210", "size": "1059",...
import socket host = '127.0.0.1' port = 5204 backlog = 5 size = 1024 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.bind((host,port)) s.listen(backlog) client, address = s.accept()#pilla 1 client while 1: data = client.recv(size)#escolta al client if len(data) > 0: #quan el client envia algo: print(d...
{ "content_hash": "fcfc41bbebb6ee9ce8c62355a4856d01", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 116, "avg_line_length": 25.842105263157894, "alnum_prop": 0.7087576374745418, "repo_name": "EyeTechPae/Detection_Occupancy", "id": "825fcc9c39d756c0b42d856a8bdfe477284e654e",...
import tests.model_control.test_ozone_custom_models_enabled as testmod testmod.build_model( ['RelativeDifference'] , ['ConstantTrend'] , ['Seasonal_MonthOfYear'] , ['AR'] );
{ "content_hash": "af796076759fb64e0f5d560540a3cf9e", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 102, "avg_line_length": 43.75, "alnum_prop": 0.7371428571428571, "repo_name": "antoinecarme/pyaf", "id": "62a94effc9271287b7423bc3f959ce8027207ac6", "size": "175", "binary...
import math ''' 二叉查找树节点的结构(dict): node['val']: number 节点的数据 node['left']: dict 左孩子引用 node['right']: dict 右孩子引用 node['parent']: dict 父节点引用 ''' class BST(object): def __init__(self, data=None): self.root = None if data is not None: sel...
{ "content_hash": "905b453278bfc1f0695a075498814efa", "timestamp": "", "source": "github", "line_count": 108, "max_line_length": 45, "avg_line_length": 25.074074074074073, "alnum_prop": 0.5066469719350074, "repo_name": "ShengGuangzhi/SummerTree", "id": "ba5852c602f953ebc349169b1ef5bd7fe2e110f3", "si...
""" This script runs the SharkCubed web applications author: edelsonc """ import sys import os import webbrowser import pycoil import jinja2.ext from flask import Flask, render_template, request, redirect # checks if the file is running as an app or in normal Python and directs flask # to the correct templates and st...
{ "content_hash": "9ac12a9c0295b2ed5eebb4c1d0b7d1a9", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 79, "avg_line_length": 33.638888888888886, "alnum_prop": 0.6800165152766309, "repo_name": "edelsonc/SharkCube", "id": "94ba330bc2bd83c92690ec645dcd085d0d085252", "size": "2...
from . import agent
{ "content_hash": "509a04a410e58b5e368bff15ef20138d", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 19, "avg_line_length": 20, "alnum_prop": 0.75, "repo_name": "tetherless-world/satoru", "id": "02c597e11e4a12162f1000288349cd65a176c6c5", "size": "20", "binary": false, "...
from .document import DocumentSchema __all__ = [DocumentSchema]
{ "content_hash": "653f0064bb72f336848df5f0deb3b746", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 36, "avg_line_length": 21.666666666666668, "alnum_prop": 0.7538461538461538, "repo_name": "HurricaneLabs/cujo", "id": "d1efe8048141238d49dafac07a0cdd6c793a603c", "size": "65...
import validictory import logging from unittest import TestCase class TestExtends(TestCase): schema1 = None schema2 = { "type": "object", "extends": "schema1", } schemas = { "schema1": schema1, "schema2": schema2, } def test_bad_data(self): w...
{ "content_hash": "9c79d4e6a67147197729ee89ed7e17de", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 73, "avg_line_length": 26, "alnum_prop": 0.5923076923076923, "repo_name": "kyleconroy/validictory", "id": "eee7541663bab4fa700f94e2c8946532053e904d", "size": "910", "bina...
import fnmatch import inspect import os from cinder import interface def _ensure_loaded(start_path): """Loads everything in a given path. This will make sure all classes have been loaded and therefore all decorators have registered class. :param start_path: The starting path to load. """ fo...
{ "content_hash": "2be5a374db5ea5db6111c1c4ee1f0b65", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 72, "avg_line_length": 28, "alnum_prop": 0.5929705215419501, "repo_name": "bswartz/cinder", "id": "32adb022286b52b691ba8b1b427468ff75447ea7", "size": "2390", "binary": fa...
import json def format_item(item): """ :type item: item.Item """ return { 'id': item.id, 'name': item.name, 'alias': item.alias, 'icon_path': item.icon_path, 'cost': item.cost, 'tooltip': item.tooltip, 'tier': item.tier, 'stats': format_i...
{ "content_hash": "bc49bf2e15f34536c56bc37d110053e6", "timestamp": "", "source": "github", "line_count": 171, "max_line_length": 61, "avg_line_length": 22.502923976608187, "alnum_prop": 0.5587318087318087, "repo_name": "Met48/League-of-Legends-DB", "id": "020ae087e8f38fdb58899f595c205aeb71f15f0b", "...
from quantumclient.common import exceptions from quantumclient.common import utils API_NAME = 'network' API_VERSIONS = { '2.0': 'quantumclient.v2_0.client.Client', } def make_client(instance): """Returns an quantum client. """ quantum_client = utils.get_client_class( API_NAME, instan...
{ "content_hash": "ad312db6b8242251145822b084d3198e", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 79, "avg_line_length": 32.61702127659574, "alnum_prop": 0.538160469667319, "repo_name": "CiscoSystems/python-quantumclient", "id": "1661a63f8d404644fb5665ef6f79655b6e919286",...
import datetime import sys import os import subprocess from future.utils import iteritems import PyQt5.QtWidgets as Qtw import PyQt5.QtGui as Qtg from PyQt5.QtCore import Qt import odml from odmltables import odml_table, odml_xls_table, odml_csv_table, xls_style from .pageutils import QIWizardPage, clearLayout, shor...
{ "content_hash": "a5e02e0c703dd3a47ff6c8f2ccdd97aa", "timestamp": "", "source": "github", "line_count": 454, "max_line_length": 97, "avg_line_length": 39.48458149779736, "alnum_prop": 0.5386589311614415, "repo_name": "JuliaSprenger/python-odmltables", "id": "8631f4f874a8b1a4fcf274b14a9e142ca9430106",...
from swgpy.object import * def create(kernel): result = Creature() result.template = "object/mobile/shared_warren_technician.iff" result.attribute_template_id = 9 result.stfName("npc_name","warren_technician") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "edc0c86820537e4bdb5d1495bc4a118b", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 63, "avg_line_length": 23, "alnum_prop": 0.6989966555183946, "repo_name": "obi-two/Rebelion", "id": "39637ad59f769eb49cccfbec20b25a5a5e8c25f3", "size": "444", "binary": f...
import sys import random from test_base import * class TestLock2(TestBase): def generate(self): self.clear_tag() set_index = 0 way_on_locked = self.ways_on_locked # random.randint(0,7) tag_on_locked = way_on_locked # set a specific tag will not be accessed later # lock way "way_on_locked" of ...
{ "content_hash": "7c40ef433cfb6e0599f0cf20f76d994a", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 81, "avg_line_length": 28.425925925925927, "alnum_prop": 0.5537459283387622, "repo_name": "litex-hub/pythondata-cpu-blackparrot", "id": "49a90803b6d1bc1121ea0a1ec3b786989ab1b...
import copy import unittest from graph.graphIO import loadgraphs, writeDOT from isomorphism.ColorRefinementChecker import ColorRefinementChecker from isomorphism.IndividualizationRefinementChecker import IndividualizationRefinementChecker from isomorphism.FastPartitionRefinement import FastPartitionRefinementChecker ...
{ "content_hash": "c1a45d2cd2e31831e4787f4a63cbe5d4", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 93, "avg_line_length": 32.752941176470586, "alnum_prop": 0.7076149425287356, "repo_name": "mooshbeef/Isomurphy", "id": "8393c69e8ca3e871290662c21af46374f3547506", "size": "...
import io import unittest from contextlib import redirect_stdout from unittest import mock from parameterized import parameterized from airflow.cli import cli_parser from airflow.cli.commands import connection_command from airflow.models import Connection from airflow.utils.db import merge_conn from airflow.utils.ses...
{ "content_hash": "c4374952347c22777463e6ea8c980d72", "timestamp": "", "source": "github", "line_count": 306, "max_line_length": 110, "avg_line_length": 37.22222222222222, "alnum_prop": 0.507550482879719, "repo_name": "wooga/airflow", "id": "75df6bd825e7f1eaa841eec2c4f90bfc54d39352", "size": "12176"...
""" Data classes and parser implementations for *incremental* chart parsers, which use dynamic programming to efficiently parse a text. A "chart parser" derives parse trees for a text by iteratively adding \"edges\" to a \"chart\". Each "edge" represents a hypothesis about the tree structure for a subsequence of the t...
{ "content_hash": "f2a4b5ebe35b9f7fd0acf29d5323a154", "timestamp": "", "source": "github", "line_count": 441, "max_line_length": 112, "avg_line_length": 41.59863945578231, "alnum_prop": 0.5784137367130008, "repo_name": "cortext/crawtextV2", "id": "688f8aa17e77f5817953892fdff0b61fdd602107", "size": "...
from django.shortcuts import render import requests, json # from django.contrib.auth.decorators import login_required # from django.contrib.auth.models import User # from django.contrib.auth import authenticate, login # from django.http import HttpResponseRedirect, Http404, HttpResponse # from django.core import seria...
{ "content_hash": "6adfd511f7b0783dffe3de2b745c913d", "timestamp": "", "source": "github", "line_count": 242, "max_line_length": 180, "avg_line_length": 36.85123966942149, "alnum_prop": 0.5801749271137027, "repo_name": "sdzharkov/Trip-Split", "id": "d1af1558534f97ac54a5f38a00dec1064ddff336", "size":...
import logging from sn_agent.job.job_descriptor import JobDescriptor from sn_agent.service_adapter import ServiceAdapterABC logger = logging.getLogger(__name__) class FaceRecognizer(ServiceAdapterABC): type_name = "FaceRecognizer" def perform(self, job: JobDescriptor): item_count = 0 for jo...
{ "content_hash": "0bef676ef3a40181f4ab2fa12f5177bd", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 54, "avg_line_length": 29.94736842105263, "alnum_prop": 0.616871704745167, "repo_name": "inflector/singnet", "id": "65e402b00a6c1def3de81c55fed97c98f21af4c6", "size": "740"...
"""Completion evaluation code for JavaScript""" import logging import types import re from pprint import pformat from itertools import chain from codeintel2.common import * from codeintel2.util import indent from codeintel2.tree import TreeEvaluator class CandidatesForTreeEvaluator(TreeEvaluator): # Note: the "...
{ "content_hash": "12e010811a3b5e2b3325d0cfcabf7c14", "timestamp": "", "source": "github", "line_count": 967, "max_line_length": 98, "avg_line_length": 44.20062047569804, "alnum_prop": 0.4935426512563755, "repo_name": "dostavro/dotfiles", "id": "ecdd13a01b239f4cc278c2720533e871179528c1", "size": "44...
import os import time import abc import logging import asyncio import argparse import signal import json import yaml try: from yaml.cyaml import CSafeLoader as YamlLoader except ImportError: from yaml import SafeLoader as YamlLoader from .proto import Client from .packets import Reserved, Ok from .exceptions ...
{ "content_hash": "ed6ab7978dbc5ee52d2c9fbc8c89fdd9", "timestamp": "", "source": "github", "line_count": 319, "max_line_length": 78, "avg_line_length": 35.60501567398119, "alnum_prop": 0.5597816516992429, "repo_name": "tailhook/aio-beanstalk", "id": "636321d696f7bc934d3147b01f3db0cab404ecdd", "size"...
"""Tests of (American) English number names.""" from pynini.examples import numbers from absl.testing import absltest class EnNumbersTest(absltest.TestCase): def test_rewrites(self): pairs = [ (324, "three hundred twenty four"), (314, "three hundred fourteen"), # Forcing newline. (30...
{ "content_hash": "0d87d12a26cabfe7dfdbd3b3a3274cec", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 67, "avg_line_length": 26.76923076923077, "alnum_prop": 0.6379310344827587, "repo_name": "kylebgorman/pynini", "id": "6220875caa92a5d15e0282c10ed42c4554917c7b", "size": "13...
import errno import json import logging import mimetypes import operator import os import parquet import posixpath import re import shutil import stat as stat_module from datetime import datetime from django.contrib import messages from django.contrib.auth.models import User, Group from django.core import urlresolver...
{ "content_hash": "7ba5d1bdf6b5da9bcf8eb5ed25c4031a", "timestamp": "", "source": "github", "line_count": 1329, "max_line_length": 249, "avg_line_length": 37.92325056433408, "alnum_prop": 0.6159722222222223, "repo_name": "mapr/hue", "id": "cbfa2c4649b53f811c0a6d6eec243d3755fc50e5", "size": "51192", ...
import cv2 import numpy as np import config import feature from multiprocessing.pool import ThreadPool from timeit import default_timer as timer # Load datasets s_data = np.load('atlas_sw.npz') s_im = s_data['images'] s_label = s_data['labels'] pw_data = np.load('atlas_pw.npz') pw_im = pw_data['images'] pw_label = pw_...
{ "content_hash": "324b7caf3360c4f9fa009cf22bf7a692", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 57, "avg_line_length": 23.830188679245282, "alnum_prop": 0.7022961203483769, "repo_name": "DeveloperJose/Vision-Rat-Brain", "id": "96dcfd23d70caabe9bc76daaa5064b3605ce4934", ...
import os import datetime os.chdir("cache") os.system("ln buildings_adjusted_for_jobs.csv buildings.csv") os.system("ln parcels_geography.csv parcels.csv") today = datetime.datetime.today().strftime('%Y-%m-%d') fname = today + "_basis_microdata.zip" os.system("zip %s buildings.csv buildings_geometry.csv households.csv...
{ "content_hash": "4557b2fc7ab577bca951d1a10a4a4bc5", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 71, "avg_line_length": 36.5, "alnum_prop": 0.726027397260274, "repo_name": "oaklandanalytics/cutting_board", "id": "5dbf8762855e366c11aa4dda3d7f328c6046e65f", "size": "365"...
import re import requests import json from datetime import datetime from sh import tail ''' POST data should be of the form: { ## REQUIRED ## 'time' : <given as epoch> 'remote_ip' : 'host_ip' : 'service': <ssh, telnet, http, ...> 'type': <vector of attack, i.e. user/pass, reversemapping, etc...> 'lo...
{ "content_hash": "531593db7470a17c1cb191a56666dd9b", "timestamp": "", "source": "github", "line_count": 167, "max_line_length": 182, "avg_line_length": 33.053892215568865, "alnum_prop": 0.6704710144927536, "repo_name": "andy-keene/events-visualization", "id": "aaa07a31889021c3026dfe14b7ded47489ef910f...
__all__ = ('autoclass', 'ensureclass') from jnius import ( JavaClass, MetaJavaClass, JavaMethod, JavaStaticMethod, JavaField, JavaStaticField, JavaMultipleMethod, find_javaclass ) class Class(JavaClass): __metaclass__ = MetaJavaClass __javaclass__ = 'java/lang/Class' desiredAssertionStatus = Jav...
{ "content_hash": "ab20d8ffedc5d962a50f05ef2a43f71e", "timestamp": "", "source": "github", "line_count": 221, "max_line_length": 102, "avg_line_length": 37.26696832579186, "alnum_prop": 0.631617289946576, "repo_name": "Weicong-Lin/pymo-global", "id": "2c86df95a8d6ce1e63759509604da14049976c11", "size...
from django.conf import settings from django.core.cache import cache from django.utils.cache import patch_response_headers, add_never_cache_headers, get_max_age from django.utils.decorators import method_decorator from django.utils.functional import wraps from django_cache_middleware.decorators.utils import _com...
{ "content_hash": "c15dbe8c864f0d9131de23fad687cf20", "timestamp": "", "source": "github", "line_count": 249, "max_line_length": 92, "avg_line_length": 35.377510040160644, "alnum_prop": 0.6160744692927688, "repo_name": "raymondbutcher/django-cache-middleware", "id": "aebdb695ad0a9027a8ad5a737aebaf0251...
"""Metric types.""" import copy import functools import inspect from typing import Any, Callable, Dict, Iterable, Iterator, List, MutableMapping, NamedTuple, Optional, Type, Union import apache_beam as beam from tensorflow_model_analysis import constants from tensorflow_model_analysis import types from tensorflow_mod...
{ "content_hash": "f663fa842324977c2e8703e02b339cb4", "timestamp": "", "source": "github", "line_count": 1051, "max_line_length": 115, "avg_line_length": 41.16841103710752, "alnum_prop": 0.6919432374965332, "repo_name": "tensorflow/model-analysis", "id": "6c5256363c3dbb6a4eaed80228ebade78c6c3f17", "...
__author__ = "Sharath Maddineni" __email__ = "smaddineni@cct.lsu.edu" __copyright__ = "Copyright 2011, Sharath Maddineni" __license__ = "MIT" import sys sys.path.insert(0,"..") import optparse parser = optparse.OptionParser() import dare.core from dare.helpers.cfgparser import CfgParser if __name__ == "__m...
{ "content_hash": "e7cc7a1a31a574f8cd0d0a382db664af", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 90, "avg_line_length": 23.258064516129032, "alnum_prop": 0.6324549237170597, "repo_name": "msharath/DARE", "id": "563b4d2d2db35d3ad31f5f1f43d8f5dfd6e92846", "size": "743", ...
from collections import Counter import copy import numpy as np import pandas as pd from scipy.stats import mode as scipy_mode from scipy.spatial.distance import cdist import subprocess import sys from pca import Pca import matplotlib.pyplot as plt class KMeans: def __init__(self, k, train_X, train_y, pca_obj, ...
{ "content_hash": "829a9f5dc55f1f66b1cf75e0f3c002ea", "timestamp": "", "source": "github", "line_count": 428, "max_line_length": 90, "avg_line_length": 36.4088785046729, "alnum_prop": 0.5748572161971379, "repo_name": "JanetMatsen/Machine_Learning_CSE_546", "id": "5d0763d49b64124780e1dc2bf5b96a7362b7f3...
import random import json import time import numpy import rospy import cPickle import math import curses from geometry_msgs.msg import PointStamped from geometry_msgs.msg import Point from geometry_msgs.msg import Twist from geometry_msgs.msg import TwistStamped from deep_learning_crazyflie.srv import * ###########...
{ "content_hash": "1b420a118749528cad736618fa84efbf", "timestamp": "", "source": "github", "line_count": 392, "max_line_length": 309, "avg_line_length": 28.81377551020408, "alnum_prop": 0.6820717131474103, "repo_name": "lkumar93/Deep_Learning_Crazyflie", "id": "cd74ec87f5bc6ed28384bd096a347744086e4952...
import sys import os from django_dbdev import __version__ # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # sys.path.insert(0, ...
{ "content_hash": "f072087d8fda5d1f49011cc6c25ba1bf", "timestamp": "", "source": "github", "line_count": 263, "max_line_length": 83, "avg_line_length": 31.79087452471483, "alnum_prop": 0.7043415859346968, "repo_name": "espenak/django_dbdev", "id": "cd90086e3ef4ce7fae95c13543aa4dc985eb5f3c", "size": ...
from django.conf.urls import url from . import views app_name = 'browse' urlpatterns = [ url(r'^$', views.browseIndex, name='browseIndex'), url(r'^all/$', views.browseAll, name='all'), url(r'^(?P<categoryID>[0-9]+)/$', views.browseCategory, name='browseCategory'), url(r'^(?P<categoryID>[0-9]+)/all/$', ...
{ "content_hash": "f51825a431f61ea8321f3ff70ec762b9", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 92, "avg_line_length": 37.3, "alnum_prop": 0.6595174262734584, "repo_name": "PNNutkung/Coursing-Field", "id": "8d1447356ed565bf7430119d399a451e4996f299", "size": "373", "...
""" Important classes of Spark SQL and DataFrames: - :class:`pyspark.sql.SparkSession` Main entry point for :class:`DataFrame` and SQL functionality. - :class:`pyspark.sql.DataFrame` A distributed collection of data grouped into named columns. - :class:`pyspark.sql.Column` A column expres...
{ "content_hash": "e407c35aeee5bb5feb4c8e025a495bef", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 89, "avg_line_length": 39.977777777777774, "alnum_prop": 0.736520289049472, "repo_name": "caneGuy/spark", "id": "ba4c4feec75c88b0338832b7f18a26d36d26cc73", "size": "2584", ...
import os import re import sys from setuptools import setup def get_version(package): """ Return package version as listed in `__version__` in `init.py`. """ init_py = open(os.path.join(package, '__init__.py')).read() return re.search("__version__ = ['\"]([^'\"]+)['\"]", init_py).group(1) def g...
{ "content_hash": "3bbc6991b3f1de37ba8c83b6b9235a86", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 75, "avg_line_length": 28.554347826086957, "alnum_prop": 0.5964979063570612, "repo_name": "tomchristie/apistar", "id": "9dbff0d742c8dcdee3a37fed4ee583d2c245c1ba", "size": "...
from callsheet.models import * from django.forms import ModelForm class ContactForm(ModelForm): class Meta: model = Contact exclude = ('callsheet',) class CallsheetForm(ModelForm): class Meta: model = Callsheet exclude = ('project', 'owner',)
{ "content_hash": "63e64b5b8f693ea7f29cebc89f1f504e", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 34, "avg_line_length": 19.692307692307693, "alnum_prop": 0.7265625, "repo_name": "tjsavage/tmrwmedia", "id": "0ac3d44fe3f4fd0f2368af75df1c734682f766b3", "size": "256", "b...
from __future__ import absolute_import import sys import argparse import os import logging import time import shutil import yaml from mzos import ressources from mzos.peaklist_reader import PeakListReader from mzos.annotator import PeakelsAnnotator from mzos.database_finder import DatabaseSearch from mzos.stats impo...
{ "content_hash": "92170a7e2a9995aa60f898589604e094", "timestamp": "", "source": "github", "line_count": 182, "max_line_length": 106, "avg_line_length": 29.296703296703296, "alnum_prop": 0.6286571642910728, "repo_name": "jerkos/mzOS", "id": "8c0ab5fd074575839334262f15c452a92fdf2966", "size": "5332",...
from logging import getLogger from django.contrib.auth import authenticate as auth, login, get_backends from django.http import Http404 from django.shortcuts import redirect from django_social_user import options from django_social_user.exceptions import (DoNotAuthenticate, SocialOauthDictFailed, MissingRequiredS...
{ "content_hash": "9d93d22ce3eca9abb96db24ffdbfe991", "timestamp": "", "source": "github", "line_count": 126, "max_line_length": 79, "avg_line_length": 36.12698412698413, "alnum_prop": 0.6513620386643234, "repo_name": "mattsnider/django-social-user", "id": "0ec5bdaee11e11dc4a225c432be11ce06e0cb21b", ...
""" Python fundamentals, part 1, for Data Bootcamp course. Repository of materials (including this file): * https://github.com/DaveBackus/Data_Bootcamp/ * https://github.com/DaveBackus/Data_Bootcamp/Code/Python Written by Dave Backus, August 2015 Created with Python 3.4 """ """ Check versions """ import sys ...
{ "content_hash": "85f9a26f9118a0da255140e100d245c8", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 65, "avg_line_length": 17.170212765957448, "alnum_prop": 0.6009913258983891, "repo_name": "ky822/Data_Bootcamp", "id": "eba1de8b31bbeac2a9d6e066a35073db8470dd78", "size": "...
from __future__ import absolute_import from .main import blueprint
{ "content_hash": "d86926c8f0228998f88ee2dd8977b349", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 38, "avg_line_length": 22.666666666666668, "alnum_prop": 0.7794117647058824, "repo_name": "SquirrelMajik/GRec", "id": "57c56e7c79b1be000f0d114c505c11f6a8ef5c8f", "size": "83...
try: from cStringIO import StringIO except ImportError: from io import StringIO __author__ = "Grant Hulegaard" __copyright__ = "Copyright (C) Nginx, Inc. All rights reserved." __license__ = "" __maintainer__ = "Grant Hulegaard" __email__ = "grant.hulegaard@nginx.com" class StringFile(object): """ Ex...
{ "content_hash": "8c8d60ea4e3d94730e0ca16134dbbc16", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 79, "avg_line_length": 27.98, "alnum_prop": 0.6075768406004288, "repo_name": "nginxinc/nginx-amplify-agent", "id": "48239cd57b1a01a5ef746762265a8a301ff94e06", "size": "282...
from django.urls import path, include from extrequests import views urlpatterns = [ # training requests path('training_requests/', views.all_trainingrequests, name='all_trainingrequests'), path('training_requests/merge', views.trainingrequests_merge, name='trainingrequests_merge'), path('training_req...
{ "content_hash": "e1be65bb3c077b6900f94f030e1e63c8", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 170, "avg_line_length": 69.42857142857143, "alnum_prop": 0.7222222222222222, "repo_name": "swcarpentry/amy", "id": "b497d9db31906b8a646caf86f53ce5424f9d0d43", "size": "3402...
''' Combine tables of recent publications with SNR catalogues. Paths only working for travelling drive ''' from astropy.table import Table, Column from astropy.table import join as join_tab import astropy.units as u from astropy.coordinates import SkyCoord mmt_overview = Table.read("/Volumes/Travel_Data/M33_2/MMT_S...
{ "content_hash": "4a2f5951aa4e028754d51198d4f55e8e", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 105, "avg_line_length": 40.714285714285715, "alnum_prop": 0.6636591478696742, "repo_name": "e-koch/VLA_Lband", "id": "9d5958ec82494e7406ecbdc9164f3b5b524532e4", "size": "19...
__all__ = ["pista","auto","obstaculo","fondo","ventana","poligono","menu"]
{ "content_hash": "b202639a09e6f91996af5e280439ffb8", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 74, "avg_line_length": 74, "alnum_prop": 0.6081081081081081, "repo_name": "bsubercaseaux/dcc", "id": "ed37a99b93c8dae5c78bb0fcacc8a0dd872e800f", "size": "74", "binary": fa...
import time import select import syslog import logging import platform import datetime from systemd import journal import bucky3.module as module import bucky3.tracing as tracing import json class SystemdJournal(module.MetricsSrcProcess, tracing.Tracer): event_map = { 'MESSAGE': 'message', '_EXE':...
{ "content_hash": "a696cf2c7afba753346fafbdf3995ce2", "timestamp": "", "source": "github", "line_count": 196, "max_line_length": 126, "avg_line_length": 39.78061224489796, "alnum_prop": 0.5767602924201616, "repo_name": "jsiembida/bucky3", "id": "52f504b1b85fee395009550366eaab28dd5a92a8", "size": "77...
"""BIG-bench api plumbing for a task modeled after the NYT Spelling Bee game.""" from typing import Dict, List, Optional import bigbench.api.model as model import bigbench.api.task as task import json import numpy as np import os from bigbench.benchmark_tasks.spelling_bee.spelling_bee_game import SpellingBeeGame c...
{ "content_hash": "0c2c598009ddae352cb6dd27f6478a49", "timestamp": "", "source": "github", "line_count": 143, "max_line_length": 86, "avg_line_length": 33.09090909090909, "alnum_prop": 0.569949281487743, "repo_name": "google/BIG-bench", "id": "dff9a11e3a77afcd35d058c6cfff506d97ef2b4d", "size": "5415...
from swgpy.object import * def create(kernel): result = Weapon() result.template = "object/weapon/melee/2h_sword/crafted_saber/shared_sword_lightsaber_two_handed_s10_gen2.iff" result.attribute_template_id = 10 result.stfName("weapon_name","sword_lightsaber_2h_type10") #### BEGIN MODIFICATIONS #### #### EN...
{ "content_hash": "791e2bb4d811a2bdeb2745c25fd2bf6b", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 111, "avg_line_length": 27.53846153846154, "alnum_prop": 0.7178770949720671, "repo_name": "anhstudios/swganh", "id": "0363bdff43b9852df71dab75bf330d6fc0dad1ac", "size": "50...
"""Support for Verisure cameras.""" from __future__ import annotations import errno import os from verisure import Error as VerisureError from homeassistant.components.camera import Camera from homeassistant.config_entries import ConfigEntry from homeassistant.const import EVENT_HOMEASSISTANT_STOP from homeassistant...
{ "content_hash": "25ea2cd853688bc1145e1e04c59de68e", "timestamp": "", "source": "github", "line_count": 149, "max_line_length": 84, "avg_line_length": 34.1744966442953, "alnum_prop": 0.6276512175962293, "repo_name": "GenericStudent/home-assistant", "id": "787e496202f6c850f18a740139baa3129cb529a3", ...
from conans import ConanFile, CMake import os channel = os.getenv("CONAN_CHANNEL", "testing") username = os.getenv("CONAN_USERNAME", "balashovartem") class CutlTest(ConanFile): settings = "os", "compiler", "arch", "build_type" generators = "cmake" requires = "libcutl/1.10.0@%s/%s" % (username, channel) ...
{ "content_hash": "23ce22836f8d87563b90ccd969710c9e", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 82, "avg_line_length": 34.529411764705884, "alnum_prop": 0.6439522998296422, "repo_name": "balashovartem/conan-libcutl", "id": "335c1bc97d7f5911a7b605bd91919c18ccb9fd08", "...
"""Create vpp_accounts table Revision ID: f029ac1af3f0 Revises: 8c866896f76e Create Date: 2017-07-19 13:02:13.563903 """ from alembic import op import sqlalchemy as sa import commandment.dbtypes from alembic import context # revision identifiers, used by Alembic. revision = 'f029ac1af3f0' down_revision = '8c866896...
{ "content_hash": "03bc9f6111b7f98507b52b1ca52cbc71", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 75, "avg_line_length": 24.8135593220339, "alnum_prop": 0.6871584699453552, "repo_name": "jessepeterson/commandment", "id": "259c23ea5d8df5a39a348051a43dd83f5ce425b5", "size...
"""This contains a set of tests for paratemp.sim_setup.sim_setup""" ######################################################################## # # # This script was written by Thomas Heavey in 2018. # # theavey@bu.edu thom...
{ "content_hash": "55c9f428b11afb7e557c47a275492acc", "timestamp": "", "source": "github", "line_count": 319, "max_line_length": 80, "avg_line_length": 40.13166144200627, "alnum_prop": 0.5515544446180284, "repo_name": "theavey/ParaTemp", "id": "8718e811ea9fe30d2c63aa9ee982d636661d4a52", "size": "128...
"""Register backend ops in mxnet.ndarray namespace""" import os as _os import ctypes import numpy as _np # pylint: disable=unused-import from ._internal import NDArrayBase, _imperative_invoke # pylint: disable=unused-import from ..ndarray_doc import _build_doc from ..base import mx_uint, check_call, _LIB, py_str, _i...
{ "content_hash": "d3d62725261821fb062df5cca07a5463", "timestamp": "", "source": "github", "line_count": 271, "max_line_length": 137, "avg_line_length": 43.656826568265686, "alnum_prop": 0.559039810666892, "repo_name": "sxjscience/mxnet", "id": "9f50ba97efee6e5c56893c07a6d0731a8c939c73", "size": "12...
"""Contains the logic for `aq publish`.""" from tempfile import NamedTemporaryFile from base64 import b64decode from aquilon.worker.broker import BrokerCommand from aquilon.exceptions_ import ProcessException, ArgumentError from aquilon.aqdb.model import Sandbox from aquilon.worker.dbwrappers.branch import force_my_s...
{ "content_hash": "cf95decec23fc369c40cace78e354c87", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 83, "avg_line_length": 40.522222222222226, "alnum_prop": 0.5908966273649575, "repo_name": "guillaume-philippon/aquilon", "id": "1c1096cc70d65aac4409a298ede3c7e784c01a1c", "...
from werkzeug.urls import Href from openid.consumer.consumer import Consumer from openid.consumer.discover import DiscoveryFailure from openid.sreg import SRegRequest def do(do, cur, request): if len(do) != 4: return ("Exactly four parameters are needed.", 400) sid = do[2] oid = do[3] cur.execute("SELECT * FROM ...
{ "content_hash": "e9d830d6e76ea7b066203810f4afcd5a", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 133, "avg_line_length": 34.27906976744186, "alnum_prop": 0.6770691994572592, "repo_name": "YtvwlD/dyluna", "id": "87bb25e2477a8018693c60b8dcf811b22cab5ff3", "size": "1474",...
from __future__ import absolute_import from __future__ import unicode_literals import mock import unittest import google.auth import datalab.context import datalab.storage import datalab.utils class TestCases(unittest.TestCase): @mock.patch('datalab.storage._api.Api.objects_list') @mock.patch('datalab.storage._...
{ "content_hash": "24ec1a3f058514febd4bfe61c7e81aaf", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 86, "avg_line_length": 29.243243243243242, "alnum_prop": 0.681762168823167, "repo_name": "yebrahim/pydatalab", "id": "81337838ff11244d58c127404282033782a506ca", "size": "3...
import os import sys sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) import bndl_elastic.__version__ import sphinx_rtd_theme # -- General configuration ------------------------------------------------ extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.autosummary', 'sphinx.ext.todo', '...
{ "content_hash": "bd9f7114728e90af68ed2496620540e3", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 75, "avg_line_length": 24.57777777777778, "alnum_prop": 0.6320072332730561, "repo_name": "bndl/elastic", "id": "a41a8903553b5145197a45f33c8ff58dffdecb72", "size": "1699", ...
from __future__ import absolute_import import ratelim import requests from geocoder.base import Base class Google(Base): """ Google Geocoding API ==================== Geocoding is the process of converting addresses into geographic coordinates (like latitude 37.423021 and longitude -122.083739), ...
{ "content_hash": "e1937d894b8496ae30368329408e15fa", "timestamp": "", "source": "github", "line_count": 173, "max_line_length": 89, "avg_line_length": 27.36416184971098, "alnum_prop": 0.5857625686523025, "repo_name": "ahlusar1989/geocoder", "id": "afd35c54cade7ca31d70e35639ba6e32cc87850f", "size": ...
import socket import time HOST = '' PORT = 50007 FILE = "text.txt" SERVING_SIZE = 50 DELAY = 5 def get_file(file_to_get): return open(file_to_get, mode='r', encoding='utf-8') def configure_socket(): sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUS...
{ "content_hash": "c273154aebef351e4de94909f789c58b", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 94, "avg_line_length": 28.59259259259259, "alnum_prop": 0.5965025906735751, "repo_name": "mayk93/TwistedIntroduction", "id": "dbe4c5d6832dc581d09f49932772ccde7466a72a", "si...
import abc import random from oslo_config import cfg from oslo_db import exception as db_exc from oslo_log import log as logging import six from sqlalchemy import sql from neutron.common import constants from neutron.common import utils from neutron.db import l3_agentschedulers_db from neutron.db import l3_db from ne...
{ "content_hash": "d0e8e5ae384b87bca2f1ec7e10147656", "timestamp": "", "source": "github", "line_count": 371, "max_line_length": 79, "avg_line_length": 43.0377358490566, "alnum_prop": 0.578756184630801, "repo_name": "neoareslinux/neutron", "id": "e41a34968d77e024ae161044b81b5f9546ede193", "size": "1...
from flask import Flask, session, redirect, url_for, escape, request, render_template app = Flask(__name__) app.config['DEBUG'] = True app.secret_key = 'A0Zr98j/3yX R~XHH!jmN]LWX/,?RT' @app.route('/') def home(): if 'username' in session: return render_template('resume.html') return render_template('si...
{ "content_hash": "449863730e824fd3e4ba53c0d9a074ec", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 85, "avg_line_length": 28.977777777777778, "alnum_prop": 0.647239263803681, "repo_name": "mmaguero/MII-SSBW16-17", "id": "cdd2ef440ea5201a4fa742600bbf06dc8b9e44a8", "size":...
from warnings import warn import types from . import access def context(f): f.contextified = True return f class WheelHandlerMixin(object): def hasaccess(self): """ hasaccess is obsolete and should be replaced with a more fine grained permission access. For backward compatibility, ...
{ "content_hash": "7a7056b1082b34d880009314c6b228c7", "timestamp": "", "source": "github", "line_count": 202, "max_line_length": 98, "avg_line_length": 31.252475247524753, "alnum_prop": 0.5889434500237605, "repo_name": "wheelcms/wheelcms_axle", "id": "023e9bc777f80a950ab69be58cda3df340d007c5", "size...
""" Synopsis ======== SQLAlchemy object-relational configuration involves the combination of :class:`.Table`, :func:`.mapper`, and class objects to define a mapped class. :mod:`~sqlalchemy.ext.declarative` allows all three to be expressed at once within the class declaration. As much as possible, regular SQLAlchemy sc...
{ "content_hash": "c5de9b0351556095fc4f7213c1ff1242", "timestamp": "", "source": "github", "line_count": 1353, "max_line_length": 106, "avg_line_length": 37.38211382113821, "alnum_prop": 0.6198149393016726, "repo_name": "dbbhattacharya/kitsune", "id": "6d4bdda437646992e0e42765442a6a2512e8c754", "siz...
from django.shortcuts import render_to_response # Create your views here. def login_url(request): return render_to_response('index.html')
{ "content_hash": "79bb49c683472db02fceb0bded8b5aa7", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 47, "avg_line_length": 20.571428571428573, "alnum_prop": 0.7569444444444444, "repo_name": "JakeLowey/HackRPIF14", "id": "b43bd282fbcba8ee12e97fc531d0655cf7b292bd", "size": "...
import mock from oslo_utils import importutils from ironic.common import exception from ironic.common import states from ironic.conductor import task_manager from ironic.drivers.modules.oneview import common from ironic.tests.unit.conductor import mgr_utils from ironic.tests.unit.db import base as db_base from ironic....
{ "content_hash": "d02504b06afc077a69429a403a83c355", "timestamp": "", "source": "github", "line_count": 269, "max_line_length": 78, "avg_line_length": 41.386617100371744, "alnum_prop": 0.5919338902362347, "repo_name": "SauloAislan/ironic", "id": "13ee45f06b8f8312ca074eadb8f01a91659d2bc6", "size": "...
from django import VERSION as djangoVersion if djangoVersion[:2] >= (1, 8): from django.db.backends.base.client import BaseDatabaseClient else: from django.db.backends import BaseDatabaseClient from django.conf import settings import os class DatabaseClient(BaseDatabaseClient): executable_name = 'dbisqlc'...
{ "content_hash": "e23d02c5d96d61423277e31fe9d0bae9", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 66, "avg_line_length": 33.69444444444444, "alnum_prop": 0.6026380873866447, "repo_name": "sqlanywhere/sqlany-django", "id": "916d2c4e94da00f1f3ac86c704473898b753a4a3", "siz...
from neutron.common import rpc as n_rpc from neutron.openstack.common import log as logging from neutron.services.vpn.common import topics from neutron.services.vpn import service_drivers from neutron.services.vpn.service_drivers import cisco_csr_db as csr_id_map from neutron.services.vpn.service_drivers import cisco_v...
{ "content_hash": "a87dfbb3db1f5bb7b007d925d7f2fe6d", "timestamp": "", "source": "github", "line_count": 149, "max_line_length": 79, "avg_line_length": 39.63758389261745, "alnum_prop": 0.6435827971554352, "repo_name": "virtualopensystems/neutron", "id": "2f7ba9f6c631b2501a9f9940eca248050349325f", "s...
try: from setuptools import setup except ImportError: from distutils.core import setup requirements = [ "sklearn", "scipy", "numpy", "matplotlib" ] test_requirements = [] setup( name='semisup_learn', version='0.0.1', description="Semisupervised Learning Framework", url='https:...
{ "content_hash": "d3718275e2d87a56676ad57d696421e0", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 52, "avg_line_length": 19.48148148148148, "alnum_prop": 0.6482889733840305, "repo_name": "tmadl/semisup-learn", "id": "70f56894977d645f5557ae46cb8e2b28d83c0382", "size": "5...
from Framework.Pedido import Pedido from Framework.ErroNoHTTP import ErroNoHTTP class PedidoCadastrar(Pedido): def __init__(self,variaveis_do_ambiente): super(PedidoCadastrar, self).__init__(variaveis_do_ambiente) try: self.id = self.corpo['id'] self.id_disciplina = self.corpo['id_disciplina'] self.id_u...
{ "content_hash": "74d5948e7e8e209f5f84f68780b5ca9d", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 62, "avg_line_length": 25.47826086956522, "alnum_prop": 0.7252559726962458, "repo_name": "AEDA-Solutions/matweb", "id": "6d07f9039938e67d5395730fcca3cfeb1b5ed7a0", "size": ...
import random from snake import * # Barva glave in repa COLOR_HEAD = '#009900' COLOR_TAIL = '#007A29' class SeaSnake(Snake): def __init__(self, field, x, y, dx, dy): # Poklicemo konstruktor nadrazreda Snake.__init__(self, field = field, color_head = COLOR_HEAD, ...
{ "content_hash": "1dba8363daf1425ecf94a4dcf94fadc3", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 97, "avg_line_length": 36.214285714285715, "alnum_prop": 0.5529257067718606, "repo_name": "andrejbauer/snakes", "id": "2e3e6bdc91a69484919e7051ddbc156be8eae857", "size": "1...
import copy import mock import sys import jsonpatch import pytest from ray.autoscaler.batching_node_provider import NodeData from ray.autoscaler._private.kuberay.node_provider import ( _worker_group_index, _worker_group_max_replicas, _worker_group_replicas, KuberayNodeProvider, ScaleRequest, ) fro...
{ "content_hash": "017c85cb60c6d23846f8b4861f7a4f15", "timestamp": "", "source": "github", "line_count": 315, "max_line_length": 88, "avg_line_length": 40.16825396825397, "alnum_prop": 0.5985141863589662, "repo_name": "ray-project/ray", "id": "d9f16c546cc2ef64ea7c9888219c318fd4cfe9b7", "size": "1265...