hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1788929e564ed8994c128d8d524cf0d5338069ba | 15,107 | py | Python | src/qrl/core/p2p/p2pPeerManager.py | cyyber/QRL | f33699501a72a6a58f1cc53499e9d85c3058451c | [
"MIT"
] | 3 | 2020-07-11T15:33:11.000Z | 2021-11-17T11:22:55.000Z | src/qrl/core/p2p/p2pPeerManager.py | cyyber/QRL | f33699501a72a6a58f1cc53499e9d85c3058451c | [
"MIT"
] | null | null | null | src/qrl/core/p2p/p2pPeerManager.py | cyyber/QRL | f33699501a72a6a58f1cc53499e9d85c3058451c | [
"MIT"
] | null | null | null | # coding=utf-8
# Distributed under the MIT software license, see the accompanying
# file LICENSE or http://www.opensource.org/licenses/mit-license.php.
import os
from enum import Enum
from typing import Callable, Set, List
from ipaddress import IPv4Address
import simplejson as json
from pyqryptonight.pyqryptonight imp... | 41.61708 | 113 | 0.63977 |
0e355f91937ae38454f290fccbd23dba735ae52a | 5,080 | py | Python | Python_code/Boston_BNN_1hidden.py | mraabo/Dissertation--Bayesian-Neural-Networks | 629b1c5f4bbdb80ef1d1037b4a0a1b7f95ac710b | [
"MIT"
] | null | null | null | Python_code/Boston_BNN_1hidden.py | mraabo/Dissertation--Bayesian-Neural-Networks | 629b1c5f4bbdb80ef1d1037b4a0a1b7f95ac710b | [
"MIT"
] | null | null | null | Python_code/Boston_BNN_1hidden.py | mraabo/Dissertation--Bayesian-Neural-Networks | 629b1c5f4bbdb80ef1d1037b4a0a1b7f95ac710b | [
"MIT"
] | null | null | null | # # ----------------------------- INFO ---------------------------
# In this python script we implement and run a BNN for predicting house prices
# in Boston. The sampler is based on the NUTS sampler
# # ----------------------------- IMPORTS ---------------------------
import warnings
import tensorflow as tf
import ma... | 36.028369 | 97 | 0.633661 |
7b26132c0d8b78762b805dd6438fa5d2c8d060b1 | 13,370 | py | Python | plotting/utils.py | plai-group/amortized-rejection-sampling | 1e85253ae1e6ef1c939e1c488e55f9d95ee48355 | [
"MIT"
] | null | null | null | plotting/utils.py | plai-group/amortized-rejection-sampling | 1e85253ae1e6ef1c939e1c488e55f9d95ee48355 | [
"MIT"
] | null | null | null | plotting/utils.py | plai-group/amortized-rejection-sampling | 1e85253ae1e6ef1c939e1c488e55f9d95ee48355 | [
"MIT"
] | null | null | null | import numpy as np
import torch
from tqdm import tqdm
import matplotlib as mpl
# https://gist.github.com/thriveth/8560036
color_cycle = ['#377eb8', '#ff7f00', '#4daf4a',
'#f781bf', '#a65628', '#984ea3',
'#999999', '#e41a1c', '#dede00']
labels_dict = {"ic": "IC",
"prior": ... | 35.558511 | 128 | 0.618624 |
b2c2f70efc01b11f80e3db4fcd445773f80526a7 | 14,071 | py | Python | ctfpwn/api.py | takeshixx/ctfpwn | b4ae4e51164ce420c96f3f06b7aa115b8329055c | [
"Apache-2.0"
] | null | null | null | ctfpwn/api.py | takeshixx/ctfpwn | b4ae4e51164ce420c96f3f06b7aa115b8329055c | [
"Apache-2.0"
] | null | null | null | ctfpwn/api.py | takeshixx/ctfpwn | b4ae4e51164ce420c96f3f06b7aa115b8329055c | [
"Apache-2.0"
] | null | null | null | import asyncio
import os.path
import aiohttp.web
import jinja2
import bson
import bson.json_util
import subprocess
from ctfpwn.db import CtfDb
from ctfpwn.shared import Service, load_ctf_config
from ctfpwn.exploitservice.worker import ExploitWorkerProtocol
dashboard_html = """<html>
<head>
<title>CTF-PWN Dashboar... | 38.656593 | 406 | 0.604932 |
0fa51395a84be5dc0cda8ecd52f8762f2ae5d98f | 3,731 | py | Python | service/src/normal_socket_plugin.py | hivesolutions/colony_plugins | cfd8fb2ac58037e01002966704b8a642feb37895 | [
"Apache-1.1"
] | 1 | 2016-10-30T09:51:06.000Z | 2016-10-30T09:51:06.000Z | service/src/normal_socket_plugin.py | hivesolutions/colony_plugins | cfd8fb2ac58037e01002966704b8a642feb37895 | [
"Apache-1.1"
] | 1 | 2015-12-29T18:51:07.000Z | 2015-12-29T18:51:07.000Z | service/src/normal_socket_plugin.py | hivesolutions/colony_plugins | cfd8fb2ac58037e01002966704b8a642feb37895 | [
"Apache-1.1"
] | 1 | 2018-01-26T12:54:13.000Z | 2018-01-26T12:54:13.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Hive Colony Framework
# Copyright (c) 2008-2020 Hive Solutions Lda.
#
# This file is part of Hive Colony Framework.
#
# Hive Colony Framework is free software: you can redistribute it and/or modify
# it under the terms of the Apache License as published by the Apach... | 30.834711 | 81 | 0.649156 |
9edf9f8f6d3e36e5e0028a003f033962e75eedc2 | 29,967 | py | Python | src/dataset.py | tomvars/medical_adv_da | d2c81ee7951c580b62d853497672057b8cf7923e | [
"Apache-2.0"
] | 2 | 2021-08-13T07:21:00.000Z | 2021-09-15T08:52:20.000Z | src/dataset.py | tomvars/medical_adv_da | d2c81ee7951c580b62d853497672057b8cf7923e | [
"Apache-2.0"
] | null | null | null | src/dataset.py | tomvars/medical_adv_da | d2c81ee7951c580b62d853497672057b8cf7923e | [
"Apache-2.0"
] | null | null | null | import os
import nibabel as nib
from functools import reduce
import numpy as np
import pandas as pd
import torch
from torch.utils.data import Dataset, DataLoader
from pathlib import Path
from src.utils import batch_adaptation, to_var_gpu
from monai.data.dataset import Dataset as MonaiDataset
from monai.data.nifti_saver... | 50.53457 | 139 | 0.61531 |
38b563cd62ec66f835f04d350a88f64b3583fadf | 2,171 | py | Python | maintenance/tests_old/test_parallel_opt.py | sfpd/rlreloaded | 650c64ec22ad45996c8c577d85b1a4f20aa1c692 | [
"MIT"
] | null | null | null | maintenance/tests_old/test_parallel_opt.py | sfpd/rlreloaded | 650c64ec22ad45996c8c577d85b1a4f20aa1c692 | [
"MIT"
] | null | null | null | maintenance/tests_old/test_parallel_opt.py | sfpd/rlreloaded | 650c64ec22ad45996c8c577d85b1a4f20aa1c692 | [
"MIT"
] | null | null | null | import argparse
import numpy as np
from cloud.cloud_interface import create_cloud,load_cloud_config,get_slave_names
from cloud.cluster_pool import ClusterPool
from cloud.slave_loop import slave_loop
from control3.common_util import chunk_slices
from control3.parallel import sum_count_reducer
# Import datasets, classifi... | 30.152778 | 94 | 0.64947 |
9fa0ff0b6e0e149bccdca6a6c15816c2dfa25ff8 | 18,472 | py | Python | ucsmsdk/mometa/sysdebug/SysdebugAutoCoreFileExportTargetFsm.py | anoop1984/python_sdk | c4a226bad5e10ad233eda62bc8f6d66a5a82b651 | [
"Apache-2.0"
] | null | null | null | ucsmsdk/mometa/sysdebug/SysdebugAutoCoreFileExportTargetFsm.py | anoop1984/python_sdk | c4a226bad5e10ad233eda62bc8f6d66a5a82b651 | [
"Apache-2.0"
] | null | null | null | ucsmsdk/mometa/sysdebug/SysdebugAutoCoreFileExportTargetFsm.py | anoop1984/python_sdk | c4a226bad5e10ad233eda62bc8f6d66a5a82b651 | [
"Apache-2.0"
] | null | null | null | """This module contains the general information for SysdebugAutoCoreFileExportTargetFsm ManagedObject."""
import sys, os
from ...ucsmo import ManagedObject
from ...ucscoremeta import UcsVersion, MoPropertyMeta, MoMeta
from ...ucsmeta import VersionMeta
class SysdebugAutoCoreFileExportTargetFsmConsts():
COMPLETIO... | 87.961905 | 3,649 | 0.758175 |
fadf633a2c614176b4f06e13b7845ebc5554706f | 1,060 | py | Python | cogs/extra.py | Nakukai/Koha | 67b014f277742fbff0532c372d6b0f49db739528 | [
"Apache-2.0"
] | 2 | 2021-02-16T11:44:13.000Z | 2021-02-23T17:41:22.000Z | cogs/extra.py | Nakukai/Koha | 67b014f277742fbff0532c372d6b0f49db739528 | [
"Apache-2.0"
] | 5 | 2021-02-14T01:36:12.000Z | 2021-02-22T11:29:21.000Z | cogs/extra.py | Nakukai/Koha | 67b014f277742fbff0532c372d6b0f49db739528 | [
"Apache-2.0"
] | 1 | 2021-02-14T14:58:05.000Z | 2021-02-14T14:58:05.000Z | import discord
from discord.ext import commands
class Extra(commands.Cog):
def __init__(self, client):
self.client = client
@commands.command()
async def invite(self, ctx):
Invitation = discord.Embed(
color=0xFFB6C1,
description="**Want me to join your amazing serv... | 34.193548 | 128 | 0.600943 |
a3638429d2d4ff9a959b513c01503ff52e7a60bb | 3,838 | py | Python | test/algorithms/pes_samplers/test_bopes_sampler.py | davindratulsi/qiskit-nature | d5209bbfe6b83496dc2be327f65a24dcebdea9df | [
"Apache-2.0"
] | null | null | null | test/algorithms/pes_samplers/test_bopes_sampler.py | davindratulsi/qiskit-nature | d5209bbfe6b83496dc2be327f65a24dcebdea9df | [
"Apache-2.0"
] | null | null | null | test/algorithms/pes_samplers/test_bopes_sampler.py | davindratulsi/qiskit-nature | d5209bbfe6b83496dc2be327f65a24dcebdea9df | [
"Apache-2.0"
] | null | null | null | # This code is part of Qiskit.
#
# (C) Copyright IBM 2020, 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | 35.869159 | 98 | 0.668838 |
1b270aebb5ab81b86aff0c689a5da103667d6ba6 | 6,637 | py | Python | zinnia/ping.py | Raekkeri/django-blog-zinnia | 1b7b03e1e0c27fdf2a84ff1fbf05aeeb5ac6f370 | [
"BSD-3-Clause"
] | 1 | 2018-05-28T08:46:41.000Z | 2018-05-28T08:46:41.000Z | zinnia/ping.py | elleven/zinnia_blog | 59270435c9f29f5c9672a41ea01fe34b228f8ef9 | [
"Apache-2.0"
] | null | null | null | zinnia/ping.py | elleven/zinnia_blog | 59270435c9f29f5c9672a41ea01fe34b228f8ef9 | [
"Apache-2.0"
] | null | null | null | """Pings utilities for Zinnia"""
import socket
from logging import getLogger
from threading import Thread
try:
from urllib.request import urlopen
from urllib.parse import urlsplit
from xmlrpc.client import Error
from xmlrpc.client import ServerProxy
except ImportError: # Python 2
from urllib2 impor... | 33.351759 | 78 | 0.560494 |
8401273e3a9d39f598898a6b59ed5906121f5ce2 | 39,922 | py | Python | skrf/circuit.py | JAnderson419/scikit-rf | b505374b5bf0baa60773ccfc4ec41c2a627df2b2 | [
"BSD-3-Clause"
] | null | null | null | skrf/circuit.py | JAnderson419/scikit-rf | b505374b5bf0baa60773ccfc4ec41c2a627df2b2 | [
"BSD-3-Clause"
] | 1 | 2021-07-15T14:45:49.000Z | 2021-07-15T14:45:49.000Z | skrf/circuit.py | JAnderson419/scikit-rf | b505374b5bf0baa60773ccfc4ec41c2a627df2b2 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
circuit (:mod:`skrf.circuit`)
========================================
The Circuit class represents a circuit of arbitrary topology,
consisting of an arbitrary number of N-ports networks.
Like in an electronic circuit simulator, the circuit must have one or more ports
connected to the circ... | 30.591571 | 126 | 0.557011 |
589a6ab68ded9181a1b56c64e9085578b5289752 | 2,140 | py | Python | tests/util_test.py | mcdobe100/arkouda | 499ecb502da214ee71e9923fda9487c65ec4d616 | [
"MIT"
] | null | null | null | tests/util_test.py | mcdobe100/arkouda | 499ecb502da214ee71e9923fda9487c65ec4d616 | [
"MIT"
] | null | null | null | tests/util_test.py | mcdobe100/arkouda | 499ecb502da214ee71e9923fda9487c65ec4d616 | [
"MIT"
] | null | null | null | from base_test import ArkoudaTest
from context import arkouda as ak
from arkouda.util import attach
class utilTest(ArkoudaTest):
def test_simple_attach(self):
a = ak.array(["abc","123","def"])
b = ak.arange(10)
# Attach the Strings array and the pdarray to new objects
a_a... | 36.896552 | 112 | 0.603738 |
11992f425ed30770f26b86064a641df89d475df2 | 6,483 | py | Python | tushare/util/formula.py | Federer1976/tushare | 1640f2beb200fa99e10dbba0fd19d0b7138f034e | [
"BSD-3-Clause"
] | 1 | 2019-02-15T12:59:02.000Z | 2019-02-15T12:59:02.000Z | tushare/util/formula.py | Federer1976/tushare | 1640f2beb200fa99e10dbba0fd19d0b7138f034e | [
"BSD-3-Clause"
] | null | null | null | tushare/util/formula.py | Federer1976/tushare | 1640f2beb200fa99e10dbba0fd19d0b7138f034e | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
import numpy as np
import pandas as pd
def EMA(DF, N):
return pd.Series.ewm(DF, span=N, min_periods=N - 1, adjust=True).mean()
def MA(DF, N):
return pd.Series.rolling(DF, N).mean()
def SMA(DF, N, M):
DF = DF.fillna(0)
z = len(DF)
var = np.zeros(z)
... | 24.83908 | 93 | 0.489588 |
6d419aba0ac21e540f99bd5f81077342d222f41f | 157 | py | Python | tests/model_control/detailed/transf_BoxCox/model_control_one_enabled_BoxCox_PolyTrend_Seasonal_Hour_AR.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | null | null | null | tests/model_control/detailed/transf_BoxCox/model_control_one_enabled_BoxCox_PolyTrend_Seasonal_Hour_AR.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | 1 | 2019-11-30T23:39:38.000Z | 2019-12-01T04:34:35.000Z | tests/model_control/detailed/transf_BoxCox/model_control_one_enabled_BoxCox_PolyTrend_Seasonal_Hour_AR.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | null | null | null | import pyaf.tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['BoxCox'] , ['PolyTrend'] , ['Seasonal_Hour'] , ['AR'] ); | 39.25 | 79 | 0.745223 |
cda58dfc7618d0aeb296932b58ee50b1ec94bbe9 | 303 | py | Python | python/reverse_a_string_using_function.py | mujib2953/general-codes | e944ceac62c89d3fc15bf7b0ed42cac8eb510296 | [
"Apache-2.0"
] | null | null | null | python/reverse_a_string_using_function.py | mujib2953/general-codes | e944ceac62c89d3fc15bf7b0ed42cac8eb510296 | [
"Apache-2.0"
] | null | null | null | python/reverse_a_string_using_function.py | mujib2953/general-codes | e944ceac62c89d3fc15bf7b0ed42cac8eb510296 | [
"Apache-2.0"
] | null | null | null | # Author: Mujib Ansari
# Date: Jan 21, 2021
# Problem Statement: WAP to reverse a string using function
def reverse_string(s):
str = ""
for i in s:
str = i + str
return str
s = "Arigato"
print("Original string : ", s)
print("Reverse string : ", reverse_string(s))
| 18.9375 | 60 | 0.60396 |
8df16a8574b726fe974d6ea9c51117fff3ef49ac | 31,389 | py | Python | third_party/depot_tools/git_common.py | gengleilei/wee8 | a7bff18685ddfc7f16de825c9d3a12432d4138d5 | [
"BSD-3-Clause"
] | 1 | 2020-10-10T02:27:19.000Z | 2020-10-10T02:27:19.000Z | third_party/depot_tools/git_common.py | gengleilei/wee8 | a7bff18685ddfc7f16de825c9d3a12432d4138d5 | [
"BSD-3-Clause"
] | null | null | null | third_party/depot_tools/git_common.py | gengleilei/wee8 | a7bff18685ddfc7f16de825c9d3a12432d4138d5 | [
"BSD-3-Clause"
] | 1 | 2020-11-03T15:15:26.000Z | 2020-11-03T15:15:26.000Z | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Monkeypatch IMapIterator so that Ctrl-C can kill everything properly.
# Derived from https://gist.github.com/aljungberg/626518
from __future__ import prin... | 28.406335 | 80 | 0.664914 |
bea1cef1f0598d8981f23e210cb64658682a65f2 | 778 | py | Python | wbsync/util/uri_constants.py | mistermboy/wikibase-sync | 4be2738719c72020159f1b113e3c4ba61b6ca2f0 | [
"MIT"
] | 5 | 2021-03-30T06:16:33.000Z | 2021-04-17T09:11:32.000Z | wbsync/util/uri_constants.py | mistermboy/wikibase-sync | 4be2738719c72020159f1b113e3c4ba61b6ca2f0 | [
"MIT"
] | 5 | 2020-12-25T18:50:14.000Z | 2021-04-18T10:01:41.000Z | wbsync/util/uri_constants.py | weso/wikibase-sync | da17aa1e691cde4c1c66bd87bc3ca3d7b899c261 | [
"MIT"
] | 4 | 2020-09-01T10:47:39.000Z | 2021-07-14T11:38:21.000Z | ASIO_BASE = 'http://purl.org/hercules/asio/core#'
RDFS_BASE = 'http://www.w3.org/2000/01/rdf-schema#'
RDFS_LABEL = f'{RDFS_BASE}label'
RDFS_COMMENT = f'{RDFS_BASE}comment'
RDFS_SUBCLASSOF = f'{RDFS_BASE}subClassOf'
RDF_BASE = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'
RDF_TYPE = f'{RDF_BASE}type'
OWL_BASE = 'http... | 29.923077 | 56 | 0.736504 |
5737162827e75229e51148a41ab56187c2e08eb1 | 10,563 | py | Python | cltk/lemmatize/backoff.py | adeloucas/cltk | 38b82530c11e153a9bd39791b50895d3a5a06ac0 | [
"MIT"
] | 1 | 2020-05-01T08:21:22.000Z | 2020-05-01T08:21:22.000Z | cltk/lemmatize/backoff.py | ecomp-shONgit/cltk | 7bc3ffd1bbbfa5d036297395d7e51b99b25b81ea | [
"MIT"
] | null | null | null | cltk/lemmatize/backoff.py | ecomp-shONgit/cltk | 7bc3ffd1bbbfa5d036297395d7e51b99b25b81ea | [
"MIT"
] | null | null | null | """Lemmatization module—includes several classes for different
lemmatizing approaches--based on training data, regex pattern matching,
etc. These can be chained together using the backoff parameter. Also,
includes a pre-built chain that uses models in cltk_data.
The logic behind the backoff lemmatizer is based on back... | 38.834559 | 132 | 0.65578 |
884b9ccd95c0ffab9690529445ccfda939f04ea9 | 90,010 | py | Python | src/redgrease/gears.py | wolkenarchitekt/redgrease | bf39651e6ad44774edac61b51a1444a668c49468 | [
"MIT"
] | 17 | 2021-02-26T23:03:39.000Z | 2022-01-26T11:21:49.000Z | src/redgrease/gears.py | wolkenarchitekt/redgrease | bf39651e6ad44774edac61b51a1444a668c49468 | [
"MIT"
] | 87 | 2021-02-16T08:54:59.000Z | 2021-08-18T07:21:39.000Z | src/redgrease/gears.py | wolkenarchitekt/redgrease | bf39651e6ad44774edac61b51a1444a668c49468 | [
"MIT"
] | 3 | 2021-04-21T07:57:43.000Z | 2021-10-04T09:13:14.000Z | # -*- coding: utf-8 -*-
# from __future__ import annotations
"""
GearsFunction and Operation definitions
"""
__author__ = "Anders Åström"
__contact__ = "anders@lyngon.com"
__copyright__ = "2021, Lyngon Pte. Ltd."
__licence__ = """The MIT License
Copyright © 2021 Lyngon Pte. Ltd.
Permission is hereby granted, free of ... | 35.577075 | 94 | 0.584002 |
e316011986842bd359ce24ef66689e5d67490fd6 | 18,018 | py | Python | rtcclient/template.py | sadikkuzu-mba/rtcclient | 831d9eef57f0daca86728ea38743925f6db017fc | [
"Apache-2.0"
] | 37 | 2015-07-31T03:21:55.000Z | 2021-08-04T10:30:13.000Z | rtcclient/template.py | sadikkuzu-mba/rtcclient | 831d9eef57f0daca86728ea38743925f6db017fc | [
"Apache-2.0"
] | 94 | 2015-07-29T14:27:13.000Z | 2022-03-10T16:53:30.000Z | rtcclient/template.py | sadikkuzu-mba/rtcclient | 831d9eef57f0daca86728ea38743925f6db017fc | [
"Apache-2.0"
] | 37 | 2015-11-11T15:06:39.000Z | 2022-03-01T12:21:48.000Z | from rtcclient.base import RTCBase
import logging
import xmltodict
import os
import jinja2
import jinja2.meta
from rtcclient import exception
from rtcclient import _search_path
import six
from rtcclient.utils import remove_empty_elements
from xml.sax.saxutils import escape
class Templater(RTCBase):
"""A wrapped c... | 41.231121 | 79 | 0.544622 |
d18eefe2cfdb8f172c974eb82d7224b7b1de4189 | 8,643 | py | Python | main/main_cv.py | Lamiane/conv_qsar_fast | e495777293199a6b529dbcb7530b2240d2310e09 | [
"MIT"
] | 2 | 2020-07-07T14:21:30.000Z | 2020-10-22T10:11:43.000Z | main/main_cv.py | Lamiane/conv_qsar_fast | e495777293199a6b529dbcb7530b2240d2310e09 | [
"MIT"
] | null | null | null | main/main_cv.py | Lamiane/conv_qsar_fast | e495777293199a6b529dbcb7530b2240d2310e09 | [
"MIT"
] | null | null | null | import os
import sys
import datetime
import numpy as np
from distutils.util import strtobool
from conv_qsar_fast.main.core import build_model, train_model, save_model
from conv_qsar_fast.main.test import test_model, test_embeddings_demo
from conv_qsar_fast.main.data import get_data_full
from conv_qsar_fast.utils.parse... | 39.108597 | 122 | 0.483513 |
09f35ceeddec41af26cc05239cee29050af07fb8 | 160 | py | Python | Chapter10/clean_sample.py | fbitti/Bioinformatics-with-Python-Cookbook-Second-Edition | 89281e5e3474cb79aeb87e75eb1a1849c338813a | [
"MIT"
] | 244 | 2018-06-28T05:05:01.000Z | 2022-03-28T07:59:19.000Z | Chapter10/clean_sample.py | fbitti/Bioinformatics-with-Python-Cookbook-Second-Edition | 89281e5e3474cb79aeb87e75eb1a1849c338813a | [
"MIT"
] | 22 | 2019-01-19T08:30:18.000Z | 2021-11-02T20:15:48.000Z | Chapter10/clean_sample.py | fbitti/Bioinformatics-with-Python-Cookbook-Second-Edition | 89281e5e3474cb79aeb87e75eb1a1849c338813a | [
"MIT"
] | 178 | 2018-05-12T10:05:29.000Z | 2022-03-31T03:01:59.000Z | import sys
sys.stdout.write('ID_1 ID_2 missing\n0 0 0 \n')
for line in sys.stdin:
ind = line.rstrip()
sys.stdout.write('%s %s 0\n' % (ind, ind))
| 17.777778 | 47 | 0.60625 |
4aa1299e971832221abff9ebf98dc3181628441e | 7,612 | py | Python | percolation.py | rafaelpleite/Algoritmos | 2f02ac89b4f71dd9780b8cbf0c054db64b68b7ae | [
"MIT"
] | null | null | null | percolation.py | rafaelpleite/Algoritmos | 2f02ac89b4f71dd9780b8cbf0c054db64b68b7ae | [
"MIT"
] | null | null | null | percolation.py | rafaelpleite/Algoritmos | 2f02ac89b4f71dd9780b8cbf0c054db64b68b7ae | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#------------------------------------------------------------------
# LEIA E PREENCHA O CABEÇALHO
# NÃO ALTERE OS NOMES DAS FUNÇÕES
# NÃO APAGUE OS DOCSTRINGS
# NÃO INCLUA NENHUM import ...
#------------------------------------------------------------------
'''
Nome: Rafael Prudêncio Leit... | 32.391489 | 186 | 0.485155 |
e782bd8739b6d9d18e92766068ccef718f1c3cc0 | 16,672 | py | Python | google/cloud/aiplatform_v1beta1/services/index_service/transports/grpc.py | dwkk-google/python-aiplatform | 016415122f93029cdd7703b6dfd6d9a431d1d571 | [
"Apache-2.0"
] | null | null | null | google/cloud/aiplatform_v1beta1/services/index_service/transports/grpc.py | dwkk-google/python-aiplatform | 016415122f93029cdd7703b6dfd6d9a431d1d571 | [
"Apache-2.0"
] | null | null | null | google/cloud/aiplatform_v1beta1/services/index_service/transports/grpc.py | dwkk-google/python-aiplatform | 016415122f93029cdd7703b6dfd6d9a431d1d571 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 43.080103 | 87 | 0.633937 |
1a32a0f2ce07e26dbe1a452582baa1551b35f990 | 5,353 | py | Python | blobrl/agents/categorical_dqn.py | garaytc/reinforcement | e6af258bf2ac3b45c20e0ed3d2f58ca7bc2b232f | [
"Apache-2.0"
] | 12 | 2020-05-19T18:58:55.000Z | 2021-02-21T20:26:46.000Z | blobrl/agents/categorical_dqn.py | garaytc/reinforcement | e6af258bf2ac3b45c20e0ed3d2f58ca7bc2b232f | [
"Apache-2.0"
] | 39 | 2020-05-19T18:41:42.000Z | 2021-01-16T08:31:06.000Z | blobrl/agents/categorical_dqn.py | garaytc/reinforcement | e6af258bf2ac3b45c20e0ed3d2f58ca7bc2b232f | [
"Apache-2.0"
] | 2 | 2020-05-19T15:15:04.000Z | 2020-05-21T08:45:59.000Z | import torch
import torch.nn.functional as F
import torch.optim as optim
from gym.spaces import flatten
from blobrl.agents import DQN
from blobrl.memories import ExperienceReplay
from blobrl.networks import C51Network
class CategoricalDQN(DQN):
def __init__(self, observation_space, action_space, memory=Experien... | 40.862595 | 112 | 0.592004 |
600fa789512d9b2c1938a6bea93d8e4f9bd2e81a | 3,353 | py | Python | cbf_item_rec.py | tmscarla/polimi-recsys-2018 | 48f97e81b5a8353271ba73797376fdd84cb70af4 | [
"Apache-2.0"
] | 6 | 2019-02-15T12:22:23.000Z | 2020-10-27T14:29:25.000Z | cbf_item_rec.py | tmscarla/polimi-recsys-2018 | 48f97e81b5a8353271ba73797376fdd84cb70af4 | [
"Apache-2.0"
] | null | null | null | cbf_item_rec.py | tmscarla/polimi-recsys-2018 | 48f97e81b5a8353271ba73797376fdd84cb70af4 | [
"Apache-2.0"
] | 1 | 2021-12-03T21:29:17.000Z | 2021-12-03T21:29:17.000Z | import similaripy as sim
import scipy.sparse as sps
from evaluator import Evaluator
import numpy as np
import pandas as pd
from tqdm import tqdm
class CBFRecommender(object):
"""
A random recommender. It recommends 10 random tracks for each playlist.
"""
def __init__(self, datareader):
self.d... | 32.240385 | 101 | 0.539219 |
fcc558e6af63886984baedefdb584ee6bf1f945b | 547 | py | Python | packages/python/plotly/plotly/validators/sunburst/marker/_coloraxis.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/sunburst/marker/_coloraxis.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/sunburst/marker/_coloraxis.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | import _plotly_utils.basevalidators
class ColoraxisValidator(_plotly_utils.basevalidators.SubplotidValidator):
def __init__(
self, plotly_name="coloraxis", parent_name="sunburst.marker", **kwargs
):
super(ColoraxisValidator, self).__init__(
plotly_name=plotly_name,
pare... | 34.1875 | 78 | 0.617916 |
2056e1196459c8c0b994eb30f92729d850c3fbcb | 8,945 | py | Python | application/analytics_project/settings.py | rendex85/analytics_backend-1 | 02ac45bde8754491795c99fbddcfc249d64a2fd3 | [
"MIT"
] | null | null | null | application/analytics_project/settings.py | rendex85/analytics_backend-1 | 02ac45bde8754491795c99fbddcfc249d64a2fd3 | [
"MIT"
] | null | null | null | application/analytics_project/settings.py | rendex85/analytics_backend-1 | 02ac45bde8754491795c99fbddcfc249d64a2fd3 | [
"MIT"
] | null | null | null | """
Django settings for analytics_project project.
Generated by 'django-admin startproject' using Django 2.2.6.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
im... | 29.916388 | 91 | 0.7109 |
450a340b74e753fbaa2b39d8aa34bab8eba52f6a | 25,125 | py | Python | tests/sphinx/test_base.py | dgehringer/pyiron_atomistics | f8f2d573a483e802c8e5840998a0769378b95e31 | [
"BSD-3-Clause"
] | null | null | null | tests/sphinx/test_base.py | dgehringer/pyiron_atomistics | f8f2d573a483e802c8e5840998a0769378b95e31 | [
"BSD-3-Clause"
] | 1 | 2022-02-24T09:51:10.000Z | 2022-02-24T09:51:10.000Z | tests/sphinx/test_base.py | srmnitc/pyiron_atomistics | 2c8052b082f2c4fb6f6291ac2b1f801ea7ab1567 | [
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
# Copyright (c) Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department
# Distributed under the terms of "New BSD License", see the LICENSE file.
import os
import numpy as np
import unittest
import warnings
import scipy.constants
from pyiron_atomistics.project impor... | 42.01505 | 120 | 0.60597 |
b53bc853c8dd2914a35661cbff98d84c84ca1e87 | 969 | py | Python | hhttp/master.py | lemoi/hhttp | 8bd813e0d153985261e38a57590748fa55e79766 | [
"MIT"
] | null | null | null | hhttp/master.py | lemoi/hhttp | 8bd813e0d153985261e38a57590748fa55e79766 | [
"MIT"
] | null | null | null | hhttp/master.py | lemoi/hhttp | 8bd813e0d153985261e38a57590748fa55e79766 | [
"MIT"
] | null | null | null | import os, sys, socket, selectors
from .manager import Manager
from .consts import CONFIG_PARAM
#the most efficient select implementation available on the current platform
SELECT = selectors.DefaultSelector()
CPU_NUM = os.cpu_count()
#ipv4
AF = socket.AF_INET #AF_INET6
HOST = CONFIG_PARAM['host']
PORT = int(CONFIG_PA... | 30.28125 | 81 | 0.651187 |
fa5910dee91ae37002bfc2dfb1bd0c4d8a66869a | 2,687 | py | Python | azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/packet_capture_parameters.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/packet_capture_parameters.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 54 | 2016-03-25T17:25:01.000Z | 2018-10-22T17:27:54.000Z | azure-mgmt-network/azure/mgmt/network/v2016_09_01/models/packet_capture_parameters.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 2 | 2017-01-20T18:25:46.000Z | 2017-05-12T21:31:47.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 43.33871 | 95 | 0.665426 |
4f4d46774538aa09598577c7d9d0519392ef77d9 | 97,810 | py | Python | fkie_node_manager/src/fkie_node_manager/node_tree_model.py | srv/multimaster_fkie | a6b0e51c2f52a5ad9cc5baae3b8c46ee45e65372 | [
"BSD-3-Clause"
] | null | null | null | fkie_node_manager/src/fkie_node_manager/node_tree_model.py | srv/multimaster_fkie | a6b0e51c2f52a5ad9cc5baae3b8c46ee45e65372 | [
"BSD-3-Clause"
] | null | null | null | fkie_node_manager/src/fkie_node_manager/node_tree_model.py | srv/multimaster_fkie | a6b0e51c2f52a5ad9cc5baae3b8c46ee45e65372 | [
"BSD-3-Clause"
] | null | null | null | # Software License Agreement (BSD License)
#
# Copyright (c) 2012, Fraunhofer FKIE/US, Alexander Tiderko
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code mus... | 43.723737 | 236 | 0.566588 |
982d148b1d7493298de788ebd9ee1db60b5b1494 | 4,367 | py | Python | ttpp/metrics.py | shchur/triangular-tpp | 19df15fb6f0701e0a2cb9f6afc8a5dfe87a80f40 | [
"MIT"
] | 19 | 2020-11-10T11:31:05.000Z | 2022-03-19T16:15:02.000Z | ttpp/metrics.py | shchur/triangular-tpp | 19df15fb6f0701e0a2cb9f6afc8a5dfe87a80f40 | [
"MIT"
] | null | null | null | ttpp/metrics.py | shchur/triangular-tpp | 19df15fb6f0701e0a2cb9f6afc8a5dfe87a80f40 | [
"MIT"
] | 5 | 2021-03-03T10:24:50.000Z | 2021-12-13T09:20:06.000Z | import numpy as np
from scipy.stats import wasserstein_distance
from typing import List
def counting_distance(x: np.ndarray, Y: np.ndarray, t_max: float):
"""Computes the distance between the counting process of x and y.
This computation is batched and expects a 1D array for x and a 2D array for Y.
From: ... | 34.65873 | 115 | 0.622853 |
1dcbc23799952a4305c271253b09474d23fee4b0 | 3,084 | py | Python | huaweicloud-sdk-vpc/huaweicloudsdkvpc/v2/model/show_network_ip_availabilities_request.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 64 | 2020-06-12T07:05:07.000Z | 2022-03-30T03:32:50.000Z | huaweicloud-sdk-vpc/huaweicloudsdkvpc/v2/model/show_network_ip_availabilities_request.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 11 | 2020-07-06T07:56:54.000Z | 2022-01-11T11:14:40.000Z | huaweicloud-sdk-vpc/huaweicloudsdkvpc/v2/model/show_network_ip_availabilities_request.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 24 | 2020-06-08T11:42:13.000Z | 2022-03-04T06:44:08.000Z | # coding: utf-8
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class ShowNetworkIpAvailabilitiesRequest:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map... | 27.052632 | 85 | 0.565175 |
49ad8b4f4a5a01ef5ee0b715d24f1aa8e9a5a467 | 10,394 | py | Python | pywindowframes/elements.py | afmelin/pywindowframes | eab943940aff9924b013a07999a2abeee4a0b520 | [
"MIT"
] | 1 | 2021-02-16T18:25:15.000Z | 2021-02-16T18:25:15.000Z | pywindowframes/elements.py | afmelin/pywindowframes | eab943940aff9924b013a07999a2abeee4a0b520 | [
"MIT"
] | 5 | 2021-02-16T18:21:44.000Z | 2021-02-16T18:28:45.000Z | pywindowframes/elements.py | afmelin/pywindowframes | eab943940aff9924b013a07999a2abeee4a0b520 | [
"MIT"
] | null | null | null | import pygame as pg
from time import time
class BaseElement:
def __init__(self, name, window, pos=None, size=None, border=True, grid_pos=None, grid_size=None):
"""
Using grid size and grid rects is a lot easier than using pos and size directly. Just set a window size
to a certain g... | 35.114865 | 115 | 0.585723 |
46f7731c0e5de3228f484d7ccd006c7137c2c7eb | 259 | py | Python | electrumsv/wallet_database/exceptions.py | electrumsv/electrumsv | a2d9027ccec338cadfca778888e6ef7f077b1651 | [
"MIT"
] | 136 | 2019-01-10T15:49:09.000Z | 2022-02-20T04:46:39.000Z | electrumsv/wallet_database/exceptions.py | electrumsv/electrumsv | a2d9027ccec338cadfca778888e6ef7f077b1651 | [
"MIT"
] | 790 | 2019-01-07T01:53:35.000Z | 2022-03-30T23:04:28.000Z | electrumsv/wallet_database/exceptions.py | electrumsv/electrumsv | a2d9027ccec338cadfca778888e6ef7f077b1651 | [
"MIT"
] | 65 | 2019-01-10T23:55:30.000Z | 2021-12-19T06:47:13.000Z | class DataPackingError(Exception):
pass
class DatabaseUpdateError(Exception):
pass
class KeyInstanceNotFoundError(Exception):
pass
class TransactionAlreadyExistsError(Exception):
pass
class TransactionRemovalError(Exception):
pass
| 13.631579 | 47 | 0.776062 |
bc190ef54fbf1ea7cb678a2ed718df8c2cdd8110 | 691 | py | Python | misctests/strength_conversion_test.py | anttikantee/wbc | cf8c25f01eb3aeb96a82e39568bd7df52dc21c60 | [
"0BSD"
] | 7 | 2019-02-27T11:48:09.000Z | 2022-02-05T06:02:34.000Z | misctests/strength_conversion_test.py | anttikantee/brewcalc | 1e40773012a59510717a3b0fa426ea3137dde9d1 | [
"0BSD"
] | null | null | null | misctests/strength_conversion_test.py | anttikantee/brewcalc | 1e40773012a59510717a3b0fa426ea3137dde9d1 | [
"0BSD"
] | null | null | null | #!/usr/bin/env python
from WBC.wbc import Recipe
from WBC.units import Strength
def testme(vals, fun, ifun):
rv = []
for x in vals:
v = fun(x)
iv = ifun(v)
diff = abs(x - iv)
rv.append((x, v, iv, diff))
return rv
def prt(v):
for x in v:
print x[0], x[1], x[2], x[3]
sv = sorted(v, key=lambda x: x[3], r... | 20.939394 | 58 | 0.612156 |
924f4c1a3f3831dd98e2aba2ba3508eb153815b7 | 8,133 | py | Python | setup_ts.py | Arunachalam96/nni | c80ed3e904e74db7126cecf5e24b9fc7c895c401 | [
"MIT"
] | null | null | null | setup_ts.py | Arunachalam96/nni | c80ed3e904e74db7126cecf5e24b9fc7c895c401 | [
"MIT"
] | null | null | null | setup_ts.py | Arunachalam96/nni | c80ed3e904e74db7126cecf5e24b9fc7c895c401 | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
"""
Script for building TypeScript modules.
This script is called by `setup.py` and common users should avoid using this directly.
It compiles TypeScript source files in `ts` directory,
and copies (or links) JavaScript output as well as dependen... | 32.532 | 118 | 0.689168 |
75aa0c5277836ab8982db1594d881c43429ea474 | 1,415 | py | Python | app/core/models.py | bowo-anakdesa/belajar-django-api | 3f2a456f29bbc18ec6e4383b929de41c2d2edbf5 | [
"MIT"
] | 1 | 2019-06-28T02:02:56.000Z | 2019-06-28T02:02:56.000Z | app/core/models.py | bowo-anakdesa/django-api | 3f2a456f29bbc18ec6e4383b929de41c2d2edbf5 | [
"MIT"
] | null | null | null | app/core/models.py | bowo-anakdesa/django-api | 3f2a456f29bbc18ec6e4383b929de41c2d2edbf5 | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager, \
PermissionsMixin
from django.conf import settings
class UserManager(BaseUserManager):
def create_user(self, email, password=None, **extra_fields):
"""Create and save a new user"""
if not em... | 28.877551 | 76 | 0.675618 |
6731e1c2e9310afe6a8e0f52fd74134649e5e7ca | 3,955 | py | Python | archive/sphinx.py | kennethpjdyer/bacch | 739575af1cf7135e8bc661415e782502276359af | [
"BSD-3-Clause"
] | 3 | 2015-02-26T05:02:08.000Z | 2015-04-11T23:41:05.000Z | archive/sphinx.py | dionysiac-endeavors/bacch | 739575af1cf7135e8bc661415e782502276359af | [
"BSD-3-Clause"
] | 11 | 2016-07-30T05:45:21.000Z | 2016-07-30T06:33:01.000Z | archive/sphinx.py | dionysiac-endeavors/bacch | 739575af1cf7135e8bc661415e782502276359af | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2017, Kenneth P. J. Dyer <kenneth@avoceteditors.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, th... | 38.77451 | 79 | 0.60708 |
20d9dfb1e5f6757c80cfe7a43477b3c63552c333 | 365 | py | Python | cracking-the-coding-interview/src/chapter1/palindrome.py | silphire/training-with-books | bd07f7376996828b6cb4000d654cdc5f53d1c589 | [
"MIT"
] | null | null | null | cracking-the-coding-interview/src/chapter1/palindrome.py | silphire/training-with-books | bd07f7376996828b6cb4000d654cdc5f53d1c589 | [
"MIT"
] | 4 | 2020-01-04T14:05:45.000Z | 2020-01-19T14:53:03.000Z | cracking-the-coding-interview/src/chapter1/palindrome.py | silphire/training-with-books | bd07f7376996828b6cb4000d654cdc5f53d1c589 | [
"MIT"
] | null | null | null | # 1.4
from collections import Counter
def palindrome(s: str) -> bool:
s = s.replace(' ', '')
if len(s) == 0:
return True
c = Counter(s)
a = Counter(c.values())
odds = 0
evens = 0
for k, v in a.items():
if k % 2 == 0:
evens += v
else:
... | 18.25 | 33 | 0.446575 |
4b315d99b885f67bca9bd8f9e32645470a5d8448 | 1,915 | py | Python | inference/online_inference/src/app.py | made-ml-in-prod-2021/marina-zav | 7b4b6e5f333707001e36dfb014dcd36bf975d969 | [
"FTL"
] | null | null | null | inference/online_inference/src/app.py | made-ml-in-prod-2021/marina-zav | 7b4b6e5f333707001e36dfb014dcd36bf975d969 | [
"FTL"
] | null | null | null | inference/online_inference/src/app.py | made-ml-in-prod-2021/marina-zav | 7b4b6e5f333707001e36dfb014dcd36bf975d969 | [
"FTL"
] | null | null | null | import logging
import sys
import time
from typing import List, Optional
import uvicorn
from fastapi import FastAPI
from fastapi.exceptions import RequestValidationError
from fastapi.responses import PlainTextResponse
from sklearn.pipeline import Pipeline
from src.entities import (
read_app_params,
HeartDiseas... | 26.232877 | 80 | 0.769191 |
e22c2b245026e9188f8c14a3c1eaaf2c45bd7fc6 | 19,144 | py | Python | aas_core_codegen/csharp/description.py | aas-core-works/aas-core-codegen | afec2cf363b6cb69816e7724a2b58626e2165869 | [
"MIT"
] | 5 | 2021-12-29T12:55:34.000Z | 2022-03-01T17:57:21.000Z | aas_core_codegen/csharp/description.py | aas-core-works/aas-core-codegen | afec2cf363b6cb69816e7724a2b58626e2165869 | [
"MIT"
] | 10 | 2021-12-29T02:15:55.000Z | 2022-03-09T11:04:22.000Z | aas_core_codegen/csharp/description.py | aas-core-works/aas-core-codegen | afec2cf363b6cb69816e7724a2b58626e2165869 | [
"MIT"
] | 2 | 2021-12-29T01:42:12.000Z | 2022-02-15T13:46:33.000Z | """Render descriptions to C# documentation comments."""
import io
import textwrap
import xml.sax.saxutils
from typing import Tuple, Optional, List
import docutils.nodes
import docutils.parsers.rst.roles
import docutils.utils
from icontract import require
from aas_core_codegen import intermediate
from aas_core_codegen... | 33.293913 | 88 | 0.617269 |
b75d8793911f64f3b879dd499516fed2435b57a0 | 11,768 | py | Python | aries-test-harness/features/steps/0453-issue-credential-v2.py | Matt-Spence/aries-agent-test-harness | a7868625d9675f2e54897b1a84b54fdb1b75dcaa | [
"Apache-2.0"
] | null | null | null | aries-test-harness/features/steps/0453-issue-credential-v2.py | Matt-Spence/aries-agent-test-harness | a7868625d9675f2e54897b1a84b54fdb1b75dcaa | [
"Apache-2.0"
] | null | null | null | aries-test-harness/features/steps/0453-issue-credential-v2.py | Matt-Spence/aries-agent-test-harness | a7868625d9675f2e54897b1a84b54fdb1b75dcaa | [
"Apache-2.0"
] | null | null | null | from behave import *
import json
from agent_backchannel_client import agent_backchannel_GET, agent_backchannel_POST, expected_agent_state
from agent_test_utils import format_cred_proposal_by_aip_version
from time import sleep
CRED_FORMAT_INDY = "indy"
CRED_FORMAT_JSON_LD = "json-ld"
@given('"{issuer}" is ready to iss... | 49.238494 | 200 | 0.701734 |
1417eaf111939fa332430aaf9b1dd4f35f49420f | 259 | py | Python | nydkcd11/projects/urls.py | asi14/nydkc11 | 4c40f7f3d0829ee3659a5edc9a03ffdb47b5bdc4 | [
"MIT"
] | null | null | null | nydkcd11/projects/urls.py | asi14/nydkc11 | 4c40f7f3d0829ee3659a5edc9a03ffdb47b5bdc4 | [
"MIT"
] | 9 | 2020-02-11T21:47:24.000Z | 2022-03-11T23:11:44.000Z | nydkcd11/projects/urls.py | asi14/nydkc11 | 4c40f7f3d0829ee3659a5edc9a03ffdb47b5bdc4 | [
"MIT"
] | 1 | 2018-04-26T04:37:10.000Z | 2018-04-26T04:37:10.000Z | from django.conf.urls import url
from . import views
app_name = 'projects'
urlpatterns = [
url(r'^(?P<level_id>[0-9]+)/(?P<slug>[\w-]+)/$', views.detail, name = 'detail'),
url(r'^(?P<level_id>[0-9]+)/$', views.detail_redirect, name = 'detail_redirect'),
]
| 28.777778 | 82 | 0.637066 |
b83a2263058fd0903bb0366a0a6a4bb18d1952e2 | 14,627 | py | Python | autotabular/pipeline/components/base.py | jianzhnie/AutoTabular | fb407300adf97532a26d33f7442d2a606fa30512 | [
"Apache-2.0"
] | 48 | 2021-09-06T08:09:26.000Z | 2022-03-28T13:02:54.000Z | autotabular/pipeline/components/base.py | Fanxingye/Autotabular | d630c78290a52f8c73885afb16884e18135c34f6 | [
"Apache-2.0"
] | null | null | null | autotabular/pipeline/components/base.py | Fanxingye/Autotabular | d630c78290a52f8c73885afb16884e18135c34f6 | [
"Apache-2.0"
] | 7 | 2021-09-23T07:28:46.000Z | 2021-10-02T21:15:18.000Z | import importlib
import inspect
import pkgutil
import sys
from collections import OrderedDict
from autotabular.pipeline.constants import SPARSE
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.utils import check_random_state
def find_components(package, directory, base_class):
components = O... | 32.649554 | 124 | 0.593697 |
7054c018c57d4ea9944d9d0540ac864e087f74bc | 3,339 | py | Python | tests/test_assign_to_workflow_seqlab_quantstudio.py | EdinburghGenomics/clarity_scripts | 472299fc4edd4e0a08895ecc7c5630b253322e28 | [
"MIT"
] | 2 | 2018-06-18T16:31:09.000Z | 2021-03-31T20:13:39.000Z | tests/test_assign_to_workflow_seqlab_quantstudio.py | EdinburghGenomics/clarity_scripts | 472299fc4edd4e0a08895ecc7c5630b253322e28 | [
"MIT"
] | 99 | 2016-02-15T16:21:51.000Z | 2022-03-11T23:43:26.000Z | tests/test_assign_to_workflow_seqlab_quantstudio.py | EdinburghGenomics/clarity_scripts | 472299fc4edd4e0a08895ecc7c5630b253322e28 | [
"MIT"
] | null | null | null | from unittest.mock import Mock, patch, PropertyMock, call
from scripts.assign_workflow_seqlab_quantstudio import AssignWorkflowSeqLabQuantStudio
from tests.test_common import TestEPP, fake_artifact
def fake_all_outputs(unique=False, resolve=False):
"""Return a list of mocked artifacts which contain samples which... | 49.102941 | 116 | 0.607966 |
35846e883b4d57821454f8b5a66685c746fe58df | 40,162 | py | Python | localstack/services/cloudformation/cloudformation_api.py | Shika9/localstack | a3af1b783595cf8b89e17a97bf5fa483b21ebe9c | [
"Apache-2.0"
] | null | null | null | localstack/services/cloudformation/cloudformation_api.py | Shika9/localstack | a3af1b783595cf8b89e17a97bf5fa483b21ebe9c | [
"Apache-2.0"
] | null | null | null | localstack/services/cloudformation/cloudformation_api.py | Shika9/localstack | a3af1b783595cf8b89e17a97bf5fa483b21ebe9c | [
"Apache-2.0"
] | null | null | null | import json
import logging
import traceback
from typing import Any, Dict, List, Optional, overload
import xmltodict
from flask import Flask, request
from requests.models import Response
from typing_extensions import Literal
from localstack.services.generic_proxy import RegionBackend
from localstack.utils.aws import a... | 36.247292 | 181 | 0.642224 |
01dd6e1257107cb7bb076f9c343e9b06751c4593 | 6,954 | py | Python | graphics/VTK-7.0.0/Filters/General/Testing/Python/tableBasedClip.py | hlzz/dotfiles | 0591f71230c919c827ba569099eb3b75897e163e | [
"BSD-3-Clause"
] | 4 | 2016-03-30T14:31:52.000Z | 2019-02-02T05:01:32.000Z | graphics/VTK-7.0.0/Filters/General/Testing/Python/tableBasedClip.py | hlzz/dotfiles | 0591f71230c919c827ba569099eb3b75897e163e | [
"BSD-3-Clause"
] | null | null | null | graphics/VTK-7.0.0/Filters/General/Testing/Python/tableBasedClip.py | hlzz/dotfiles | 0591f71230c919c827ba569099eb3b75897e163e | [
"BSD-3-Clause"
] | 2 | 2019-08-30T23:36:13.000Z | 2019-11-08T16:52:01.000Z | #!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
import sys
class TestClip(Testing.vtkTest):
def testImage2DScalar(self):
planes = ['XY', 'XZ', 'YZ']
expectedNCells = [38, 46, 42]
expectedNClip... | 29.591489 | 94 | 0.533937 |
d8d090a475c0e257b183fb8b55de1158d1c569b2 | 1,391 | py | Python | examples/examples.py | vdejager/pipetaxon | 2dcf2f4cf3fd9ca8677ba313c0191df45ccc3f77 | [
"MIT"
] | 18 | 2018-11-26T03:04:18.000Z | 2021-05-12T16:25:27.000Z | examples/examples.py | vdejager/pipetaxon | 2dcf2f4cf3fd9ca8677ba313c0191df45ccc3f77 | [
"MIT"
] | 13 | 2018-11-26T17:41:41.000Z | 2022-02-19T19:49:51.000Z | examples/examples.py | vdejager/pipetaxon | 2dcf2f4cf3fd9ca8677ba313c0191df45ccc3f77 | [
"MIT"
] | 3 | 2018-11-26T15:20:15.000Z | 2020-11-27T07:26:17.000Z | import requests
# Get a taxonomy from pipetaxon.voorloop.com anonymously
#
response = requests.get('http://pipetaxon.voorloop.com/api/taxonomy/4373')
print(response.json())
# Get a taxonomy from pipetaxon.voorloop.com using a token ( http://pipetaxon.voorloop.com/register/ )
#
token = 'Token 2ea7fa00-YOUR-REAL-KE... | 23.982759 | 108 | 0.751258 |
74ef5f0c4733be5687c50fe2a444c53cadb70fca | 18,679 | py | Python | qa/rpc-tests/test_framework/comptool.py | citypayorg/utb | 2b9aff79fc19367c67d986ceae4511f7ef116e6a | [
"MIT"
] | 1 | 2020-04-09T09:23:12.000Z | 2020-04-09T09:23:12.000Z | qa/rpc-tests/test_framework/comptool.py | citypayorg/utb | 2b9aff79fc19367c67d986ceae4511f7ef116e6a | [
"MIT"
] | 1 | 2020-02-19T20:32:41.000Z | 2020-02-19T20:32:41.000Z | qa/rpc-tests/test_framework/comptool.py | citypayorg/utb | 2b9aff79fc19367c67d986ceae4511f7ef116e6a | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Compare two or more utbds to each other.
To use, create a class that implements get_tests(), and pass ... | 45.337379 | 149 | 0.601156 |
45206bbf15872f24a1fcaaf32e70f2afa10161b1 | 5,563 | py | Python | python/tests/test_standard_files.py | benjeffery/kastore | 186fa617b889bc88f86fab1559368934149e21e2 | [
"MIT"
] | 4 | 2019-01-23T00:49:35.000Z | 2021-12-03T15:39:28.000Z | python/tests/test_standard_files.py | benjeffery/kastore | 186fa617b889bc88f86fab1559368934149e21e2 | [
"MIT"
] | 168 | 2018-03-21T18:59:19.000Z | 2022-03-04T13:03:55.000Z | python/tests/test_standard_files.py | benjeffery/kastore | 186fa617b889bc88f86fab1559368934149e21e2 | [
"MIT"
] | 8 | 2019-03-09T14:30:28.000Z | 2021-03-26T07:17:13.000Z | """
Tests reading in the standard test files.
"""
import os.path
import unittest
import numpy as np
import kastore as kas
class StandardFilesMixin:
"""
Read in the standard files.
"""
@classmethod
def setUpClass(cls):
# Figure out where this is being run from and set the test data
... | 30.398907 | 88 | 0.633831 |
9449d85876dd907000c8ed7ded20a7e188334300 | 83 | py | Python | nes/processors/cpu/instructions/load_store/ldy.py | Hexadorsimal/pynes | dbb3d40c1240fa27f70fa798bcec09188755eec2 | [
"MIT"
] | 1 | 2017-05-13T18:57:09.000Z | 2017-05-13T18:57:09.000Z | nes/processors/cpu/instructions/load_store/ldy.py | Hexadorsimal/py6502 | dbb3d40c1240fa27f70fa798bcec09188755eec2 | [
"MIT"
] | 7 | 2020-10-24T17:16:56.000Z | 2020-11-01T14:10:23.000Z | nes/processors/cpu/instructions/load_store/ldy.py | Hexadorsimal/pynes | dbb3d40c1240fa27f70fa798bcec09188755eec2 | [
"MIT"
] | null | null | null | from .load import LoadInstruction
class Ldy(LoadInstruction):
register = 'y'
| 13.833333 | 33 | 0.73494 |
7168b44361eae44cacf4237d3e0064e3310b2f2e | 1,699 | py | Python | blog/migrations/0001_initial.py | k115626/myblog | 71df4a1c2e300f41ba2580200ec17e9b778de138 | [
"MIT"
] | null | null | null | blog/migrations/0001_initial.py | k115626/myblog | 71df4a1c2e300f41ba2580200ec17e9b778de138 | [
"MIT"
] | null | null | null | blog/migrations/0001_initial.py | k115626/myblog | 71df4a1c2e300f41ba2580200ec17e9b778de138 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.3 on 2021-01-01 23:41
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... | 36.934783 | 114 | 0.57681 |
51abaee307242d5909b5e2b4cf4b4c2aa9423cba | 1,867 | py | Python | examples/tutorial.py | kaji-project/influxdb-python | b88454a598f1f638b9d1679fc2dd712fec30dc51 | [
"MIT"
] | 1 | 2021-11-12T23:51:31.000Z | 2021-11-12T23:51:31.000Z | examples/tutorial.py | kaji-project/influxdb-python | b88454a598f1f638b9d1679fc2dd712fec30dc51 | [
"MIT"
] | null | null | null | examples/tutorial.py | kaji-project/influxdb-python | b88454a598f1f638b9d1679fc2dd712fec30dc51 | [
"MIT"
] | 1 | 2020-12-18T14:26:53.000Z | 2020-12-18T14:26:53.000Z | import argparse
from influxdb import InfluxDBClient
def main(host='localhost', port=8086):
user = 'root'
password = 'root'
dbname = 'example'
dbuser = 'smly'
dbuser_password = 'my_secret_password'
query = 'select column_one from foo;'
json_body = [{
"points": [
["1", 1... | 26.295775 | 66 | 0.651312 |
c9f8c3b78a456335dcef78ce9af0cd8dd9327853 | 2,899 | py | Python | mmdet/core/bbox/samplers/ohem_sampler.py | yutliu/AerialDetection_val | cf84255c75e7710ab9aa24b3fa407a9a658256a0 | [
"Apache-2.0"
] | null | null | null | mmdet/core/bbox/samplers/ohem_sampler.py | yutliu/AerialDetection_val | cf84255c75e7710ab9aa24b3fa407a9a658256a0 | [
"Apache-2.0"
] | null | null | null | mmdet/core/bbox/samplers/ohem_sampler.py | yutliu/AerialDetection_val | cf84255c75e7710ab9aa24b3fa407a9a658256a0 | [
"Apache-2.0"
] | null | null | null | import torch
from .base_sampler import BaseSampler
from ..transforms import bbox2roi
class OHEMSampler(BaseSampler):
def __init__(self,
num,
pos_fraction,
context,
neg_pos_ub=-1,
add_gt_as_proposals=True,
**kwa... | 37.166667 | 77 | 0.540186 |
4cebd3983717a90b5572d9f4f68cc60423e9d1d0 | 2,903 | py | Python | test/functional/mempool_resurrect.py | ComputerCraftr/Xuez-Core | c7428cf4e51363eb6510e4541e7292c98a7d3a9c | [
"MIT"
] | 1 | 2022-01-18T21:37:41.000Z | 2022-01-18T21:37:41.000Z | test/functional/mempool_resurrect.py | ComputerCraftr/Xuez-Core | c7428cf4e51363eb6510e4541e7292c98a7d3a9c | [
"MIT"
] | null | null | null | test/functional/mempool_resurrect.py | ComputerCraftr/Xuez-Core | c7428cf4e51363eb6510e4541e7292c98a7d3a9c | [
"MIT"
] | 2 | 2021-02-24T04:17:06.000Z | 2021-11-30T23:41:27.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test resurrection of mined transactions when the blockchain is re-organized."""
from test_framework.bl... | 40.887324 | 123 | 0.673786 |
c70631884d2468e74e9d159701d1a04f31586d95 | 654 | py | Python | quantipy/core/helpers/constants.py | encount/quantipy3 | 01fe350b79594ba162cd48ce91f6e547e74265fe | [
"MIT"
] | 67 | 2015-07-29T18:39:46.000Z | 2022-01-10T12:32:26.000Z | quantipy/core/helpers/constants.py | encount/quantipy3 | 01fe350b79594ba162cd48ce91f6e547e74265fe | [
"MIT"
] | 1,052 | 2015-07-10T15:14:17.000Z | 2021-11-14T11:14:58.000Z | quantipy/core/helpers/constants.py | encount/quantipy3 | 01fe350b79594ba162cd48ce91f6e547e74265fe | [
"MIT"
] | 15 | 2016-04-06T14:40:08.000Z | 2020-08-12T18:36:30.000Z | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
''' Constant mapping appropriate quantipy types to pandas dtypes
'''
DTYPE_MAP = {
"float": ["float64", "float32", "float16"],
"int": ["int64", "int32", "int16", "int8", "int0", "float64", "float32", "float16"],
"string": [... | 36.333333 | 92 | 0.455657 |
db32250e2ee6db08e45c90f1284709f55acdff6f | 517 | py | Python | project/client/crawlers/job_crawler.py | zubairalam/getyourjobdone | 5e3f37b7679180e45cfea31ab7d60f60e9e30f65 | [
"MIT"
] | null | null | null | project/client/crawlers/job_crawler.py | zubairalam/getyourjobdone | 5e3f37b7679180e45cfea31ab7d60f60e9e30f65 | [
"MIT"
] | null | null | null | project/client/crawlers/job_crawler.py | zubairalam/getyourjobdone | 5e3f37b7679180e45cfea31ab7d60f60e9e30f65 | [
"MIT"
] | null | null | null | import re
import requests
from lxml import html
import pymongo
client = pymongo.MongoClient("127.0.0.1", 27017)
db = client.jobs
def scrap_jobpages():
url = 'http://jobsearch.naukri.com/top-skill-jobs'
response = requests.get(url)
tree = html.fromstring(response.text)
joburls = tree.xpath("//div[@cla... | 23.5 | 85 | 0.682785 |
2b7035edb0dd91c834dbb2b115512f0aa9fb7a13 | 1,466 | py | Python | CyberPi/Python with CyberPi 015.py | nothingszpt/PythonWithHardware | 95b580824f1bb11e36c0a27fdcbd4aec07548b59 | [
"MIT"
] | 2 | 2020-08-15T02:49:19.000Z | 2020-08-15T02:49:31.000Z | CyberPi/Python with CyberPi 015.py | nothingszpt/PythonWithHardware | 95b580824f1bb11e36c0a27fdcbd4aec07548b59 | [
"MIT"
] | null | null | null | CyberPi/Python with CyberPi 015.py | nothingszpt/PythonWithHardware | 95b580824f1bb11e36c0a27fdcbd4aec07548b59 | [
"MIT"
] | 1 | 2022-02-24T05:30:30.000Z | 2022-02-24T05:30:30.000Z | """"
名称:015 想亮哪里亮哪里
硬件:童芯派
功能介绍:通过输入信息,控制童芯派灯光的颜色
难度:⭐⭐
支持的模式:在线
使用功能解读:
1. 双分支结构
if-条件1 :
----条件成立执行的代码
elif-条件2
----条件2成立时执行的代码
elif-条件3
----条件3成立时执行的代码
else:
----条件1 2 3 都不成立时执行的代码
在多分支结构当中,可以增设多个elif语句在里面。
- 表示空格
条件成立,返回值则为True,条件不成立则返回值False
"""
# ---------程序分割线----------------程序分割线----------------程序分割线---... | 29.32 | 82 | 0.45839 |
3fe7ee97d5f2fca0e78abb36b2d0eb238135c0e9 | 18,664 | py | Python | rosbridge_server/src/tornado/test/twisted_test.py | ipa-fxm/rosbridge_suite | 7c7fa43c00383f39f64945c68f0a6290b00a53fc | [
"BSD-2-Clause"
] | null | null | null | rosbridge_server/src/tornado/test/twisted_test.py | ipa-fxm/rosbridge_suite | 7c7fa43c00383f39f64945c68f0a6290b00a53fc | [
"BSD-2-Clause"
] | null | null | null | rosbridge_server/src/tornado/test/twisted_test.py | ipa-fxm/rosbridge_suite | 7c7fa43c00383f39f64945c68f0a6290b00a53fc | [
"BSD-2-Clause"
] | null | null | null | # Author: Ovidiu Predescu
# Date: July 2011
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | 34.820896 | 80 | 0.658165 |
b04cbf3f9f8bd35e3f9408ec02867b9373c2c132 | 7,126 | py | Python | Plugin for Interpretable Machine Learning /plot/ice.py | GraceRuisiGu/NLP | ac75052e4cd0edcaa228fdd41d6ab4b109e8a0f1 | [
"MIT"
] | null | null | null | Plugin for Interpretable Machine Learning /plot/ice.py | GraceRuisiGu/NLP | ac75052e4cd0edcaa228fdd41d6ab4b109e8a0f1 | [
"MIT"
] | null | null | null | Plugin for Interpretable Machine Learning /plot/ice.py | GraceRuisiGu/NLP | ac75052e4cd0edcaa228fdd41d6ab4b109e8a0f1 | [
"MIT"
] | null | null | null | from __future__ import division
import six
from matplotlib import colors, cm
from matplotlib import pyplot as plt
import numpy as np
import pandas as pd
import h2o
def _get_grid_points(x, num_grid_points):
if num_grid_points is None:
return x.unique()
else:
# unique is necessary, because if n... | 34.425121 | 106 | 0.65689 |
973b778f95bc8e256743f17fec821e3fea23c5b5 | 589 | py | Python | camera.py | ender18g/CircleBot | 548d0de8eac7452ce442068f86d64efc1924808c | [
"MIT"
] | 5 | 2021-01-20T19:29:11.000Z | 2021-04-29T17:13:10.000Z | camera.py | ender18g/CircleBot | 548d0de8eac7452ce442068f86d64efc1924808c | [
"MIT"
] | null | null | null | camera.py | ender18g/CircleBot | 548d0de8eac7452ce442068f86d64efc1924808c | [
"MIT"
] | null | null | null | import cv2
from imutils.video.pivideostream import PiVideoStream
import imutils
import time
import numpy as np
class VideoCamera(object):
def __init__(self, flip = False):
self.vs = PiVideoStream().start()
self.flip = flip
time.sleep(2.0)
def __del__(self):
self.vs.stop()
... | 23.56 | 53 | 0.626486 |
991e6b60284f523fba36d5810d9bf75a9c678d36 | 1,712 | py | Python | multiprobe/run/resolve_index.py | h324yang/multiprobe | ee4a32cd8bc6d8fc2649830ecde55fe0b6ae9478 | [
"MIT"
] | null | null | null | multiprobe/run/resolve_index.py | h324yang/multiprobe | ee4a32cd8bc6d8fc2649830ecde55fe0b6ae9478 | [
"MIT"
] | null | null | null | multiprobe/run/resolve_index.py | h324yang/multiprobe | ee4a32cd8bc6d8fc2649830ecde55fe0b6ae9478 | [
"MIT"
] | 1 | 2020-09-17T17:32:34.000Z | 2020-09-17T17:32:34.000Z | from getpass import getpass
import argparse
import os
from tqdm import tqdm
from multiprobe.data import WikipediaIndex, PagePropertiesDatabase
from multiprobe.utils import chunk
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--data-dir', '-d', type=str, required=True)
parser.add_arg... | 39.813953 | 104 | 0.688084 |
3b274b3a3685011f4b7dc112755cbba064720072 | 1,762 | py | Python | scavenger.py | ehsan/scavenger2 | 9c0ced38e73d3cf2ef5aae55445bfb752d9602dd | [
"MIT"
] | 1 | 2021-11-30T16:33:29.000Z | 2021-11-30T16:33:29.000Z | scavenger.py | ehsan/scavenger2 | 9c0ced38e73d3cf2ef5aae55445bfb752d9602dd | [
"MIT"
] | null | null | null | scavenger.py | ehsan/scavenger2 | 9c0ced38e73d3cf2ef5aae55445bfb752d9602dd | [
"MIT"
] | null | null | null | from mrcc import CCJob
import csv
import urllib2
import hashlib
class Scavenger(CCJob):
hashes = list()
def configure_options(self):
try:
samples = "https://raw.githubusercontent.com/ehsan/scavenger/master/data/samples.txt"
with urllib2.urlopen(samples) as file:
... | 35.959184 | 125 | 0.53916 |
6db6a5098b31764894692cb91bf5c45f87873266 | 449 | py | Python | test/async/test_backends.py | shuckc/hip | bf64a3d74976153b103bdd903fa8061160862346 | [
"Apache-2.0",
"MIT"
] | 70 | 2019-11-25T23:18:20.000Z | 2022-02-09T17:04:30.000Z | test/async/test_backends.py | shuckc/hip | bf64a3d74976153b103bdd903fa8061160862346 | [
"Apache-2.0",
"MIT"
] | 125 | 2018-04-02T09:28:22.000Z | 2019-11-25T18:56:25.000Z | test/async/test_backends.py | shuckc/hip | bf64a3d74976153b103bdd903fa8061160862346 | [
"Apache-2.0",
"MIT"
] | 13 | 2019-11-26T15:38:44.000Z | 2022-01-05T19:35:32.000Z | import asyncio
import curio
import trio
from hip._backends._loader import normalize_backend
def test_sniff_backends():
async def _test_sniff_async(expected_name):
backend = normalize_backend(None, async_mode=True)
assert backend.name == expected_name
trio.run(_test_sniff_async, "trio")
c... | 26.411765 | 58 | 0.755011 |
7bd66dae1850e961d56f48bf7e14ddbf1b890e71 | 7,431 | py | Python | python/dglke/infer_emb_sim.py | VoVAllen/dgl-ke | ae4f720253ba6d22ed7ad4b20a16c57d04aac018 | [
"Apache-2.0"
] | 1 | 2022-02-06T09:04:03.000Z | 2022-02-06T09:04:03.000Z | python/dglke/infer_emb_sim.py | aksnzhy/dgl-ke | 31fb9654584ab490e1a68b8f97370f297f3d2b7e | [
"Apache-2.0"
] | null | null | null | python/dglke/infer_emb_sim.py | aksnzhy/dgl-ke | 31fb9654584ab490e1a68b8f97370f297f3d2b7e | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# infer_emb.py
#
# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.... | 53.847826 | 159 | 0.560894 |
4f1f3236b68ac71fe44ae97b6454bd9a611e82c6 | 729 | py | Python | py-royalmail/setup.py | QwadwoNyamekye/purplship-carriers | ce34e3054de246e3d85ddf6928b607193d061ae2 | [
"MIT"
] | null | null | null | py-royalmail/setup.py | QwadwoNyamekye/purplship-carriers | ce34e3054de246e3d85ddf6928b607193d061ae2 | [
"MIT"
] | null | null | null | py-royalmail/setup.py | QwadwoNyamekye/purplship-carriers | ce34e3054de246e3d85ddf6928b607193d061ae2 | [
"MIT"
] | null | null | null | from setuptools import setup
setup(name='py-royalmail',
version='1.0-alpha',
description='Royal Mail Python Data domain library',
url='https://github.com/PurplShip/purplship-carriers/tree/master/py-royalmail',
author='PurplShip',
author_email='danielk.developer@gmail.com',
license='... | 31.695652 | 85 | 0.578875 |
83bb1202a25827ca4161b62e2f94814750e71c8c | 860 | py | Python | juggler.py | singhpraveen2010/experimental | 5fff00d8137ae069af3a66e5c4ebaff39f7acf80 | [
"MIT"
] | 1 | 2018-11-17T19:00:04.000Z | 2018-11-17T19:00:04.000Z | juggler.py | singhpraveen2010/experimental | 5fff00d8137ae069af3a66e5c4ebaff39f7acf80 | [
"MIT"
] | 1 | 2017-12-28T04:53:56.000Z | 2018-02-15T07:54:42.000Z | juggler.py | sara-02/junk | 3c23165eafb600b7af2d15231fb9508e2f26bbc6 | [
"MIT"
] | null | null | null | #Source: http://www.geeksforgeeks.org/juggler-sequence/
from math import (sqrt,
floor)
def is_even(number):
return number % 2 == 0
def square_root(number):
return sqrt(number)
def pow_3(number):
return number**3
def floor_num(number):
return int(floor(number))
def generate_ju... | 19.545455 | 70 | 0.622093 |
27e2249cb3ac77006963c167394651d77b19ec39 | 1,142 | py | Python | src/applications/package_manager.py | VMoM/dotstar | 3448d0053796955d75bfaae28ae702aff449841f | [
"MIT"
] | null | null | null | src/applications/package_manager.py | VMoM/dotstar | 3448d0053796955d75bfaae28ae702aff449841f | [
"MIT"
] | null | null | null | src/applications/package_manager.py | VMoM/dotstar | 3448d0053796955d75bfaae28ae702aff449841f | [
"MIT"
] | null | null | null | class PackageManager:
"""
An object that contains the name used by dotstar and the true name of the PM (the one used by the OS, that dotstar
calls when installing).
dotstar don't uses the same name as the OS because snap has two mods of installation (sandbox and classic)
so we have to differentiate ... | 43.923077 | 119 | 0.669002 |
326ea8ec35bcdca9eb7142a29bd57514a4e119a3 | 9,301 | py | Python | board.py | pirtim/mascarade_table | 21e0e463025291dc038c5be9f6c0676f0cfedfb3 | [
"MIT"
] | null | null | null | board.py | pirtim/mascarade_table | 21e0e463025291dc038c5be9f6c0676f0cfedfb3 | [
"MIT"
] | null | null | null | board.py | pirtim/mascarade_table | 21e0e463025291dc038c5be9f6c0676f0cfedfb3 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#pylint: disable=W1202
from __future__ import division
import functools
import logging
import operator
from collections import OrderedDict, namedtuple
import cards
from inputs import input_for_choice, input_for_confirmation
from player import Player
# dodac named tuple na (player, val), bedzi... | 41.70852 | 155 | 0.611225 |
9b3575701ad5276c515ec4eaafe6cefc0e98be3e | 8,071 | py | Python | students/K33401/Do_Thien/Lr3/project_lw3/my_app/migrations/0001_initial.py | DoVanThien/ITMO_ICT_WebDevelopment_2021-2022 | b9951f4e0e419a6d07c7d38f48df876878424a04 | [
"MIT"
] | null | null | null | students/K33401/Do_Thien/Lr3/project_lw3/my_app/migrations/0001_initial.py | DoVanThien/ITMO_ICT_WebDevelopment_2021-2022 | b9951f4e0e419a6d07c7d38f48df876878424a04 | [
"MIT"
] | null | null | null | students/K33401/Do_Thien/Lr3/project_lw3/my_app/migrations/0001_initial.py | DoVanThien/ITMO_ICT_WebDevelopment_2021-2022 | b9951f4e0e419a6d07c7d38f48df876878424a04 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.9 on 2021-12-03 01:00
import django.contrib.auth.models
import django.contrib.auth.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('aut... | 62.084615 | 329 | 0.611448 |
2fea29d961e56e53996bd63cfcd87b5d2ee7112b | 27,470 | py | Python | tensorflow/python/tools/saved_model_cli.py | digimatronics/tensorflow1 | b0ab95c7af7c051d78dd74bd0a3032ce35273ea6 | [
"Apache-2.0"
] | 1 | 2017-09-29T09:12:22.000Z | 2017-09-29T09:12:22.000Z | tensorflow/python/tools/saved_model_cli.py | digimatronics/tensorflow1 | b0ab95c7af7c051d78dd74bd0a3032ce35273ea6 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/tools/saved_model_cli.py | digimatronics/tensorflow1 | b0ab95c7af7c051d78dd74bd0a3032ce35273ea6 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 39.298999 | 87 | 0.702039 |
73c2a7e219b469c56cadb90ec0996607d34067a3 | 987 | py | Python | pw_bloat/py/setup.py | antmicro/pigweed | a308c3354a6131425e3f484f07f05a1813948860 | [
"Apache-2.0"
] | null | null | null | pw_bloat/py/setup.py | antmicro/pigweed | a308c3354a6131425e3f484f07f05a1813948860 | [
"Apache-2.0"
] | 1 | 2021-06-18T13:54:41.000Z | 2021-06-18T13:54:41.000Z | pw_bloat/py/setup.py | antmicro/pigweed | a308c3354a6131425e3f484f07f05a1813948860 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 The Pigweed Authors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 34.034483 | 79 | 0.734549 |
eed12e711199091f11e82b81487e7b1bac9841ea | 4,781 | py | Python | tests/integration/widgets/tables/test_data_table.py | samwill/bokeh | 228132eba4b696b91b2a77f7e9d07771ba868093 | [
"BSD-3-Clause"
] | 1 | 2021-05-03T15:19:05.000Z | 2021-05-03T15:19:05.000Z | tests/integration/widgets/tables/test_data_table.py | samwill/bokeh | 228132eba4b696b91b2a77f7e9d07771ba868093 | [
"BSD-3-Clause"
] | 3 | 2021-09-08T03:16:42.000Z | 2022-03-12T00:57:18.000Z | tests/integration/widgets/tables/test_data_table.py | samwill/bokeh | 228132eba4b696b91b2a77f7e9d07771ba868093 | [
"BSD-3-Clause"
] | 2 | 2021-01-12T18:22:24.000Z | 2021-10-30T00:32:02.000Z | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2017, Anaconda, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#---------------------------------------------------... | 36.776923 | 118 | 0.585024 |
26c94055eb84c6a715605c54ed415631966f5656 | 159 | py | Python | app1/app/api/v2/hello/__init__.py | hzjsea/fastapi-admin | 6a72e83ad967d5a33a1c9d1e861685d68bef06b1 | [
"Apache-2.0"
] | null | null | null | app1/app/api/v2/hello/__init__.py | hzjsea/fastapi-admin | 6a72e83ad967d5a33a1c9d1e861685d68bef06b1 | [
"Apache-2.0"
] | null | null | null | app1/app/api/v2/hello/__init__.py | hzjsea/fastapi-admin | 6a72e83ad967d5a33a1c9d1e861685d68bef06b1 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# encoding: utf-8
"""
@author: hzjsea
@file: __init__.py.py
@time: 2021/11/19 10:33 上午
"""
from .hello import router as hello_router
| 13.25 | 41 | 0.685535 |
6b8a1032d8978e039dc082ffaf4d99d4b0f633b2 | 8,900 | py | Python | vivisect/tests/testremote.py | sprout42/vivisect | bbb8072abd0dbe728f08f4f4d1e36a87c7b57c36 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | vivisect/tests/testremote.py | sprout42/vivisect | bbb8072abd0dbe728f08f4f4d1e36a87c7b57c36 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | vivisect/tests/testremote.py | sprout42/vivisect | bbb8072abd0dbe728f08f4f4d1e36a87c7b57c36 | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2021-10-12T15:37:24.000Z | 2021-10-21T15:25:31.000Z | import os
import sys
import time
import tempfile
import unittest
import threading
import multiprocessing as mp
import vivisect
import vivisect.cli as vivcli
import vivisect.const as v_const
import vivisect.tests.helpers as helpers
import vivisect.remote.server as v_r_server
import envi.memcanvas as e_mcanvas
def run... | 35.742972 | 114 | 0.479101 |
2c69ddc58d42f9329ec300976500526bfcc5cfcc | 7,888 | py | Python | exoatlas/visualizations/panels/ErrorPanel.py | zkbt/exopop | 5e8b9d391fe9e2d39c623d7ccd7eca8fd0f0f3f8 | [
"MIT"
] | 4 | 2020-06-24T16:38:27.000Z | 2022-01-23T01:57:19.000Z | exoatlas/visualizations/panels/ErrorPanel.py | zkbt/exopop | 5e8b9d391fe9e2d39c623d7ccd7eca8fd0f0f3f8 | [
"MIT"
] | 4 | 2018-09-20T23:12:30.000Z | 2019-05-15T15:31:58.000Z | exoatlas/visualizations/panels/ErrorPanel.py | zkbt/exopop | 5e8b9d391fe9e2d39c623d7ccd7eca8fd0f0f3f8 | [
"MIT"
] | null | null | null | from .Panel import *
from ..ink_errorbar import *
__all__ = ['ErrorPanel']
def remove_unit(x):
'''
A simple wrapper to help make sure that we're dealing
just with numerical values, instead of astropy Quantitys
with units.
'''
if type(x) == u.quantity.Quantity:
return x.value
else:... | 36.859813 | 100 | 0.49962 |
48370b29c0ee5eede9183f77075b69846fb7cfb7 | 5,642 | py | Python | tr/mainloop_test.py | DentonGentry/gfiber-catawampus | b01e4444f3c7f12b1af7837203b37060fd443bb7 | [
"Apache-2.0"
] | 2 | 2017-10-03T16:06:29.000Z | 2020-09-08T13:03:13.000Z | tr/mainloop_test.py | DentonGentry/gfiber-catawampus | b01e4444f3c7f12b1af7837203b37060fd443bb7 | [
"Apache-2.0"
] | null | null | null | tr/mainloop_test.py | DentonGentry/gfiber-catawampus | b01e4444f3c7f12b1af7837203b37060fd443bb7 | [
"Apache-2.0"
] | 1 | 2017-05-07T17:39:02.000Z | 2017-05-07T17:39:02.000Z | #!/usr/bin/python
# Copyright 2011 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 29.082474 | 79 | 0.672988 |
04b4c0941ac016d63925e5ab03caf16e2cfe111c | 1,301 | py | Python | test/python/classical_function_compiler/test_simulate.py | WiFisunset/qiskit-terra | e122c9c0cef78d1ba4ac57442cd03fb0363ba93c | [
"Apache-2.0"
] | 1 | 2021-06-09T11:22:21.000Z | 2021-06-09T11:22:21.000Z | test/python/classical_function_compiler/test_simulate.py | WiFisunset/qiskit-terra | e122c9c0cef78d1ba4ac57442cd03fb0363ba93c | [
"Apache-2.0"
] | 1 | 2019-10-03T12:22:41.000Z | 2019-10-03T12:22:41.000Z | test/python/classical_function_compiler/test_simulate.py | nonhermitian/qiskit-terra | 6a2602a9ecf9b1a3345de1516b873ac7b3da587f | [
"Apache-2.0"
] | null | null | null | # This code is part of Qiskit.
#
# (C) Copyright IBM 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... | 38.264706 | 93 | 0.775557 |
8331d2146687494c4950e9244383130dbb08a23d | 5,254 | py | Python | network_devices_manager.py | Network-imperium/network-device-manager | ea922e36240369d60be8ac74ffa69d8a7919d289 | [
"MIT"
] | 1 | 2021-03-30T15:25:02.000Z | 2021-03-30T15:25:02.000Z | network_devices_manager.py | Network-imperium/network-device-manager | ea922e36240369d60be8ac74ffa69d8a7919d289 | [
"MIT"
] | null | null | null | network_devices_manager.py | Network-imperium/network-device-manager | ea922e36240369d60be8ac74ffa69d8a7919d289 | [
"MIT"
] | null | null | null | import json
import tkinter as tk
from datetime import datetime
from tkinter.font import Font
from ssh_executor import *
class Device:
def __init__ (self, host, name):
self.host = host
self.name = name
class MainApp:
def __init__ (self, master):
# Define Tk variables
self.host ... | 38.350365 | 108 | 0.619147 |
2c22b036f728e18b35a20d09205df104680211e8 | 2,849 | py | Python | pipeline/async_predict.py | CornellDataScience/NN_Workshop_SP2020 | da526e6ffdb51e1ea5b1e75e2581686eb46e7ede | [
"MIT"
] | null | null | null | pipeline/async_predict.py | CornellDataScience/NN_Workshop_SP2020 | da526e6ffdb51e1ea5b1e75e2581686eb46e7ede | [
"MIT"
] | null | null | null | pipeline/async_predict.py | CornellDataScience/NN_Workshop_SP2020 | da526e6ffdb51e1ea5b1e75e2581686eb46e7ede | [
"MIT"
] | null | null | null | from collections import deque
from pipeline.pipeline import Pipeline
from pipeline.libs.async_predictor import AsyncPredictor
class AsyncPredict(Pipeline):
"""Pipeline task to perform prediction asynchronously (in separate processes)."""
def __init__(self, model_path, load_model_fn, num_cpus=1, queue_size=3... | 31.655556 | 90 | 0.523693 |
912bfa176bb63ed87da15d398becacc04e54c266 | 816 | py | Python | molpy/cli.py | OliverLemke/molpy | 1be180bf7ff44cfb2c90a6e3b8d4429955de6a53 | [
"MIT"
] | null | null | null | molpy/cli.py | OliverLemke/molpy | 1be180bf7ff44cfb2c90a6e3b8d4429955de6a53 | [
"MIT"
] | 6 | 2020-02-12T14:23:16.000Z | 2020-02-13T15:15:50.000Z | molpy/cli.py | OliverLemke/molpy | 1be180bf7ff44cfb2c90a6e3b8d4429955de6a53 | [
"MIT"
] | null | null | null | import argparse
from .util import read_xyz, distance
parser = argparse.ArgumentParser(description="Reads XYZ files and calculates the distance between two atoms at index1 and index2")
parser.add_argument('filename', type=str, help="The XYZ file to read")
parser.add_argument('index1', type=int, help="Index of the first... | 35.478261 | 130 | 0.732843 |
06ef1ce64361c9ae9087eebabb52aee58056aeaf | 851 | py | Python | el-wrapper.py | bonifield/extractlinks | 2b7bdca0f42a8da70e95a7861aeff08e73d86b62 | [
"MIT"
] | null | null | null | el-wrapper.py | bonifield/extractlinks | 2b7bdca0f42a8da70e95a7861aeff08e73d86b62 | [
"MIT"
] | null | null | null | el-wrapper.py | bonifield/extractlinks | 2b7bdca0f42a8da70e95a7861aeff08e73d86b62 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# el-wrapper.py | jq '.'
import requests
from extractlinks import ExtractLinks as EL
# suppress warning
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
#URL = "http://google.com/"
URL = "http://cnn.com/"
heady={
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win... | 20.756098 | 96 | 0.695652 |
e106f6e245e680f88d801db283f49966d8447e6c | 615 | py | Python | test/test_05_delete_group.py | oostapenko84/python_training | 0308c2beae5a375a32c9972412f2920f1cc7d69d | [
"Apache-2.0"
] | null | null | null | test/test_05_delete_group.py | oostapenko84/python_training | 0308c2beae5a375a32c9972412f2920f1cc7d69d | [
"Apache-2.0"
] | null | null | null | test/test_05_delete_group.py | oostapenko84/python_training | 0308c2beae5a375a32c9972412f2920f1cc7d69d | [
"Apache-2.0"
] | null | null | null | __author__ = 'olga.ostapenko'
from model.group import Group
def test_delete_first_group(app):
app.session.login(username="admin", password="secret")
if app.group.count() == 0:
app.group.create(Group(name="test", header="test", footer="test"))
old_groups = app.group.get_group_list()
app.group.... | 34.166667 | 93 | 0.700813 |
9bbfe38a79f7fcebf6964f8cf12f5b46ebfc31c4 | 1,385 | py | Python | tests/conftest.py | bhanuvrat/rainy-day | 34a6b82a08f32a7e230d3434f658d6c271007993 | [
"MIT"
] | null | null | null | tests/conftest.py | bhanuvrat/rainy-day | 34a6b82a08f32a7e230d3434f658d6c271007993 | [
"MIT"
] | null | null | null | tests/conftest.py | bhanuvrat/rainy-day | 34a6b82a08f32a7e230d3434f658d6c271007993 | [
"MIT"
] | null | null | null | # Standard Library
import functools
# Third Party Stuff
import pytest
from unittest import mock
class PartialMethodCaller:
def __init__(self, obj, **partial_params):
self.obj = obj
self.partial_params = partial_params
def __getattr__(self, name):
return functools.partial(getattr(self... | 28.854167 | 103 | 0.675812 |
cc816ed6238b5be8a1f3698b9ef4e39c81f45150 | 5,524 | py | Python | Nonparametric_Regression/moving_mean.py | AlparslanErol/Course_Related | 9a59eb2857c525769b046b7b2a7706ec4a1cdba8 | [
"MIT"
] | null | null | null | Nonparametric_Regression/moving_mean.py | AlparslanErol/Course_Related | 9a59eb2857c525769b046b7b2a7706ec4a1cdba8 | [
"MIT"
] | null | null | null | Nonparametric_Regression/moving_mean.py | AlparslanErol/Course_Related | 9a59eb2857c525769b046b7b2a7706ec4a1cdba8 | [
"MIT"
] | null | null | null | # IMPORT LIBRARIES
# =============================================================================
import seaborn as sns
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import warnings
# =============================================================================
# VERSION CHECK
# ============... | 32.116279 | 121 | 0.463794 |
70c3be45ba353fb3ba350fc459dd20000eebc7e5 | 590 | py | Python | ddcz/forms/comments.py | jimmeak/graveyard | 4c0f9d5e8b6c965171d9dc228c765b662f5b7ab4 | [
"MIT"
] | 6 | 2018-06-10T09:47:50.000Z | 2022-02-13T12:22:07.000Z | ddcz/forms/comments.py | dracidoupe/graveyard | 706e17cc60879623115bc9b8e98c0b74a607c9b1 | [
"MIT"
] | 268 | 2018-05-30T21:54:50.000Z | 2022-01-08T21:00:03.000Z | ddcz/forms/comments.py | jimmeak/graveyard | 4c0f9d5e8b6c965171d9dc228c765b662f5b7ab4 | [
"MIT"
] | 4 | 2018-09-14T03:50:08.000Z | 2021-04-19T19:36:23.000Z | from enum import Enum
from django import forms
class CommentAction(Enum):
ADD = "a"
DELETE = "d"
class PhorumCommentForm(forms.Form):
post_type = forms.CharField(
widget=forms.HiddenInput(attrs={"value": CommentAction.ADD.value})
)
text = forms.CharField(
label="", widget=forms.T... | 24.583333 | 77 | 0.689831 |
5bfa3fc4d1dd47c4a6411f9d873a6e247ec52f77 | 15,576 | py | Python | nova/api/openstack/compute/contrib/cells.py | yuyuyu101/nova | 0f3776d036be5c2174eb848af1e312f7df35de26 | [
"Apache-2.0"
] | null | null | null | nova/api/openstack/compute/contrib/cells.py | yuyuyu101/nova | 0f3776d036be5c2174eb848af1e312f7df35de26 | [
"Apache-2.0"
] | null | null | null | nova/api/openstack/compute/contrib/cells.py | yuyuyu101/nova | 0f3776d036be5c2174eb848af1e312f7df35de26 | [
"Apache-2.0"
] | null | null | null | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011-2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.... | 35.724771 | 78 | 0.615049 |
d9be4807b6e25c2f847cce96447d4e062bdbbc4a | 2,096 | py | Python | app.py | FurySwordXD/VNC | f515b95cbb64f21d730cd08fcb4dbad8aa51dc67 | [
"MIT"
] | 19 | 2019-04-09T05:38:57.000Z | 2022-03-13T14:08:29.000Z | app.py | csoni70/VNC | f515b95cbb64f21d730cd08fcb4dbad8aa51dc67 | [
"MIT"
] | 5 | 2021-03-18T22:50:19.000Z | 2022-03-11T23:42:16.000Z | app.py | csoni70/VNC | f515b95cbb64f21d730cd08fcb4dbad8aa51dc67 | [
"MIT"
] | 5 | 2019-08-02T09:48:01.000Z | 2022-03-20T19:19:30.000Z | import eel
from vnc import VNC
from threading import Thread
import atexit
import sys
from input_manager import InputManager
from vnc import VNC
status = 'None'
connection = 'None'
vnc = VNC()
input_manager = InputManager()
eel.init('web')
@eel.expose
def host():
global status
global vnc
global transmit_... | 24.091954 | 90 | 0.63645 |
73a4916ad6fc1c09f7fe263a72305aa6985bbf62 | 529 | py | Python | Multidimensional-Arrays/snake_moves.py | dechevh/Python-Advanced | 9daf33771b9096db77bcbf05ae2a4591b876c723 | [
"MIT"
] | 2 | 2020-09-15T19:12:26.000Z | 2020-09-15T19:12:30.000Z | Multidimensional-Arrays/snake_moves.py | dechevh/Python-Advanced | 9daf33771b9096db77bcbf05ae2a4591b876c723 | [
"MIT"
] | 1 | 2021-07-06T09:20:49.000Z | 2021-07-06T09:20:49.000Z | Multidimensional-Arrays/snake_moves.py | dechevh/Python-Advanced | 9daf33771b9096db77bcbf05ae2a4591b876c723 | [
"MIT"
] | null | null | null | from _collections import deque
rows, cols = [int(x) for x in input().split()]
text = deque(input())
matrix = []
for row in range(rows):
matrix.append([])
for col in range(cols):
matrix[row].append("")
for row in range(rows):
for col in range(cols):
current_col = col
current_char ... | 22.041667 | 47 | 0.591682 |
30a11838a820849a36fa3adc851b522523727c8d | 26,321 | py | Python | Lib/site-packages/qwt/scale_widget.py | fochoao/cpython | 3dc84b260e5bced65ebc2c45c40c8fa65f9b5aa9 | [
"bzip2-1.0.6",
"0BSD"
] | null | null | null | Lib/site-packages/qwt/scale_widget.py | fochoao/cpython | 3dc84b260e5bced65ebc2c45c40c8fa65f9b5aa9 | [
"bzip2-1.0.6",
"0BSD"
] | 20 | 2021-05-03T18:02:23.000Z | 2022-03-12T12:01:04.000Z | Lib/site-packages/qwt/scale_widget.py | fochoao/cpython | 3dc84b260e5bced65ebc2c45c40c8fa65f9b5aa9 | [
"bzip2-1.0.6",
"0BSD"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Licensed under the terms of the Qwt License
# Copyright (c) 2002 Uwe Rathmann, for the original C++ code
# Copyright (c) 2015 Pierre Raybaut, for the Python translation/optimization
# (see LICENSE file for more details)
"""
QwtScaleWidget
--------------
.. autoclass:: QwtScaleWidget
:me... | 31.446834 | 143 | 0.569963 |
02534aa4926dd5d9cefd03fbc0f5ada6664e1e15 | 33,530 | py | Python | ryu/topology/switches.py | uiuc-srg/ryu | 2a597f812270ea9690269a20bf659f334c323eb6 | [
"Apache-2.0"
] | null | null | null | ryu/topology/switches.py | uiuc-srg/ryu | 2a597f812270ea9690269a20bf659f334c323eb6 | [
"Apache-2.0"
] | null | null | null | ryu/topology/switches.py | uiuc-srg/ryu | 2a597f812270ea9690269a20bf659f334c323eb6 | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2013 Nippon Telegraph and Telephone Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 33.296922 | 79 | 0.574083 |
e32bf12196115431798b952b595a7ed78e19dcef | 9,130 | py | Python | tests/models/test_patient.py | ZviBaratz/django-dicom | fc5d5443ebcab9af9705a2e81c58662789a34c62 | [
"Apache-2.0"
] | 8 | 2018-12-25T11:00:31.000Z | 2022-02-03T12:05:56.000Z | tests/models/test_patient.py | ZviBaratz/django-dicom | fc5d5443ebcab9af9705a2e81c58662789a34c62 | [
"Apache-2.0"
] | 49 | 2019-09-04T11:36:00.000Z | 2022-03-20T12:33:04.000Z | tests/models/test_patient.py | ZviBaratz/django-dicom | fc5d5443ebcab9af9705a2e81c58662789a34c62 | [
"Apache-2.0"
] | 4 | 2019-06-23T18:09:07.000Z | 2019-08-30T15:43:18.000Z | from django.test import TestCase
from django_dicom.models import Image, Patient, Series, Study
from tests.fixtures import (TEST_IMAGE_FIELDS, TEST_PATIENT_FIELDS,
TEST_SERIES_FIELDS, TEST_STUDY_FIELDS)
class PatientTestCase(TestCase):
"""
Tests for the :class:`~django_dicom.models.... | 33.2 | 125 | 0.623987 |
1268dc6d7f7a9cd64c547da26253ff1e7b2736f6 | 7,165 | py | Python | test/integration/test_good_templates.py | thbishop-intuit/cfn-python-lint | bee2082654e5e7816911f9208d7099dbaddd7a6b | [
"MIT-0"
] | 1 | 2020-11-18T07:06:47.000Z | 2020-11-18T07:06:47.000Z | test/integration/test_good_templates.py | thbishop-intuit/cfn-python-lint | bee2082654e5e7816911f9208d7099dbaddd7a6b | [
"MIT-0"
] | null | null | null | test/integration/test_good_templates.py | thbishop-intuit/cfn-python-lint | bee2082654e5e7816911f9208d7099dbaddd7a6b | [
"MIT-0"
] | null | null | null | """
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: MIT-0
"""
from test.integration import BaseCliTestCase
import cfnlint.core
class TestQuickStartTemplates(BaseCliTestCase):
"""Test QuickStart Templates Parsing """
scenarios = [
{
'filename': '... | 40.027933 | 154 | 0.430286 |
8a5b2d7a7e256eeb6aa5ac52e1734950519124f2 | 2,869 | py | Python | dhalsim/network_events/network_delay.py | afmurillo/WadiTwin | 80e2e260a99c02f93aa0a45c9037eef07a70a2f2 | [
"MIT"
] | null | null | null | dhalsim/network_events/network_delay.py | afmurillo/WadiTwin | 80e2e260a99c02f93aa0a45c9037eef07a70a2f2 | [
"MIT"
] | null | null | null | dhalsim/network_events/network_delay.py | afmurillo/WadiTwin | 80e2e260a99c02f93aa0a45c9037eef07a70a2f2 | [
"MIT"
] | null | null | null | import os
import subprocess
import sys
from dhalsim.network_events.synced_event import SyncedEvent
import argparse
from pathlib import Path
class NetworkDelay(SyncedEvent):
"""
This is a delay network event. This event will use Linux-tc at a switch link that causes the indicated
delay in ms in all commun... | 36.782051 | 114 | 0.656675 |
51febf22b0facd552d35748a11b39de2fc7adf8c | 265 | py | Python | poezio/ui/consts.py | hrnciar/poezio | 12b8af11df35dda535412b0c02ba792890095a7d | [
"Zlib"
] | 50 | 2015-02-11T12:00:25.000Z | 2022-01-18T05:26:40.000Z | poezio/ui/consts.py | hrnciar/poezio | 12b8af11df35dda535412b0c02ba792890095a7d | [
"Zlib"
] | 3 | 2017-11-27T20:55:42.000Z | 2020-03-20T18:05:53.000Z | poezio/ui/consts.py | hrnciar/poezio | 12b8af11df35dda535412b0c02ba792890095a7d | [
"Zlib"
] | 15 | 2015-04-22T14:33:36.000Z | 2021-09-29T21:33:50.000Z | from datetime import datetime
FORMAT_CHAR = '\x19'
# These are non-printable chars, so they should never appear in the input,
# I guess. But maybe we can find better chars that are even less risky.
FORMAT_CHARS = '\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x1A'
| 37.857143 | 74 | 0.754717 |
83d02ac35274083af6c9d0596bc9c7821b62536e | 3,592 | py | Python | 3_3_2_speaker_file.py | hajin-kim/Python-EV3 | 4d590772ee82697f43dea5a878275a917f13acc5 | [
"MIT"
] | null | null | null | 3_3_2_speaker_file.py | hajin-kim/Python-EV3 | 4d590772ee82697f43dea5a878275a917f13acc5 | [
"MIT"
] | null | null | null | 3_3_2_speaker_file.py | hajin-kim/Python-EV3 | 4d590772ee82697f43dea5a878275a917f13acc5 | [
"MIT"
] | null | null | null | #!/usr/bin/env pybricks-micropython
from pybricks.hubs import EV3Brick
from pybricks.ev3devices import (Motor, TouchSensor, ColorSensor,
InfraredSensor, UltrasonicSensor, GyroSensor)
from pybricks.parameters import Port, Stop, Direction, Button, Color
from pybricks.tools import wait, St... | 25.295775 | 78 | 0.688753 |
4787bc58fd71a71f0b53c7542713d43c5056a820 | 913 | py | Python | Label initialization.py | hianingan/Prediction-of-igneous-reservoir-parameters | 92b781762472eef25b5ec27cc9f9e94d864244f2 | [
"Apache-2.0"
] | 3 | 2020-05-27T13:08:33.000Z | 2022-03-01T06:59:06.000Z | Label initialization.py | hianingan/Prediction-of-igneous-reservoir-parameters | 92b781762472eef25b5ec27cc9f9e94d864244f2 | [
"Apache-2.0"
] | null | null | null | Label initialization.py | hianingan/Prediction-of-igneous-reservoir-parameters | 92b781762472eef25b5ec27cc9f9e94d864244f2 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import os
import csv
xls_name =
root =
file_name =
def make_tensor(xls_name, sheet_name):
df = pd.read_excel(xls_name, sheet_name=sheet_name)
a = []
for i in range(539):
data = df.iloc[i, 2]
data... | 20.75 | 76 | 0.564074 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.