text
stringlengths
0
1.05M
meta
dict
"""A helper function for parsing and executing wit.ai skills.""" import logging import json import aiohttp from voluptuous import Required from opsdroid.const import WITAI_DEFAULT_VERSION from opsdroid.const import WITAI_API_ENDPOINT _LOGGER = logging.getLogger(__name__) CONFIG_SCHEMA = {Required("token"): str, "m...
{ "repo_name": "FabioRosado/opsdroid", "path": "opsdroid/parsers/witai.py", "copies": "3", "size": "3059", "license": "apache-2.0", "hash": 3737355968324776400, "line_mean": 36.3048780488, "line_max": 88, "alpha_frac": 0.4923177509, "autogenerated": false, "ratio": 4.698924731182796, "config_tes...
"""A helper function for parsing event type skills.""" import logging from opsdroid.events import Event _LOGGER = logging.getLogger(__name__) async def match_event(event, event_opts): """Filter and matches the event.""" event_type = event_opts.get("type", None) if event_type: # The event type...
{ "repo_name": "opsdroid/opsdroid", "path": "opsdroid/parsers/event_type.py", "copies": "3", "size": "2024", "license": "apache-2.0", "hash": 7033986564143498000, "line_mean": 32.1803278689, "line_max": 81, "alpha_frac": 0.5385375494, "autogenerated": false, "ratio": 4.487804878048781, "config_t...
"""A helper function for training, parsing and executing Rasa NLU skills.""" import logging import json import unicodedata from hashlib import sha256 import aiohttp import arrow from opsdroid.const import RASANLU_DEFAULT_URL, RASANLU_DEFAULT_MODELS_PATH _LOGGER = logging.getLogger(__name__) CONFIG_SCHEMA = {"url":...
{ "repo_name": "jacobtomlinson/opsdroid", "path": "opsdroid/parsers/rasanlu.py", "copies": "2", "size": "10676", "license": "apache-2.0", "hash": -3132005126475477500, "line_mean": 35.6872852234, "line_max": 90, "alpha_frac": 0.5721243912, "autogenerated": false, "ratio": 4.204805041354864, "con...
"""A helper function that executes a series of List queries for many APIs.""" import copy __all__ = [ 'YieldFromList', ] def YieldFromList( service, request, limit=None, batch_size=100, method='List', field='items', predicate=None, current_token_attribute='pageToken', next_token_attribute='nextP...
{ "repo_name": "wemanuel/smry", "path": "smry/server-auth/ls/google-cloud-sdk/.install/.backup/lib/googlecloudapis/apitools/base/py/list_pager.py", "copies": "4", "size": "2208", "license": "apache-2.0", "hash": -4528370331874206700, "line_mean": 37.0689655172, "line_max": 80, "alpha_frac": 0.70289855...
"""A helper module for customization.""" import collections from typing import Any, Dict, List import fnmatch import voluptuous as vol from homeassistant.const import CONF_ENTITY_ID from homeassistant.core import HomeAssistant, split_entity_id import homeassistant.helpers.config_validation as cv _OVERWRITE_KEY_FORMAT...
{ "repo_name": "kyvinh/home-assistant", "path": "homeassistant/helpers/customize.py", "copies": "3", "size": "3752", "license": "apache-2.0", "hash": -162111667948171900, "line_mean": 34.0654205607, "line_max": 78, "alpha_frac": 0.6199360341, "autogenerated": false, "ratio": 3.793731041456016, "...
"""A helper module to create opsdroid events from matrix events.""" import logging from collections import defaultdict from opsdroid import events from . import events as matrix_events _LOGGER = logging.getLogger(__name__) __all__ = ["MatrixEventCreator"] def trim_reply_fallback_text(text): # Copyright (C) 20...
{ "repo_name": "FabioRosado/opsdroid", "path": "opsdroid/connector/matrix/create_events.py", "copies": "3", "size": "7538", "license": "apache-2.0", "hash": -3481010709602380000, "line_mean": 36.5024875622, "line_max": 103, "alpha_frac": 0.5619527726, "autogenerated": false, "ratio": 3.99470058293...
"""A helper module to create opsdroid events from Slack events.""" import logging from collections import defaultdict from opsdroid import events from opsdroid.connector.slack import events as slack_events _LOGGER = logging.getLogger(__name__) class SlackEventCreator(events.EventCreator): """Create opsdroid eve...
{ "repo_name": "jacobtomlinson/opsdroid", "path": "opsdroid/connector/slack/create_events.py", "copies": "2", "size": "8878", "license": "apache-2.0", "hash": 3450214042172813300, "line_mean": 33.277992278, "line_max": 84, "alpha_frac": 0.5698355485, "autogenerated": false, "ratio": 4.286817962337...
"""A helper module to generate fake records for testing. """ from __future__ import print_function from __future__ import division from __future__ import absolute_import from __future__ import unicode_literals import os import sys import re import json import argparse import random from faker import Faker fake = Fake...
{ "repo_name": "nsh87/ehrcorral", "path": "tests/gen_records.py", "copies": "1", "size": "5213", "license": "isc", "hash": 4628451986145361000, "line_mean": 39.7265625, "line_max": 81, "alpha_frac": 0.6182620372, "autogenerated": false, "ratio": 3.774800868935554, "config_test": false, "has_no...
"""A helper script to generate the external examples gallery""" import os def format_icon(title, description, link, image): body = r""" .. raw:: html <div class="sphx-glr-thumbcontainer" tooltip="{}"> .. only:: html .. figure:: ./images/external-examples/{} :target: {} {} .. raw:: h...
{ "repo_name": "akaszynski/vtkInterface", "path": "docs/make_external_gallery.py", "copies": "1", "size": "5208", "license": "mit", "hash": 2098677476674136600, "line_mean": 32.3846153846, "line_max": 161, "alpha_frac": 0.643625192, "autogenerated": false, "ratio": 3.5917241379310343, "config_te...
"""A helper to make an HTML table from a list of dicts, objects, or sequences. A set of CSS styles complementing this helper is in "webhelpers2_grid/html/public/stylesheets/grid.css". To use them, include the stylesheet in your applcation and set your <table> class to "stylized". """ from webhelpers2.html.builder im...
{ "repo_name": "ergo/webhelpers_grid2", "path": "webhelpers2_grid/__init__.py", "copies": "1", "size": "9159", "license": "bsd-3-clause", "hash": -8955709325842078000, "line_mean": 36.5368852459, "line_max": 88, "alpha_frac": 0.6029042472, "autogenerated": false, "ratio": 4.029476462824461, "con...
"""A helper utility to automatically create a database for the DLI App Author: Logan Gore This file is responsible for (at the bare minimum) creating the database and all associated tables for the DLI App. It will import all appropriate models and ensure that a table for each model exists. If given the command-line op...
{ "repo_name": "gorel/dli-reports", "path": "create_db.py", "copies": "1", "size": "37018", "license": "mit", "hash": -1513442793696105700, "line_mean": 26.875, "line_max": 79, "alpha_frac": 0.5201793722, "autogenerated": false, "ratio": 4.6516712741894946, "config_test": false, "has_no_keywor...
#A helpful little script by A. Colwell (2014). from graphics import * win1 = GraphWin('graphics.py Guide',600,400) circ = Circle(Point(50,30),25) circ.draw(win1) labelCirc = Text(Point(200,25),'Circle at 50,30 with radius of 25') labelCirc.draw(win1) lineCirc = Line(Point(75,55),Point(50,30)) lineCirc.set...
{ "repo_name": "MrColwell/PythonProfessionalLearning", "path": "PythonForTeachers/studentExercises/graphics_guide.py", "copies": "1", "size": "1784", "license": "mit", "hash": 6244709449616433000, "line_mean": 25.875, "line_max": 76, "alpha_frac": 0.7012331839, "autogenerated": false, "ratio": 2.4...
"""A Henson plugin to integrate Sentry.""" import asyncio import os as _os import pkg_resources as _pkg_resources from henson import Extension from raven import Client from raven.conf import defaults from raven.utils.imports import import_string from raven_aiohttp import AioHttpTransport __all__ = ('Sentry',) try: ...
{ "repo_name": "dirn/Henson-Sentry", "path": "henson_sentry.py", "copies": "1", "size": "3544", "license": "mit", "hash": 3719142768433842700, "line_mean": 30.3628318584, "line_max": 73, "alpha_frac": 0.6286681716, "autogenerated": false, "ratio": 3.810752688172043, "config_test": false, "has_...
# Ahhh requests w/ freegeoip API from optparse import OptionParser import logging import requests import json def queryFreeGeo(query): response = requests.get('http://www.freegeoip.net/json/' + query) api_response = [] if response.status_code == 200: body = json.loads(response.text) for key, value in b...
{ "repo_name": "ahhh/SPSE", "path": "requests_freegeoip_API.py", "copies": "1", "size": "1548", "license": "mit", "hash": -4217524779756073500, "line_mean": 29.96, "line_max": 67, "alpha_frac": 0.6279069767, "autogenerated": false, "ratio": 3.8034398034398036, "config_test": false, "has_no_key...
# Ahhh requests w/ Malwr API from optparse import OptionParser import logging import requests from requests.auth import HTTPBasicAuth # Function to run our upload def uploadToMalwr(file_upload, apikey): url = 'https://malwr.com/api/analysis/add/' files = {'file': (file_upload, open(file_upload, 'rb'), 'applicatio...
{ "repo_name": "ahhh/SPSE", "path": "requests_malwr_API.py", "copies": "1", "size": "2473", "license": "mit", "hash": -1946090112263411500, "line_mean": 33.3472222222, "line_max": 104, "alpha_frac": 0.6328346138, "autogenerated": false, "ratio": 3.615497076023392, "config_test": false, "has_no...
# Ahhh requests w/ ShadowServer API from optparse import OptionParser import logging import requests # Function to run our check def checkSS(ioc): url = "https://innocuous.shadowserver.org/api/?query=" + ioc if "," in ioc: url = "https://innocuous.shadowserver.org/api/?query=" args = ioc.split(",") r...
{ "repo_name": "ahhh/SPSE", "path": "requests_shadowserver_API.py", "copies": "1", "size": "1659", "license": "mit", "hash": -4461268757921220000, "line_mean": 29.7222222222, "line_max": 78, "alpha_frac": 0.6202531646, "autogenerated": false, "ratio": 3.638157894736842, "config_test": false, "...
# Ahhh requests w/ Viper API from optparse import OptionParser import logging import requests from requests.auth import HTTPBasicAuth # Function to run our upload def uploadToViper(user, passw, file_upload, endpoint): url = 'http://'+endpoint+'/file/add' files = {'file': (file_upload, open(file_upload, 'rb'), 'ap...
{ "repo_name": "ahhh/SPSE", "path": "requests_viper_API.py", "copies": "1", "size": "3263", "license": "mit", "hash": -5327346186200123000, "line_mean": 35.6629213483, "line_max": 104, "alpha_frac": 0.6444989274, "autogenerated": false, "ratio": 3.629588431590656, "config_test": false, "has_no...
"""A Hiero task and preset for sending shots to a Stone FS via Wiretap. @author Brendan Holt @date March 2014 @see \ref modStonify @defgroup modFnStonify FnStonify @{ """ import os.path import platform from Queue import Queue, Empty import re import subprocess import sys from threading import Thread import hiero.cor...
{ "repo_name": "CBSDigital/Hiero-Wiretap", "path": "plugins/FnStonify.py", "copies": "1", "size": "19083", "license": "bsd-3-clause", "hash": 5688566619608152000, "line_mean": 38.3463917526, "line_max": 124, "alpha_frac": 0.5889535188, "autogenerated": false, "ratio": 4.436875145315043, "config_...
"""A high level class that simplifies emulated protocol hosts. Example: find all bgp sessions that are up and flap them protocol_mgmt = IxnProtocolManagement(ixnhttp) bgp_ipv4_peer = protocol_mgmt.find(type='bgpipv4peer', name='BGP Peer 1', session_state='up') bgp_ipv4_peer. """ from ixnetwork.IxnQu...
{ "repo_name": "OpenIxia/ixnetwork_client_python", "path": "ixnetwork/IxnProtocolManagement.py", "copies": "1", "size": "1372", "license": "mit", "hash": -4229922102414817300, "line_mean": 38.3529411765, "line_max": 98, "alpha_frac": 0.7201166181, "autogenerated": false, "ratio": 3.875706214689265...
"""A high level class that simplifies the process of adding physical ports annd mapping virtual ports to physical ports Example: port_mgmt = IxnPortManagement(ixnhttp) port_mgmt \ .map('10.200.109.3', '1', '1') \ .map('10.200.109.3', '1', '2') \ .map('Ethernet - 001', '10.200.109.3...
{ "repo_name": "OpenIxia/ixnetwork_client_python", "path": "ixnetwork/IxnPortManagement.py", "copies": "1", "size": "2624", "license": "mit", "hash": -1574607407959083800, "line_mean": 38.1791044776, "line_max": 146, "alpha_frac": 0.584222561, "autogenerated": false, "ratio": 3.70098730606488, "...
# A high-level interface to the pycurl extension # # ** mfx NOTE: the CGI class uses "black magic" using COOKIEFILE in # combination with a non-existant file name. See the libcurl docs # for more info. # # By Eric S. Raymond, April 2003. import sys, pycurl py3 = sys.version_info[0] == 3 # python 2/3 compatibil...
{ "repo_name": "yasoob/PythonRSSReader", "path": "venv/lib/python2.7/dist-packages/curl/__init__.py", "copies": "3", "size": "7070", "license": "mit", "hash": -7697916630468215000, "line_mean": 37.4239130435, "line_max": 90, "alpha_frac": 0.6398868458, "autogenerated": false, "ratio": 3.5815602836...
'''A high-level interface to the pycurl extension''' # ** mfx NOTE: the CGI class uses "black magic" using COOKIEFILE in # combination with a non-existant file name. See the libcurl docs # for more info. import sys, pycurl py3 = sys.version_info[0] == 3 # python 2/3 compatibility if py3: import urllib.par...
{ "repo_name": "solome/jyp", "path": "misc/virtenv/lib/python2.7/site-packages/curl/__init__.py", "copies": "10", "size": "7037", "license": "mpl-2.0", "hash": 8535137645339292000, "line_mean": 37.6648351648, "line_max": 90, "alpha_frac": 0.6396191559, "autogenerated": false, "ratio": 3.5958099131...
"""A high-level wrapper around the whole ui.TableView system.""" import ui import collections class Cell(): """A single cell in a ui.TableView. This class "subclasses" ui.TableViewCell by wrapping it. """ def __init__(self): self._cell = ui.TableViewCell() @property def accessory_ty...
{ "repo_name": "controversial/ui2", "path": "ui2/view_classes/TableView.py", "copies": "1", "size": "1923", "license": "mit", "hash": 5480735436470973000, "line_mean": 21.8928571429, "line_max": 64, "alpha_frac": 0.6307852314, "autogenerated": false, "ratio": 4.00625, "config_test": false, "ha...
"""A high-speed, production ready, thread pooled, generic HTTP server. Simplest example on how to use this module directly (without using CherryPy's application machinery):: from cherrypy import wsgiserver def my_crazy_app(environ, start_response): status = '200 OK' response_headers = [('Cont...
{ "repo_name": "mapproxy/mapproxy-renderd", "path": "mp_renderd/ext/wsgiserver.py", "copies": "1", "size": "86726", "license": "apache-2.0", "hash": 1431731323040410600, "line_mean": 36.7069565217, "line_max": 135, "alpha_frac": 0.5290916219, "autogenerated": false, "ratio": 4.416458725874625, "...
"""A high-speed, production ready, thread pooled, generic WSGI server. Simplest example on how to use this module directly (without using CherryPy's application machinery): from cherrypy import wsgiserver def my_crazy_app(environ, start_response): status = '200 OK' response_headers = [('C...
{ "repo_name": "fmcingvale/cherrypy_gae", "path": "wsgiserver/__init__.py", "copies": "1", "size": "61017", "license": "bsd-3-clause", "hash": 3918985307104238000, "line_mean": 38.1134615385, "line_max": 91, "alpha_frac": 0.5375714965, "autogenerated": false, "ratio": 4.432120287644367, "config_...
"""A high-speed, production ready, thread pooled, generic WSGI server. Simplest example on how to use this module directly (without using CherryPy's application machinery): from cherrypy import wsgiserver def my_crazy_app(environ, start_response): status = '200 OK' response_heade...
{ "repo_name": "cread/ec2id", "path": "cherrypy/wsgiserver/__init__.py", "copies": "3", "size": "73214", "license": "apache-2.0", "hash": -1220438902395194600, "line_mean": 38.8104793757, "line_max": 92, "alpha_frac": 0.5087141803, "autogenerated": false, "ratio": 4.623847416950865, "config_test...
"""A histoprogramming utility to go from some input lines to something plottable. Licensed under the 3-clause BSD License: Copyright (c) 2011-2014, Neeraj Kumar (neerajkumar.org) All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the foll...
{ "repo_name": "neeraj-kumar/nkpylib", "path": "nkhist.py", "copies": "1", "size": "5481", "license": "bsd-3-clause", "hash": 798612625080239600, "line_mean": 35.0592105263, "line_max": 81, "alpha_frac": 0.6591862799, "autogenerated": false, "ratio": 3.808895066018068, "config_test": false, "h...
"""A home for constants.""" # Python modules from __future__ import division # 3rd party modules # Our modules # import vespa.common.ordered_dict as ordered_dict from collections import OrderedDict as ordered_dict # We could also use numpy.pi in place of 3.14..., but it's useful to limit # this module's dependencie...
{ "repo_name": "beOn/hcpre", "path": "hcpre/duke_siemens/constants.py", "copies": "1", "size": "13790", "license": "bsd-3-clause", "hash": -3535862691005569500, "line_mean": 30.3409090909, "line_max": 88, "alpha_frac": 0.5553299492, "autogenerated": false, "ratio": 3.8041379310344827, "config_te...
"""A home-grown job-queueing system based on Postgres To avoid having to run another system, we use a PostgreSQL table as our queue. If our pipeline for each dataset looks like `A -> B -> C -> D`, then we store the timestamps of the last time we ran `A`, `B`, `C`, and `D` for each dataset. A worker for step `B` in the...
{ "repo_name": "adi-foundry/nycodex", "path": "nycodex/db/queue.py", "copies": "1", "size": "5228", "license": "apache-2.0", "hash": 6131081676243189000, "line_mean": 37.7259259259, "line_max": 78, "alpha_frac": 0.6440321347, "autogenerated": false, "ratio": 3.705173635719348, "config_test": fal...
# a homophonic cipher # needs to have a homophoinic letter substitution table import sys; sys.path.append(".."); sys.path.append("homophonic") from tkinter import Tk from tkinter.filedialog import askopenfilename from homophonic_table_creator import TableCreator from letter_distribution import LangData class TableGe...
{ "repo_name": "himrasmussen/PyCipher", "path": "homophonic/table_getter.py", "copies": "1", "size": "1523", "license": "mit", "hash": -929651335152941800, "line_mean": 36.1463414634, "line_max": 83, "alpha_frac": 0.6198292843, "autogenerated": false, "ratio": 4.094086021505376, "config_test": f...
# a homophonic cipher # needs to have a homophoinic letter substitution table import sys; sys.path.append(".."); sys.path.append("homophonic") import copy from tkinter import Tk from tkinter.filedialog import askopenfilename from cryptobase import CryptoBase from homophonic_table_creator import TableCreator from lett...
{ "repo_name": "himrasmussen/PyCipher", "path": "homophonic/homophonic_cipher.py", "copies": "1", "size": "2625", "license": "mit", "hash": -8112990081034443000, "line_mean": 33.0909090909, "line_max": 96, "alpha_frac": 0.5961904762, "autogenerated": false, "ratio": 3.977272727272727, "config_te...
# a homophonic cipher # needs to have a homophoinic letter substitution table import copy from tkinter import Tk from tkinter.filedialog import askopenfilename from cryptobase import CryptoBase from homophonic_table_creator import TableCreator from letter_distribution import LangData class HomophonicCipher(CryptoBas...
{ "repo_name": "himrasmussen/PyCipher", "path": "homophonic_cipher.py", "copies": "1", "size": "3719", "license": "mit", "hash": -4135545183103933000, "line_mean": 35.1067961165, "line_max": 96, "alpha_frac": 0.5885990858, "autogenerated": false, "ratio": 4.095814977973569, "config_test": false,...
"""A hook for modifying parameter values read from the WMT client.""" from wmt.utils.hook import yaml_dump def apply_boundary_condition(env, side='left'): boundary = env['_boundary_condition_' + side].encode('utf-8') if boundary == 'Dirichlet': bc = [] bc.append(boundary) bc.append(fl...
{ "repo_name": "csdms/wmt-metadata", "path": "metadata/AnugaSedRectangular/hooks/pre-stage.py", "copies": "1", "size": "1039", "license": "mit", "hash": -9102546280493783000, "line_mean": 27.8611111111, "line_max": 71, "alpha_frac": 0.6130895091, "autogenerated": false, "ratio": 3.8198529411764706...
"""A hook for modifying parameter values read from the WMT client.""" from wmt.utils.hook import yaml_dump max_sides = 8 def apply_boundary_condition(env, side='side1'): boundary = env['_boundary_condition_' + side].encode('utf-8') if boundary == 'Dirichlet': bc = [] bc.append(boundary) ...
{ "repo_name": "csdms/wmt-metadata", "path": "metadata/AnugaSedOutline/hooks/pre-stage.py", "copies": "1", "size": "1295", "license": "mit", "hash": -460593016373203700, "line_mean": 25.9791666667, "line_max": 71, "alpha_frac": 0.5961389961, "autogenerated": false, "ratio": 3.647887323943662, "c...
"""A hook for modifying parameter values read from the WMT client.""" import os import shutil from wmt.utils.hook import yaml_dump, find_simulation_input_file from pbs_server.file import (IlambConfigFile, get_region_labels_txt, get_region_labels_ncdf) gfed_re...
{ "repo_name": "csdms/wmt-metadata", "path": "metadata/ILAMB/hooks/pre-stage.py", "copies": "1", "size": "2408", "license": "mit", "hash": -4470623128888226300, "line_mean": 27.3294117647, "line_max": 72, "alpha_frac": 0.5527408638, "autogenerated": false, "ratio": 3.7333333333333334, "config_te...
"""A hook for modifying parameter values read from the WMT client.""" import os import shutil from wmt.utils.hook import find_simulation_input_file, yaml_dump from topoflow_utils.hook import assign_parameters file_list = [] def execute(env): """Perform pre-stage tasks for running a component. Parameters ...
{ "repo_name": "csdms/wmt-metadata", "path": "metadata/FrostNumberGeoModel/hooks/pre-stage.py", "copies": "1", "size": "1249", "license": "mit", "hash": -311074938657756540, "line_mean": 26.7555555556, "line_max": 70, "alpha_frac": 0.645316253, "autogenerated": false, "ratio": 3.538243626062323, ...
"""A hook for refreshing a component's metadata.""" import os import subprocess import json from wmt.utils.ssh import get_host_info, open_connection_to_host from wmt.config import site import pbs_server.models as models import pbs_server.variables as variables hostname = 'siwenna.colorado.edu' models_dir = '/home/cs...
{ "repo_name": "csdms/wmt-metadata", "path": "metadata/ILAMB/hooks/refresh.py", "copies": "1", "size": "3416", "license": "mit", "hash": 9112944227350282000, "line_mean": 27.9491525424, "line_max": 78, "alpha_frac": 0.6349531616, "autogenerated": false, "ratio": 3.7292576419213974, "config_test"...
"""A hook to add the '--reorder' argument to py.test.""" from pytest_reorder import DEFAULT_ORDER, make_reordering_hook def pytest_addoption(parser): """Add the '--reorder' argument to the py.test invocation.""" group = parser.getgroup('tests reordering', 'reordering', after='general') group.addoption( ...
{ "repo_name": "not-raspberry/pytest_reorder", "path": "pytest_reorder/hook.py", "copies": "1", "size": "1428", "license": "mit", "hash": -5511328188489932000, "line_mean": 43.625, "line_max": 99, "alpha_frac": 0.6316526611, "autogenerated": false, "ratio": 3.9338842975206614, "config_test": tru...
#<a href="path/to/myimage1_original.jpg"> # <img alt="Title 1" src="path/to/myimage1_thumbnail.jpg" /> # </a> numfiles = 12 # justified gallery """ for i in range(1,numfiles+1): print('<a href="img/resized/{}.jpg">'.format(str(i).zfill(4))) print('<img alt="Title {}" src="img/resized/{}.jpg" />'....
{ "repo_name": "harfordt/harfordt.github.io", "path": "L3_demos/img/resized/gen.py", "copies": "1", "size": "1581", "license": "mit", "hash": -7938862249148161000, "line_mean": 23.3230769231, "line_max": 218, "alpha_frac": 0.5762175838, "autogenerated": false, "ratio": 2.591803278688525, "config...
"""Ahsay API example. Usage: example.py <user> <backup_name> [--username=<username> | --password=<password> | --hostname=<hostname>] example.py (-h | --help) example.py --version Options: -h --help Show this screen. --version Show version. --username=<username> ...
{ "repo_name": "koddsson/ahsay-python-api", "path": "ahsay/example.py", "copies": "1", "size": "1790", "license": "mit", "hash": 6595940438205103000, "line_mean": 33.4230769231, "line_max": 105, "alpha_frac": 0.6324022346, "autogenerated": false, "ratio": 3.5728542914171655, "config_test": false...
a = ['https://store.starbucks.com/coffee/whole-bean-and-ground?utm_source=Sbux&utm_m edium=Mega&utm_campaign=Coffee+Mega+WB&utm_content=HolFY17&cm_mmc=Sbux-_-Mega-_- Coffee+Mega+WB-_-HolFY17', 'https://store.starbucks.com/coffee/whole-bean-and-gr ound?utm_source=sbuc&utm_medium=Mega&utm_campaign=Coffee+Mega+Ground...
{ "repo_name": "Zhaominxin/MyProject", "path": "starbucks/select_urls.py", "copies": "1", "size": "16527", "license": "mit", "hash": -4151703646051846000, "line_mean": 75.9669811321, "line_max": 84, "alpha_frac": 0.7505294367, "autogenerated": false, "ratio": 2.1803430079155675, "config_test": f...
"""A hug directive that enables easy interaction and storage of profiling information and code path explanations.""" from copy import deepcopy from datetime import datetime import hug from hug_explainable.context_manager import explainable from inspect import getframeinfo, stack @hug.directive() class Explainable(ob...
{ "repo_name": "timothycrosley/hug_explainable", "path": "hug_explainable/directive.py", "copies": "1", "size": "3668", "license": "mit", "hash": 2786187956554770400, "line_mean": 33.6037735849, "line_max": 116, "alpha_frac": 0.6166848419, "autogenerated": false, "ratio": 4.613836477987421, "con...
"""A hug middleware that automatically adds explanations to the request.""" import json import hug from hug_explainable.directive import Explainable DOCUMENT = """ <html> <head> <meta charset="UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="viewport" c...
{ "repo_name": "timothycrosley/hug_explainable", "path": "hug_explainable/middleware.py", "copies": "1", "size": "16001", "license": "mit", "hash": -1989437529620294400, "line_mean": 32.9004237288, "line_max": 121, "alpha_frac": 0.4116617711, "autogenerated": false, "ratio": 4.4213871235147835, ...
"""A human-run test to see if toolbars have correct widget traversal. Currently only tests FirstOrderBar. """ # TODO: add other toolbars as well. # Purpose: intent is an integration test for toolbars and widgets, to test the # widget._find_next_entry method (and, at some future time, ._on_return, # ._on_tab, ._refres...
{ "repo_name": "sametz/nmrmint", "path": "tests/human/toolbar_focus.py", "copies": "1", "size": "2276", "license": "mit", "hash": -2180323120616833800, "line_mean": 31.9855072464, "line_max": 80, "alpha_frac": 0.64543058, "autogenerated": false, "ratio": 3.8972602739726026, "config_test": true, ...
# AI 2018 import os import inspect currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) parentdir = os.path.dirname(os.path.dirname(currentdir)) os.sys.path.insert(0, parentdir) # Importing the libraries import os import numpy as np import gym from gym import wrappers import pybullet...
{ "repo_name": "MTASZTAKI/ApertusVR", "path": "plugins/physics/bulletPhysics/3rdParty/bullet3/examples/pybullet/gym/pybullet_envs/ARS/ars.py", "copies": "4", "size": "8825", "license": "mit", "hash": -3985892365939780600, "line_mean": 29.6423611111, "line_max": 100, "alpha_frac": 0.6554107649, "auto...
"""ai and foreign keys genomic set member Revision ID: da3c59138805 Revises: 6f26f7c49be7 Create Date: 2020-02-19 15:04:32.203546 """ from alembic import op import sqlalchemy as sa import model.utils from sqlalchemy.dialects import mysql from rdr_service.participant_enums import PhysicalMeasurementsStatus, Questionn...
{ "repo_name": "all-of-us/raw-data-repository", "path": "rdr_service/alembic/versions/da3c59138805_ai_and_foreign_keys_genomic_set_member.py", "copies": "1", "size": "3052", "license": "bsd-3-clause", "hash": -8390815264279897000, "line_mean": 37.15, "line_max": 131, "alpha_frac": 0.7031454784, "aut...
# AI Class. This is my first ever take on AI. # It gives commands by setting an attribute, # which is then accesed by a getCommand() method # in the game instance's handleInput() method. # We'll work with heuristics: # 1. Aggregate height (minimize) # 2. Complete lines (maximize) # 3. Holes (minimize) # 4. Bumpiness ...
{ "repo_name": "SpiritualForest/tetris", "path": "src/ai.py", "copies": "1", "size": "4695", "license": "mit", "hash": 1226782768736429800, "line_mean": 36.8629032258, "line_max": 128, "alpha_frac": 0.5676251331, "autogenerated": false, "ratio": 4.009393680614859, "config_test": false, "has_no...
# AI has randomly generated stats with a total of 20 Skill points. each jitsu (it gets 4) is ranked from highest to lowest, with a class asigned to it. # if statements determine what jitsu TYPE should be used, and the stats of jitsus are balanced from highest to lowest. AI randomly chooses 1 # each jitsu has a number a...
{ "repo_name": "TheMuffinMan5930/NarutoBattle", "path": "Rudimentary AI.py", "copies": "1", "size": "1400", "license": "mit", "hash": -3459622945905392600, "line_mean": 59.8695652174, "line_max": 153, "alpha_frac": 0.6857142857, "autogenerated": false, "ratio": 3.4739454094292803, "config_test":...
""" AIML Loader that can load zipped AIML2.0 XML files with an AIML1.0 parser in python 3 TODO: fix doctests >>> from nlpia.loaders import get_data >> alice_path = get_data('alice') >> bot = create_brain(alice_path) # doctest: +NORMALIZE_WHITESPACE, +ELLIPSIS Loading ... >> len(bot._brain._root.keys()) 3445 >> bo...
{ "repo_name": "totalgood/nlpia", "path": "src/nlpia/clean_alice.py", "copies": "1", "size": "4128", "license": "mit", "hash": 8243229993944606000, "line_mean": 33.4, "line_max": 119, "alpha_frac": 0.617248062, "autogenerated": false, "ratio": 3.480607082630691, "config_test": false, "has_no_k...
# Aim: Mostly for phenix users and those don't like using Miniconda # 1. wget url_to_tar_file.tar # 2. tar -xf url_to_tar_file.tar # 3. source amber17/ambersh # 4. Just it """ Usage example: python pack_non_conda.py ambertools-17.0.1-py27_1.tar.bz2 Note: You can use file pattern This script will unpack that bz2 file...
{ "repo_name": "Amber-MD/ambertools-conda-build", "path": "conda_tools/pack_non_conda.py", "copies": "1", "size": "1508", "license": "mit", "hash": -6768139214133132000, "line_mean": 27.4528301887, "line_max": 104, "alpha_frac": 0.6558355438, "autogenerated": false, "ratio": 3.4350797266514808, ...
# Aim of this file is to create a few classes and methods to test # my ideas (Adrian) # Main documentation for this file is the Wiki: # https://github.com/aernesto/dots-reversal-ideal-obs/wiki/Python-classes-and # -methods # Comment practice: In this script, we write comments before the targeted # instruction import...
{ "repo_name": "aernesto/dots-reversal-ideal-obs", "path": "class_tests_Adrian.py", "copies": "1", "size": "8308", "license": "mit", "hash": 3725155238078859000, "line_mean": 32.3654618474, "line_max": 80, "alpha_frac": 0.5607847857, "autogenerated": false, "ratio": 3.8022883295194507, "config_t...
# aiMove.py # various movement AI scripts for mobs import random import Globals class Timer: # this was copied directly from World.py, and should be exactly the same at all times. """ A timer is an object that, when spawned, will count down until zero, and then perform and action and possibly respawn its...
{ "repo_name": "buckets1337/MotherMUD", "path": "aiMove.py", "copies": "1", "size": "9771", "license": "apache-2.0", "hash": -4014692986062936000, "line_mean": 36.2977099237, "line_max": 213, "alpha_frac": 0.6536690206, "autogenerated": false, "ratio": 2.969006381039198, "config_test": false, ...
#a Imports from gjslib.math import vectors, matrix #a c_set_of_lines class c_set_of_lines(object): def __init__(self): self.lines = [] pass def add_line(self, pt, drn): drn = list(drn) drn = vectors.vector_normalize(drn) self.lines.append( (pt,drn) ) pass def...
{ "repo_name": "embisi-github/gjslib", "path": "python/gjslib/math/line_sets.py", "copies": "1", "size": "1834", "license": "apache-2.0", "hash": -776752342993064100, "line_mean": 31.75, "line_max": 86, "alpha_frac": 0.5070883315, "autogenerated": false, "ratio": 3.0164473684210527, "config_test...
#a Imports from gjslib.math.line_sets import c_set_of_lines from gjslib.math.quaternion import c_quaternion import image_projection #a c_point_mapping class c_point_mapping(object): #f __init__ def __init__(self, images_dir=""): self.reset() self.images_dir = images_dir self.object_gues...
{ "repo_name": "embisi-github/gjslib", "path": "3d/image_point_mapping.py", "copies": "1", "size": "14734", "license": "apache-2.0", "hash": 7553273644891667000, "line_mean": 38.2906666667, "line_max": 132, "alpha_frac": 0.5376001086, "autogenerated": false, "ratio": 3.4733616218764736, "config_...
#a Imports from overlap import c_overlap_2d #a Structure element class - a piece of 'background' that has an image and is slightly dynamic #c c_structure_element class c_structure_element( object ): """ An element of a structure This has a position and a list of images that can be used to represent the el...
{ "repo_name": "embisi-github/gjslib", "path": "python/gjslib/math/structure.py", "copies": "1", "size": "4317", "license": "apache-2.0", "hash": 3071361528450831000, "line_mean": 34.975, "line_max": 170, "alpha_frac": 0.5916145471, "autogenerated": false, "ratio": 3.978801843317972, "config_tes...
#a Imports import gjslib.graphics.bone as bones from gjslib.math.bezier import c_point #a Test stuff def build_ship(): skin_angles = { "jet":10.0, "bottom":70.0, "mid_b":65.0, "mid_m":85.0, "mid_t":115.0, "top":20.0 } bone_angles = { "base":60.0, "mid_b":80.0, "mid_m":80.0, "mid_t":80.0, "fin_t":80.0, "fin_b":...
{ "repo_name": "embisi-github/gjslib", "path": "tests/sample_ship.py", "copies": "1", "size": "17539", "license": "apache-2.0", "hash": -1542440475179620000, "line_mean": 95.9005524862, "line_max": 165, "alpha_frac": 0.3796111523, "autogenerated": false, "ratio": 3.588175122749591, "config_test"...
#a Imports import math #f vector_sq def vector_sq( v ): return v[0]*v[0] + v[1]*v[1] #f vector_dot_product def vector_dot_product( v0, v1 ): return v0[0]*v1[0] + v0[1]*v1[1] #f find_collision_time_circle_circle def find_collision_time_circle_circle( p0, v0, r0, p1, v1, r1 ): """ Find the time (0<t<=1...
{ "repo_name": "embisi-github/gjslib", "path": "python/gjslib/math/collision.py", "copies": "1", "size": "9383", "license": "apache-2.0", "hash": -6972021953243486000, "line_mean": 34.4075471698, "line_max": 127, "alpha_frac": 0.5314931259, "autogenerated": false, "ratio": 2.2807486631016043, "c...
#a Imports import pygame.image #a Simple background #c c_image class c_image( object ): def __init__( self, **kwargs ): self.image = None self.scaled_image = None self.size = (0,0) self.scaled_size = (0,0) self.last_scale = 1 pass def load( self, image_filename )...
{ "repo_name": "embisi-github/gjslib", "path": "python/gjslib/graphics/image.py", "copies": "1", "size": "2219", "license": "apache-2.0", "hash": 1914557989559335700, "line_mean": 40.8679245283, "line_max": 133, "alpha_frac": 0.5808922938, "autogenerated": false, "ratio": 3.6617161716171616, "co...
#a Imports #c Classes class c_overlap_2d( object ): """ This class manages overlapping objects each with a 2D bounding box The class is given a set of objects, each with its bounding box A caller can then interrograte the class to find a list of all the objects in the class' set which overlap a given b...
{ "repo_name": "embisi-github/gjslib", "path": "python/gjslib/math/overlap.py", "copies": "1", "size": "5803", "license": "apache-2.0", "hash": 1017177414628081700, "line_mean": 44.6929133858, "line_max": 146, "alpha_frac": 0.5891780114, "autogenerated": false, "ratio": 4.416286149162861, "confi...
#Aim - Program to read the logs generated by YCSB and generate the graphs for read latency, update latency and throughput #Assumption - File Name of logs should be XXXXrunYYYY_ZZZZ.out #XXXX - DBName #YYYY - Desired Throughput #ZZZZ - Threads #Author - Naman Aggarwal import os import re from os.path import isfile, joi...
{ "repo_name": "namaggarwal/ycsb-autograph-generator", "path": "create_graph.py", "copies": "1", "size": "5357", "license": "mit", "hash": 9039027597842200000, "line_mean": 32.48125, "line_max": 148, "alpha_frac": 0.6455105469, "autogenerated": false, "ratio": 3.1236151603498543, "config_test": ...
# Aims to provide functions for fast periodic daubechies transforms (forward and inverse) in 2D # https://github.com/amitgroup/amitgroup/tree/master/amitgroup/util/wavelet import numpy as np import scipy import scipy.sparse SPARSITY_THRESHOLD = 256 def _populate(W, filtr, yoffset): N = len(filtr) for i in ra...
{ "repo_name": "aasensio/pyiacsun", "path": "pyiacsun/sparse/wavelet.py", "copies": "1", "size": "25382", "license": "mit", "hash": -409426970546257100, "line_mean": 54.90969163, "line_max": 957, "alpha_frac": 0.6892285872, "autogenerated": false, "ratio": 2.728073946689596, "config_test": false...
# Aims to provide functions for fast periodic daubechies transforms (forward and inverse) in 2D import numpy as np import scipy import scipy.sparse SPARSITY_THRESHOLD = 256 def _populate(W, filtr, yoffset): N = len(filtr) for i in range(W.shape[1]//2): for j in range(N): W[yoffset+i, (-(N...
{ "repo_name": "amitgroup/amitgroup", "path": "amitgroup/util/wavelet/periodic_daubechies.py", "copies": "1", "size": "25304", "license": "bsd-3-clause", "hash": -1045014297493018100, "line_mean": 54.8587196468, "line_max": 957, "alpha_frac": 0.6888634208, "autogenerated": false, "ratio": 2.728488...
"""Aimsun dummy server. This script creates a dummy server mimicking the functionality in the Aimsun runner script. Used for testing purposes. """ from thread import start_new_thread import socket import struct import sys import os sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) import...
{ "repo_name": "cathywu/flow", "path": "tests/dummy_server.py", "copies": "1", "size": "6442", "license": "mit", "hash": -3998859465154709000, "line_mean": 30.8910891089, "line_max": 79, "alpha_frac": 0.5158335921, "autogenerated": false, "ratio": 4.0901587301587305, "config_test": false, "has...
# a_input = input('Please input a number:') # print('This number is',a_input) # a_input=int(input('please input a number:')) # if a_input==1: # print('This is a good one') # elif a_input==2: # print('see u next time') # else: # print('good luck') # myScore = int(input("Please input your score:")) # if myS...
{ "repo_name": "1065865483/0python_script", "path": "Python/003.py", "copies": "1", "size": "1908", "license": "mit", "hash": 6627837142604277000, "line_mean": 21.6585365854, "line_max": 61, "alpha_frac": 0.491926803, "autogenerated": false, "ratio": 2.118586088939567, "config_test": false, "h...
# a = input("Type a number") # b = input("type a number") # # a =int(a) # b = int(b) # # try: # print(a/b) # except ZeroDivisionError: # print("Do not enter that") # try: # a = input("Skriv ett heltal: \n") # b = input("Skriv ett heltal: \n") # a = int(a) # b = int(b) # print(a/b) # except...
{ "repo_name": "Frikeer/LearnPython", "path": "exc4.py", "copies": "1", "size": "1156", "license": "unlicense", "hash": -7018978671122824000, "line_mean": 15.2816901408, "line_max": 42, "alpha_frac": 0.5302768166, "autogenerated": false, "ratio": 2.4491525423728815, "config_test": false, "has_...
A = [int(i) for i in input()] B = [int(i) for i in input()] C = [int(i) for i in input()] D = [int(i) for i in input()] n = int(input()) W = [] T = [] for _ in range(n) : w, t = list(map(int, input().split())) W.append(w) T.append(t) index_list = [0] * 4 a, b, c, d = index_list cal_case_1 = [lambda x : x-1,...
{ "repo_name": "TeamLab/lab_study_group", "path": "2018/CodingInterview/3주차/index.py", "copies": "2", "size": "1032", "license": "mit", "hash": 3089146759025189000, "line_mean": 28.4857142857, "line_max": 81, "alpha_frac": 0.4525193798, "autogenerated": false, "ratio": 2.2483660130718954, "confi...
a=int(raw_input()) for i in range(0,a): arr=raw_input() array=raw_input() newstr=[] c=1 ar=[] for i in range(0,len(arr)): ar.append(arr[i]) #print ar for j in range(0,len(arr)-1): for k in range(j+1,len(arr)): if(arr[j]==arr[k]): c=0 ...
{ "repo_name": "shreyakupadhyay/pythonbite", "path": "enigmum/Cryptography.py", "copies": "1", "size": "3265", "license": "mit", "hash": 436113134447901300, "line_mean": 24.5078125, "line_max": 53, "alpha_frac": 0.4355283308, "autogenerated": false, "ratio": 3.1454720616570326, "config_test": fa...
""" Aioauth-client example. """ import asyncio from aiohttp import web import html from aioauth_client import ( FacebookClient, GithubClient, GoogleClient, OAuth1Client, TwitterClient, VKClient, YandexClient, ) app = web.Application() clients = { 'twitter': { 'class': Twitter...
{ "repo_name": "ei-grad/aioauth-client", "path": "example/app.py", "copies": "1", "size": "4955", "license": "mit", "hash": -603581447197160400, "line_mean": 29.0303030303, "line_max": 107, "alpha_frac": 0.5886982846, "autogenerated": false, "ratio": 3.2449246889325476, "config_test": false, "...
"""Aioauth-client example. Requirements: aioauth-client asgi-tools uvicorn Run the example with uvicorn: $ uvicorn --port 5000 example.app:app """ from asgi_tools import App, ResponseRedirect import html from pprint import pformat from .config import CREDENTIALS from aioauth_client import ClientRe...
{ "repo_name": "klen/aioauth-client", "path": "example/app.py", "copies": "1", "size": "4687", "license": "mit", "hash": -8679985485114157000, "line_mean": 35.0538461538, "line_max": 98, "alpha_frac": 0.584168978, "autogenerated": false, "ratio": 3.566971080669711, "config_test": false, "has_n...
"""aiobfd: Asynchronous BFD Daemon""" import argparse import socket import logging import logging.handlers import sys import aiobfd _LOG_LEVELS = ['CRITICAL', 'ERROR', 'WARNING', 'INFO', 'DEBUG'] def parse_arguments(): """Parse the user arguments""" parser = argparse.ArgumentParser( description='Mai...
{ "repo_name": "netedgeplus/aiobfd", "path": "aiobfd/__main__.py", "copies": "1", "size": "3533", "license": "mit", "hash": 8888595770207889000, "line_mean": 46.1066666667, "line_max": 79, "alpha_frac": 0.5776960091, "autogenerated": false, "ratio": 4.1033681765389085, "config_test": false, "h...
"""aiobfd: BFD Control Packet""" # pylint: disable=I0011,E0632,R0902 import logging import bitstring log = logging.getLogger(__name__) # pylint: disable=I0011,C0103 MIN_PACKET_SIZE = 24 MIN_AUTH_PACKET_SIZE = 26 STATE_ADMIN_DOWN = 0 # AdminDown STATE_DOWN = 1 # Down ''' 0 ...
{ "repo_name": "netedgeplus/aiobfd", "path": "aiobfd/packet.py", "copies": "1", "size": "5197", "license": "mit", "hash": -593048696572567900, "line_mean": 41.5983606557, "line_max": 79, "alpha_frac": 0.5135655186, "autogenerated": false, "ratio": 4.088906372934697, "config_test": false, "has_...
"""aiobfd: BFD Control process""" # pylint: disable=I0011,R0913 import asyncio import logging import socket from .transport import Server from .session import Session from .packet import Packet log = logging.getLogger(__name__) # pylint: disable=I0011,C0103 CONTROL_PORT = 3784 class Control: """BFD Control""" ...
{ "repo_name": "netedgeplus/aiobfd", "path": "aiobfd/control.py", "copies": "1", "size": "4397", "license": "mit", "hash": -7752043058861960000, "line_mean": 38.9727272727, "line_max": 79, "alpha_frac": 0.5856265636, "autogenerated": false, "ratio": 4.401401401401402, "config_test": false, "ha...
"""aiobfd: BFD IPv4/IPv6 transport""" import asyncio import logging log = logging.getLogger(__name__) # pylint: disable=I0011,C0103 class Client: """BFD Client for sourcing egress datagrams""" def __init__(self): self.transport = None def connection_made(self, transport): """Socket set...
{ "repo_name": "netedgeplus/aiobfd", "path": "aiobfd/transport.py", "copies": "1", "size": "1275", "license": "mit", "hash": 638356305853112400, "line_mean": 25.5625, "line_max": 72, "alpha_frac": 0.6094117647, "autogenerated": false, "ratio": 4.034810126582278, "config_test": false, "has_no_k...
"""aiobfd: BFD Session with an individual remote""" # pylint: disable=I0011,R0902,R0913 # pylint: disable=I0011,E1101 # socket.IPPROTO_IPV6 missing on Windows import asyncio import random import socket import time import logging import bitstring from .transport import Client from .packet import PACKET_FORMAT, PACKET_D...
{ "repo_name": "netedgeplus/aiobfd", "path": "aiobfd/session.py", "copies": "1", "size": "21572", "license": "mit", "hash": 132790871942410370, "line_mean": 45.7939262473, "line_max": 79, "alpha_frac": 0.5935935472, "autogenerated": false, "ratio": 4.124665391969407, "config_test": false, "has...
"""aiodownload This module contains the core classes. """ import aiohttp import asyncio import async_timeout import logging import os from .strategy import DownloadStrategy, Lenient logger = logging.getLogger(__name__) STATUS_ATTEMPT = 'Download attempted' STATUS_CACHE = 'Cache hit' STATUS_DONE = 'File written' ST...
{ "repo_name": "jelloslinger/aiodownload", "path": "aiodownload/aiodownload.py", "copies": "1", "size": "6383", "license": "mit", "hash": -1540059012498056400, "line_mean": 36.1104651163, "line_max": 117, "alpha_frac": 0.6318345606, "autogenerated": false, "ratio": 4.533380681818182, "config_tes...
"""aiofirebase package.""" import asyncio import json import posixpath from aiohttp import ClientSession class StreamCancelled(Exception): """Signals the stream has been cancelled.""" class StreamAuthRevoked(Exception): """Signals the stream has been cancelled due to the authentication being revoked.""" ...
{ "repo_name": "billyshambrook/aiofirebase", "path": "aiofirebase/__init__.py", "copies": "1", "size": "3513", "license": "mit", "hash": -3317453448974585000, "line_mean": 36.7741935484, "line_max": 120, "alpha_frac": 0.6142897808, "autogenerated": false, "ratio": 4.172209026128266, "config_test...
"""aiohttp bassd Socket Mode client * https://api.slack.com/apis/connections/socket * https://slack.dev/python-slack-sdk/socket-mode/ * https://pypi.org/project/aiohttp/ """ import asyncio import logging from asyncio import Future from asyncio import Queue from logging import Logger from typing import Union, Optional...
{ "repo_name": "slackhq/python-slackclient", "path": "slack_sdk/socket_mode/aiohttp/__init__.py", "copies": "1", "size": "9532", "license": "mit", "hash": -272533492160883330, "line_mean": 40.0862068966, "line_max": 112, "alpha_frac": 0.6027066723, "autogenerated": false, "ratio": 4.45004668534080...
"""Aiohttp cleverbot.io API library.""" import json import asyncio import aiohttp class CleverBot: def __init__(self, user, key, async_init=True, loop=None): self.body = { 'user': user, 'key': key } self.conversation = [] if loop is None: loop = a...
{ "repo_name": "Armored-Dragon/goldmine", "path": "util/cleverbot.py", "copies": "1", "size": "1162", "license": "mit", "hash": 6052570529330879000, "line_mean": 31.2777777778, "line_max": 93, "alpha_frac": 0.5473321859, "autogenerated": false, "ratio": 3.7483870967741937, "config_test": false, ...
"""aiohttp request argument parsing module. Example: :: import asyncio from aiohttp import web from webargs import fields from webargs.aiohttpparser import use_args hello_args = { 'name': fields.Str(required=True) } @asyncio.coroutine @use_args(hello_args) def index(requ...
{ "repo_name": "sloria/webargs", "path": "src/webargs/aiohttpparser.py", "copies": "1", "size": "5966", "license": "mit", "hash": 9171119074826655000, "line_mean": 32.5168539326, "line_max": 86, "alpha_frac": 0.6149849145, "autogenerated": false, "ratio": 3.9933065595716197, "config_test": false...
"""Aiohttp test utils.""" import asyncio from contextlib import contextmanager import functools import json as _json from unittest import mock from urllib.parse import urlparse, parse_qs import yarl from aiohttp.client_exceptions import ClientResponseError class AiohttpClientMocker: """Mock Aiohttp client reques...
{ "repo_name": "tboyce1/home-assistant", "path": "tests/test_util/aiohttp.py", "copies": "2", "size": "6578", "license": "apache-2.0", "hash": 1085597680468487200, "line_mean": 29.1743119266, "line_max": 78, "alpha_frac": 0.5478868957, "autogenerated": false, "ratio": 4.508567511994517, "config_...
"""Aiohttp test utils.""" import asyncio from contextlib import contextmanager import functools import json as _json from unittest import mock from urllib.parse import urlparse, parse_qs class AiohttpClientMocker: """Mock Aiohttp client requests.""" def __init__(self): """Initialize the request mocke...
{ "repo_name": "lukas-hetzenecker/home-assistant", "path": "tests/test_util/aiohttp.py", "copies": "5", "size": "4339", "license": "mit", "hash": -3777463014769264600, "line_mean": 29.3426573427, "line_max": 75, "alpha_frac": 0.5593454713, "autogenerated": false, "ratio": 4.445696721311475, "con...
"""Aiohttp test utils.""" import asyncio from contextlib import contextmanager import json as _json import re from unittest import mock from urllib.parse import parse_qs from aiohttp import ClientSession from aiohttp.client_exceptions import ClientError, ClientResponseError from aiohttp.streams import StreamReader fro...
{ "repo_name": "tboyce021/home-assistant", "path": "tests/test_util/aiohttp.py", "copies": "4", "size": "9174", "license": "apache-2.0", "hash": -4818059551611379000, "line_mean": 26.8, "line_max": 87, "alpha_frac": 0.5601700458, "autogenerated": false, "ratio": 4.3978906999041225, "config_test"...
"""AioHTTP Web Server Setup""" import logging import subprocess import time import os import base64 from cryptography import fernet import aiohttp import aiohttp_jinja2 import jinja2 import markdown import markupsafe from aiohttp_session import setup as setup_session from aiohttp_session.cookie_storage import Encrypt...
{ "repo_name": "bioconda/bioconda-utils", "path": "bioconda_utils/bot/web.py", "copies": "1", "size": "7964", "license": "mit", "hash": -2179244879578885400, "line_mean": 31.9090909091, "line_max": 87, "alpha_frac": 0.6377448518, "autogenerated": false, "ratio": 4.198207696362678, "config_test":...
"""Aiomongodel errors and exceptions.""" import re import pymongo.errors from aiomongodel.utils import _Empty class AioMongodelException(Exception): """Base AioMongodel Exception class.""" class Error(AioMongodelException): """Base AioMongodel Error class.""" class ValidationError(Error): """Raised ...
{ "repo_name": "ilex/aiomongodel", "path": "aiomongodel/errors.py", "copies": "1", "size": "3819", "license": "mit", "hash": -6899302539755537000, "line_mean": 29.3095238095, "line_max": 76, "alpha_frac": 0.5810421576, "autogenerated": false, "ratio": 4.645985401459854, "config_test": false, "...
"""Aioreactive module. Contains the AsyncRx chained obserable that allows method chaining of all operators. Also contains all operators as plain functions. To use this module: Example: >>> import aioreactive as rx >>> xs = rx.from_iterable([1, 2, 3]) >>> ... """ from __future__ import annotations from...
{ "repo_name": "dbrattli/aioreactive", "path": "aioreactive/__init__.py", "copies": "1", "size": "28718", "license": "mit", "hash": -6224501212110773000, "line_mean": 28.2146490336, "line_max": 117, "alpha_frac": 0.6651577408, "autogenerated": false, "ratio": 4.29075153145077, "config_test": tru...
# The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE...
{ "repo_name": "artfwo/aiosc", "path": "aiosc.py", "copies": "1", "size": "6730", "license": "mit", "hash": 9058854128923644000, "line_mean": 31.9901960784, "line_max": 94, "alpha_frac": 0.5569093611, "autogenerated": false, "ratio": 3.7851518560179978, "config_test": false, "has_no_keywords":...
# AIPlayer.py # base class for ai players import itertools from Players.Player import Player from Game.Card import Card class AIPlayer(Player): "base class for ai players" @staticmethod def getOptions(hand, piles, requiredPoints): options = [] typeOptions = [] # options.append([]) # we need to give the opt...
{ "repo_name": "ryanrborn/hand-and-foot-ai", "path": "Players/AI/AIPlayer.py", "copies": "1", "size": "4404", "license": "mit", "hash": 9066730789626149000, "line_mean": 29.7972027972, "line_max": 125, "alpha_frac": 0.6580381471, "autogenerated": false, "ratio": 3.010252904989747, "config_test":...
"""aiplay URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-bas...
{ "repo_name": "zerolfx/aiplay-api", "path": "aiplay/urls.py", "copies": "1", "size": "1486", "license": "mit", "hash": -3086638415991074000, "line_mean": 32.7727272727, "line_max": 79, "alpha_frac": 0.6769851952, "autogenerated": false, "ratio": 3.5213270142180093, "config_test": false, "has_...
# ai.py # when user messages need to be processed using the wit.ai NLP platform, convert user input to narrowly defined outputs for easy processing import os from wit import Wit import json access_token = os.environ['WIT_AI_TOKEN'] client = Wit(access_token = access_token) # TEST REQUEST #message_text = "ELM 15 Jul...
{ "repo_name": "tauseef-khan/london-prayer-times-bot", "path": "ai.py", "copies": "1", "size": "1986", "license": "mit", "hash": -6168821735702935000, "line_mean": 22.9277108434, "line_max": 139, "alpha_frac": 0.6933534743, "autogenerated": false, "ratio": 2.9909638554216866, "config_test": fals...
"""Airbase-ng.""" from .executor import ExecutorHelper class AirbaseNg(ExecutorHelper): """Airbase-ng 1.6 - (C) 2008-2020 Thomas d'Otreppe Original work: Martin Beck https://www.aircrack-ng.org Usage: airbase-ng <options> <replay interface> Options: -a <bssid> : set Access Point...
{ "repo_name": "XayOn/pyrcrack", "path": "pyrcrack/airbase.py", "copies": "1", "size": "2507", "license": "isc", "hash": -551328248622173100, "line_mean": 47.2115384615, "line_max": 79, "alpha_frac": 0.5508575987, "autogenerated": false, "ratio": 3.7699248120300752, "config_test": false, "has_...
"""airbrake-flask - Airbrake client for Python Flask airbrake-flask is a fast library that use the amazing requests library to send error, exception messages to airbrake.io. You can use this library with the amazing gevent library to send your request asynchronously. Example Usage with gevent ------------------------...
{ "repo_name": "kienpham2000/airbrake-flask", "path": "setup.py", "copies": "1", "size": "1983", "license": "mit", "hash": -3182732716280509400, "line_mean": 26.9295774648, "line_max": 78, "alpha_frac": 0.6651538074, "autogenerated": false, "ratio": 3.8061420345489445, "config_test": false, "h...
# airconics_setup.py Setup file: here you can specify top level system variables # ============================================================================== # AirCONICS # Aircraft CONfiguration through Integrated Cross-disciplinary Scripting # version 0.2.1 # Andras Sobester, 2015. # Bug reports to a.sobeste...
{ "repo_name": "teknologika/foil-generator", "path": "airconicsv021/airconics_setup.py", "copies": "1", "size": "1422", "license": "apache-2.0", "hash": 6097659105402468000, "line_mean": 38.6285714286, "line_max": 80, "alpha_frac": 0.6153305204, "autogenerated": false, "ratio": 3.6555269922879177,...
# AirCONICStools.py ============================================================ # Ancillary methods called by the higher level AirCONICS functions. # ============================================================================== # AirCONICS # Aircraft CONfiguration through Integrated Cross-disciplinary Scripting ...
{ "repo_name": "teknologika/foil-generator", "path": "airconicsv021/AirCONICStools.py", "copies": "1", "size": "13188", "license": "apache-2.0", "hash": 3198392840716299300, "line_mean": 32.170984456, "line_max": 139, "alpha_frac": 0.5794661814, "autogenerated": false, "ratio": 3.2260273972602738,...
""" This module contains a library of classes devoted to modeling aircraft parts. The main purpose of this library is to model various types of aircraft parts. Currently only wing objects are suported, however in the future it is possible that fuselages as well as other parts will be added. :SUMARRY OF THE CLASSES: ...
{ "repo_name": "bennames/AeroComBAT-Project", "path": "AeroComBAT/AircraftParts.py", "copies": "1", "size": "15495", "license": "mit", "hash": 4831329771102902000, "line_mean": 51.1750841751, "line_max": 95, "alpha_frac": 0.5699903195, "autogenerated": false, "ratio": 3.8776276276276276, "config...
"""Aireplay-ng""" import asyncio from parse import parse from .executor import ExecutorHelper class AireplayNg(ExecutorHelper): """ Aireplay-ng 1.6 - (C) 2006-2020 Thomas d'Otreppe https://www.aircrack-ng.org Usage: aireplay-ng <options> <replay interface> Options: -b bssid : MAC addres...
{ "repo_name": "XayOn/pyrcrack", "path": "pyrcrack/aireplay.py", "copies": "1", "size": "3513", "license": "isc", "hash": 1506223169662656800, "line_mean": 40.3294117647, "line_max": 79, "alpha_frac": 0.5701679476, "autogenerated": false, "ratio": 3.947191011235955, "config_test": false, "has_...
from random import uniform as rand from struct import pack, unpack from time import time import unittest from bisect import insort_left from twisted.internet import protocol from twisted.internet import abstract from twisted.internet import reactor from twisted.internet import app from twisted.internet import interfa...
{ "repo_name": "csm/khashmir", "path": "airhook.py", "copies": "1", "size": "15578", "license": "mit", "hash": -7172027387011201000, "line_mean": 34.8940092166, "line_max": 162, "alpha_frac": 0.5299139813, "autogenerated": false, "ratio": 4.0305304010349285, "config_test": false, "has_no_keywo...
# Airline / Hotel Reservation System - Create a reservation system which books airline # seats or hotel rooms. It charges various rates for particular sections of the plane or hotel. # Example, first class is going to cost more than coach. Hotel rooms have penthouse suites which # cost more. Keep track of when rooms wi...
{ "repo_name": "so0p/unity2dgame", "path": "schoolGame/Assets/Sprites/Projects/HotelReservationProgram/HotelReservationSystem.py", "copies": "1", "size": "2718", "license": "mit", "hash": -8921679489183505000, "line_mean": 50.2452830189, "line_max": 120, "alpha_frac": 0.5784241532, "autogenerated": ...
"""Airmon-ng""" from .executor import ExecutorHelper from .models import Interfaces class AirmonNg(ExecutorHelper): """ Airmon-NG Usage: airmon-ng <start|stop|check> <interface> [channel or frequency] """ command = 'airmon-ng' requires_tempfile = False requires_tempdir = False def __init...
{ "repo_name": "XayOn/pyrcrack", "path": "pyrcrack/airmon.py", "copies": "1", "size": "2047", "license": "isc", "hash": -5517832959096703000, "line_mean": 31.4920634921, "line_max": 74, "alpha_frac": 0.5959941378, "autogenerated": false, "ratio": 4.110441767068273, "config_test": false, "has_n...
"""Airodump.""" import os import asyncio import xml from contextlib import suppress from .executor import ExecutorHelper from async_timeout import timeout import xmltodict import dotmap from .models import Result from .models import AccessPoint class AirodumpNg(ExecutorHelper): """Airodump-ng 1.6 - (C) 2006-2...
{ "repo_name": "XayOn/pyrcrack", "path": "pyrcrack/airodump.py", "copies": "1", "size": "5875", "license": "isc", "hash": 5396743684128508000, "line_mean": 40.6666666667, "line_max": 79, "alpha_frac": 0.5057021277, "autogenerated": false, "ratio": 4.722668810289389, "config_test": false, "has_...
airplanes = spark.read.json('data/airplanes.json') airplanes.registerTempTable("airplanes") manufacturer_variety = spark.sql( """SELECT DISTINCT(Manufacturer) AS Manufacturer FROM airplanes ORDER BY Manufacturer""" ) manufacturer_variety_local = manufacturer_variety.collect() # We need to print these left justi...
{ "repo_name": "rjurney/Agile_Data_Code_2", "path": "ch06/resolve_airplane_manufacturers.py", "copies": "1", "size": "3067", "license": "mit", "hash": 2595555408379708000, "line_mean": 28.4903846154, "line_max": 94, "alpha_frac": 0.7241604173, "autogenerated": false, "ratio": 3.060878243512974, ...