text
stringlengths
4
1.02M
meta
dict
class Oveja: def __init__(self, nombre, tipo): self.nombre = nombre self.tipo = tipo def set_nombre(self, nombre): self.nombre def get_nombre(self): return self.nombre def set_tipo(self, tipo): self.tipo def get_tipo(self): return self.tipo
{ "content_hash": "f31d7af52b0c45bd04f05784660feaba", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 37, "avg_line_length": 19.5, "alnum_prop": 0.5673076923076923, "repo_name": "AnhellO/DAS_Sistemas", "id": "06e2e9b42f011b346b2605f1903d09f397bbf6e9", "size": "312", "bina...
""" Fetch two subtrees in parallel ++++++++++++++++++++++++++++++ Send a series of SNMP GETNEXT requests with the following options: * with SNMPv1, community 'public' * over IPv4/UDP * to an Agent at 195.218.195.228:161 * for two OIDs in tuple form * stop on end-of-mib condition for both OIDs This script performs si...
{ "content_hash": "b4cc1e6385c4220cdeed878af7001ee8", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 78, "avg_line_length": 28.228915662650603, "alnum_prop": 0.6816047801963295, "repo_name": "filippog/pysnmp", "id": "0a41a416c65da4ba5e75ca9798e6ad9cedb47bb0", "size": "2343...
def app(environ, start_response): status = '200 OK' headers = [('Content-Type', 'text/plain')] qstr = environ['QUERY_STRING'] body = qstr.replace('&', '\n') start_response(status, headers) return body
{ "content_hash": "703e1901fd00d5b70322d239d772dae3", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 44, "avg_line_length": 30.428571428571427, "alnum_prop": 0.647887323943662, "repo_name": "k1r8r0wn/nginx_py", "id": "44a7831a212f869264480df76e3c239076bd144e", "size": "213"...
""" NetCollector client.""" # pylint: disable=C0103 import argparse import getpass import net_collector import netspot_settings from spotmax import SpotMAX # Arguments parser = argparse.ArgumentParser(description='NetSPOT Network Collector') parser.add_argument('-a', '--asset', help='Asset', required=False) # User...
{ "content_hash": "176a6bea79b2a36e5914b87147e29eb8", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 96, "avg_line_length": 26, "alnum_prop": 0.6612111292962357, "repo_name": "MaxIV-KitsControls/netspot", "id": "c4d7d401816fc3eee1fc539e39271e17a7b82ff4", "size": "2467", ...
from flask import Flask, request, render_template import json from watsoncloud import downloader from watsoncloud import transcribe from watsoncloud import compilator import pafy from search import audioJSON, videoJSON from clarifai_v1 import fetch_video_tags from flask_cors import CORS, cross_origin app = Flask(__na...
{ "content_hash": "faf20f512b0bb74d7d9d71a8597e7797", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 100, "avg_line_length": 35.55714285714286, "alnum_prop": 0.6882282040980313, "repo_name": "audip/youtubeseek", "id": "acc242348cb3bab72cf460c2de0c80424442dc52", "size": "24...
import warnings from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union from google.api_core import gapic_v1 from google.api_core import grpc_helpers_async from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore ...
{ "content_hash": "40e505b3b5ad21cc45df5e1ec9f1fbfc", "timestamp": "", "source": "github", "line_count": 511, "max_line_length": 106, "avg_line_length": 45.06262230919765, "alnum_prop": 0.6290007382637773, "repo_name": "googleapis/python-monitoring", "id": "3d7fda0e8e5f56e137221b3996987aed3ce96666", ...
import os import httplib2 from apiclient.discovery import build from oauth2client.file import Storage from datetime import datetime from jobs import AbstractJob class Calendar(AbstractJob): def __init__(self, conf): self.interval = conf['interval'] self.timeout = conf.get('timeout') def _au...
{ "content_hash": "6dde868c9a26134bf114306370d1730f", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 77, "avg_line_length": 33.2, "alnum_prop": 0.5394912985274432, "repo_name": "martinp/jarvis2", "id": "ef1726965309312c9fe9ed2def3f796d63578f89", "size": "1519", "binary":...
import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, map_error, ) from azure.core.pipeline import Pipeline...
{ "content_hash": "9a4e46525a92c085af0cd22b962eba95", "timestamp": "", "source": "github", "line_count": 2294, "max_line_length": 297, "avg_line_length": 49.266346992153444, "alnum_prop": 0.6628383340559385, "repo_name": "Azure/azure-sdk-for-python", "id": "4887e7617c61ae5e7edf04f2f3085c5719542443", ...
from __future__ import unicode_literals from django.utils.translation import ugettext_lazy as _ from aldryn_apphooks_config.app_base import CMSConfigApp from cms.apphook_pool import apphook_pool from .menu import FaqCategoryMenu from .models import FaqConfig class FaqApp(CMSConfigApp): name = _('FAQ') urls...
{ "content_hash": "fc50a4f7c6f20523e429394753d356a1", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 56, "avg_line_length": 24.263157894736842, "alnum_prop": 0.7396963123644251, "repo_name": "czpython/aldryn-faq", "id": "75ce15c558f1b55abf0e85dcdd02402dc9572d42", "size": "...
import socket from oslo.config import cfg from oslo import messaging from oslo.utils import importutils from ironic.common import config from ironic.common.i18n import _LE from ironic.common.i18n import _LI from ironic.common import rpc from ironic.objects import base as objects_base from ironic.openstack.common impo...
{ "content_hash": "b8886a05ba28e0849b43be34a927eae2", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 79, "avg_line_length": 39.23, "alnum_prop": 0.5347947998980372, "repo_name": "debayanray/ironic_backup", "id": "32c869cebd94f9fcd4baa5997b466b9009910ef6", "size": "4600", ...
"""SelectionContainer class. Represents a multipage container that can be used to group other widgets into pages. """ from .widget_box import Box from .widget import register from .widget_core import CoreWidget from traitlets import Unicode, Dict, CInt, TraitError, validate, observe from .trait_types import TypedTupl...
{ "content_hash": "f4bebcb16cc5fbf88b3528787725353c", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 149, "avg_line_length": 36.958333333333336, "alnum_prop": 0.6681698609545283, "repo_name": "SylvainCorlay/ipywidgets", "id": "73be629b6dfce4bad6ccd4be352eb4e8b40dd78e", "si...
import errno import optparse as op import os import subprocess as sp import sys import time import unicodedata __usage__ = "%prog [OPTIONS] DIRECTORY" if sys.version_info[0] == 3: def enc(text): if isinstance(text, bytes): return text return text.encode() def dec(text): i...
{ "content_hash": "49fa1b04fb4183ee60f708c79a8dce95", "timestamp": "", "source": "github", "line_count": 167, "max_line_length": 74, "avg_line_length": 27.79640718562874, "alnum_prop": 0.5702283498492029, "repo_name": "DaveBackus/Data_Bootcamp", "id": "aa392849acee640c3b1bcc590a8bbb16be5a0d9f", "siz...
import logging from marshmallow import fields, post_load from azure.ai.ml._restclient.v2021_10_01.models import Goal from azure.ai.ml._schema.core.fields import StringTransformedEnum from azure.ai.ml._schema.core.schema import PatchedSchemaMeta from azure.ai.ml._utils.utils import camel_to_snake module_logger = logg...
{ "content_hash": "3ca49dfa4f10006ff1197e20cb105330", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 71, "avg_line_length": 31.28, "alnum_prop": 0.7327365728900256, "repo_name": "Azure/azure-sdk-for-python", "id": "d326bd1f970bbecd9209c8f144d00c5d533a43e0", "size": "1010",...
from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * import decimal class ScriptAddress2Test(BitcoinTestFramework): def __init__(self): super().__init__() self.num_nodes = 3 self.setup_clean_chain = False def setup_network(self): self...
{ "content_hash": "afdf1c61d6635b0b9e7348e889c6787b", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 93, "avg_line_length": 41.824175824175825, "alnum_prop": 0.6237519705727799, "repo_name": "Yearcoin-dev/yearcoin", "id": "ee163cc4ff0924876afd156b3c6aba115db93c1b", "size":...
import nbformat as nbf from glob import glob # Collect a list of all notebooks in the content folder notebooks = glob("*.ipynb") # Text to look for in adding tags text_search_dict = { "# Solution": "hide-cell", # Hide the cell with a button to show } # Search through each notebook and look for the text, add a t...
{ "content_hash": "14dc7dadf6529ad3a8da58211b235b9b", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 76, "avg_line_length": 30.576923076923077, "alnum_prop": 0.6062893081761006, "repo_name": "AllenDowney/ModSimPy", "id": "95067d965c3cc443b6000c1cdb98652ed54d59fc", "size": ...
import unittest from quickbooks import QuickBooks from quickbooks.objects.journalentry import JournalEntry, JournalEntryLine, JournalEntryLineDetail, Entity class JournalentryTests(unittest.TestCase): def test_unicode(self): journalentry = JournalEntry() journalentry.TotalAmt = 1000 self...
{ "content_hash": "6031b71dec6f6f349d6d6dbd29d4eb2d", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 106, "avg_line_length": 33.06, "alnum_prop": 0.7223230490018149, "repo_name": "sidecars/python-quickbooks", "id": "cd1e9d47389bcced92ffcc146ee4f5ff868a54db", "size": "1653"...
from rest_framework.views import APIView from rest_framework.response import Response from rest_framework import status from endpoints.utils.decorators import room_required, pk_required from music.serializers import PlaylistSerializer from music.models import PlaylistTrack class PlaylistView(APIView): """ Pl...
{ "content_hash": "d8d3e9cce8d83ac99067f1c377488495", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 130, "avg_line_length": 36.139240506329116, "alnum_prop": 0.6301225919439579, "repo_name": "Amoki/Amoki-Music", "id": "c44baaf285678c22a0f6d4112cba48c2c07e0dc6", "size": "2...
import pytest import time import random import string from selenium import webdriver @pytest.fixture def driver(request): wd = webdriver.Chrome() request.addfinalizer(wd.quit) return wd def test_registration(driver): driver.get('http://localhost/litecart/') driver.find_element_by_css_selector('d...
{ "content_hash": "e1ac0e1a0e28c7a700b3cfd67d78e3e0", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 126, "avg_line_length": 35.774193548387096, "alnum_prop": 0.6853020739404869, "repo_name": "madm0nkey/selenium-training", "id": "ed74dc8cc9d36e7a35b8fbddb8afa582f2e7fb07", ...
import time from django.test import TestCase import mailjet from .forms import SubscriptionForm class SubscriptionFormTest(TestCase): def list_name_and_label(self): ts = int(time.time()) result = (u'Test%s' % ts, u'test%s' % ts) self.temporary_lists.append(result) return resu...
{ "content_hash": "25005cadf3e12463a1a6f8823c0fbcf1", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 77, "avg_line_length": 32.64912280701754, "alnum_prop": 0.591886082751209, "repo_name": "WoLpH/mailjet", "id": "bab171a281d09e096aeebaeb67fd24c68bcf4be9", "size": "3722", ...
from django.db import DEFAULT_DB_ALIAS from django_atomic_celery import ( _post_enter_atomic_block, _post_exit_atomic_block, ) class DjangoAtomicCeleryTestCaseMixin(object): """Django atomic Celery test case mixin. Counters Django's behavior of running all test cases in atomic transactions, which...
{ "content_hash": "0148779581d9e557f3236db8707fa3f6", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 69, "avg_line_length": 36.25806451612903, "alnum_prop": 0.5444839857651246, "repo_name": "graingert/django_atomic_celery", "id": "95f1a1e75d301dda9255ebd422902f0c6ea1f26c", ...
import numpy as np import pygrit as GRIT import math def write_svg_files(engine, parameters, output_path, frame_number): filename = output_path + GRIT.generate_filename('/tutorial_vortex_in_a_box', frame_number, 'svg') GRIT.svg_draw(filename, engine, parameters) print('\t\twrite_svg_files() Done writing '...
{ "content_hash": "39d9d430a74dd17a0fe1f168781dab0c", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 108, "avg_line_length": 29.930555555555557, "alnum_prop": 0.5870069605568445, "repo_name": "misztal/GRIT", "id": "7fcf463798e076178adefe01ac8158c5611b0904", "size": "2155",...
import copy import six import yaml from st2tests import DbTestCase from st2tests.fixturesloader import FixturesLoader import st2common.bootstrap.runnersregistrar as runners_registrar from st2actions.runners.mistral import utils from st2common.models.api.action import ActionAPI, RunnerTypeAPI from st2common.persistence...
{ "content_hash": "21c4d0a2d9ffed0a93f3dc9cb54cca22", "timestamp": "", "source": "github", "line_count": 149, "max_line_length": 96, "avg_line_length": 37.577181208053695, "alnum_prop": 0.674048937310234, "repo_name": "Itxaka/st2", "id": "e13e193e48c3dc36158e6aa8c6b8fc8c66fd2612", "size": "6379", ...
from django import template register = template.Library() @register.inclusion_tag('core/paginator.html', takes_context=True) def paginator(context, adjacent_pages=5): current_page = context['page_obj'].number number_of_pages = context['paginator'].num_pages page_obj = context['page_obj'] paginator = c...
{ "content_hash": "a5c3c687f1f715cb3d5be7efd024a4ce", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 85, "avg_line_length": 37.11538461538461, "alnum_prop": 0.633160621761658, "repo_name": "valbertovc/blog_django_bootstrap_ajax", "id": "1b44284a0aab215f0d8251334be71dcb4bd537...
class mapreducejob: # Data source (mandatory). Can be any dict object, the keys/values will be passed # to "mapfn" function datasource = {0: "This is the first phrase", 1: "This is the second phrase and the end",} # Map function (mandatory). It's static method of map function code to ...
{ "content_hash": "46375e54c382d0bc3855fcb673d62644", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 91, "avg_line_length": 47.36363636363637, "alnum_prop": 0.6621880998080614, "repo_name": "darrenzhangcn/mapreducepy", "id": "6bf81f63a657c667ccb7a70b9be179db97d3033b", "siz...
from viper.core.ui import commands from viper.core.database import Database from viper.core.project import Project from tests.conftest import FIXTURE_DIR import re import os import sys try: from unittest import mock except ImportError: # Python2 import mock class TestCommands: def setup_class(cls): ...
{ "content_hash": "14626f811df0840e00a6ad178533f2b1", "timestamp": "", "source": "github", "line_count": 229, "max_line_length": 124, "avg_line_length": 36.29694323144105, "alnum_prop": 0.5684552454282964, "repo_name": "kevthehermit/viper", "id": "fb1af67985388f7998a26c08ea634d32f15ab1a0", "size": "...
""" Connect to local server: python3 client.py samples/longloop.py -- -n 100 -p 0.01 Connect to remote server: python3 client.py --host 192.168.11.2 samples/longloop.py -- -n 100 -p 0.01 """ import aiohttp import argparse import asyncio import base64 import fcntl import json import os import random import signal impo...
{ "content_hash": "871edd303f29bf72a62630d8b3b9f691", "timestamp": "", "source": "github", "line_count": 128, "max_line_length": 95, "avg_line_length": 31.921875, "alnum_prop": 0.6045031815956926, "repo_name": "google/aiyprojects-raspbian-tools", "id": "383744e60364bea17538f3b53d68fca541f4f4bb", "si...
from django.urls import include, path from django.views.generic import RedirectView from reviewboard.admin import admin_site, views from reviewboard.admin.forms.auth_settings import AuthenticationSettingsForm from reviewboard.admin.forms.avatar_settings import AvatarServicesForm from reviewboard.admin.forms.diff_setti...
{ "content_hash": "2ef6b9c692dfb3e04de02cc15cfd676f", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 76, "avg_line_length": 31.36036036036036, "alnum_prop": 0.5748348175811548, "repo_name": "reviewboard/reviewboard", "id": "15f9b9a28bc348dcdfb4a1e7cb5af04aeb303816", "size...
import shutil, os, argparse, sys, stat sys.path.append(os.path.join(os.path.dirname(os.path.dirname(__file__)), "pyUtils")) from utils import Utils from genFuncs import genHelper def parse_args(): parser = argparse.ArgumentParser() parser.add_argument('-prefix', type=str) parser.add_argument('-externalLib...
{ "content_hash": "4d41930f71de691e9bceaff79da9ab2c", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 128, "avg_line_length": 39.361702127659576, "alnum_prop": 0.6291891891891892, "repo_name": "weng-lab/TwoBit", "id": "9b1b3dde87f792335219d19fbe5bb16e0d4f1ca3", "size": "187...
""" Pure functions used in transformer implementation. """ import numpy as np import torch import torch.nn as nn from parlai.core.opt import Opt def create_position_codes(n_pos, dim, out): """ Create positional codes and store them in ``out``. """ position_enc = np.array( [ [pos ...
{ "content_hash": "2951a70f5bfc106835495e705ba2721f", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 73, "avg_line_length": 27.637931034482758, "alnum_prop": 0.5995009357454772, "repo_name": "facebookresearch/ParlAI", "id": "f003ab931449a33ab0162bd26478b37f55379222", "size...
from BattleBase import * from DistributedBattleAI import * from toontown.toonbase.ToontownBattleGlobals import * import random from toontown.suit import DistributedSuitBaseAI import SuitBattleGlobals import BattleExperienceAI from toontown.toon import NPCToons from toontown.pets import PetTricks, DistributedPetProxyAI ...
{ "content_hash": "40659a1580943df42cfde97509627260", "timestamp": "", "source": "github", "line_count": 1621, "max_line_length": 272, "avg_line_length": 45.18692165330043, "alnum_prop": 0.5520150720838795, "repo_name": "ToontownUprising/src", "id": "81f271fa2b8c41f8407e6de11b33114abb0d4633", "size"...
class ASMGroups(object): """Advanced Suppression Manager gives your recipients more control over the types of emails they want to receive by letting them opt out of messages from a certain type of email. Groups are specific types of email you would like your recipients to be able to unsubscri...
{ "content_hash": "60bd1ccda6b58cda446bf6515c8e0374", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 121, "avg_line_length": 33.72222222222222, "alnum_prop": 0.6166941241076331, "repo_name": "Khan/sendgrid-python", "id": "48c8a7371b9a4b5b70ff66632cad59b83d8569cb", "size": ...
import os import subprocess import sys from collections import defaultdict from typing import Any, ClassVar, Dict, Type from urllib.parse import urljoin from .wptmanifest.parser import atoms atom_reset = atoms["Reset"] enabled_tests = {"testharness", "reftest", "wdspec", "crashtest", "print-reftest"} class Result: ...
{ "content_hash": "0e887e76cf81dd219c87327d2710446b", "timestamp": "", "source": "github", "line_count": 712, "max_line_length": 117, "avg_line_length": 33.86938202247191, "alnum_prop": 0.5483723823346465, "repo_name": "chromium/chromium", "id": "65577c1eabced979341854ea0c3b642bbe84f67a", "size": "2...
""" Copyright 2015 SmartBear Software Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to i...
{ "content_hash": "0bd1087f8028f9170fd3304559b77617", "timestamp": "", "source": "github", "line_count": 227, "max_line_length": 97, "avg_line_length": 31.555066079295155, "alnum_prop": 0.5963981571967053, "repo_name": "keedya/shovel-api-python-client", "id": "0dda47e99c1950945eb372b86fc1b0f21a08be71"...
import sys import getopt, parser_generator, grammar_parser, interpreter if __name__ == '__main__': if len(sys.argv) != 2: print "Please give one argument, the input filename." sys.exit(1) cs164_grammar_file = './cs164c.grm' cs164_input_file = sys.argv[1] cs164_library_file = './library....
{ "content_hash": "1fbf22fe7976d7e4bab01af4b9b8a87d", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 100, "avg_line_length": 36.55, "alnum_prop": 0.6949384404924761, "repo_name": "michelle/sink", "id": "33a486f2d518c9ace1c9fe3eca6727b0a04ee717", "size": "754", "binary": ...
from __future__ import unicode_literals from django.core.urlresolvers import reverse_lazy from django.db.models.loading import get_model from django.test import TestCase import json class ViewsTests(TestCase): fixtures = ['test_data'] def test_task_view_200(self): response = self.client.get(reverse_l...
{ "content_hash": "129bafe7eda4bcbd596d89ae2a1c5e32", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 118, "avg_line_length": 41.6031746031746, "alnum_prop": 0.6547119420068676, "repo_name": "ToxicWar/travail-de-tests", "id": "665a5d6b531515bf938eeab3e32603b65fd29ed6", "siz...
from tests import web class ApiTest(web.WebsiteTest): async def test_base(self): request = await self.client.get('/') data = self.json(request.response, 200) self.assertTrue(data) self.assertTrue('user_url' in data) # CONTENT API async def test_article_list(self): ...
{ "content_hash": "475503c3b01d3f6074743919a2346819", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 75, "avg_line_length": 39.166666666666664, "alnum_prop": 0.658628841607565, "repo_name": "quantmind/lux", "id": "850c8160fda50b8455b895fef5a610a462012ba2", "size": "2115", ...
import socket import time import threading import pickle from msg import Msg class Server(threading.Thread): def __init__(self, host, port, user): self.host = host self.port = port self.user = user self.running = True self.sock = socket.socket(socket.AF_INET, socket.SOCK_S...
{ "content_hash": "af21e4044ca26fcc906f24e972c4cbaa", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 77, "avg_line_length": 30.58139534883721, "alnum_prop": 0.44258555133079847, "repo_name": "MalteT/secure-chat-py", "id": "6a209038315641145082a25175ccbffe8a26c154", "size":...
from enum import IntEnum class CalibrationMethod(IntEnum): PLUS_EIGENSTATE = 1 NONE = 0 MINUS_EIGENSTATE = -1
{ "content_hash": "ad39e45c7399da768f425e6c26117cac", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 33, "avg_line_length": 17.714285714285715, "alnum_prop": 0.6935483870967742, "repo_name": "rigetticomputing/pyquil", "id": "6fdb559f1b8d9009ec1bceb14c814e4737ab8252", "size"...
""" Module containing the FooWrapper1 class """ import time import subprocess from wopmars.utils.Logger import Logger from wopmars.models.ToolWrapper import ToolWrapper class FooWrapper9(ToolWrapper): """ This class has been done for example/testing purpose. Modifications may lead to failure in tests. ...
{ "content_hash": "fd0932e44677c6a544b44bc7e42e1fc2", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 74, "avg_line_length": 25.193548387096776, "alnum_prop": 0.646606914212548, "repo_name": "aitgon/wopmars", "id": "f690415b83b63767b7e81b90a449d1d917907486", "size": "781", ...
from unittest import mock import ddt from tooz import coordination as tooz_coordination from tooz import locking as tooz_locking from manila import coordination from manila import test class Locked(Exception): pass class MockToozLock(tooz_locking.Lock): active_locks = set() def acquire(self, blocking...
{ "content_hash": "c47962f4c81972ae4e7c34b0e5b0940e", "timestamp": "", "source": "github", "line_count": 106, "max_line_length": 76, "avg_line_length": 29.830188679245282, "alnum_prop": 0.6461100569259962, "repo_name": "openstack/manila", "id": "843528711a1bf350f98e780aa46b858ef196be23", "size": "37...
import copy import re from nltk.sem.logic import Expression from .category import Category from .logic_parser import lexpr from .normalization import normalize_token class SemanticRule(object): def __init__(self, category, semantics, attributes = {}): if not isinstance(category, Category): se...
{ "content_hash": "963cfadb2273614c47bba82b11100e9e", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 87, "avg_line_length": 43.92035398230089, "alnum_prop": 0.6564577876284505, "repo_name": "masashi-y/depccg", "id": "1f1007392abd65c10ae26e87e3319b8092cbfc5d", "size": "558...
""" BioPandas module for working with Protein Data Bank (PDB) files in pandas DataFrames. """ from .pandas_pdb import PandasPdb __all__ = ["PandasPdb"]
{ "content_hash": "5fd211e65b4c11a6eb754b3e646fade0", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 57, "avg_line_length": 19.25, "alnum_prop": 0.7142857142857143, "repo_name": "rasbt/biopandas", "id": "f11af5159da93a6017221c5833ef55a7b96baeab", "size": "354", "binary": ...
from netpyne import specs from cfg import cfg #------------------------------------------------------------------------------ # # NETWORK PARAMETERS # #------------------------------------------------------------------------------ netParams = specs.NetParams() # object of class NetParams to store the network parame...
{ "content_hash": "147e1c57521da5b1d88058a08a647008", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 185, "avg_line_length": 56.27350427350427, "alnum_prop": 0.5476913730255164, "repo_name": "Neurosim-lab/netpyne", "id": "5f8360a52756bfb390436f7b812309b319bbe077", "size":...
"""Longley dataset""" __docformat__ = 'restructuredtext' COPYRIGHT = """This is public domain.""" TITLE = __doc__ SOURCE = """ The classic 1967 Longley Data http://www.itl.nist.gov/div898/strd/lls/data/Longley.shtml :: Longley, J.W. (1967) "An Appraisal of Least Squares Programs for the El...
{ "content_hash": "0d4b78d6ac7ed807daad0976fb4984cf", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 78, "avg_line_length": 25.794520547945204, "alnum_prop": 0.6436537440254912, "repo_name": "pprett/statsmodels", "id": "c91f9bd03a310a9c3b69e98235f29d851a5a9bda", "size": "1...
from __future__ import unicode_literals import django __author__ = 'Dmitriy Sokolov' __version__ = '1.0.0' if django.VERSION < (3, 2): default_app_config = 'admin_permissions.apps.AdminPermissionsConfig' VERSION = __version__
{ "content_hash": "e3efb68445f1ea8ab6314f4f524f4cbd", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 72, "avg_line_length": 18.153846153846153, "alnum_prop": 0.6864406779661016, "repo_name": "silentsokolov/django-admin-permissions", "id": "31eb3cd2bd9f9963b083c10230b3cf292c9...
import requests import json import decimal from requests.exceptions import ConnectionError import logging #Logger logging.getLogger("requests").setLevel(logging.WARNING) logging.getLogger("urllib3").setLevel(logging.WARNING) log = logging.getLogger("EtherRpc") class EtherRpcWrapper(object): __id_count = 0 d...
{ "content_hash": "1c6336fbdc4ae99b89d450df67b92260", "timestamp": "", "source": "github", "line_count": 130, "max_line_length": 77, "avg_line_length": 40.83076923076923, "alnum_prop": 0.4798417483044461, "repo_name": "nicosandller/python-ethereumrpc", "id": "a08cfca1266326c166de9119a0bf9ec065177c82",...
''' Common interface for all All ChamberConnectLibrary upper level interfaces :copyright: (C) Espec North America, INC. :license: MIT, see LICENSE for more details. ''' #pylint: disable=W0703,W0201,R0902,W0232,R0904,C0103 from abc import ABCMeta, abstractmethod from threading import RLock import traceback import time...
{ "content_hash": "2982ed28c1a252b0dd455187470aa5cb", "timestamp": "", "source": "github", "line_count": 1445, "max_line_length": 123, "avg_line_length": 30.91764705882353, "alnum_prop": 0.5130047452771063, "repo_name": "EspecNorthAmerica/ChamberConnectLibrary", "id": "016f20fe170b1b338f595d31afd11f7a...
import os import time import numpy as np import keras_vgg_buddy from .generators.base import output_samples from .generators.style_xfer import output_size_from_glob, transform_glob from .generators.callbacks import GenerateSamplesCallback from .models.config import get_model_by_name from .training import train def ...
{ "content_hash": "5135ec87ec1a8ca4d8c86c0a6c25bef6", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 115, "avg_line_length": 33.964285714285715, "alnum_prop": 0.69155275148966, "repo_name": "awentzonline/keras-rtst", "id": "9bdb3841aaba9bf1e924a543769ad51a87c2422d", "size"...
"""Provide handling of a gateway.""" from .controlsystem import ControlSystem class Gateway( object ): # pylint: disable=too-few-public-methods,useless-object-inheritance """Provide handling of a gateway.""" def __init__(self, client, location, data=None): """Initialise the class.""" sel...
{ "content_hash": "b88b00d2af105f7afcfa51c7fc1d1e40", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 79, "avg_line_length": 35.08695652173913, "alnum_prop": 0.6270136307311028, "repo_name": "watchforstock/evohome-client", "id": "781406d93b1ca9f6430c77426c94058a9abdac1e", "...
import os, glob, re from lxml import etree localesPath = 'C:\Documents and Settings\zelle\My Documents\CSL\locales\\' localeXSLTPath = 'C:\Documents and Settings\zelle\My Documents\CSL\utilities\update-locales-1.0-to-1.0.1.xsl' class FileResolver(etree.Resolver): def resolve(self, url, pubid, context): re...
{ "content_hash": "8d3530163a652c6549dc049783916898", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 128, "avg_line_length": 44.666666666666664, "alnum_prop": 0.7154228855721393, "repo_name": "citation-style-language/utilities", "id": "501d0af594cd477b05e9b987ba4c27d7eabd39a...
name = 'Phennyfyxata. http://phenny.venefyxatu.be' nick = 'Phennyfyxata' host = 'irc.freenode.net' channels = ['#dutchnano', '#venefyxatu'] #channels = ['#venefyxatu'] owner = 'venefyxatu' password = 'PLACEHOLDER_PASSWORD' # This isn't implemented yet: # serverpass = 'yourserverpassword' # These are people who will b...
{ "content_hash": "7669439531877e4f27003ed4e93ceb9f", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 70, "avg_line_length": 26.916666666666668, "alnum_prop": 0.6790505675954592, "repo_name": "Venefyxatu/phennyfyxata", "id": "dbfc896efffac8226ca7187ed8c9ec65145877b5", "size...
import os import json from argparse import ArgumentParser from CloudFormationGraph import GraphvizGenerator def main(): parser = ArgumentParser() parser.add_argument('--in', dest='stack', required=True, metavar='FILE', help='File containing CloudFormation template', ...
{ "content_hash": "2d719a0fce77aca0892708d24ceed510", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 77, "avg_line_length": 30.416666666666668, "alnum_prop": 0.6027397260273972, "repo_name": "tigertoes/CloudFormationGraph", "id": "400aa7e0970ea4a90bdeb88e49487e656d718edb", ...
""" Fusion Tables Client. Issue requests to Fusion Tables. """ __author__ = 'kbrisbin@google.com (Kathryn Brisbin)' import urllib2, urllib try: import oauth2 import authorization.oauth except: pass import httplib2 from oauth2client.file import Storage from oauth2client.client import AccessTokenRefreshError from...
{ "content_hash": "677f1396acff9ce20370631ea1b97349", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 110, "avg_line_length": 29.65714285714286, "alnum_prop": 0.655427103403982, "repo_name": "MapofLife/MOL", "id": "1e8adcbaa469c84a72b4b0a69f60cae2664feecb", "size": "3168",...
from enum import Enum class ApplicationType(Enum): web = "web" other = "other" class FlowType(Enum): bluefield = "Bluefield" class RequestSource(Enum): rest = "rest" class WebTestKind(Enum): ping = "ping" multistep = "multistep"
{ "content_hash": "c78a7163257712d5675a235a9164e4e6", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 28, "avg_line_length": 11.521739130434783, "alnum_prop": 0.6377358490566037, "repo_name": "AutorestCI/azure-sdk-for-python", "id": "fdb344ca6bf35e5356aeb9f4bb8c3e9042927216",...
import sublime, sublime_plugin import json import os.path try: import urllib.request as urllib2 except ImportError: import urllib2 import urllib.parse import re import threading import os, random, string import subprocess from subprocess import Popen, PIPE, STDOUT # Check to see if we're in Sublime Text 3 ST3 ...
{ "content_hash": "eb82e36cd7f46ca9651fd7b670d20c8f", "timestamp": "", "source": "github", "line_count": 938, "max_line_length": 263, "avg_line_length": 35.26012793176972, "alnum_prop": 0.6869141924170042, "repo_name": "rguisewite/MvSublimeTemplateEditor", "id": "79ff0c0372c27f85dd618d42ffcbf53a9c41fc...
from mangopi.helper.decorators import memoize from mangopi.helper.util import Util class HasUrl(object): @property @memoize def source(self): return Util.getSourceCode(self.url)
{ "content_hash": "a0037f89ae4afd26f28206be04906452", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 45, "avg_line_length": 22.22222222222222, "alnum_prop": 0.73, "repo_name": "jiaweihli/mangopi", "id": "fd6aaf7b1c83edc2ec319142afc9d203ddf02b7a", "size": "200", "binary": ...
""" past.translation ================== The ``past.translation`` package provides an import hook for Python 3 which transparently runs ``futurize`` fixers over Python 2 code on import to convert print statements into functions, etc. It is intended to assist users in migrating to Python 3.x even if some dependencies s...
{ "content_hash": "f7ddd39d6adec3f3885169d71b2f1eb1", "timestamp": "", "source": "github", "line_count": 496, "max_line_length": 163, "avg_line_length": 37.082661290322584, "alnum_prop": 0.5776110476811831, "repo_name": "ryfeus/lambda-packs", "id": "c7ae2b7a081be3c800ef229a4b760cca3d842e6b", "size":...
l = Glyphs.font.selectedLayers[0] l.paths = [] for p in l.parent.layers[-1].paths: l.paths.append(p.copy())
{ "content_hash": "243b07e54b8954d6d671b487ac07b4bd", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 35, "avg_line_length": 22.2, "alnum_prop": 0.6666666666666666, "repo_name": "jenskutilek/Glyphs-Scripts", "id": "41a2dd33f936fc4c605738cecc94b6630a37e841", "size": "152", ...
import six #import numpy as np import pandas as pd from io import StringIO #from exa import Series, TypedMeta from exa import TypedMeta from exatomic.core import Editor, Tensor class Meta(TypedMeta): tensor = Tensor class RTensor(six.with_metaclass(Meta, Editor)): """ This is a simple script to read a r...
{ "content_hash": "c03748491e37fe65ba2c3d37b6b326f3", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 89, "avg_line_length": 33.61333333333334, "alnum_prop": 0.49147163823879414, "repo_name": "tjduigna/exatomic", "id": "c3edf0dc7d0aabc5ba8df9cef827f2797f79a609", "size": "26...
import sys sys.path.append('../../../src/') import cgmap as cg import mdtraj as md import md_check as check ############################### config ##################################### xyz_tolerance = 1e-6 input_traj = "dppc.trr" input_top = "dppc.pdb" input_traj_wrapped = "dppc_vmd_w...
{ "content_hash": "b180abf6495808ebfb611590ba7b2a5b", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 102, "avg_line_length": 42.482142857142854, "alnum_prop": 0.5559058427910887, "repo_name": "uchicago-voth/cgmap", "id": "dc074a237466bb0dbcf11d6feda997e1dca2b058", "size":...
from django.template import Library from google.appengine.api import users register = Library() @register.simple_tag def google_login_url(redirect='/'): return users.create_login_url(redirect) @register.simple_tag def google_logout_url(redirect='/'): return users.create_logout_url(redirect)
{ "content_hash": "92bc854ea10df55da9673868f86a7a64", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 44, "avg_line_length": 25.25, "alnum_prop": 0.7623762376237624, "repo_name": "certik/chess", "id": "9581d746185e5a3090afdba5f67044b6525755f3", "size": "327", "binary": fa...
"""Simple HTTP server based on the asyncore / asynchat framework Under asyncore, every time a socket is created it enters a table which is scanned through select calls by the asyncore.loop() function All events (a client connecting to a server socket, a client sending data, a server receiving data) is handled by the...
{ "content_hash": "c4ac22f8cc5d9965a320107d36a951c5", "timestamp": "", "source": "github", "line_count": 248, "max_line_length": 84, "avg_line_length": 37.346774193548384, "alnum_prop": 0.6238393435543079, "repo_name": "ActiveState/code", "id": "3a756853f4d4051f4543f058dc6e0b1c1dc255cb", "size": "92...
"""empty message Revision ID: a92d9d023624 Revises: f819f3f77f30 Create Date: 2016-10-08 01:17:30.083109 """ # revision identifiers, used by Alembic. revision = 'a92d9d023624' down_revision = 'f819f3f77f30' from alembic import op import sqlalchemy as sa def upgrade(): op.rename_table('shortenedURL', 'targetUR...
{ "content_hash": "65b12eb91b211caeef19ab9cdd7bd2f7", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 48, "avg_line_length": 18.61904761904762, "alnum_prop": 0.7365728900255755, "repo_name": "piotr-rusin/url-shortener", "id": "b9a357c3ecb08fd44955c68469cba7d6f87c2304", "siz...
""" minio.api ~~~~~~~~~~~~ This module implements the API. :copyright: (c) 2015, 2016 by Minio, Inc. :license: Apache 2.0, see LICENSE for more details. """ # Standard python packages from __future__ import absolute_import import platform from time import mktime, strptime from datetime import datetime, timedelta ...
{ "content_hash": "d13f41c22e484de4e0751f98bb21450a", "timestamp": "", "source": "github", "line_count": 1755, "max_line_length": 121, "avg_line_length": 38.26894586894587, "alnum_prop": 0.5351240284684792, "repo_name": "donatello/minio-py", "id": "8e3b6d2fc9ec141ac6e9a73561426839234bcd74", "size": ...
import pickle import numpy import pytest try: import scipy.sparse scipy_available = True except ImportError: scipy_available = False import cupy from cupy import testing from cupy.cuda import driver from cupy.cuda import runtime from cupyx.scipy import sparse def _make(xp, sp, dtype): data = xp.arra...
{ "content_hash": "ee8badde346f0232e59e6ff8ca98c374", "timestamp": "", "source": "github", "line_count": 1554, "max_line_length": 79, "avg_line_length": 35.7998712998713, "alnum_prop": 0.566300576995668, "repo_name": "cupy/cupy", "id": "b2be4476ac4ac259e38cd8b14c2f2fb4a269788c", "size": "55633", "...
from collections import OrderedDict import mock from nose.tools import * from website.notifications.events.base import Event, register, event_registry from website.notifications.events.files import ( FileAdded, FileRemoved, FolderCreated, FileUpdated, AddonFileCopied, AddonFileMoved, AddonFileRenamed, ) from ...
{ "content_hash": "30c8d965a5cf1b7c466a1cecf7defc14", "timestamp": "", "source": "github", "line_count": 815, "max_line_length": 120, "avg_line_length": 42.00490797546012, "alnum_prop": 0.5959280247706958, "repo_name": "mattclark/osf.io", "id": "560c7e8979c665d237dec980e4adb4916ea11646", "size": "34...
""" Searching for names with given scope and name. This is very central in Jedi and Python. The name resolution is quite complicated with descripter, ``__getattribute__``, ``__getattr__``, ``global``, etc. If you want to understand name resolution, please read the first few chapters in http://blog.ionelmc.ro/2015/02/0...
{ "content_hash": "e88ee82bd89a47784b2aabed16cf2ba2", "timestamp": "", "source": "github", "line_count": 410, "max_line_length": 102, "avg_line_length": 40.45609756097561, "alnum_prop": 0.594139989148128, "repo_name": "NixaSoftware/CVis", "id": "aba190e19636899ae64cc389b5365d46305ea0ad", "size": "16...
from fabric import task deploy_folder = '/opt/site_bot' existing_packages_tmp_file = '/tmp/existing_site_bot_python_requirements.txt' @task def deploy(c, ref): c.run(""" cd %(deploy_folder)s git fetch origin git checkout %(ref)s # Delete existing dependencies pip3 freeze ...
{ "content_hash": "5cffa04dbddad118c5ab858d0fd84c9f", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 77, "avg_line_length": 30.772727272727273, "alnum_prop": 0.6262924667651403, "repo_name": "OpenTwinCities/site_bot", "id": "6d336a188ab31e14acb91af29253eacd82766086", "size...
import fcntl, shutil, signal, sys, os # Define the constant to hold the special string that will be used as # the delimiter when splitting the arguments from the command line import struct, termios # Check if python3 is being used if sys.version_info.major < 3: version = '.'.join([str(sys.version_info.major), str...
{ "content_hash": "987976afa30f976a60f0af7b8026dbc3", "timestamp": "", "source": "github", "line_count": 306, "max_line_length": 112, "avg_line_length": 31.604575163398692, "alnum_prop": 0.5913555992141454, "repo_name": "MaxNdesh/server-automation", "id": "ddd2f5d8d174b02ece5a298974cfccdef0d66068", ...
from ftplib import FTP import time, sys ftp = FTP("ServerIP") # Declaring server IP ftp.login('supercow','amazingpassword') # Logging in with credentials files = [] dates = [] files = ftp.nlst() files = (filter(lambda k: '.zip' in k, files) #out = [w.replace('.zip','') for w in files] #Formatting is as follows : YYYY...
{ "content_hash": "b0eeec4cbe22c80534fb6c3a5dc5795b", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 70, "avg_line_length": 24.31578947368421, "alnum_prop": 0.6645021645021645, "repo_name": "B-Genc/Pi-FTP-Sync", "id": "c62b698bf88848d9e8733654e25b7a481a7a58fc", "size": "46...
import pandas as pd import matplotlib.pyplot as plt from utils import get_data, plot_data def compute_daily_returns(df): """Compute and return the daily return values.""" daily_returns = df.copy() daily_returns[1:] = (df[1:]/df[:-1].values) - 1 # to avoid index matching daily_returns.ix[0, :] = 0 return dai...
{ "content_hash": "89032e3093cf4eb3c3bee57d6954568d", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 75, "avg_line_length": 26.321428571428573, "alnum_prop": 0.6580732700135685, "repo_name": "alexey-ernest/ml-for-trading", "id": "6dcd04f51d7bb4bd6ff0c08bd1435798a77508e8", ...
from connector import channel from google3.cloud.graphite.mmv2.services.google.datastore import index_pb2 from google3.cloud.graphite.mmv2.services.google.datastore import index_pb2_grpc from typing import List class Index(object): def __init__( self, ancestor: str = None, index_id: str =...
{ "content_hash": "361fa44386a28d9428fc10ae844df417", "timestamp": "", "source": "github", "line_count": 197, "max_line_length": 86, "avg_line_length": 33.45685279187817, "alnum_prop": 0.6555909573661053, "repo_name": "GoogleCloudPlatform/declarative-resource-client-library", "id": "6be8d0d5c3fb6248c0...
import sys from DataMining import * from PythonLearn import * from PandasLearn import * from NumpyLearn import * ch02path = 'D:/software/Python/python code/pydata-book-master/ch02/usagov_bitly_data2012-03-16-1331923249.txt'; # dm = DataMining(ch02path); # dm.ch02_frame(); # dm.drawPlot(); # pl = PythonLearn(); # mylis...
{ "content_hash": "3d49d03a304fc5419645dcca0362f45d", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 111, "avg_line_length": 22.238095238095237, "alnum_prop": 0.702355460385439, "repo_name": "woniukaibuick/DA-ML", "id": "5009c011962a5a17c2a8fa87a4511cb92fde7978", "size": "...
from azure.identity import DefaultAzureCredential from azure.mgmt.cdn import CdnManagementClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-cdn # USAGE python afd_endpoints_get.py Before run the sample, please set the values of the client ID, tenant ID and client secret ...
{ "content_hash": "8a7c438be4b2191effbc8e785357ddd6", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 119, "avg_line_length": 30.852941176470587, "alnum_prop": 0.7121067683508103, "repo_name": "Azure/azure-sdk-for-python", "id": "5655f10e5e461a61765498531cd979612fd395ab", "...
TIME_ZONE = 'Europe/Amsterdam' USE_TZ = True # Language code for this installation. All choices can be found here: # http://www.i18nguy.com/unicode/language-identifiers.html LANGUAGE_CODE = 'en-us' # If you set this to False, Django will make some optimizations so as not # to load the internationalization machinery. ...
{ "content_hash": "1bfb3146c1826a8a55f3b611be8ddb9e", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 73, "avg_line_length": 31.2, "alnum_prop": 0.7606837606837606, "repo_name": "wheelcms/obsolete-do-not-use-wheel-cms", "id": "6d25178a7b0c43d3bbb0a3d72591844493688199", "siz...
from django.http.response import HttpResponse, Http404 from django.views.decorators.csrf import csrf_exempt from django.conf import settings import importlib import uuid import os import json import unicodecsv from itertools import chain @csrf_exempt def csvimport(request, label): if not request.method == 'POST': ...
{ "content_hash": "63ab101a3cb76c2cfbd8e958faa44c45", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 108, "avg_line_length": 37.62352941176471, "alnum_prop": 0.5888055034396498, "repo_name": "DontPanicBaby/django-csvimport", "id": "fc54434a4bdea6a5a8de4e160d779a84ffdb1a68", ...
import logging import traceback import numpy as np import pandas as pd from ConfigSpace.hyperparameters import CategoricalHyperparameter, \ UniformFloatHyperparameter, UniformIntegerHyperparameter from ConfigSpace.conditions import EqualsCondition, InCondition from ConfigSpace.configuration_space import Configura...
{ "content_hash": "77a2d652742fedf1667abe8d1bd5e895", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 145, "avg_line_length": 31.833333333333332, "alnum_prop": 0.5913474786442546, "repo_name": "mlindauer/AutoFolio", "id": "8edf37de627fdb8494cc0bc2f1ace553819d72bd", "size":...
from mpxapi.api_base import ApiBase class Checksum(ApiBase): def __init__(self, api): ApiBase.__init__(self, api) self.schema = "1.2.0" self.service = "Ingest Data Service" self.path = "/data/Checksum"
{ "content_hash": "2098e2906d45a8a79029c797bd008444", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 44, "avg_line_length": 24.1, "alnum_prop": 0.5933609958506224, "repo_name": "blockbuster/mpxapi", "id": "782e6dc72c91a9788365beb586c49f9dc1305acf", "size": "241", "binary...
from types import ModuleType from typing import TYPE_CHECKING, Type, Union from libcloud.storage.types import OLD_CONSTANT_TO_NEW_MAPPING, Provider from libcloud.common.providers import get_driver as _get_provider_driver from libcloud.common.providers import set_driver as _set_provider_driver if TYPE_CHECKING: fr...
{ "content_hash": "caa86093adbf83659a19cc2b5edcf280", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 95, "avg_line_length": 45.873684210526314, "alnum_prop": 0.7129417163836622, "repo_name": "apache/libcloud", "id": "2bd1db4c686b20948b74cfa1dfc3c35d2877761b", "size": "5140...
r""" Backrefs for the 'regex' module. Add the ability to use the following backrefs with re: - `\Q` and `\Q...\E` - Escape/quote chars (search) - `\c` and `\C...\E` - Uppercase char or chars (replace) - `\l` and `\L...\E` ...
{ "content_hash": "027f4212e65ced324e13b591f279af5c", "timestamp": "", "source": "github", "line_count": 713, "max_line_length": 119, "avg_line_length": 29.782608695652176, "alnum_prop": 0.5883682599481987, "repo_name": "facelessuser/backrefs", "id": "13ce1b44f78d604c85e183af9d770ef5a1dfd024", "size...
""" AerPauliExpectation Class """ import logging from functools import reduce from operator import add from typing import Union from qiskit.exceptions import MissingOptionalLibraryError from qiskit.opflow.expectations.expectation_base import ExpectationBase from qiskit.opflow.list_ops.composed_op import ComposedOp fr...
{ "content_hash": "3a74b60d64732706823d3d8f684be504", "timestamp": "", "source": "github", "line_count": 142, "max_line_length": 97, "avg_line_length": 43.03521126760563, "alnum_prop": 0.6373752250040909, "repo_name": "QISKit/qiskit-sdk-py", "id": "33790531592adecabe688c474c02401d02f671b5", "size": ...
import json from typing import Any, Dict, Tuple from flask import current_app, g, jsonify, request from werkzeug.datastructures import ImmutableMultiDict from alerta.exceptions import ApiError from alerta.models.alert import Alert from alerta.utils.audit import write_audit_trail from alerta.utils.response import abso...
{ "content_hash": "c950ad2807e3b4693d8560d910f55030", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 106, "avg_line_length": 35.91, "alnum_prop": 0.6285157337788917, "repo_name": "guardian/alerta", "id": "aa265ce29813984769e67f7abc6f75a96c37951c", "size": "3591", "binar...
""" MXP - Mud eXtension Protocol. Partial implementation of the MXP protocol. The MXP protocol allows more advanced formatting options for telnet clients that supports it (mudlet, zmud, mushclient are a few) This only implements the SEND tag. More information can be found on the following links: http://www.zuggsoft....
{ "content_hash": "46ff1a5fc7ede20fb1447c2d49c3a942", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 75, "avg_line_length": 23.46590909090909, "alnum_prop": 0.5951573849878935, "repo_name": "feend78/evennia", "id": "44bc9628ea305254306bc5cd039f1873fa843528", "size": "2065"...
""" Django settings for untitled6 project. Generated by 'django-admin startproject' using Django 1.11.1. For more information on this file, see https://docs.djangoproject.com/en/1.11/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/ref/settings/ """ import ...
{ "content_hash": "2742b7c1681cac0d7652d46b279ba551", "timestamp": "", "source": "github", "line_count": 157, "max_line_length": 91, "avg_line_length": 26.305732484076433, "alnum_prop": 0.6791767554479419, "repo_name": "Prakash2403/Blog", "id": "0ad20ad0ac9abbf17b402eaf3dcba1519d5879bf", "size": "41...
print "#"*3 +" Operador corto circuito "+"#"*3 persona = True #if persona: # nombre = 'Juan Perez' nombre = persona and 'Juan Perez' print "nombre:",nombre #nombre = False """ if nombre: encargado = nombre else: encargado = 'Algun nombre' """ encargado = nombre or 'Algun nombre' print "encargado:",encargad...
{ "content_hash": "e8d52b7875016ce857b633f5bc00274b", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 46, "avg_line_length": 18.941176470588236, "alnum_prop": 0.6645962732919255, "repo_name": "mario21ic/python_curso", "id": "b60cf627be394ba192fd40603c4a59e1f8301e7a", "size"...
from azure.identity import DefaultAzureCredential from azure.mgmt.storageimportexport import StorageImportExport """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-storageimportexport # USAGE python list_available_operations.py Before run the sample, please set the values of the cli...
{ "content_hash": "ad1b3e9628923f6da109bce9a587d8c8", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 143, "avg_line_length": 33.516129032258064, "alnum_prop": 0.7449470644850819, "repo_name": "Azure/azure-sdk-for-python", "id": "185e21ed93ea30902e2386a58502b8554ee4ac86", "...
from __future__ import absolute_import from topaz.module import ModuleDef class Signal(object): moduledef = ModuleDef("Signal") @moduledef.function("trap") def method_trap(self, args_w): pass
{ "content_hash": "dc046b08f9f3351bd6335014bf072d84", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 38, "avg_line_length": 19.636363636363637, "alnum_prop": 0.6851851851851852, "repo_name": "kachick/topaz", "id": "e5d72b570140387bacd3666e2b94b927df34e1d6", "size": "216", ...
""" Django settings for chalk project. Generated by 'django-admin startproject' using Django 1.8.6. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build paths ...
{ "content_hash": "d2dc48fde03ad5769a1b161c42d20363", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 71, "avg_line_length": 25.666666666666668, "alnum_prop": 0.686456400742115, "repo_name": "Victoria-Sardelli/hackBU16", "id": "c04022320c7e8fcb86cce93e026131ee21d69efc", "s...
import copy from glanceclient.common import utils as glanceclient_utils from glanceclient.v2 import schemas import mock from osc_lib.cli import format_columns from osc_lib import exceptions import warlock from openstackclient.image.v2 import image from openstackclient.tests.unit.identity.v3 import fakes as identity_f...
{ "content_hash": "82c99107c84c7a726f876dc0d3063187", "timestamp": "", "source": "github", "line_count": 1625, "max_line_length": 79, "avg_line_length": 31.743384615384617, "alnum_prop": 0.5523719054727333, "repo_name": "dtroyer/python-openstackclient", "id": "748a61aaf40798806984bf015b763bea2f287e79"...
from django.test import TestCase from music.models import MusicProfile from users.models import User class SearchTestCase(TestCase): def setUp(self): u = User.objects.create(username='joe') MusicProfile.objects.create(user=u, zipcode='80516') def test_find_one(self): user = do_find...
{ "content_hash": "9cb62cbb322fe16002214e3040e611c2", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 60, "avg_line_length": 25.63888888888889, "alnum_prop": 0.6403033586132177, "repo_name": "jimfmunro/djangodash2013", "id": "595a9fcb04aa23e30148a24c246f7396bef5fa58", "size...
''' testimages.py Jusa test program to test the librarys Author: Brandon Layton ''' import tkinter, tkinter.filedialog from GIF import GIF root = tkinter.Tk() root.withdraw() file_path = tkinter.filedialog.askopenfilename() f = open(file_path,"rb") myImage = GIF() myImage.loadGIF(f) #for p in myImage.getImage(0...
{ "content_hash": "38d58075b6a81e6c1e09cb4eab765d0c", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 48, "avg_line_length": 15.242424242424242, "alnum_prop": 0.7017892644135189, "repo_name": "proflayton/pyMediaManip", "id": "e993c7dbae9167b0a0e56e7e4090442a491231d6", "size...
import unittest import os from test.aiml_tests.client import TestClient from programy.config.brain import BrainFileConfiguration class BasicTestClient(TestClient): def __init__(self): TestClient.__init__(self) def load_configuration(self, arguments): super(BasicTestClient, self).load_configur...
{ "content_hash": "ff8b35b14e2171647eb47b896cd4fe10", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 116, "avg_line_length": 36.629629629629626, "alnum_prop": 0.731041456016178, "repo_name": "dkamotsky/program-y", "id": "402ee8dec6f5fb8d48e2ee0cb0f7108049352d36", "size": "...
import mock from django.conf import settings from oslo_serialization import jsonutils from openstack_dashboard.api.rest import keystone from openstack_dashboard.test import helpers as test class KeystoneRestTestCase(test.TestCase): # # Version # @mock.patch.object(keystone.api, 'keystone') def ...
{ "content_hash": "139790927dc457abb3afcbe4adc588ae", "timestamp": "", "source": "github", "line_count": 656, "max_line_length": 79, "avg_line_length": 40.07164634146341, "alnum_prop": 0.5269905276372351, "repo_name": "maestro-hybrid-cloud/horizon", "id": "8aed1ac66a787656dddef9eda4756043c0f0a9af", ...
""" If a task raises an unhandled exception, it is saved to the Future for the task and made available through the result() or exception() methods. """ from concurrent import futures def task(n): print('{}: starting'.format(n)) raise ValueError('the value {} is no good'.format(n)) ex = futures.ThreadPool...
{ "content_hash": "4d336881d2cc763bdbb9c242b749cba1", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 75, "avg_line_length": 22.92, "alnum_prop": 0.6858638743455497, "repo_name": "scotthuang1989/Python-3-Module-of-the-Week", "id": "acee3d76f8cffdb61e027794d20c8c08261497da", ...
import numpy as np from sklearn import metrics, svm from sklearn.linear_model import LinearRegression from sklearn.linear_model import LogisticRegression from sklearn.tree import DecisionTreeClassifier from sklearn.neighbors import KNeighborsClas...
{ "content_hash": "6d9c392bc7fc4f63c7b526a078486a42", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 146, "avg_line_length": 33.41379310344828, "alnum_prop": 0.7223942208462333, "repo_name": "OO-E/MoviePrediction", "id": "e3d19e0824549dcd0286df8fd8b858d1da3a731b", "size": ...
''' Author: Prakhar Mishra Date: 13/01/2016 ''' # Importing Packages import pygmaps import webbrowser import csv import geocoder import random import re import sys # Opening and getting marker for the input file data = open(str(sys.argv[1]), 'r') data_reader = csv.reader(data) # Reads only the geo informatio...
{ "content_hash": "1c68e863914a07bcdceaac16938ed652", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 53, "avg_line_length": 19.278688524590162, "alnum_prop": 0.6760204081632653, "repo_name": "prakhar21/SocialCops", "id": "0454eb69c042ae506de47b3aa0ba64e7001e4415", "size": ...
import time import json from bson import ObjectId # To install it: `$ pip3 install pymongo` users = dict() # uId (input) -> user number (output) songs = dict() # eId (input), just to count unique youtube tracks counter = 0 # == Print anonymised playlog to stdout print('timestamp,user,song') # header of the csv file...
{ "content_hash": "e3f8fa0a8663c0d88dbd2d942087d8b8", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 92, "avg_line_length": 29.842105263157894, "alnum_prop": 0.6022927689594356, "repo_name": "openwhyd/openwhyd", "id": "69bfafb3833124a8e89b3ea18edc26a643fe01ae", "size": "13...
from django.db import models class CalloutUserfield(models.Model): name = models.CharField(max_length=255)
{ "content_hash": "666e7b2f1a336ab49eefecf6b6a9923a", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 43, "avg_line_length": 28, "alnum_prop": 0.7767857142857143, "repo_name": "350dotorg/aktivator", "id": "67e0e178606b251694b13c4714eeb2f03f248ebb", "size": "112", "binary":...
from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.action_chains import ActionChains from Selenium2Library import utils from Selenium2Library.locators import ElementFinder from keywordgroup import KeywordGroup class _ElementKeywords(KeywordGroup): def __init__(self): self._elem...
{ "content_hash": "53ef277a8ba041d9cd1410dda9dbbfc6", "timestamp": "", "source": "github", "line_count": 675, "max_line_length": 113, "avg_line_length": 41.534814814814816, "alnum_prop": 0.6196675702667999, "repo_name": "ktan2020/legacy-automation", "id": "fbdec75e65709865881a1c6b08177d0daa8feeff", ...
"""This file contains some utility functions""" import time import os import six import codecs import glob import numpy as np import tensorflow as tf from tensorflow.python.client import device_lib FLAGS = tf.app.flags.FLAGS def get_dir_or_file_path(dir_or_path, max_deep=1): if os.path.exists(dir_or_path) == False:...
{ "content_hash": "485cfc4daba60546664ed9b3e0b641bd", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 181, "avg_line_length": 31.9625, "alnum_prop": 0.6624951114587407, "repo_name": "liyi193328/pointer-generator", "id": "344507c88721cd0817ce12c1fad2304ba30da24d", "size": "3...