text
stringlengths
0
1.05M
meta
dict
""" Astropy coordinate class for the Orphan stream coordinate systems """ import astropy.coordinates as coord import astropy.units as u from astropy.coordinates import frame_transform_graph from astropy.coordinates.matrix_utilities import (rotation_matrix, matrix_produ...
{ "repo_name": "adrn/gary", "path": "gala/coordinates/orphan.py", "copies": "2", "size": "7585", "license": "mit", "hash": -8976747483832489000, "line_mean": 38.7120418848, "line_max": 83, "alpha_frac": 0.6477257746, "autogenerated": false, "ratio": 3.979538300104932, "config_test": false, "ha...
""" Astropy coordinate class for the Palomar 5 stream coordinate system """ # Third-party import numpy as np import astropy.units as u import astropy.coordinates as coord from astropy.coordinates import frame_transform_graph from astropy.coordinates.matrix_utilities import matrix_transpose __all__ = ["Pal5PriceWhela...
{ "repo_name": "adrn/gala", "path": "gala/coordinates/pal5.py", "copies": "2", "size": "4701", "license": "mit", "hash": 473640145548087700, "line_mean": 40.2368421053, "line_max": 83, "alpha_frac": 0.6651776218, "autogenerated": false, "ratio": 3.739856801909308, "config_test": false, "has_no...
""" Astropy coordinate class for the Sagittarius coordinate system """ # Third-party import numpy as np from astropy.coordinates import frame_transform_graph import astropy.coordinates as coord import astropy.units as u from astropy.coordinates.matrix_utilities import rotation_matrix, matrix_product, matrix_transpose...
{ "repo_name": "adrn/gary", "path": "gala/coordinates/sgr.py", "copies": "2", "size": "4699", "license": "mit", "hash": -3312646800986424300, "line_mean": 39.1623931624, "line_max": 98, "alpha_frac": 0.6714194509, "autogenerated": false, "ratio": 3.7058359621451102, "config_test": false, "has_...
""" Astropy coordinate class for the Sagittarius coordinate system """ # Third-party import numpy as np import astropy.units as u import astropy.coordinates as coord from astropy.coordinates import frame_transform_graph from astropy.coordinates.matrix_utilities import matrix_transpose __all__ = ["GD1Koposov10", "GD1...
{ "repo_name": "adrn/gala", "path": "gala/coordinates/gd1.py", "copies": "2", "size": "4444", "license": "mit", "hash": 41145343724178220, "line_mean": 39.7706422018, "line_max": 83, "alpha_frac": 0.6660666067, "autogenerated": false, "ratio": 3.7885763000852517, "config_test": false, "has_no_...
# astrotools.py # Useful astronomy utility functions # Steven Bamford # Created September 2005 from math import * import numpy as N #from ppgplot_spb import * from checkarray import checkarray from cosmology import * import string import sys import copy # convert strings of RA (hh:mm:ss.s) and Dec (dd:mm:ss.s) in t...
{ "repo_name": "bamford/astrobamf", "path": "astrotools.py", "copies": "1", "size": "16628", "license": "mit", "hash": 6530107104200708000, "line_mean": 32.256, "line_max": 88, "alpha_frac": 0.5668150108, "autogenerated": false, "ratio": 2.7015434606011373, "config_test": false, "has_no_keywor...
""" A structured data container for EDF(+) header and data records. An EdfContainer instance represents a single EDF file with the headers and all its data records. Note that the data container should *not* require all fields to be set and it should not enforce any validation. For the EDF(+) specification see:...
{ "repo_name": "dualon/senk_poly_tools", "path": "senk_poly_tools/edf_container.py", "copies": "1", "size": "1478", "license": "mit", "hash": -5992800640869896000, "line_mean": 30.4680851064, "line_max": 85, "alpha_frac": 0.6684709066, "autogenerated": false, "ratio": 2.9325396825396823, "config...
"""A structure representing data (and metadata). """ # standard imports from typing import Any, Union, Iterable from collections.abc import Sized # third party imports import numpy as np # toolbox imports from . import Observable # Datalike is intended to be everything that can be used as data. # # np.ndarray: # ...
{ "repo_name": "Petr-By/qtpyvis", "path": "dltb/base/data.py", "copies": "1", "size": "14581", "license": "mit", "hash": 133406136776068940, "line_mean": 37.2703412073, "line_max": 79, "alpha_frac": 0.5725944723, "autogenerated": false, "ratio": 4.413135593220339, "config_test": false, "has_no...
## AST tools from core import ( ASTNode, StructSymbol, Scope, VariableSymbol, FunctionSymbol, LocalScope ) ## lex ## import ply.lex as lex keywords = ( 'DEFSTRUCT', 'DEFUN', 'END', 'EQUALS', 'DOT', 'NEW', 'PRINT', 'RETURN' ) tokens = keywords + ( 'ID', 'COLON', 'COMMA', 'STRING', 'INT', 'LPAREN...
{ "repo_name": "gando999/scubble", "path": "parser.py", "copies": "1", "size": "5183", "license": "mit", "hash": 589044309578856600, "line_mean": 20.9618644068, "line_max": 75, "alpha_frac": 0.5203550068, "autogenerated": false, "ratio": 2.8955307262569834, "config_test": false, "has_no_keywor...
""" Ast to sourcecode printer. """ import io from contextlib import contextmanager from .nodes import types, declarations, expressions, statements def render_ast(ast): """ Render a C program as text For example: >>> from ppci.lang.c import parse_text, print_ast, render_ast >>> ast = parse_text('in...
{ "repo_name": "windelbouwman/ppci-mirror", "path": "ppci/lang/c/printer.py", "copies": "1", "size": "12026", "license": "bsd-2-clause", "hash": 6724284614763629000, "line_mean": 37.5448717949, "line_max": 77, "alpha_frac": 0.5305172127, "autogenerated": false, "ratio": 4.558756633813495, "confi...
"""A stupidly simple, unsafe, and inefficient template engine.""" import re def parse(source): root = nodes = [] stack = [] while 1: text, delim, source = source.partition('{%') nodes.append(('text', text)) if not delim: return root code, _, source = source.par...
{ "repo_name": "SimonSapin/snippets", "path": "stupid_templates.py", "copies": "1", "size": "1888", "license": "bsd-3-clause", "hash": -7270721997393445000, "line_mean": 28.5, "line_max": 65, "alpha_frac": 0.4862288136, "autogenerated": false, "ratio": 3.9915433403805496, "config_test": false, ...
"""A style is a set of configuration to draw a layout. This module contains the base style as well as a variety of example styles. """ __author__ = 'jt@javiertordable.com' __copyright__ = "Copyright (C) 2014 Javier Tordable" class Style(object): """A style contains configuration for drawing a layout.""" def __...
{ "repo_name": "tordable/XlsxReports", "path": "style.py", "copies": "1", "size": "1686", "license": "apache-2.0", "hash": 363633646772353540, "line_mean": 25.7619047619, "line_max": 75, "alpha_frac": 0.6809015421, "autogenerated": false, "ratio": 3.6973684210526314, "config_test": false, "has...
"""A style transfer module in the spirit of FIXME * TensorFlow Tutorial: Neural style transfer https://www.tensorflow.org/tutorials/generative/style_transfer """ # FIXME[todo]: why 3 classes? # - StyleContentModel(tf.keras.models.Model) # - TensorflowStyletransferEngine # - StyletransferTool(ImageTool) # # sta...
{ "repo_name": "Petr-By/qtpyvis", "path": "models/styletransfer.py", "copies": "1", "size": "18578", "license": "mit", "hash": -957119093003101200, "line_mean": 31.8814159292, "line_max": 83, "alpha_frac": 0.5674991926, "autogenerated": false, "ratio": 4.088468309859155, "config_test": false, ...
""" A stylish alternative for caching your map tiles. TileStache is a Python-based server application that can serve up map tiles based on rendered geographic data. You might be familiar with TileCache (http://tilecache.org), the venerable open source WMS server from MetaCarta. TileStache is similar, but we hope simpl...
{ "repo_name": "MetGIS/TileStache", "path": "TileStache/__init__.py", "copies": "1", "size": "17070", "license": "bsd-3-clause", "hash": 2615415941641669600, "line_mean": 34.7112970711, "line_max": 187, "alpha_frac": 0.618629174, "autogenerated": false, "ratio": 4.142198495510798, "config_test":...
"""A submix in the mixing hierarchy akin to a bus that can contain both :py:class:`~pyfmodex.channel.Channel` and :py:class:`~pyfmodex.channel_group.ChannelGroup` objects. """ from ctypes import * from .channel_control import ChannelControl from .globalvars import DLL as _dll from .globalvars import get_class from .u...
{ "repo_name": "tyrylu/pyfmodex", "path": "pyfmodex/channel_group.py", "copies": "1", "size": "3649", "license": "mit", "hash": 2250041940331478000, "line_mean": 31.5803571429, "line_max": 81, "alpha_frac": 0.6209920526, "autogenerated": false, "ratio": 3.7735263702171666, "config_test": false, ...
""" A submodule for calculating basic statistics about .csv metadata files converted from fidl files. To convert see fidl.convert.fidl_to_csv(). Requires pandas (http://pandas.pydata.org/). """ import os import pandas as pd def counts(csvfile, col): """ Return the counts for each unique entry in <col>. <col> c...
{ "repo_name": "parenthetical-e/fidl", "path": "stats.py", "copies": "1", "size": "1562", "license": "bsd-2-clause", "hash": 8123375651477635000, "line_mean": 27.4181818182, "line_max": 74, "alpha_frac": 0.5877080666, "autogenerated": false, "ratio": 3.692671394799054, "config_test": false, "h...
""" A submodule for processing/exporting results from Trials. """ import csv from collections import defaultdict from accumulate.stats import correct_trial # TODO test def combine(results_list): """ Combine results by trial. """ trials = results_list[0].keys() combined = defaultdict(dict) for tri...
{ "repo_name": "parenthetical-e/accumulate", "path": "sim/results.py", "copies": "1", "size": "2542", "license": "bsd-2-clause", "hash": 9196236769191860000, "line_mean": 30.3827160494, "line_max": 76, "alpha_frac": 0.5472069237, "autogenerated": false, "ratio": 4.073717948717949, "config_test":...
# A subroutine for extracting a function name from a code object # (with cache) import sys from stat import * import string import os import linecache # XXX The functions getcodename() and getfuncname() are now obsolete # XXX as code and function objects now have a name attribute -- # XXX co.co_name and f.func_name. ...
{ "repo_name": "MalloyPower/parsing-python", "path": "front-end/testsuite-python-lib/Python-2.1/Lib/lib-old/codehack.py", "copies": "1", "size": "2422", "license": "mit", "hash": -9195360742343520000, "line_mean": 28.9012345679, "line_max": 78, "alpha_frac": 0.7093311313, "autogenerated": false, "...
# A suite of commonly used routines for application # in multiple scripts. import MySQLdb import sys, string import Config class CommonFunctions( ) : def __init__( self, db, cursor ) : self.db = db self.cursor = cursor def fetchOrganismList( self, isUniprot = False ) : if isUniprot : ...
{ "repo_name": "BioGRID/BioGRID-Annotation", "path": "classes/CommonFunctions.py", "copies": "2", "size": "1063", "license": "mit", "hash": -966387314153491200, "line_mean": 37.4444444444, "line_max": 232, "alpha_frac": 0.7224835372, "autogenerated": false, "ratio": 3.011331444759207, "config_te...
""" A suite of functions for file conversion to/from fidl types. All functions write their results to disk, and return None. """ import os import re import csv import pandas as pd import numpy as np from scipy.io import savemat from copy import deepcopy def nod_mat(names, onsets, durations, matname): """Conver ...
{ "repo_name": "parenthetical-e/fidl", "path": "convert.py", "copies": "1", "size": "11291", "license": "bsd-2-clause", "hash": -2307386959886787000, "line_mean": 30.5391061453, "line_max": 128, "alpha_frac": 0.571871402, "autogenerated": false, "ratio": 3.7787817938420347, "config_test": false,...
# A supermarket wants to reward its best customer of each day, showing the custom- # er’s name on a screen in the supermarket. For that purpose, the customer’s purchase # amount is stored in a list and the customer’s name is stored in a corresponding list. # Implement a function # def nameOfBestCustomer(sales, cust...
{ "repo_name": "futurepr0n/Books-solutions", "path": "Python-For-Everyone-Horstmann/Chapter6-Lists/P6.32.py", "copies": "1", "size": "1434", "license": "mit", "hash": 5347527193873367000, "line_mean": 28.1632653061, "line_max": 99, "alpha_frac": 0.7051820728, "autogenerated": false, "ratio": 3.718...
"""A supervised clustering or transfer learning workflow. Training and test data consist of a set of events ad each event has an unknown number of clusters. At training time we know the classes (clusters) of each event. At test time we only know which instances belong to the same event. Events share statistical proper...
{ "repo_name": "paris-saclay-cds/ramp-workflow", "path": "rampwf/workflows/clusterer.py", "copies": "1", "size": "2439", "license": "bsd-3-clause", "hash": 8153252978665360000, "line_mean": 39.65, "line_max": 79, "alpha_frac": 0.6896268963, "autogenerated": false, "ratio": 3.678733031674208, "co...
import runhandler import json import util from datetime import datetime from pytz.gae import pytz from google.appengine.runtime import apiproxy_errors from google.appengine.runtime import DeadlineExceededError class Asup( runhandler.RunHandler ): def get_success_response( self, data=None ): response = d...
{ "repo_name": "rggibson/pb-tracker", "path": "asup.py", "copies": "1", "size": "13092", "license": "mit", "hash": 7566255541359875000, "line_mean": 44.3010380623, "line_max": 87, "alpha_frac": 0.4774671555, "autogenerated": false, "ratio": 4.640907479617157, "config_test": false, "has_no_keyw...
# As usual, a bit of setup import time, os, json import numpy as np from scipy.misc import imread, imresize import matplotlib.pyplot as plt from cs231n.classifiers.pretrained_cnn import PretrainedCNN from cs231n.data_utils import load_tiny_imagenet from cs231n.image_utils import blur_image, deprocess_image, preproces...
{ "repo_name": "HrWangChengdu/CS231n", "path": "assignment3_tianjun/exp_generation.py", "copies": "1", "size": "5432", "license": "mit", "hash": -5522183120755738000, "line_mean": 34.0451612903, "line_max": 119, "alpha_frac": 0.66089838, "autogenerated": false, "ratio": 3.075877689694224, "confi...
# As usual, a bit of setup import time, os, json import numpy as np import skimage.io import matplotlib.pyplot as plt from cs231n.classifiers.pretrained_cnn import PretrainedCNN from cs231n.data_utils import load_tiny_imagenet from cs231n.image_utils import blur_image, deprocess_image #%matplotlib inline plt.rcParam...
{ "repo_name": "HrWangChengdu/CS231n", "path": "assignment3_tianjun/exp_gradient.py", "copies": "1", "size": "5907", "license": "mit", "hash": 3381107718992323600, "line_mean": 32, "line_max": 93, "alpha_frac": 0.6309463349, "autogenerated": false, "ratio": 2.9969558599695585, "config_test": fal...
# As usual, use a train/test split to get a reliable F1 score from two classifiers, and # save it the scores in the provided dictionaries. import numpy as np import pandas as pd # Load the dataset X = pd.read_csv('titanic_data.csv') X = X._get_numeric_data() y = X['Survived'] del X['Age'], X['Survived'] from sklear...
{ "repo_name": "coolsgupta/machine_learning_nanodegree", "path": "Model_Evaluation_and_Validation/evaluation_metrics/compute_F1_score.py", "copies": "1", "size": "1110", "license": "mit", "hash": -3054291969534298000, "line_mean": 31.6764705882, "line_max": 87, "alpha_frac": 0.7351351351, "autogener...
"""Asuswrt status sensors.""" from datetime import timedelta import enum import logging from typing import Any, Dict, List, Optional from aioasuswrt.asuswrt import AsusWrt from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_NAME, DATA_GIGABYTES, DATA_RATE_MEGABITS_PER_SECOND from...
{ "repo_name": "turbokongen/home-assistant", "path": "homeassistant/components/asuswrt/sensor.py", "copies": "1", "size": "8041", "license": "apache-2.0", "hash": -8251768304210883000, "line_mean": 33.0720338983, "line_max": 93, "alpha_frac": 0.6173361522, "autogenerated": false, "ratio": 4.044768...
"""Asuswrt status sensors.""" from datetime import timedelta import enum import logging from typing import Any, Dict, List, Optional from aioasuswrt.asuswrt import AsusWrt from homeassistant.const import DATA_GIGABYTES, DATA_RATE_MEGABITS_PER_SECOND from homeassistant.helpers.update_coordinator import ( Coordinat...
{ "repo_name": "tboyce021/home-assistant", "path": "homeassistant/components/asuswrt/sensor.py", "copies": "2", "size": "5741", "license": "apache-2.0", "hash": 3003475818595437000, "line_mean": 33.1726190476, "line_max": 86, "alpha_frac": 0.6261975266, "autogenerated": false, "ratio": 4.006280530...
"""Asuswrt status sensors.""" from __future__ import annotations import logging from numbers import Number from typing import Any from homeassistant.components.sensor import SensorEntity from homeassistant.config_entries import ConfigEntry from homeassistant.const import DATA_GIGABYTES, DATA_RATE_MEGABITS_PER_SECOND ...
{ "repo_name": "home-assistant/home-assistant", "path": "homeassistant/components/asuswrt/sensor.py", "copies": "2", "size": "5041", "license": "apache-2.0", "hash": -777810237136378600, "line_mean": 28.1387283237, "line_max": 93, "alpha_frac": 0.6236857766, "autogenerated": false, "ratio": 3.7368...
"""Asuswrt status sensors.""" from __future__ import annotations import logging from numbers import Number from homeassistant.components.sensor import SensorEntity from homeassistant.config_entries import ConfigEntry from homeassistant.const import DATA_GIGABYTES, DATA_RATE_MEGABITS_PER_SECOND from homeassistant.help...
{ "repo_name": "w1ll1am23/home-assistant", "path": "homeassistant/components/asuswrt/sensor.py", "copies": "3", "size": "4988", "license": "apache-2.0", "hash": -5324377233677743000, "line_mean": 28.1695906433, "line_max": 93, "alpha_frac": 0.6206896552, "autogenerated": false, "ratio": 3.71961222...
"""Asuswrt status sensors.""" import logging from numbers import Number from typing import Dict from homeassistant.config_entries import ConfigEntry from homeassistant.const import DATA_GIGABYTES, DATA_RATE_MEGABITS_PER_SECOND from homeassistant.helpers.typing import HomeAssistantType from homeassistant.helpers.update...
{ "repo_name": "partofthething/home-assistant", "path": "homeassistant/components/asuswrt/sensor.py", "copies": "1", "size": "4906", "license": "mit", "hash": 420581022115252700, "line_mean": 28.0295857988, "line_max": 93, "alpha_frac": 0.6169995923, "autogenerated": false, "ratio": 3.702641509433...
"""Asuswrt status sensors.""" import logging from aioasuswrt.asuswrt import AsusWrt from homeassistant.const import DATA_GIGABYTES, DATA_RATE_MEGABITS_PER_SECOND from homeassistant.helpers.entity import Entity from . import DATA_ASUSWRT _LOGGER = logging.getLogger(__name__) UPLOAD_ICON = "mdi:upload-network" DOWNL...
{ "repo_name": "GenericStudent/home-assistant", "path": "homeassistant/components/asuswrt/sensor.py", "copies": "10", "size": "5092", "license": "apache-2.0", "hash": 5739049164288950000, "line_mean": 26.6739130435, "line_max": 88, "alpha_frac": 0.6084053417, "autogenerated": false, "ratio": 3.857...
"""Asuswrt status sensors.""" import logging from homeassistant.const import DATA_GIGABYTES, DATA_RATE_MEGABITS_PER_SECOND from homeassistant.helpers.entity import Entity from . import DATA_ASUSWRT _LOGGER = logging.getLogger(__name__) async def async_setup_platform(hass, config, add_entities, discovery_info=None)...
{ "repo_name": "postlund/home-assistant", "path": "homeassistant/components/asuswrt/sensor.py", "copies": "1", "size": "3539", "license": "apache-2.0", "hash": -6747662361513728000, "line_mean": 26.2230769231, "line_max": 80, "alpha_frac": 0.6287086748, "autogenerated": false, "ratio": 3.744973544...
"""Asuswrt status sensors.""" import logging from homeassistant.helpers.entity import Entity from . import DATA_ASUSWRT _LOGGER = logging.getLogger(__name__) async def async_setup_platform(hass, config, add_entities, discovery_info=None): """Set up the asuswrt sensors.""" if discovery_info is None: ...
{ "repo_name": "fbradyirl/home-assistant", "path": "homeassistant/components/asuswrt/sensor.py", "copies": "6", "size": "3411", "license": "apache-2.0", "hash": 8306579097903068000, "line_mean": 25.4418604651, "line_max": 80, "alpha_frac": 0.6182937555, "autogenerated": false, "ratio": 3.769060773...
"""Asuswrt status sensors.""" import logging from homeassistant.helpers.entity import Entity from . import DATA_ASUSWRT _LOGGER = logging.getLogger(__name__) async def async_setup_platform( hass, config, add_entities, discovery_info=None): """Set up the asuswrt sensors.""" if discovery_info is None...
{ "repo_name": "aequitas/home-assistant", "path": "homeassistant/components/asuswrt/sensor.py", "copies": "7", "size": "3420", "license": "apache-2.0", "hash": 1643182450999053800, "line_mean": 25.3076923077, "line_max": 72, "alpha_frac": 0.6166666667, "autogenerated": false, "ratio": 3.7748344370...
# Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary fo...
{ "repo_name": "jeske/csla", "path": "pysrc/base/ASV.py", "copies": "1", "size": "25279", "license": "bsd-2-clause", "hash": 5233993668169918000, "line_mean": 28.9514218009, "line_max": 171, "alpha_frac": 0.6703587958, "autogenerated": false, "ratio": 3.305308577405858, "config_test": false, "...
# # History: # # ASV 0.1 29 October 2000 # # # ASV 0.2 2 November 2000 # # # ASV 0.3 1 March 2001 # # First public release. # # # ASV 0.4 3 April 2001 # # * Fixed bug where __setitem__ ignored the field_names paramater. # # * Added code to make ASV `executeable' with command line parameters etc...
{ "repo_name": "owlfish/pubtal", "path": "optional-plugins/CSVPlugin/ASV.py", "copies": "1", "size": "25488", "license": "bsd-3-clause", "hash": -4269213714867609000, "line_mean": 28.6717112922, "line_max": 165, "alpha_frac": 0.669373823, "autogenerated": false, "ratio": 3.29685681024447, "confi...
"""ASV benchmarks for solarposition.py using numba. We use a separate module so that we can control the pvlib import process using an environment variable. This will force pvlib to compile the numba code during setup. Try to keep relevant sections in sync with benchmarks/solarposition.py """ from pkg_resources impor...
{ "repo_name": "mikofski/pvlib-python", "path": "benchmarks/benchmarks/solarposition_numba.py", "copies": "3", "size": "1461", "license": "bsd-3-clause", "hash": 1568895244520010200, "line_mean": 30.7608695652, "line_max": 73, "alpha_frac": 0.6632443532, "autogenerated": false, "ratio": 3.20394736...
"""asw_ entities.""" from srctools._class_resources import * res('asw_camera_control') res('asw_alien_goo', mdl('models/aliens/biomass/biomasshelix.mdl'), mdl('models/aliens/biomass/biomassl.mdl'), mdl('models/aliens/biomass/biomasss.mdl'), mdl('models/aliens/biomass/biomassu.mdl'), sound('ASWGoo....
{ "repo_name": "TeamSpen210/srctools", "path": "srctools/_class_resources/asw_.py", "copies": "1", "size": "6360", "license": "unlicense", "hash": -3420921736147131000, "line_mean": 30.8, "line_max": 89, "alpha_frac": 0.6649371069, "autogenerated": false, "ratio": 2.460348162475822, "config_test...
"""A switch conntected to a fast controller.""" import logging from mpf.core.platform import SwitchConfig from mpf.core.utility_functions import Util from mpf.platforms.interfaces.switch_platform_interface import SwitchPlatformInterface MYPY = False if MYPY: # pragma: no cover from mpf.platforms.fast.fast impor...
{ "repo_name": "missionpinball/mpf", "path": "mpf/platforms/fast/fast_switch.py", "copies": "1", "size": "3124", "license": "mit", "hash": 1872091748918848000, "line_mean": 39.5714285714, "line_max": 120, "alpha_frac": 0.6459667093, "autogenerated": false, "ratio": 3.9444444444444446, "config_te...
"""A switch driver for Brocade NOS. Uses the XML REST API for communicating with the switch. """ import logging from lxml import etree from os.path import dirname, join import re import requests from schema import Schema, Optional from hil.migrations import paths from hil.model import db, Switch from hil.errors impo...
{ "repo_name": "CCI-MOC/haas", "path": "hil/ext/switches/brocade.py", "copies": "1", "size": "8931", "license": "apache-2.0", "hash": 4615517649634469000, "line_mean": 33.35, "line_max": 78, "alpha_frac": 0.5906393461, "autogenerated": false, "ratio": 4.153953488372093, "config_test": false, "...
"""A switch driver for OpenVswitch.""" import re import logging import schema import subprocess from hil.model import db, Switch, Port, BigIntegerType, SwitchSession from hil.errors import SwitchError from hil.ext.switches.common import string_to_dict, string_to_list logger = logging.getLogger(__name__) # Class layo...
{ "repo_name": "CCI-MOC/haas", "path": "hil/ext/switches/ovs.py", "copies": "4", "size": "8356", "license": "apache-2.0", "hash": 1085333488677977700, "line_mean": 34.406779661, "line_max": 78, "alpha_frac": 0.5234561991, "autogenerated": false, "ratio": 3.9847401049117788, "config_test": false,...
"""A switch driver for the Dell Powerconnect 5500 series. Currently the driver uses telnet to connect to the switch's console; in the long term we want to be using SNMP. """ import logging from schema import Schema, Optional import re from hil.model import db, Switch from hil.migrations import paths from hil.ext.swi...
{ "repo_name": "CCI-MOC/haas", "path": "hil/ext/switches/dell.py", "copies": "4", "size": "3427", "license": "apache-2.0", "hash": 7380841641640156000, "line_mean": 31.6380952381, "line_max": 79, "alpha_frac": 0.6209512693, "autogenerated": false, "ratio": 3.9345579793340986, "config_test": fals...
"""A switch driver that maintains local state only. Meant for use in the test suite. """ from collections import defaultdict from hil.model import Switch, SwitchSession from hil.migrations import paths import schema import re from sqlalchemy import Column, ForeignKey, String from os.path import dirname, join from hil...
{ "repo_name": "SahilTikale/haas", "path": "hil/ext/switches/mock.py", "copies": "4", "size": "2707", "license": "apache-2.0", "hash": 622676150097583200, "line_mean": 28.4239130435, "line_max": 78, "alpha_frac": 0.6128555597, "autogenerated": false, "ratio": 4.052395209580839, "config_test": fa...
"""A switch input on a PKONE Extension board.""" import logging from collections import namedtuple from mpf.core.platform import SwitchConfig from mpf.platforms.interfaces.switch_platform_interface import SwitchPlatformInterface MYPY = False if MYPY: # pragma: no cover from mpf.platforms.pkone.pkone import PKON...
{ "repo_name": "missionpinball/mpf", "path": "mpf/platforms/pkone/pkone_switch.py", "copies": "1", "size": "1221", "license": "mit", "hash": -2441376605254189600, "line_mean": 37.15625, "line_max": 116, "alpha_frac": 0.7100737101, "autogenerated": false, "ratio": 3.876190476190476, "config_test"...
# aswitch.py Switch and pushbutton classes for asyncio # Delay_ms A retriggerable delay class. Can schedule a coro on timeout. # Switch Simple debounced switch class for normally open grounded switch. # Pushbutton extend the above to support logical state, long press and # double-click events # Tested on Pyboard but sh...
{ "repo_name": "peterhinch/micropython-async", "path": "aswitch.py", "copies": "2", "size": "9406", "license": "mit", "hash": -1937283579248194000, "line_mean": 39.7186147186, "line_max": 91, "alpha_frac": 0.591005741, "autogenerated": false, "ratio": 4.182303245887061, "config_test": false, "...
"""A symbolic AI that forms decisions by using a decision tree.""" import random from .interface import IPlayerController from model.card import Card class SymbolicAI_PC(IPlayerController): """player controller that returns resolutes its choices using a decision tree. It is called symbolic because it is n...
{ "repo_name": "DrSLDR/mgmag-proj", "path": "gravitas/controller/symbolic.py", "copies": "1", "size": "7657", "license": "mit", "hash": 1690824329179841000, "line_mean": 41.5388888889, "line_max": 120, "alpha_frac": 0.5971006922, "autogenerated": false, "ratio": 4.0815565031982945, "config_test"...
"""Async adapters to MQTT, using the hbmqtt library. We can make the send code slightly cleaner by using async/await. To preverse compatability with Python 3.4, we explicitly queue up the connect request instead. """ import hbmqtt.client import hbmqtt.session import json import asyncio from collections import deque f...
{ "repo_name": "mpi-sws-rse/antevents-python", "path": "antevents/adapters/mqtt_async.py", "copies": "1", "size": "10148", "license": "apache-2.0", "hash": 5075351461084942000, "line_mean": 42.3675213675, "line_max": 105, "alpha_frac": 0.5690776508, "autogenerated": false, "ratio": 4.3591065292096...
# ASYNC by default, settings to override try: from django.conf import settings except ImportError: settings = {} from django.shortcuts import redirect import jingo from . import forms try: if 'ID' not in settings.RESPONSYS or \ 'CAMPAIGN_ID' not in settings.RESPONSYS: raise Exception("Pl...
{ "repo_name": "mozilla/webowonder", "path": "apps/responsys/views.py", "copies": "1", "size": "1252", "license": "bsd-3-clause", "hash": -6005379277612282000, "line_mean": 29.5365853659, "line_max": 68, "alpha_frac": 0.6190095847, "autogenerated": false, "ratio": 4.244067796610169, "config_test...
"""Async channels""" # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. from queue import Queue, Empty class ZMQSocketChannel(object): """A ZMQ socket in an async API""" session = None socket = None stream = None _exiting = False proxy_method...
{ "repo_name": "sserrot/champion_relationships", "path": "venv/Lib/site-packages/jupyter_client/asynchronous/channels.py", "copies": "1", "size": "2174", "license": "mit", "hash": 2310206231734450000, "line_mean": 25.512195122, "line_max": 61, "alpha_frac": 0.5547378105, "autogenerated": false, "r...
"""Async client for GitHub API v3.""" from http import HTTPStatus import logging import aiohttp from werkzeug.contrib.cache import BaseCache from api.cache import get_cache_key logger = logging.getLogger(__name__) API_URL = 'https://api.github.com' class GitHubClientError(Exception): def __init__(self, body, r...
{ "repo_name": "sloria/sir", "path": "api/github/client.py", "copies": "1", "size": "3659", "license": "mit", "hash": -7246638085706173000, "line_mean": 33.5188679245, "line_max": 85, "alpha_frac": 0.5239136376, "autogenerated": false, "ratio": 4.215437788018433, "config_test": false, "has_no_...
"""Async compatibility wrappers for Python io module stream objects.""" import io as sync_io def open( file, mode="r", buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None, ): r"""Open file and return a stream. Raise OS...
{ "repo_name": "asyncdef/apyio", "path": "apyio/__init__.py", "copies": "1", "size": "29174", "license": "apache-2.0", "hash": -3270068734598580700, "line_mean": 31.7429854097, "line_max": 79, "alpha_frac": 0.6362171797, "autogenerated": false, "ratio": 4.586385788398051, "config_test": false, ...
async def __aenter__(self): return await self async def __aexit__(self, exc_type, exc_value, traceback): await self.ws_client.close() async def __await_impl__(self): # Duplicated with __iter__ because Python 3.7 requires an async function # (as explained in __await__ below) which Python 3.4 doesn't ...
{ "repo_name": "gnmiller/craig-bot", "path": "craig-bot/lib/python3.6/site-packages/websockets/py35/client.py", "copies": "1", "size": "1076", "license": "mit", "hash": 4315640115803690000, "line_mean": 31.6060606061, "line_max": 76, "alpha_frac": 0.6533457249, "autogenerated": false, "ratio": 4.2...
async def application_201(scope, receive, send): assert scope['type'] == 'http' await send( { 'type': 'http.response.start', 'status': 201, 'headers': [(b'content-length', b'0')], } ) async def application_200(scope, receive, send): assert scope['ty...
{ "repo_name": "nginx/unit", "path": "test/python/targets/asgi.py", "copies": "1", "size": "1157", "license": "apache-2.0", "hash": 3152721545539313700, "line_mean": 20.4259259259, "line_max": 59, "alpha_frac": 0.5090751945, "autogenerated": false, "ratio": 3.673015873015873, "config_test": fals...
async def application(scope, receive, send): assert scope['type'] == 'http' body = b'' while True: m = await receive() body += m.get('body', b'') if not m.get('more_body', False): break headers = scope.get('headers', []) def get_header(n): res = [] ...
{ "repo_name": "nginx/unit", "path": "test/python/variables/asgi.py", "copies": "1", "size": "1285", "license": "apache-2.0", "hash": 7468817318274393000, "line_mean": 31.9487179487, "line_max": 79, "alpha_frac": 0.4645914397, "autogenerated": false, "ratio": 3.858858858858859, "config_test": fa...
async def asyncgen(): <error descr="Python version 3.5 does not support 'yield' inside async functions">yield 10</error> async def run(): {i <error descr="Python version 3.5 does not support 'async' inside comprehensions and generator expressions">async</error> for i in asyncgen()} [i <error descr="Python v...
{ "repo_name": "JetBrains/intellij-community", "path": "python/testData/highlighting/asyncComprehensionsPy35.py", "copies": "33", "size": "1495", "license": "apache-2.0", "hash": -7245069694316381000, "line_mean": 92.5, "line_max": 163, "alpha_frac": 0.7090301003, "autogenerated": false, "ratio": ...
async def asyncgen(): yield 10 async def run(): {i for i in <warning descr="Expected 'collections.Iterable', got '__asyncgenerator[int, Any]' instead">asyncgen()</warning>} [i for i in <warning descr="Expected 'collections.Iterable', got '__asyncgenerator[int, Any]' instead">asyncgen()</warning>] {i: i ...
{ "repo_name": "idea4bsd/idea4bsd", "path": "python/testData/inspections/PyTypeCheckerInspection/ComprehensionsOverAsyncGenerator.py", "copies": "3", "size": "1038", "license": "apache-2.0", "hash": 4422142651001956400, "line_mean": 85.5833333333, "line_max": 143, "alpha_frac": 0.6782273603, "autoge...
async def asyncgen(): yield 10 async def run(): {i for i in <warning descr="Expected 'collections.Iterable', got 'AsyncGenerator[int, Any]' instead">asyncgen()</warning>} [i for i in <warning descr="Expected 'collections.Iterable', got 'AsyncGenerator[int, Any]' instead">asyncgen()</warning>] {i: i ** 2...
{ "repo_name": "siosio/intellij-community", "path": "python/testData/inspections/PyTypeCheckerInspection/ComprehensionsOverAsyncGenerator.py", "copies": "20", "size": "1024", "license": "apache-2.0", "hash": -186137779911222880, "line_mean": 84.4166666667, "line_max": 141, "alpha_frac": 0.6875, "aut...
async def asyncgen(): yield 10 async def run(): {i for i in <warning descr="Expected type 'collections.Iterable', got 'AsyncGenerator[int, Any]' instead">asyncgen()</warning>} [i for i in <warning descr="Expected type 'collections.Iterable', got 'AsyncGenerator[int, Any]' instead">asyncgen()</warning>] ...
{ "repo_name": "JetBrains/intellij-community", "path": "python/testData/inspections/PyTypeCheckerInspection/ComprehensionsOverAsyncGenerator.py", "copies": "10", "size": "1059", "license": "apache-2.0", "hash": 5482287131787333000, "line_mean": 87.3333333333, "line_max": 146, "alpha_frac": 0.691218130...
async def do_scan(self, order, key=None, cursor=0, count=None, pattern=None): _ = [] if pattern: _ += [b'MATCH', pattern] if count != 10: _ += [b'COUNT', count] __ = [] if key: __.append(key) count, lst = await self._send(order, *__, cursor, *_) return int(count), lst x_mode_m_crc16_lookup = [ 0x0000...
{ "repo_name": "ztkIsAlreadyTaken/rain", "path": "rain/redis/others.py", "copies": "1", "size": "2552", "license": "unlicense", "hash": -382636851485984000, "line_mean": 43.7719298246, "line_max": 78, "alpha_frac": 0.7065047022, "autogenerated": false, "ratio": 1.5733662145499383, "config_test":...
async def entry_to_code(bot, entries): width = max(map(lambda t: len(t[0]), entries)) output = ['```'] fmt = '{0:<{width}}: {1}' for name, entry in entries: output.append(fmt.format(name, entry, width=width)) output.append('```') await bot.say('\n'.join(output)) async def indented_entry...
{ "repo_name": "plusreed/foxpy", "path": "plugins/utils/formats.py", "copies": "1", "size": "1268", "license": "mit", "hash": -9132650654303391000, "line_mean": 37.4545454545, "line_max": 99, "alpha_frac": 0.6072555205, "autogenerated": false, "ratio": 3.417789757412399, "config_test": false, ...
async def f11(x): y = {await<error descr="Expression expected">:</error> 10 for await<error descr="Expression expected"> </error>in []} # fail await x def f12(x): y = {await: 10 for await in []} return x async def f21(x): y = {mapper(await<error descr="Expression expected">)</error>: 10 for awa...
{ "repo_name": "zdary/intellij-community", "path": "python/testData/highlighting/awaitInDictPy36.py", "copies": "9", "size": "1745", "license": "apache-2.0", "hash": 595490068246000500, "line_mean": 20.2926829268, "line_max": 137, "alpha_frac": 0.5936962751, "autogenerated": false, "ratio": 3.1669...
async def f11(x): y = {await<error descr="expression expected">:</error> 10 for await<error descr="expression expected"> </error>in []} # fail await x def f12(x): y = {await: 10 for await in []} return x async def f21(x): y = {mapper(await<error descr="expression expected">)</error>: 10 for awa...
{ "repo_name": "semonte/intellij-community", "path": "python/testData/highlighting/awaitInDictPy36.py", "copies": "23", "size": "1744", "license": "apache-2.0", "hash": 6558491934449130000, "line_mean": 20.2804878049, "line_max": 137, "alpha_frac": 0.5928899083, "autogenerated": false, "ratio": 3....
async def f11(x): y = {await<error descr="Expression expected">:</error> 10 for await<error descr="Expression expected"> </error>in []} # fail await x def f12(x): y = {await: 10 for await in []} return x async def f21(x): y = {mapper(await<error descr="Expression expected">)</error>: 10 for awa...
{ "repo_name": "smmribeiro/intellij-community", "path": "python/testData/highlighting/awaitInDictPy36.py", "copies": "1", "size": "1744", "license": "apache-2.0", "hash": 2756219970941176300, "line_mean": 20.2804878049, "line_max": 137, "alpha_frac": 0.5928899083, "autogenerated": false, "ratio": ...
async def f11(x): y = {await<error descr="expression expected">:</error> 10 for await<error descr="expression expected"> </error>in []} # fail await x def f12(x): y = {await: 10 for await in []} return x async def f21(x): y = {mapper(await<error descr="expression expected">)</error>: 10 for awa...
{ "repo_name": "michaelgallacher/intellij-community", "path": "python/testData/highlighting/awaitInDict.py", "copies": "2", "size": "1759", "license": "apache-2.0", "hash": 2599957926310020000, "line_mean": 21.5641025641, "line_max": 137, "alpha_frac": 0.5997725981, "autogenerated": false, "ratio"...
async def f11(x): y = {await<error descr="Expression expected">:</error> 10 for await<error descr="Expression expected"> </error>in []} # fail await x def f12(x): y = {await: 10 for await in []} return x async def f21(x): y = {mapper(await<error descr="Expression expected">)</error>: 10 for awa...
{ "repo_name": "mdaniel/intellij-community", "path": "python/testData/highlighting/awaitInDictPy35.py", "copies": "9", "size": "2410", "license": "apache-2.0", "hash": -7883710426222257000, "line_mean": 28.4024390244, "line_max": 352, "alpha_frac": 0.643153527, "autogenerated": false, "ratio": 3.3...
async def f11(x): y = {await<error descr="expression expected">:</error> 10 for await<error descr="expression expected"> </error>in []} # fail await x def f12(x): y = {await: 10 for await in []} return x async def f21(x): y = {mapper(await<error descr="expression expected">)</error>: 10 for awa...
{ "repo_name": "youdonghai/intellij-community", "path": "python/testData/highlighting/awaitInDictPy35.py", "copies": "23", "size": "2409", "license": "apache-2.0", "hash": -3741966729163991600, "line_mean": 28.3902439024, "line_max": 352, "alpha_frac": 0.6425902864, "autogenerated": false, "ratio"...
async def f11(x): y = [await<error descr="Expression expected"> </error>for await<error descr="Expression expected"> </error>in []] # fail await x def f12(x): y = [await for await in []] return x async def f21(x): y = [mapper(await<error descr="Expression expected">)</error> for await<error des...
{ "repo_name": "GunoH/intellij-community", "path": "python/testData/highlighting/awaitInListPy36.py", "copies": "9", "size": "1647", "license": "apache-2.0", "hash": 956546602471940200, "line_mean": 19.0975609756, "line_max": 133, "alpha_frac": 0.598664238, "autogenerated": false, "ratio": 3.18568...
async def f11(x): y = {await<error descr="Expression expected"> </error>for await<error descr="Expression expected"> </error>in []} # fail await x def f12(x): y = {await for await in []} return x async def f21(x): y = {mapper(await<error descr="Expression expected">)</error> for await<error des...
{ "repo_name": "mdaniel/intellij-community", "path": "python/testData/highlighting/awaitInSetPy36.py", "copies": "9", "size": "1647", "license": "apache-2.0", "hash": 3319931425057337000, "line_mean": 19.0975609756, "line_max": 133, "alpha_frac": 0.598664238, "autogenerated": false, "ratio": 3.242...
async def f11(x): y = {await<error descr="expression expected"> </error>for await<error descr="expression expected"> </error>in []} # fail await x def f12(x): y = {await for await in []} return x async def f21(x): y = {mapper(await<error descr="expression expected">)</error> for await<error des...
{ "repo_name": "asedunov/intellij-community", "path": "python/testData/highlighting/awaitInSetPy36.py", "copies": "23", "size": "1646", "license": "apache-2.0", "hash": -3343905608462441500, "line_mean": 19.0853658537, "line_max": 133, "alpha_frac": 0.5978128797, "autogenerated": false, "ratio": 3...
async def f11(x): y = [await<error descr="expression expected"> </error>for await<error descr="expression expected"> </error>in []] # fail await x def f12(x): y = [await for await in []] return x async def f21(x): y = [mapper(await<error descr="expression expected">)</error> for await<error des...
{ "repo_name": "fitermay/intellij-community", "path": "python/testData/highlighting/awaitInListPy36.py", "copies": "23", "size": "1646", "license": "apache-2.0", "hash": -3155421804963500500, "line_mean": 19.0853658537, "line_max": 133, "alpha_frac": 0.5978128797, "autogenerated": false, "ratio": ...
async def f11(x): y = [await<error descr="Expression expected"> </error>for await<error descr="Expression expected"> </error>in []] # fail await x def f12(x): y = [await for await in []] return x async def f21(x): y = [mapper(await<error descr="Expression expected">)</error> for await<error des...
{ "repo_name": "smmribeiro/intellij-community", "path": "python/testData/highlighting/awaitInListPy36.py", "copies": "1", "size": "1646", "license": "apache-2.0", "hash": -903746035417926300, "line_mean": 19.0853658537, "line_max": 133, "alpha_frac": 0.5978128797, "autogenerated": false, "ratio": ...
async def f11(x): y = {await<error descr="Expression expected"> </error>for await<error descr="Expression expected"> </error>in []} # fail await x def f12(x): y = {await for await in []} return x async def f21(x): y = {mapper(await<error descr="Expression expected">)</error> for await<error des...
{ "repo_name": "smmribeiro/intellij-community", "path": "python/testData/highlighting/awaitInSetPy36.py", "copies": "1", "size": "1646", "license": "apache-2.0", "hash": -3123888948750148600, "line_mean": 19.0853658537, "line_max": 133, "alpha_frac": 0.5978128797, "autogenerated": false, "ratio": ...
async def f11(x): y = {await<error descr="expression expected"> </error>for await<error descr="expression expected"> </error>in []} # fail await x def f12(x): y = {await for await in []} return x async def f21(x): y = {mapper(await<error descr="expression expected">)</error> for await<error des...
{ "repo_name": "hurricup/intellij-community", "path": "python/testData/highlighting/awaitInSet.py", "copies": "2", "size": "1671", "license": "apache-2.0", "hash": -4692883555801461000, "line_mean": 20.4358974359, "line_max": 133, "alpha_frac": 0.60502693, "autogenerated": false, "ratio": 3.302371...
async def f11(x): y = [await<error descr="expression expected"> </error>for await<error descr="expression expected"> </error>in []] # fail await x def f12(x): y = [await for await in []] return x async def f21(x): y = [mapper(await<error descr="expression expected">)</error> for await<error des...
{ "repo_name": "michaelgallacher/intellij-community", "path": "python/testData/highlighting/awaitInList.py", "copies": "2", "size": "1671", "license": "apache-2.0", "hash": 2566421773010911700, "line_mean": 20.4358974359, "line_max": 133, "alpha_frac": 0.60502693, "autogenerated": false, "ratio": ...
async def f11(x): y = (await<error descr="expression expected"> </error>for await<error descr="expression expected"> </error>in []) # fail await x def f12(x): y = (await for await in []) return x async def f21(x): y = (mapper(await<error descr="expression expected">)</error> for await<error des...
{ "repo_name": "michaelgallacher/intellij-community", "path": "python/testData/highlighting/awaitInGenerator.py", "copies": "2", "size": "1159", "license": "apache-2.0", "hash": -1118002766175595900, "line_mean": 22.2, "line_max": 133, "alpha_frac": 0.6100086281, "autogenerated": false, "ratio": 3...
async def f11(x): y = [await<error descr="Expression expected"> </error>for await<error descr="Expression expected"> </error>in []] # fail await x def f12(x): y = [await for await in []] return x async def f21(x): y = [mapper(await<error descr="Expression expected">)</error> for await<error des...
{ "repo_name": "GunoH/intellij-community", "path": "python/testData/highlighting/awaitInListPy35.py", "copies": "9", "size": "2312", "license": "apache-2.0", "hash": 5554891175219126000, "line_mean": 27.2073170732, "line_max": 347, "alpha_frac": 0.6487889273, "autogenerated": false, "ratio": 3.385...
async def f11(x): y = {await<error descr="Expression expected"> </error>for await<error descr="Expression expected"> </error>in []} # fail await x def f12(x): y = {await for await in []} return x async def f21(x): y = {mapper(await<error descr="Expression expected">)</error> for await<error des...
{ "repo_name": "Maccimo/intellij-community", "path": "python/testData/highlighting/awaitInSetPy35.py", "copies": "9", "size": "2312", "license": "apache-2.0", "hash": 569859663220584000, "line_mean": 27.2073170732, "line_max": 347, "alpha_frac": 0.6487889273, "autogenerated": false, "ratio": 3.415...
async def f11(x): y = (await<error descr="Expression expected"> </error>for await<error descr="Expression expected"> </error>in []) # fail await x def f12(x): y = (await for await in []) return x async def f21(x): y = (mapper(await<error descr="Expression expected">)</error> for await<error des...
{ "repo_name": "jwren/intellij-community", "path": "python/testData/highlighting/awaitInGenerator.py", "copies": "9", "size": "1206", "license": "apache-2.0", "hash": 2258057581761021400, "line_mean": 23.14, "line_max": 134, "alpha_frac": 0.6194029851, "autogenerated": false, "ratio": 3.3131868131...
async def f11(x): y = {await<error descr="expression expected"> </error>for await<error descr="expression expected"> </error>in []} # fail await x def f12(x): y = {await for await in []} return x async def f21(x): y = {mapper(await<error descr="expression expected">)</error> for await<error des...
{ "repo_name": "da1z/intellij-community", "path": "python/testData/highlighting/awaitInSetPy35.py", "copies": "23", "size": "2311", "license": "apache-2.0", "hash": -1696578380124982300, "line_mean": 27.1951219512, "line_max": 347, "alpha_frac": 0.6482042406, "autogenerated": false, "ratio": 3.408...
async def f11(x): y = [await<error descr="expression expected"> </error>for await<error descr="expression expected"> </error>in []] # fail await x def f12(x): y = [await for await in []] return x async def f21(x): y = [mapper(await<error descr="expression expected">)</error> for await<error des...
{ "repo_name": "siosio/intellij-community", "path": "python/testData/highlighting/awaitInListPy35.py", "copies": "23", "size": "2311", "license": "apache-2.0", "hash": 177478890019102560, "line_mean": 27.1951219512, "line_max": 347, "alpha_frac": 0.6482042406, "autogenerated": false, "ratio": 3.37...
async def f11(x): y = [await<error descr="Expression expected"> </error>for await<error descr="Expression expected"> </error>in []] # fail await x def f12(x): y = [await for await in []] return x async def f21(x): y = [mapper(await<error descr="Expression expected">)</error> for await<error des...
{ "repo_name": "smmribeiro/intellij-community", "path": "python/testData/highlighting/awaitInListPy35.py", "copies": "1", "size": "2311", "license": "apache-2.0", "hash": -359354467655637500, "line_mean": 27.1951219512, "line_max": 347, "alpha_frac": 0.6482042406, "autogenerated": false, "ratio": ...
async def f11(x): y = {await<error descr="Expression expected"> </error>for await<error descr="Expression expected"> </error>in []} # fail await x def f12(x): y = {await for await in []} return x async def f21(x): y = {mapper(await<error descr="Expression expected">)</error> for await<error des...
{ "repo_name": "smmribeiro/intellij-community", "path": "python/testData/highlighting/awaitInSetPy35.py", "copies": "1", "size": "2311", "license": "apache-2.0", "hash": -4075739834762466300, "line_mean": 27.1951219512, "line_max": 347, "alpha_frac": 0.6482042406, "autogenerated": false, "ratio": ...
async def f11(x): y = (await<error descr="expression expected"> </error>for await<error descr="expression expected"> </error>in []) # fail await x def f12(x): y = (await for await in []) return x async def f21(x): y = (mapper(await<error descr="expression expected">)</error> for await<error des...
{ "repo_name": "goodwinnk/intellij-community", "path": "python/testData/highlighting/awaitInGenerator.py", "copies": "23", "size": "1205", "license": "apache-2.0", "hash": 4997179852566142000, "line_mean": 23.12, "line_max": 134, "alpha_frac": 0.6182572614, "autogenerated": false, "ratio": 3.30136...
async def f11(x): y = (await<error descr="Expression expected"> </error>for await<error descr="Expression expected"> </error>in []) # fail await x def f12(x): y = (await for await in []) return x async def f21(x): y = (mapper(await<error descr="Expression expected">)</error> for await<error des...
{ "repo_name": "smmribeiro/intellij-community", "path": "python/testData/highlighting/awaitInGenerator.py", "copies": "1", "size": "1205", "license": "apache-2.0", "hash": -756104383289367800, "line_mean": 23.12, "line_max": 134, "alpha_frac": 0.6182572614, "autogenerated": false, "ratio": 3.30136...
async def main(): #!/usr/bin/env python # coding: utf-8 # In[1]: from seamless.highlevel import Context, Transformer, Cell import numpy as np ctx = Context() # In[2]: ctx.pdb1 = open("1AKE-flanks.pdb").read() ctx.pdb2 = open("1AKE-B-hit.pdb").read() ctx.load_pdb1 = Transf...
{ "repo_name": "sjdv1982/seamless", "path": "examples/BC/bcloopsearch.py", "copies": "1", "size": "6628", "license": "mit", "hash": 1083576905137119600, "line_mean": 26.8529411765, "line_max": 123, "alpha_frac": 0.622057936, "autogenerated": false, "ratio": 2.9655480984340046, "config_test": fal...
async def walk_query(obj, object_resolver, connection_resolver, errors, current_user=None, __naut_name=None, obey_auth=True, **filters): """ This function traverses a query and collects the corresponding information in a dictionary. """ # if the object has no selection set if not hasattr...
{ "repo_name": "aaivazis/nautilus", "path": "nautilus/api/util/walk_query.py", "copies": "2", "size": "3839", "license": "mit", "hash": -815822614770029600, "line_mean": 36.2718446602, "line_max": 148, "alpha_frac": 0.5225319094, "autogenerated": false, "ratio": 5.118666666666667, "config_test":...
"""Async gunicorn worker for aiohttp.web""" import asyncio import logging import os import re import signal import socket import ssl import sys import warnings from gunicorn.config import AccessLogFormat as GunicornAccessLogFormat from gunicorn.workers import base from .helpers import AccessLogger, ensure_future fro...
{ "repo_name": "z2v/aiohttp", "path": "aiohttp/worker.py", "copies": "2", "size": "8581", "license": "apache-2.0", "hash": -7646038252839069000, "line_mean": 31.6273764259, "line_max": 77, "alpha_frac": 0.5760400886, "autogenerated": false, "ratio": 4.125480769230769, "config_test": false, "ha...
"""Async gunicorn worker for aiohttp.web""" import asyncio import logging import os import re import signal import ssl import sys import gunicorn.workers.base as base from gunicorn.config import AccessLogFormat as GunicornAccessLogFormat from aiohttp.helpers import AccessLogger, ensure_future __all__ = ('GunicornWe...
{ "repo_name": "jettify/aiohttp", "path": "aiohttp/worker.py", "copies": "1", "size": "6645", "license": "apache-2.0", "hash": -8074538118286070000, "line_mean": 31.896039604, "line_max": 77, "alpha_frac": 0.5723100075, "autogenerated": false, "ratio": 4.179245283018868, "config_test": false, ...
"""Async gunicorn worker for aiohttp.web""" import asyncio import logging import os import signal import sys import gunicorn.workers.base as base __all__ = ['GunicornWebWorker'] class GunicornWebWorker(base.Worker): def __init__(self, *args, **kw): # pragma: no cover super().__init__(*args, **kw) ...
{ "repo_name": "noplay/aiohttp", "path": "aiohttp/worker.py", "copies": "1", "size": "3734", "license": "apache-2.0", "hash": 8249771386237739000, "line_mean": 30.3781512605, "line_max": 77, "alpha_frac": 0.5782003214, "autogenerated": false, "ratio": 3.9893162393162394, "config_test": false, ...
"""Async gunicorn worker for aiohttp.web""" import asyncio import logging import os import signal import sys import gunicorn.workers.base as base __all__ = ('GunicornWebWorker',) class GunicornWebWorker(base.Worker): def __init__(self, *args, **kw): # pragma: no cover super().__init__(*args, **kw) ...
{ "repo_name": "Insoleet/aiohttp", "path": "aiohttp/worker.py", "copies": "1", "size": "4174", "license": "apache-2.0", "hash": -2620613719296301000, "line_mean": 31.609375, "line_max": 78, "alpha_frac": 0.5678006708, "autogenerated": false, "ratio": 4.096172718351325, "config_test": false, "h...
"""Async gunicorn worker for aiohttp.web""" import asyncio import logging import os import signal import sys import gunicorn.workers.base as base from aiohttp.helpers import ensure_future __all__ = ('GunicornWebWorker', 'GunicornUVLoopWebWorker') class GunicornWebWorker(base.Worker): def __init__(self, *args,...
{ "repo_name": "vaskalas/aiohttp", "path": "aiohttp/worker.py", "copies": "3", "size": "5093", "license": "apache-2.0", "hash": -6752413389485337000, "line_mean": 30.83125, "line_max": 78, "alpha_frac": 0.5599842922, "autogenerated": false, "ratio": 4.254803675856308, "config_test": false, "ha...
"""Async gunicorn worker for aiohttp.web""" import asyncio import os import re import signal import socket import ssl import sys from gunicorn.config import AccessLogFormat as GunicornAccessLogFormat from gunicorn.workers import base from .helpers import AccessLogger, ensure_future __all__ = ('GunicornWebWorker', '...
{ "repo_name": "singulared/aiohttp", "path": "aiohttp/worker.py", "copies": "2", "size": "7839", "license": "apache-2.0", "hash": -8770410689407842000, "line_mean": 32.0759493671, "line_max": 77, "alpha_frac": 0.5723944381, "autogenerated": false, "ratio": 4.141045958795563, "config_test": false...
"""Async gunicorn worker for aiohttp.web""" import asyncio import os import re import signal import socket import sys from gunicorn.config import AccessLogFormat as GunicornAccessLogFormat from gunicorn.workers import base from .helpers import AccessLogger, create_future, ensure_future try: import ssl except I...
{ "repo_name": "Eyepea/aiohttp", "path": "aiohttp/worker.py", "copies": "1", "size": "8682", "license": "apache-2.0", "hash": -6157309803682184000, "line_mean": 31.3955223881, "line_max": 77, "alpha_frac": 0.575558627, "autogenerated": false, "ratio": 4.144152744630071, "config_test": false, "...
"""Async gunicorn worker for aiohttp.web""" import asyncio import os import re import signal import sys from contextlib import suppress from gunicorn.config import AccessLogFormat as GunicornAccessLogFormat from gunicorn.workers import base from aiohttp import web from .helpers import AccessLogger, set_result try...
{ "repo_name": "pfreixes/aiohttp", "path": "aiohttp/worker.py", "copies": "2", "size": "7087", "license": "apache-2.0", "hash": 5699931631927062000, "line_mean": 30.7802690583, "line_max": 77, "alpha_frac": 0.5924932976, "autogenerated": false, "ratio": 4.003954802259887, "config_test": false, ...
"""Async gunicorn worker for aiohttp.web""" import asyncio import os import re import signal import sys from types import FrameType from typing import Any, Awaitable, Callable, Optional, Union # noqa from gunicorn.config import AccessLogFormat as GunicornAccessLogFormat from gunicorn.workers import base from aiohtt...
{ "repo_name": "gnmiller/craig-bot", "path": "craig-bot/lib/python3.6/site-packages/aiohttp/worker.py", "copies": "3", "size": "8178", "license": "mit", "hash": 250145257476488580, "line_mean": 32.7933884298, "line_max": 79, "alpha_frac": 0.585106383, "autogenerated": false, "ratio": 4.07270916334...
"""Async gunicorn worker for aiohttp.web""" import asyncio import os import signal import ssl import sys import gunicorn.workers.base as base from aiohttp.helpers import ensure_future __all__ = ('GunicornWebWorker', 'GunicornUVLoopWebWorker') class GunicornWebWorker(base.Worker): def __init__(self, *args, **...
{ "repo_name": "mind1master/aiohttp", "path": "aiohttp/worker.py", "copies": "1", "size": "5538", "license": "apache-2.0", "hash": -6980361484334939000, "line_mean": 30.6457142857, "line_max": 78, "alpha_frac": 0.5585048754, "autogenerated": false, "ratio": 4.2146118721461185, "config_test": fal...
"""Async gunicorn worker for auihttp.wen.Application.""" __all__ = ['GunicornWebWorker'] import asyncio import os import signal import sys import gunicorn.workers.base as base class GunicornWebWorker(base.Worker): def __init__(self, *args, **kw): # pragma: no cover super().__init__(*args, **kw) ...
{ "repo_name": "saghul/aiohttp", "path": "aiohttp/worker.py", "copies": "1", "size": "3587", "license": "apache-2.0", "hash": -6063816857199592000, "line_mean": 31.0267857143, "line_max": 77, "alpha_frac": 0.5809868971, "autogenerated": false, "ratio": 3.981132075471698, "config_test": false, ...
"""Async gunicorn worker.""" __all__ = ['AsyncGunicornWorker', 'PortMapperWorker'] import asyncio import functools import os import gunicorn.workers.base as base from aiohttp.wsgi import WSGIServerHttpProtocol class AsyncGunicornWorker(base.Worker): def __init__(self, *args, **kw): # pragma: no cover ...
{ "repo_name": "jtackaberry/stagehand", "path": "external/aiohttp/worker.py", "copies": "1", "size": "4372", "license": "mit", "hash": 5838751226161500000, "line_mean": 29.5734265734, "line_max": 78, "alpha_frac": 0.5475754803, "autogenerated": false, "ratio": 4.345924453280318, "config_test": f...
""" Async Handler Provides async operations for various api calls and other non-blocking work. """ import logging import time from collections import defaultdict from concurrent.futures import ThreadPoolExecutor from threading import Event log = logging.getLogger("async") class ThreadCancelledException(Exception): ...
{ "repo_name": "battlemidget/conjure-up", "path": "conjureup/async.py", "copies": "1", "size": "1298", "license": "mit", "hash": 3562765527175917000, "line_mean": 23.4905660377, "line_max": 70, "alpha_frac": 0.687211094, "autogenerated": false, "ratio": 4.006172839506172, "config_test": false, ...
"""Asynchronous Actor-Critic Agents. Implementations refer to Denny Britz implementations at https://github.com/dennybritz/reinforcement-learning/tree/master/PolicyGradient/a3c """ import copy import threading import numpy as np from SafeRLBench import AlgorithmBase from SafeRLBench.error import add_dependency tr...
{ "repo_name": "befelix/Safe-RL-Benchmark", "path": "SafeRLBench/algo/a3c.py", "copies": "1", "size": "12494", "license": "mit", "hash": -8452443156449950000, "line_mean": 32.5860215054, "line_max": 83, "alpha_frac": 0.557947815, "autogenerated": false, "ratio": 4.203903095558546, "config_test":...