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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
638b0a00a63883a2bb04ae6a08d45cf3e222d715 | 6,636 | py | Python | modoboa_dmarc/lib.py | modoboa/modoboa-dmarc | 47572ed820f16203670d0f8c2881e10ecc1d53a7 | [
"MIT"
] | 14 | 2016-06-07T08:11:20.000Z | 2021-10-12T15:05:26.000Z | modoboa_dmarc/lib.py | modoboa/modoboa-dmarc | 47572ed820f16203670d0f8c2881e10ecc1d53a7 | [
"MIT"
] | 54 | 2016-02-26T18:53:07.000Z | 2022-03-01T22:17:51.000Z | modoboa_dmarc/lib.py | modoboa/modoboa-dmarc | 47572ed820f16203670d0f8c2881e10ecc1d53a7 | [
"MIT"
] | 12 | 2016-08-11T07:42:15.000Z | 2021-10-15T19:45:41.000Z | """Internal library."""
import datetime
import email
import fileinput
import getpass
import imaplib
import zipfile
import gzip
import sys
from defusedxml.ElementTree import fromstring
import pytz.exceptions
import six
import magic
from django.db import transaction
from django.utils.encoding import smart_text
from dj... | 31.903846 | 91 | 0.643761 |
2757d4191a7a4d62f61773f96836976a0d7914ca | 754 | py | Python | tests/test_inspections.py | Hidden-black/jishaku | d3f50749b5a977b544e5fd14894585f656247486 | [
"MIT"
] | 434 | 2018-01-04T05:57:46.000Z | 2022-03-29T12:52:54.000Z | tests/test_inspections.py | Hidden-black/jishaku | d3f50749b5a977b544e5fd14894585f656247486 | [
"MIT"
] | 134 | 2018-02-16T05:12:13.000Z | 2022-03-31T15:05:23.000Z | tests/test_inspections.py | Hidden-black/jishaku | d3f50749b5a977b544e5fd14894585f656247486 | [
"MIT"
] | 228 | 2017-12-18T18:02:17.000Z | 2022-03-29T23:25:41.000Z | # -*- coding: utf-8 -*-
"""
jishaku.inspections test
~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2021 Devon (Gorialis) R
:license: MIT, see LICENSE for more details.
"""
import collections # for __iadd__ test
import discord
import pytest
from utils import run_async
from jishaku.repl.inspections import all_inspect... | 21.542857 | 64 | 0.649867 |
0f38ba8b8c6db701aaf679a0675d359ffbf9b382 | 5,842 | py | Python | sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_response_handlers.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 1 | 2020-12-10T03:17:51.000Z | 2020-12-10T03:17:51.000Z | sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_response_handlers.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 226 | 2019-07-24T07:57:21.000Z | 2019-10-15T01:07:24.000Z | sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_response_handlers.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 1 | 2020-07-05T21:13:37.000Z | 2020-07-05T21:13:37.000Z | # coding=utf-8
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import json
from azure.core.exceptions import (
HttpResponseError,
ClientAuthenticationError,
ODataV4Format
)
from ._models import (
Reco... | 38.946667 | 146 | 0.704896 |
f5a1e80e6b834b31ef70ead31790ed21892c6154 | 949 | py | Python | doctrans/tests/test_ast_equality.py | danielebra/doctrans | fe15f4883ff37d7a05546ad337c0f6f5431285b7 | [
"Apache-2.0",
"MIT"
] | null | null | null | doctrans/tests/test_ast_equality.py | danielebra/doctrans | fe15f4883ff37d7a05546ad337c0f6f5431285b7 | [
"Apache-2.0",
"MIT"
] | null | null | null | doctrans/tests/test_ast_equality.py | danielebra/doctrans | fe15f4883ff37d7a05546ad337c0f6f5431285b7 | [
"Apache-2.0",
"MIT"
] | null | null | null | """
Tests for AST equality
"""
import ast
from unittest import TestCase
from doctrans.tests.mocks.argparse import argparse_func_ast, argparse_func_str
from doctrans.tests.mocks.classes import class_ast, class_str
from doctrans.tests.utils_for_tests import (
reindent_docstring,
run_ast_test,
unittest_main,
... | 25.648649 | 92 | 0.671233 |
27ae36cbc421f591be8bc5cd1445e01d2aa2419c | 53,999 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_circuits_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 3 | 2020-06-23T02:25:27.000Z | 2021-09-07T18:48:11.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_circuits_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 510 | 2019-07-17T16:11:19.000Z | 2021-08-02T08:38:32.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/operations/_express_route_circuits_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 5 | 2019-09-04T12:51:37.000Z | 2020-09-16T07:28:40.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 may ... | 50.278399 | 261 | 0.667327 |
7c414250036c9aff481005e97ac393b03b27412b | 2,192 | py | Python | sample.3.py | box-community/samples-docs-authenticate-with-jwt-api | 6bd82bba3fea6701ff54207bf7ff3645aefcfaa4 | [
"Apache-2.0"
] | 6 | 2019-08-14T19:30:30.000Z | 2021-02-22T23:03:39.000Z | sample.3.py | box-community/samples-docs-authenticate-with-jwt-api | 6bd82bba3fea6701ff54207bf7ff3645aefcfaa4 | [
"Apache-2.0"
] | 1 | 2020-04-07T00:55:14.000Z | 2020-04-07T10:29:53.000Z | sample.3.py | box-community/samples-docs-authenticate-with-jwt-api | 6bd82bba3fea6701ff54207bf7ff3645aefcfaa4 | [
"Apache-2.0"
] | 10 | 2018-11-21T22:58:35.000Z | 2021-04-24T17:17:59.000Z | import json
import os
import time
import secrets
import json
import requests
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.serialization import load_pem_private_key
import jwt
config = json.load(open('config.json'))
appAuth = config["boxAppSettings"]["appAuth"]
privateK... | 28.102564 | 77 | 0.729927 |
c5b17d607b5b5720dde5fa42e5a12bd34836ee80 | 17,027 | py | Python | test/v4.1/controller.py | gavinIRL/RHBot | 1e22ae5ca7b67ebd6a72c23d9f46d5a8eb6e99cf | [
"MIT"
] | null | null | null | test/v4.1/controller.py | gavinIRL/RHBot | 1e22ae5ca7b67ebd6a72c23d9f46d5a8eb6e99cf | [
"MIT"
] | 60 | 2021-03-29T14:29:49.000Z | 2021-05-03T06:06:19.000Z | test/v4.1/controller.py | gavinIRL/RHBot | 1e22ae5ca7b67ebd6a72c23d9f46d5a8eb6e99cf | [
"MIT"
] | null | null | null | from pynput.keyboard import Key, Listener, KeyCode
from pynput import mouse, keyboard
import time
import os
import pydirectinput as pyautogui
import json
from windowcapture import WindowCapture
from combat_standalone import StandaloneCombat
from moveloot_standalone import StandaloneMoveLoot
from freemove_standalone imp... | 38.697727 | 113 | 0.55782 |
91c3e6284e4cd61539435deb60531a2199bdec3a | 1,603 | py | Python | onnxmltools/convert/sparkml/shape_calculators/LogisticRegression.py | stevenlix/onnxmltools | e0953d90f99d076658ed76a6fd6ed51610786e79 | [
"MIT"
] | null | null | null | onnxmltools/convert/sparkml/shape_calculators/LogisticRegression.py | stevenlix/onnxmltools | e0953d90f99d076658ed76a6fd6ed51610786e79 | [
"MIT"
] | null | null | null | onnxmltools/convert/sparkml/shape_calculators/LogisticRegression.py | stevenlix/onnxmltools | e0953d90f99d076658ed76a6fd6ed51610786e79 | [
"MIT"
] | null | null | null | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
from ...co... | 50.09375 | 123 | 0.699314 |
2d151ecbb03d635d10bfb1b85d891ec411f491ba | 2,321 | py | Python | find_social_media_links.py | ezzieyguywuf/gsscrapp | d77fa53b1b0f790549fb6abab143600045d4ce1e | [
"MIT"
] | null | null | null | find_social_media_links.py | ezzieyguywuf/gsscrapp | d77fa53b1b0f790549fb6abab143600045d4ce1e | [
"MIT"
] | null | null | null | find_social_media_links.py | ezzieyguywuf/gsscrapp | d77fa53b1b0f790549fb6abab143600045d4ce1e | [
"MIT"
] | null | null | null | import sys
import requests
from bs4 import BeautifulSoup
import re
def updateListOfLinks(links, link):
"""
This will modify the links list in-place
"""
href = link.get('href')
if href[:4] == "http" and not href in links:
links.append(href)
def getLinks(url):
"""
Will scrape the giv... | 37.435484 | 97 | 0.63464 |
2821d5433bcf2d45ba872a3ab011432bd7386cf6 | 315 | py | Python | rasa_learn/action.py | wangjianhua1/rasa_demo | 3f81c746cec1f522a6454f42d613eafb1a564457 | [
"Apache-2.0"
] | null | null | null | rasa_learn/action.py | wangjianhua1/rasa_demo | 3f81c746cec1f522a6454f42d613eafb1a564457 | [
"Apache-2.0"
] | null | null | null | rasa_learn/action.py | wangjianhua1/rasa_demo | 3f81c746cec1f522a6454f42d613eafb1a564457 | [
"Apache-2.0"
] | null | null | null | from rasa_core_sdk import Action
from rasa_core_sdk.events import SlotSet
# 继承Action
class ActionAskWeather(Action):
def name(self):
return 'action_ask_weather'
def run(self, dispatcher, tracker, domain):
dispatcher.utter_message(f'您访问的天气地点是哪里呢')
return [SlotSet(('city', '武汉'))]
| 24.230769 | 49 | 0.707937 |
7f60efce09e831149204bf00c6dc29f00fab7131 | 490 | py | Python | corehq/apps/cachehq/invalidate.py | dslowikowski/commcare-hq | ad8885cf8dab69dc85cb64f37aeaf06106124797 | [
"BSD-3-Clause"
] | 1 | 2015-02-10T23:26:39.000Z | 2015-02-10T23:26:39.000Z | corehq/apps/cachehq/invalidate.py | SEL-Columbia/commcare-hq | 992ee34a679c37f063f86200e6df5a197d5e3ff6 | [
"BSD-3-Clause"
] | null | null | null | corehq/apps/cachehq/invalidate.py | SEL-Columbia/commcare-hq | 992ee34a679c37f063f86200e6df5a197d5e3ff6 | [
"BSD-3-Clause"
] | null | null | null | from corehq.pillows import cacheinvalidate
cache_pillow = cacheinvalidate.CacheInvalidatePillow()
def invalidate_document(document, deleted=False):
"""
Invalidates a document in the cached_core caching framework.
"""
# this is a hack that use the caching pillow invalidation that was intended to be
... | 30.625 | 85 | 0.702041 |
cbced80c1ab29ed07b1d19bc232c0a1b14f77eaf | 5,136 | py | Python | qa/rpc-tests/importprunedfunds.py | platincoin-project/platincoin | e3c4cfc90c37293c1dce8a829b5eb64c587fd33d | [
"MIT"
] | 17 | 2018-06-11T08:21:39.000Z | 2022-01-10T21:08:21.000Z | qa/rpc-tests/importprunedfunds.py | cryptoraver/platincoin-DPOS-Core_wallet | 07d5bff1eb1b4ec7e3d44ecd2a84e69346fbb8f9 | [
"MIT"
] | 2 | 2021-05-08T11:13:07.000Z | 2021-05-09T12:39:45.000Z | qa/rpc-tests/importprunedfunds.py | coinnoob/platincoin_scam | 2584ff0d47e557c976613ee6271521ae30a53fc6 | [
"MIT"
] | 9 | 2018-06-11T08:21:45.000Z | 2021-05-07T20:09:55.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-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.
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
class ... | 37.217391 | 107 | 0.640576 |
862f643b179be846a09601b77464ffe53c7f9844 | 1,518 | py | Python | tests/unit/test_parser.py | viktorkertesz/netutils | cf6541a25dd918d377ad34562826dc95ec4bfaea | [
"Apache-2.0"
] | null | null | null | tests/unit/test_parser.py | viktorkertesz/netutils | cf6541a25dd918d377ad34562826dc95ec4bfaea | [
"Apache-2.0"
] | null | null | null | tests/unit/test_parser.py | viktorkertesz/netutils | cf6541a25dd918d377ad34562826dc95ec4bfaea | [
"Apache-2.0"
] | null | null | null | """Test for the network os parser functions."""
import glob
import os
import pytest
from netutils.config import compliance
MOCK_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "mock", "config", "parser")
TXT_FILE = "_sent.txt"
parameters = []
for network_os in list(compliance.parser_map.keys()):
... | 37.95 | 110 | 0.62253 |
bd859b3c8708c0d7ab9c8a6c8fb87400c3156f81 | 1,607 | py | Python | examples/flip_mesh_normals.py | ScanMountGoat/ssbh_data_py | f4bb5c0fb0b27f3f791842518a0ae6554fcb318a | [
"MIT"
] | 3 | 2021-04-04T04:16:58.000Z | 2022-02-01T18:42:14.000Z | examples/flip_mesh_normals.py | ScanMountGoat/ssbh_data_py | f4bb5c0fb0b27f3f791842518a0ae6554fcb318a | [
"MIT"
] | 34 | 2021-05-01T15:12:38.000Z | 2022-03-24T01:59:50.000Z | examples/flip_mesh_normals.py | ScanMountGoat/ssbh_data_py | f4bb5c0fb0b27f3f791842518a0ae6554fcb318a | [
"MIT"
] | null | null | null | # This script demonstrates how to flip normals and reverse winding order.
# Winding order primarily affects face culling.
# If normals on a model appear "flipped" or inside out, this script may help.
# Ideally, these should both be fixed in a 3D modeling program before exporting.
import ssbh_data_py
# It may not be ne... | 45.914286 | 107 | 0.643435 |
12de1361ca429aeedc0d48f047e3f9d2b2410871 | 333 | py | Python | inheritance_exercise/players_and_monsters/project/main.py | Veselin-Stoilov/software-university-OOP | 452a77cabf2e7d93f30f629c67c6b22682eb255d | [
"MIT"
] | null | null | null | inheritance_exercise/players_and_monsters/project/main.py | Veselin-Stoilov/software-university-OOP | 452a77cabf2e7d93f30f629c67c6b22682eb255d | [
"MIT"
] | null | null | null | inheritance_exercise/players_and_monsters/project/main.py | Veselin-Stoilov/software-university-OOP | 452a77cabf2e7d93f30f629c67c6b22682eb255d | [
"MIT"
] | null | null | null | from inheritance_exercise.players_and_monsters.project.elf import Elf
from inheritance_exercise.players_and_monsters.project.hero import Hero
hero = Hero("H", 4)
print(hero.username)
print(hero.level)
print(str(hero))
elf = Elf("E", 4)
print(str(elf))
print(elf.__class__.__bases__[0].__name__)
print(elf.username)
prin... | 25.615385 | 71 | 0.792793 |
c23f3aa27532502b0b12dadd3d2569f61457166f | 20,154 | py | Python | examples/nlp/question_answering/question_answering_squad.py | aasseman/NeMo | 78b6befb05838f2e8917aee7654cb2c1bc560ecc | [
"Apache-2.0"
] | 1 | 2020-08-04T08:29:41.000Z | 2020-08-04T08:29:41.000Z | examples/nlp/question_answering/question_answering_squad.py | aasseman/NeMo | 78b6befb05838f2e8917aee7654cb2c1bc560ecc | [
"Apache-2.0"
] | null | null | null | examples/nlp/question_answering/question_answering_squad.py | aasseman/NeMo | 78b6befb05838f2e8917aee7654cb2c1bc560ecc | [
"Apache-2.0"
] | null | null | null | # =============================================================================
# Copyright 2020 NVIDIA. All Rights Reserved.
# Copyright 2018 The Google AI Language Team Authors and
# The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in co... | 38.461832 | 118 | 0.657835 |
068164412d08e8f4ce91ffb663cdb342a437e9bf | 880 | py | Python | rhoci/server/config.py | dsariel/rhoci | 76734fefc495fe7d2e5b5b38d8eeb3bd6b156aa7 | [
"Apache-2.0"
] | null | null | null | rhoci/server/config.py | dsariel/rhoci | 76734fefc495fe7d2e5b5b38d8eeb3bd6b156aa7 | [
"Apache-2.0"
] | null | null | null | rhoci/server/config.py | dsariel/rhoci | 76734fefc495fe7d2e5b5b38d8eeb3bd6b156aa7 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Arie Bregman
#
# 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 agree... | 35.2 | 78 | 0.713636 |
7ab631b6a439351bc324694138b5bf03a9f29d7a | 1,108 | py | Python | python/xviz_avs/io/json.py | EliotCao/xviz | 57429ba8f76a8bb7ac0889d021a12e22a52f8e7e | [
"Apache-2.0"
] | 851 | 2019-02-19T18:06:42.000Z | 2022-01-17T03:04:23.000Z | python/xviz_avs/io/json.py | Smart-Ag/xviz | 71c4470fdcb5c497793eb53666da6a5feb6832f0 | [
"Apache-2.0"
] | 291 | 2019-02-19T18:48:01.000Z | 2022-01-17T03:03:59.000Z | python/xviz_avs/io/json.py | assalmeftahi/xviz | b9f05ade77b1fe4f0fd478e6075e4f62456ec6a0 | [
"Apache-2.0"
] | 221 | 2019-02-19T20:57:37.000Z | 2022-01-20T08:43:01.000Z | import json
from .base import XVIZBaseWriter
from xviz_avs.message import XVIZEnvelope, XVIZMessage, Metadata
class XVIZJsonWriter(XVIZBaseWriter):
def __init__(self, sink, wrap_envelope=True, float_precision=10, as_array_buffer=False):
super().__init__(sink)
self._wrap_envelop = wrap_envelope
... | 35.741935 | 92 | 0.636282 |
ebe528e746d8fb0d3cbc196c2d24fe020abc3970 | 1,406 | py | Python | src/scripts/cluster_vol.py | flaviovdf/pyksc | 6ba8988c7fad63366dc2b8d005d0779971e129c5 | [
"BSD-3-Clause"
] | 32 | 2015-03-09T12:08:13.000Z | 2021-03-23T09:47:25.000Z | src/scripts/cluster_vol.py | flaviovdf/pyksc | 6ba8988c7fad63366dc2b8d005d0779971e129c5 | [
"BSD-3-Clause"
] | 5 | 2015-04-22T02:46:14.000Z | 2018-07-26T14:17:54.000Z | src/scripts/cluster_vol.py | flaviovdf/pyksc | 6ba8988c7fad63366dc2b8d005d0779971e129c5 | [
"BSD-3-Clause"
] | 13 | 2015-04-15T06:58:33.000Z | 2019-07-26T03:34:12.000Z | # -*- coding: utf8
from __future__ import division, print_function
from scipy import stats
from collections import defaultdict
from matplotlib import pyplot as plt
from scripts import initialize_matplotlib
import numpy as np
import plac
import sys
cols = {'PEAK_VIEWS':3, 'SUM_VIEWS':-1}
@plac.annotations(features... | 26.037037 | 80 | 0.621622 |
47b2fb1ccce82ce16769810b044e59a7122d35fc | 1,002 | py | Python | isi_sdk_8_2_0/test/test_result_directories_total_usage.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 24 | 2018-06-22T14:13:23.000Z | 2022-03-23T01:21:26.000Z | isi_sdk_8_2_0/test/test_result_directories_total_usage.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 46 | 2018-04-30T13:28:22.000Z | 2022-03-21T21:11:07.000Z | isi_sdk_8_2_0/test/test_result_directories_total_usage.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 29 | 2018-06-19T00:14:04.000Z | 2022-02-08T17:51:19.000Z | # coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 7
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import isi_sdk_8_2_0
from i... | 24.439024 | 113 | 0.734531 |
3b2074985a653123f9ef020e7a63d1cec5412844 | 6,906 | py | Python | raven.py | ChenYi015/Raven | e732e03f8dd118ed805a143fc6916f0e5fc53c2c | [
"Apache-2.0"
] | 1 | 2022-03-03T05:54:25.000Z | 2022-03-03T05:54:25.000Z | raven.py | ChenYi015/Raven | e732e03f8dd118ed805a143fc6916f0e5fc53c2c | [
"Apache-2.0"
] | null | null | null | raven.py | ChenYi015/Raven | e732e03f8dd118ed805a143fc6916f0e5fc53c2c | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Raven 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 applicable law or ... | 35.597938 | 108 | 0.643064 |
bd4cb0acf5b320a98c06054fc795f7a931c9d029 | 6,814 | py | Python | tests/cli/test_cli.py | vlanse/plan_b | 59f6b3aa57f73f4406cf5acfc4f0a834d71b0d5e | [
"Apache-2.0"
] | null | null | null | tests/cli/test_cli.py | vlanse/plan_b | 59f6b3aa57f73f4406cf5acfc4f0a834d71b0d5e | [
"Apache-2.0"
] | 10 | 2019-01-03T12:56:24.000Z | 2021-06-01T23:16:05.000Z | tests/cli/test_cli.py | vlanse/plan_b | 59f6b3aa57f73f4406cf5acfc4f0a834d71b0d5e | [
"Apache-2.0"
] | null | null | null | import os
from collections import namedtuple
from unittest import TestCase
from unittest.mock import patch, Mock
from plan_b.cli import do_work
MockIssue = namedtuple('MockIssue', ['key', 'fields'])
MockFields = namedtuple('MockFields', [
'issuetype', 'summary', 'assignee', 'reporter', 'created', 'resolutiondate... | 42.061728 | 116 | 0.58688 |
8d1549fa91c093ee8bfa934bd05de0c8bd316aa0 | 1,393 | py | Python | user-t.py | jamesgathuru001/password-locker | ce545c11d027aa384c4d901aa867651f49dd6797 | [
"Unlicense"
] | null | null | null | user-t.py | jamesgathuru001/password-locker | ce545c11d027aa384c4d901aa867651f49dd6797 | [
"Unlicense"
] | null | null | null | user-t.py | jamesgathuru001/password-locker | ce545c11d027aa384c4d901aa867651f49dd6797 | [
"Unlicense"
] | null | null | null |
import unittest
from user import User
class TestUser(unittest.TestCase):
'''
Test class that defines test cases for the contact class behaviours.
Args:
unittest.TestCase: TestCase class that helps in creating test cases.
'''
def setUp(self):
'''
Set up method to run befor... | 26.788462 | 88 | 0.613783 |
96f4c9e70b35e79a43ce56364228e95701ca9fe0 | 5,350 | py | Python | obniz/obniz/libs/embeds/ble/ble_attribute_abstract.py | izm51/obniz-python-sdk | 40a738b5fe2c0a415cdc09f46d28c143982bfb07 | [
"MIT"
] | 11 | 2019-03-22T12:02:11.000Z | 2021-01-21T04:57:18.000Z | obniz/obniz/libs/embeds/ble/ble_attribute_abstract.py | izm51/obniz-python-sdk | 40a738b5fe2c0a415cdc09f46d28c143982bfb07 | [
"MIT"
] | 5 | 2019-03-02T08:28:25.000Z | 2021-02-02T22:06:37.000Z | obniz/obniz/libs/embeds/ble/ble_attribute_abstract.py | izm51/obniz-python-sdk | 40a738b5fe2c0a415cdc09f46d28c143982bfb07 | [
"MIT"
] | 3 | 2019-07-20T06:55:09.000Z | 2019-12-04T05:05:00.000Z | from pyee import AsyncIOEventEmitter
import asyncio
from .ble_helper import BleHelper
from ...utils.util import ObnizUtil
class BleAttributeAbstract:
def __init__(self, params):
self.uuid = BleHelper.uuid_filter(params["uuid"])
self.parent = None
self.children = []
self.isRemote ... | 25.970874 | 69 | 0.54486 |
6139a23285eb479f53d8d18c68235f2cfdebce51 | 3,012 | py | Python | Practice_2/main2.py | jldj1/Practice-2 | 014d63bff36c4ba7a80a32db1da66c397267a205 | [
"MIT"
] | null | null | null | Practice_2/main2.py | jldj1/Practice-2 | 014d63bff36c4ba7a80a32db1da66c397267a205 | [
"MIT"
] | null | null | null | Practice_2/main2.py | jldj1/Practice-2 | 014d63bff36c4ba7a80a32db1da66c397267a205 | [
"MIT"
] | null | null | null | import sys
from typing import Type
import pygame
from pygame.transform import scale
from buttons.button import Button
from buttons.input_box import InputBox
from image_button import ImageButton
login: Type[InputBox] = InputBox
window = (1150, 1050)
screen = pygame.display.set_mode(window)
pygame.font.init()
clock =... | 26.421053 | 129 | 0.565737 |
567509ad72310178809745447aeb4c7390821dcd | 4,002 | py | Python | samples/cli/accelbyte_py_sdk_cli/platform/_public_normalize_payment_return_url.py | AccelByte/accelbyte-python-sdk | dcd311fad111c59da828278975340fb92e0f26f7 | [
"MIT"
] | null | null | null | samples/cli/accelbyte_py_sdk_cli/platform/_public_normalize_payment_return_url.py | AccelByte/accelbyte-python-sdk | dcd311fad111c59da828278975340fb92e0f26f7 | [
"MIT"
] | 1 | 2021-10-13T03:46:58.000Z | 2021-10-13T03:46:58.000Z | samples/cli/accelbyte_py_sdk_cli/platform/_public_normalize_payment_return_url.py | AccelByte/accelbyte-python-sdk | dcd311fad111c59da828278975340fb92e0f26f7 | [
"MIT"
] | null | null | null | # Copyright (c) 2021 AccelByte Inc. All Rights Reserved.
# This is licensed software from AccelByte Inc, for limitations
# and restrictions contact your company contract manager.
#
# Code generated. DO NOT EDIT!
# template_file: python-cli-command.j2
# justice-platform-service (4.10.0)
# pylint: disable=duplicate-co... | 35.415929 | 125 | 0.708896 |
eb6557d0e302dfb20a6db8080766312ad518ee93 | 32,635 | py | Python | jams/river_network.py | MuellerSeb/jams_python | 1bca04557da79d8f8a4c447f5ccc517c40ab7dfc | [
"MIT"
] | null | null | null | jams/river_network.py | MuellerSeb/jams_python | 1bca04557da79d8f8a4c447f5ccc517c40ab7dfc | [
"MIT"
] | null | null | null | jams/river_network.py | MuellerSeb/jams_python | 1bca04557da79d8f8a4c447f5ccc517c40ab7dfc | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from __future__ import division, absolute_import, print_function
#
# This script reads a DEM from a netcdf file and calculates the flow direction
# following ArcGis convention:
#
# flow direction is assumed like this
# 64 y-axis
# 32 128 |
# 16 -1 ... | 45.326389 | 153 | 0.531117 |
468113bfb30ee029a902e0ae0fbe91a4bf9a2ff9 | 912 | py | Python | base/urls.py | omololevy/study-college | 5ce482b4f09314fd370509654337e95ec39c4612 | [
"MIT"
] | 1 | 2022-03-21T08:23:19.000Z | 2022-03-21T08:23:19.000Z | base/urls.py | omololevy/study-college | 5ce482b4f09314fd370509654337e95ec39c4612 | [
"MIT"
] | 1 | 2022-03-21T08:21:27.000Z | 2022-03-21T08:21:27.000Z | base/urls.py | omololevy/study-college | 5ce482b4f09314fd370509654337e95ec39c4612 | [
"MIT"
] | null | null | null | from django.urls import path, include
from . import views
urlpatterns = [
path('', views.index, name='index'),
path('register/', views.signup, name='signup'),
path('account/', include('django.contrib.auth.urls')),
path('all-cohorts/', views.cohorts, name='cohort'),
path('new-cohort/', views.create_... | 48 | 81 | 0.680921 |
ed7911a1df67f1346d5d024e0dd912013369c8e8 | 68 | py | Python | dictsum.py | sushmitajaiswal/PythonPrograms | d4fb1b36953185e2f8dd866798ca6965a52563a9 | [
"MIT"
] | null | null | null | dictsum.py | sushmitajaiswal/PythonPrograms | d4fb1b36953185e2f8dd866798ca6965a52563a9 | [
"MIT"
] | null | null | null | dictsum.py | sushmitajaiswal/PythonPrograms | d4fb1b36953185e2f8dd866798ca6965a52563a9 | [
"MIT"
] | null | null | null | d=eval(input("enter dictionary:"))
s=sum(d.values())
print("sum=",s) | 22.666667 | 34 | 0.661765 |
9c742845a98a7fec994403fb8fb6ea563ce9b667 | 5,017 | py | Python | JVTC/utils/resnet.py | FlyingRoastDuck/UnrealPerson | 9fd5a882bea16f6289f0353b78140bff36c16609 | [
"Apache-2.0"
] | 62 | 2020-12-09T02:05:32.000Z | 2022-03-30T03:04:25.000Z | JVTC/utils/resnet.py | FlyingRoastDuck/UnrealPerson | 9fd5a882bea16f6289f0353b78140bff36c16609 | [
"Apache-2.0"
] | 8 | 2021-04-16T10:18:44.000Z | 2022-03-24T04:51:29.000Z | JVTC/utils/resnet.py | FlyingRoastDuck/UnrealPerson | 9fd5a882bea16f6289f0353b78140bff36c16609 | [
"Apache-2.0"
] | 7 | 2020-12-09T03:38:25.000Z | 2022-02-05T06:21:33.000Z | import torch.nn as nn
import math, torch
import torch.utils.model_zoo as model_zoo
from torch.nn import init
from torch.nn import functional as F
class Bottleneck(nn.Module):
expansion = 4
def __init__(self, inplanes, planes, stride=1, downsample=None):
super(Bottleneck, self).__init__()
self.... | 33.446667 | 85 | 0.587801 |
3f8d00f8f50a25f52eaf189e1f12727b4c34ffe3 | 13,015 | py | Python | tests/components/apns/test_notify.py | alindeman/home-assistant | b274b10f3874c196f0db8f9cfa5f47eb756d1f8e | [
"Apache-2.0"
] | 4 | 2019-07-03T22:36:57.000Z | 2019-08-10T15:33:25.000Z | tests/components/apns/test_notify.py | alindeman/home-assistant | b274b10f3874c196f0db8f9cfa5f47eb756d1f8e | [
"Apache-2.0"
] | 7 | 2019-08-23T05:26:02.000Z | 2022-03-11T23:57:18.000Z | tests/components/apns/test_notify.py | alindeman/home-assistant | b274b10f3874c196f0db8f9cfa5f47eb756d1f8e | [
"Apache-2.0"
] | 2 | 2018-08-15T03:59:35.000Z | 2018-10-18T12:20:05.000Z | """The tests for the APNS component."""
import io
import unittest
from unittest.mock import Mock, patch, mock_open
from apns2.errors import Unregistered
import yaml
import homeassistant.components.notify as notify
from homeassistant.setup import setup_component
import homeassistant.components.apns.notify as apns
from... | 31.666667 | 77 | 0.57088 |
b13f78c6ba7663fe9fe53ca6a706d6aeb6940a8a | 178 | py | Python | EduRec/meta/ReplayBuffer/__init__.py | tswsxk/EduRec | b7514acc4dea805375fe512534d8ab6ad8916374 | [
"MIT"
] | 2 | 2021-03-03T11:04:53.000Z | 2021-09-03T09:12:32.000Z | EduRec/meta/ReplayBuffer/__init__.py | bigdata-ustc/EduRec | 133f3fd0ce74b7c8f36f0e5a2cf71bbf759ee4c8 | [
"MIT"
] | null | null | null | EduRec/meta/ReplayBuffer/__init__.py | bigdata-ustc/EduRec | 133f3fd0ce74b7c8f36f0e5a2cf71bbf759ee4c8 | [
"MIT"
] | 1 | 2022-03-12T00:27:52.000Z | 2022-03-12T00:27:52.000Z | # coding: utf-8
# 2021/2/13 @ tongshiwei
from .ReplayBuffer import ReplayBuffer, FiniteReplayBuffer, InfinityReplayBuffer
from .CircularReplayBuffer import CircularReplayBuffer | 29.666667 | 80 | 0.837079 |
e65a443276fd4aeffc90475a8a4a2945d4e08a10 | 1,042 | py | Python | parks/tests/views/test_profile.py | bskari/park-stamper | cb347b9fdb7b71bd2cc100547bd171336f7ac272 | [
"MIT"
] | null | null | null | parks/tests/views/test_profile.py | bskari/park-stamper | cb347b9fdb7b71bd2cc100547bd171336f7ac272 | [
"MIT"
] | null | null | null | parks/tests/views/test_profile.py | bskari/park-stamper | cb347b9fdb7b71bd2cc100547bd171336f7ac272 | [
"MIT"
] | null | null | null | from mock import patch
from pyramid import testing
from parks.models import User
from parks.tests.test_base import IntegrationTestBase
from parks.views.profile import profile_user
class ProfileUnitTest(IntegrationTestBase):
@patch('parks.logic.user.get_user_by_username_or_email')
@patch('parks.logic.stamp_co... | 29.771429 | 76 | 0.671785 |
283eae9acbde0c66c55aedb0c3708736fd6ca494 | 2,202 | py | Python | oncopolicy/models/deterministic_screening.py | yala/Tempo | bf3e0e78d64869bb2079c582a4a35982f78386ad | [
"MIT"
] | 6 | 2022-01-15T11:57:19.000Z | 2022-02-13T21:15:22.000Z | oncopolicy/models/deterministic_screening.py | yala/Tempo | bf3e0e78d64869bb2079c582a4a35982f78386ad | [
"MIT"
] | null | null | null | oncopolicy/models/deterministic_screening.py | yala/Tempo | bf3e0e78d64869bb2079c582a4a35982f78386ad | [
"MIT"
] | 2 | 2022-02-02T13:09:29.000Z | 2022-02-18T07:06:19.000Z | import torch
import torch.nn as nn
from oncopolicy.models.factory import RegisterModel
from oncopolicy.datasets.personalized_screening import PAD_Y_VALUE
import pdb
ANNUAL_GUIDELINE_IN_6MO_INTERVALS = 2
BIANNUAL_GUIDELINE_IN_6MO_INTERVALS = 4
SWITCHING_AGE = 55
class AbstractDeterministicGuideline(nn.Module):
def... | 31.457143 | 112 | 0.721163 |
2400f21b8210508c89f18e8c5c569cea2ab5d504 | 2,889 | py | Python | tests/test_warnings.py | jonathanslenders/cryptography | 2535e557872ac2f94355eb8a91a598f5cfc8afcf | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2021-09-14T03:21:30.000Z | 2021-09-14T03:21:30.000Z | tests/test_warnings.py | jonathanslenders/cryptography | 2535e557872ac2f94355eb8a91a598f5cfc8afcf | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | 9 | 2022-02-21T07:34:59.000Z | 2022-03-31T07:36:36.000Z | tests/test_warnings.py | jonathanslenders/cryptography | 2535e557872ac2f94355eb8a91a598f5cfc8afcf | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | 2 | 2022-02-04T07:50:54.000Z | 2022-02-04T10:21:43.000Z | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
import sys
import types
import typing
import warnings
import pytest
from cryptography.utils import deprecated
class TestDeprecated:
... | 31.747253 | 79 | 0.624091 |
7086956d353f6e15ac7c4b80dfce6fea27e7464a | 8,982 | py | Python | src/authorization/web_server.py | rdsea/ZETA | da4410b443ba918870773c43d117267bf4329471 | [
"Apache-2.0"
] | 1 | 2021-11-09T05:32:54.000Z | 2021-11-09T05:32:54.000Z | src/authorization/web_server.py | rdsea/ZETA | da4410b443ba918870773c43d117267bf4329471 | [
"Apache-2.0"
] | 2 | 2021-08-31T21:20:15.000Z | 2021-09-02T16:30:31.000Z | src/authorization/web_server.py | rdsea/ZETA | da4410b443ba918870773c43d117267bf4329471 | [
"Apache-2.0"
] | null | null | null | from flask import Flask, request
from flask_restful import Resource, Api
import psycopg2
import jwt
import os
import requests
from datetime import datetime, timedelta
from enum import Enum
from helpers.custom_logger import CustomLogger
app = Flask(__name__)
api = Api(app)
logger = CustomLogger().get_logger()
PRIVAT... | 35.928 | 134 | 0.634714 |
55f8c049a429c0afdd8c2987e2386391cd9f31cb | 7,028 | py | Python | spikeinterface/sortingcomponents/tests/test_motion_estimation.py | andrei8782/spikeinterface | c9f5672ee142189d149dfd776c51c664693b083a | [
"MIT"
] | null | null | null | spikeinterface/sortingcomponents/tests/test_motion_estimation.py | andrei8782/spikeinterface | c9f5672ee142189d149dfd776c51c664693b083a | [
"MIT"
] | null | null | null | spikeinterface/sortingcomponents/tests/test_motion_estimation.py | andrei8782/spikeinterface | c9f5672ee142189d149dfd776c51c664693b083a | [
"MIT"
] | null | null | null | import pytest
from pathlib import Path
import numpy as np
from spikeinterface import download_dataset
from spikeinterface.extractors import MEArecRecordingExtractor
from spikeinterface.sortingcomponents import detect_peaks
from spikeinterface.sortingcomponents import (estimate_motion, make_motion_histogram,
... | 40.16 | 117 | 0.577832 |
17de7f4d5ac0109e303cb6cfb13392b07f803160 | 859 | py | Python | paper_recommender/urls.py | kzkadc/paper-recommender | 7b47638ae5a3d5b45cdcb585adabc1ce6ae5f1b1 | [
"MIT"
] | null | null | null | paper_recommender/urls.py | kzkadc/paper-recommender | 7b47638ae5a3d5b45cdcb585adabc1ce6ae5f1b1 | [
"MIT"
] | 2 | 2022-03-29T12:28:36.000Z | 2022-03-30T14:01:23.000Z | paper_recommender/urls.py | kzkadc/paper-recommender | 7b47638ae5a3d5b45cdcb585adabc1ce6ae5f1b1 | [
"MIT"
] | null | null | null | """paper_recommender URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/4.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
C... | 35.791667 | 77 | 0.703143 |
88f4b436e6f5a61201c75f32d35042f1ce79603d | 339 | py | Python | TD/TD3/Code/Python/4.py | sumaxime/LIFAP1 | b5da0395de9775cd8b319b56af7a6d0257d542db | [
"MIT"
] | 1 | 2019-06-19T08:40:24.000Z | 2019-06-19T08:40:24.000Z | TD/TD3/Code/Python/4.py | sumaxime/LIFAP1 | b5da0395de9775cd8b319b56af7a6d0257d542db | [
"MIT"
] | 13 | 2016-11-15T16:44:23.000Z | 2016-12-16T09:42:48.000Z | TD/TD3/Code/Python/4.py | sumaxime/LIFAP1 | b5da0395de9775cd8b319b56af7a6d0257d542db | [
"MIT"
] | 1 | 2019-12-06T11:48:09.000Z | 2019-12-06T11:48:09.000Z | #!/usr/bin/python
# Demander à USER une valeur entre 0 et 20, la retourner après
def retour():
print('Donne moi une valeur entre 0 et 20 : ', end='')
val = int(input())
while val < 0 or val > 20:
print('La valeur doit être entre 0 et 20. Recommence : ', end='')
val = int(input())
ret... | 19.941176 | 73 | 0.59292 |
5e8515383ea78804178206a5cb434137868f8858 | 557 | py | Python | legacy/regenesis/test_variable.py | crijke/regenesis | e53a0c6302aa458ff9ae95f573d5594351e5434c | [
"MIT"
] | 16 | 2015-04-09T14:40:53.000Z | 2021-07-13T15:03:35.000Z | legacy/regenesis/test_variable.py | crijke/regenesis | e53a0c6302aa458ff9ae95f573d5594351e5434c | [
"MIT"
] | 1 | 2018-06-25T07:51:18.000Z | 2018-06-25T07:51:18.000Z | legacy/regenesis/test_variable.py | crijke/regenesis | e53a0c6302aa458ff9ae95f573d5594351e5434c | [
"MIT"
] | 3 | 2015-12-20T18:24:21.000Z | 2018-06-24T16:57:25.000Z | import unittest
import variable
import mongo
class variableTest(unittest.TestCase):
def setUp(self):
self.db = mongo.get_db()
def test_types(self):
types = set()
types_ausp = {}
for variable in self.db.variables.find():
#print variable
#assert ... | 22.28 | 88 | 0.561939 |
863f01e0dae83bf2224a4d2da417a0f93f5a00a7 | 4,863 | py | Python | data/process_data.py | paulobueno90/Disaster-Response | 7786bb3cd90e37519b66d978b4a28239c1c515d4 | [
"MIT"
] | null | null | null | data/process_data.py | paulobueno90/Disaster-Response | 7786bb3cd90e37519b66d978b4a28239c1c515d4 | [
"MIT"
] | null | null | null | data/process_data.py | paulobueno90/Disaster-Response | 7786bb3cd90e37519b66d978b4a28239c1c515d4 | [
"MIT"
] | null | null | null | import os
from os.path import isfile, join, isdir
import sys
import pandas as pd
from sqlalchemy import create_engine
def load_data(messages_filepath, categories_filepath):
"""
Load Messages data and categories data to be handled.
:param messages_filepath: string. Path to csv with messages data
:para... | 30.39375 | 97 | 0.641785 |
7125dbb8b9e35c108be9b82d8de3de4974ce635b | 6,501 | py | Python | plugins/ldap/plugin_tests/ldap_test.py | adsorensen/girder | ae461d1198e6173f36168a71d4f7a9a5f66e6b70 | [
"Apache-2.0"
] | null | null | null | plugins/ldap/plugin_tests/ldap_test.py | adsorensen/girder | ae461d1198e6173f36168a71d4f7a9a5f66e6b70 | [
"Apache-2.0"
] | null | null | null | plugins/ldap/plugin_tests/ldap_test.py | adsorensen/girder | ae461d1198e6173f36168a71d4f7a9a5f66e6b70 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright Kitware Inc.
#
# 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 ... | 38.928144 | 92 | 0.593909 |
5e2a615c084cbfd08c822be5d3459873fdff3695 | 23,593 | py | Python | src/radon/cli.py | radon-provenance/radon-lib | 30e0486ed5d0b63c46b139b6e35f687fe3d91402 | [
"Apache-2.0"
] | null | null | null | src/radon/cli.py | radon-provenance/radon-lib | 30e0486ed5d0b63c46b139b6e35f687fe3d91402 | [
"Apache-2.0"
] | 2 | 2020-06-08T10:11:10.000Z | 2020-06-11T15:54:12.000Z | src/radon/cli.py | radon-provenance/radon-lib | 30e0486ed5d0b63c46b139b6e35f687fe3d91402 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distr... | 32.90516 | 88 | 0.535455 |
cd875ba0723bc934b78a7d8d29dd16f1cfdef470 | 6,224 | py | Python | src/auditlog_tests/models.py | mathspace/django-auditlog | 7bfe1897c53aff77c13c1e3858d3712c294f3027 | [
"MIT"
] | null | null | null | src/auditlog_tests/models.py | mathspace/django-auditlog | 7bfe1897c53aff77c13c1e3858d3712c294f3027 | [
"MIT"
] | null | null | null | src/auditlog_tests/models.py | mathspace/django-auditlog | 7bfe1897c53aff77c13c1e3858d3712c294f3027 | [
"MIT"
] | null | null | null | import uuid
from django.contrib.postgres.fields import ArrayField
from django.db import models
from auditlog.models import AuditlogHistoryField
from auditlog.registry import auditlog
from multiselectfield import MultiSelectField
@auditlog.register()
class SimpleModel(models.Model):
"""
A simple model with n... | 26.485106 | 91 | 0.711279 |
da242ab51b146fa05a0b65849ce69197407aef49 | 16,694 | py | Python | oscar/lib/python2.7/site-packages/flake8/processor.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/flake8/processor.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/flake8/processor.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | """Module containing our file processor that tokenizes a file for checks."""
import contextlib
import io
import logging
import sys
import tokenize
import flake8
from flake8 import defaults
from flake8 import exceptions
from flake8 import utils
LOG = logging.getLogger(__name__)
PyCF_ONLY_AST = 1024
NEWLI... | 35.824034 | 79 | 0.574997 |
e6663448e51189fccb952c112ccc0dea551582a8 | 449 | py | Python | webempresa/social/admin.py | tomapkiewicz/web-empresa-curso-django-2 | 175a32b617157f24687e8a5b68c062d80edb1731 | [
"Apache-2.0"
] | null | null | null | webempresa/social/admin.py | tomapkiewicz/web-empresa-curso-django-2 | 175a32b617157f24687e8a5b68c062d80edb1731 | [
"Apache-2.0"
] | null | null | null | webempresa/social/admin.py | tomapkiewicz/web-empresa-curso-django-2 | 175a32b617157f24687e8a5b68c062d80edb1731 | [
"Apache-2.0"
] | null | null | null | from django.contrib import admin
from .models import Link
# Register your models here.
class LinkAdmin(admin.ModelAdmin):
readonly_fields = ('created', 'updated')
def get_readonly_fields(self, request, obj=None):
# if request.user.groups.filter(name='admin').exists():
if request.user.is_superuse... | 32.071429 | 62 | 0.668151 |
e3e9b8477e234b9dd55c3ab9faa01d21c05d7454 | 335 | py | Python | peples_heigth/solution.py | andriiglukhyi/leetcode | 22be8c8417b28b2888be5aee82ccfe47f57f1945 | [
"MIT"
] | 1 | 2018-08-16T09:42:44.000Z | 2018-08-16T09:42:44.000Z | peples_heigth/solution.py | andriiglukhyi/leetcode | 22be8c8417b28b2888be5aee82ccfe47f57f1945 | [
"MIT"
] | null | null | null | peples_heigth/solution.py | andriiglukhyi/leetcode | 22be8c8417b28b2888be5aee82ccfe47f57f1945 | [
"MIT"
] | null | null | null | class Solution:
def reconstructQueue(self, people):
"""
:type people: List[List[int]]
:rtype: List[List[int]]
"""
people.sort(key = lambda person: [-person[0],person[1]])
newlist = []
for person in people:
newlist.insert(person[1],person)
... | 30.454545 | 65 | 0.540299 |
117700c216a16e3ab9a6bf4a58b54b4a93055bc0 | 7,907 | py | Python | messenger/envs/stage_one.py | vzhong/messenger-emma | ecf94af47b30718edf419928e0bbebda9a21a87f | [
"MIT"
] | null | null | null | messenger/envs/stage_one.py | vzhong/messenger-emma | ecf94af47b30718edf419928e0bbebda9a21a87f | [
"MIT"
] | null | null | null | messenger/envs/stage_one.py | vzhong/messenger-emma | ecf94af47b30718edf419928e0bbebda9a21a87f | [
"MIT"
] | null | null | null | '''
Classes that follows a gym-like interface and implements stage one of the Messenger
environment.
'''
import json
import random
from collections import namedtuple
from pathlib import Path
import numpy as np
from.base import MessengerEnv, Position
from . import config
from .manual import TextManual
from .utils imp... | 37.29717 | 97 | 0.563298 |
16e328f912f8530fa9a64a538e5c0d855fad9df7 | 27,394 | py | Python | resources/usr/lib/python2.7/dist-packages/numpy/polynomial/polytemplate.py | edawson/parliament2 | 2632aa3484ef64c9539c4885026b705b737f6d1e | [
"Apache-2.0"
] | null | null | null | resources/usr/lib/python2.7/dist-packages/numpy/polynomial/polytemplate.py | edawson/parliament2 | 2632aa3484ef64c9539c4885026b705b737f6d1e | [
"Apache-2.0"
] | null | null | null | resources/usr/lib/python2.7/dist-packages/numpy/polynomial/polytemplate.py | edawson/parliament2 | 2632aa3484ef64c9539c4885026b705b737f6d1e | [
"Apache-2.0"
] | 1 | 2020-05-28T23:01:44.000Z | 2020-05-28T23:01:44.000Z | """
Template for the Chebyshev and Polynomial classes.
This module houses a Python string module Template object (see, e.g.,
http://docs.python.org/library/string.html#template-strings) used by
the `polynomial` and `chebyshev` modules to implement their respective
`Polynomial` and `Chebyshev` classes. It provides a m... | 32.304245 | 78 | 0.562787 |
c62751905d32efe77afdeb0c1d02caff0e3ca9bd | 5,003 | py | Python | pythran/dist.py | PierreBlancfat/pythran2 | 37869bc73aae1054253c2b1643aee5c63f11b7e8 | [
"BSD-3-Clause"
] | null | null | null | pythran/dist.py | PierreBlancfat/pythran2 | 37869bc73aae1054253c2b1643aee5c63f11b7e8 | [
"BSD-3-Clause"
] | null | null | null | pythran/dist.py | PierreBlancfat/pythran2 | 37869bc73aae1054253c2b1643aee5c63f11b7e8 | [
"BSD-3-Clause"
] | null | null | null | '''
This modules contains a distutils extension mechanism for Pythran
* PythranExtension: is used as distutils's Extension
'''
import pythran.config as cfg
from collections import defaultdict, Iterable
import os.path
import os
import sys
from distutils.command.build_ext import build_ext as LegacyBuildExt
from n... | 35.232394 | 79 | 0.563862 |
372c0f0fe3b374aa7d15fd83db35a0ff0c84f106 | 27,147 | py | Python | ambari-server/src/main/resources/stacks/HDP/3.0/services/HIVE/package/scripts/hive.py | niuchp/ambari-2.7.3 | 12e67c143b7eb07bec692edf2b8349ccda99f3c6 | [
"Apache-2.0"
] | null | null | null | ambari-server/src/main/resources/stacks/HDP/3.0/services/HIVE/package/scripts/hive.py | niuchp/ambari-2.7.3 | 12e67c143b7eb07bec692edf2b8349ccda99f3c6 | [
"Apache-2.0"
] | null | null | null | ambari-server/src/main/resources/stacks/HDP/3.0/services/HIVE/package/scripts/hive.py | niuchp/ambari-2.7.3 | 12e67c143b7eb07bec692edf2b8349ccda99f3c6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License");... | 42.351014 | 139 | 0.659336 |
a760eaad6c434c094becc50e93c6d801ba0e8e42 | 72,685 | py | Python | IPython/frontend/qt/console/console_widget.py | btel/ipython | 6ecc466f4571913479172d974a6dd8bea5658941 | [
"BSD-3-Clause-Clear"
] | null | null | null | IPython/frontend/qt/console/console_widget.py | btel/ipython | 6ecc466f4571913479172d974a6dd8bea5658941 | [
"BSD-3-Clause-Clear"
] | null | null | null | IPython/frontend/qt/console/console_widget.py | btel/ipython | 6ecc466f4571913479172d974a6dd8bea5658941 | [
"BSD-3-Clause-Clear"
] | null | null | null | """ An abstract base class for console-type widgets.
"""
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
# Standard library imports
import os
from os.path import commonprefix
import re
import sys
fro... | 40.765564 | 80 | 0.579927 |
f66ea62a6a3a2f0b0e2ceaa04ff3482dd8ce7761 | 2,757 | py | Python | djangocms_text_ckeditor/migrations/0002_rename_plugin.py | webu/djangocms-text-ckeditor | 03e3139d6264d2ec5e7a61ad37c231fbdd502e0b | [
"BSD-3-Clause"
] | 1 | 2015-11-05T17:56:07.000Z | 2015-11-05T17:56:07.000Z | djangocms_text_ckeditor/migrations/0002_rename_plugin.py | webu/djangocms-text-ckeditor | 03e3139d6264d2ec5e7a61ad37c231fbdd502e0b | [
"BSD-3-Clause"
] | null | null | null | djangocms_text_ckeditor/migrations/0002_rename_plugin.py | webu/djangocms-text-ckeditor | 03e3139d6264d2ec5e7a61ad37c231fbdd502e0b | [
"BSD-3-Clause"
] | 1 | 2019-08-17T20:46:59.000Z | 2019-08-17T20:46:59.000Z | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models, connections
class Migration(SchemaMigration):
def forwards(self, orm):
table_names = connections[db.db_alias].introspection.table_names()
... | 57.4375 | 156 | 0.598114 |
d5788bac20b923c0313dad6cc2f7d37fbbeab972 | 5,247 | py | Python | env/lib/python3.6/site-packages/appconf/base.py | anthowen/duplify | 846d01c1b21230937fdf0281b0cf8c0b08a8c24e | [
"MIT"
] | 10 | 2016-09-14T21:58:49.000Z | 2019-01-28T21:56:35.000Z | env/lib/python3.6/site-packages/appconf/base.py | anthowen/duplify | 846d01c1b21230937fdf0281b0cf8c0b08a8c24e | [
"MIT"
] | 10 | 2020-06-06T01:43:38.000Z | 2022-03-12T00:23:20.000Z | env/lib/python3.6/site-packages/appconf/base.py | anthowen/duplify | 846d01c1b21230937fdf0281b0cf8c0b08a8c24e | [
"MIT"
] | 1 | 2020-11-04T08:39:22.000Z | 2020-11-04T08:39:22.000Z | import sys
from django.core.exceptions import ImproperlyConfigured
from django.utils import six
from .utils import import_attribute
class AppConfOptions(object):
def __init__(self, meta, prefix=None):
self.prefix = prefix
self.holder_path = getattr(meta, 'holder', 'django.conf.settings')
... | 36.692308 | 75 | 0.618258 |
63ca86ca502af280ab1243932cde81a9b3530503 | 11,249 | py | Python | systems/iodine/dimerHighlyCoupled.py | jgoodknight/spectroscopy | 5c41852dff8d02fe49395ecc5cd36902ec867033 | [
"MIT"
] | 6 | 2017-04-06T00:47:24.000Z | 2020-05-12T19:33:39.000Z | systems/iodine/dimerHighlyCoupled.py | jgoodknight/spectroscopy | 5c41852dff8d02fe49395ecc5cd36902ec867033 | [
"MIT"
] | null | null | null | systems/iodine/dimerHighlyCoupled.py | jgoodknight/spectroscopy | 5c41852dff8d02fe49395ecc5cd36902ec867033 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri Jan 04 13:23:27 2013
@author: Joey
"""
import copy
import os
import time
import multiprocessing
import numpy as np
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
import scipy.integrate
import spectroscopy.Spacetime as Spacetime
imp... | 46.292181 | 141 | 0.68335 |
90f8f23e1a23dbe2b2827f5667d68ed058d6cf3d | 1,549 | py | Python | src/fluxgui/fluxcontroller.py | 0xflotus/fluxgui | a3b55da976053fc978b29d191db52dfb8da2f8ee | [
"MIT"
] | 381 | 2015-01-02T01:11:19.000Z | 2021-11-08T11:55:12.000Z | src/fluxgui/fluxcontroller.py | JasonMetal/fluxgui | 23ac6af778ab259edb67972e9cc997370d810f39 | [
"MIT"
] | 49 | 2015-01-04T21:08:52.000Z | 2022-01-05T08:28:13.000Z | src/fluxgui/fluxcontroller.py | JasonMetal/fluxgui | 23ac6af778ab259edb67972e9cc997370d810f39 | [
"MIT"
] | 78 | 2015-01-07T17:07:48.000Z | 2019-10-20T15:23:45.000Z | from fluxgui import xfluxcontroller
class FluxController(xfluxcontroller.XfluxController):
"""
FluxController is the same as XfluxController except that it
requires a Settings instance and updates that instance when
relevant controller calls are made.
"""
def __init__(self, settings):
s... | 33.673913 | 80 | 0.699161 |
2b1b32794cb2132eafa4df8f17ceb4b9a9b587d6 | 3,636 | py | Python | tdmclient/tools/list.py | epfl-mobots/tdm-python | 80eea3a0907c0fec4c19cc12e75bfffacf2eed43 | [
"BSD-3-Clause"
] | 2 | 2022-01-26T09:54:45.000Z | 2022-03-30T07:05:37.000Z | tdmclient/tools/list.py | epfl-mobots/tdm-python | 80eea3a0907c0fec4c19cc12e75bfffacf2eed43 | [
"BSD-3-Clause"
] | null | null | null | tdmclient/tools/list.py | epfl-mobots/tdm-python | 80eea3a0907c0fec4c19cc12e75bfffacf2eed43 | [
"BSD-3-Clause"
] | 1 | 2022-01-26T09:38:51.000Z | 2022-01-26T09:38:51.000Z | # This file is part of tdmclient.
# Copyright 2021 ECOLE POLYTECHNIQUE FEDERALE DE LAUSANNE,
# Miniature Mobile Robots group, Switzerland
# Author: Yves Piguet
#
# SPDX-License-Identifier: BSD-3-Clause
import sys
import os
import getopt
from time import sleep
from tdmclient import ClientAsync
def help():
print(... | 34.961538 | 87 | 0.492574 |
c52265cd2218a25ec803d0703f6cfb58ab870921 | 11,047 | py | Python | care/hook_events/purchase_receipt.py | mohsinalimat/care | 5b2f85839c5fa9882eb0d0097825e149402a6a8c | [
"MIT"
] | null | null | null | care/hook_events/purchase_receipt.py | mohsinalimat/care | 5b2f85839c5fa9882eb0d0097825e149402a6a8c | [
"MIT"
] | null | null | null | care/hook_events/purchase_receipt.py | mohsinalimat/care | 5b2f85839c5fa9882eb0d0097825e149402a6a8c | [
"MIT"
] | null | null | null |
import frappe
import erpnext
from frappe.utils import flt
from erpnext.controllers.taxes_and_totals import get_itemised_tax_breakup_data
from erpnext.stock.doctype.purchase_receipt.purchase_receipt import PurchaseReceipt
from erpnext.stock.get_item_details import get_item_details
force_item_fields = (
"item_group"... | 43.492126 | 154 | 0.543405 |
cbe63681074ec3cfb70720a32870fadb2114a5bf | 1,268 | py | Python | app/core/tests/test_models.py | ghoshrohit72/Recipe-API | d0946671a62c8ad0b38dd5f63fcc35e4953c0f99 | [
"MIT"
] | null | null | null | app/core/tests/test_models.py | ghoshrohit72/Recipe-API | d0946671a62c8ad0b38dd5f63fcc35e4953c0f99 | [
"MIT"
] | null | null | null | app/core/tests/test_models.py | ghoshrohit72/Recipe-API | d0946671a62c8ad0b38dd5f63fcc35e4953c0f99 | [
"MIT"
] | null | null | null | from django.test import TestCase
from django.contrib.auth import get_user_model
class ModelTests(TestCase):
def test_create_user_with_email_successful(self):
#check user email id is valid or not
email="rohitofficial95@outlook.com"
password="1234"
user = get_user_model().objects.cr... | 27.565217 | 68 | 0.64511 |
ae3352cdabc2d171fbc5e383ba71a98b45bf98b2 | 578 | py | Python | t2s/src/text_preprocessing.py | grestonian/Sign-Language-Translator | 05467000aff9e85da04d1f8ff6e5a92cf30b060d | [
"MIT"
] | null | null | null | t2s/src/text_preprocessing.py | grestonian/Sign-Language-Translator | 05467000aff9e85da04d1f8ff6e5a92cf30b060d | [
"MIT"
] | null | null | null | t2s/src/text_preprocessing.py | grestonian/Sign-Language-Translator | 05467000aff9e85da04d1f8ff6e5a92cf30b060d | [
"MIT"
] | 1 | 2020-12-07T15:55:43.000Z | 2020-12-07T15:55:43.000Z | import spacy
from pprint import pprint
import string
import pickle
nlp = spacy.load("en_core_web_sm")
stop_words = {'a', 'am', 'are', 'the', 'am', 'to', 'for', 'of'}
with open('isl_dictionary', 'rb') as dic:
isl_dict = pickle.load(dic)
# print(isl_dict)
def preprocess_text(text):
# print(spacy.info())
r... | 23.12 | 67 | 0.648789 |
f3e99c6ca95b5644b7ee928570eea48a9f25fdc9 | 2,928 | py | Python | tests/conftest.py | avosper-intellaegis/runway | 757d4e7db269ec16479b044ac82a69f25fa2a450 | [
"Apache-2.0"
] | 134 | 2018-02-26T21:35:23.000Z | 2022-03-03T00:30:27.000Z | tests/conftest.py | asksmruti/runway | 8aca76df9372e3d13eb35e12f81758f618e89e74 | [
"Apache-2.0"
] | 937 | 2018-03-08T22:04:35.000Z | 2022-03-30T12:21:47.000Z | tests/conftest.py | asksmruti/runway | 8aca76df9372e3d13eb35e12f81758f618e89e74 | [
"Apache-2.0"
] | 70 | 2018-02-26T23:48:11.000Z | 2022-03-02T18:44:30.000Z | """Pytest configuration, fixtures, and plugins."""
# pylint: disable=redefined-outer-name
from __future__ import annotations
import os
from pathlib import Path
from typing import TYPE_CHECKING, Generator, Iterator
import pytest
from .factories import cli_runner_factory
if TYPE_CHECKING:
from _pytest.config impo... | 27.622642 | 94 | 0.681011 |
4c2b09964fadeda985de08868f2eb8009fba4603 | 3,269 | py | Python | models/pointnet2_part_seg_msg_one_hot.py | zazgf/Tensorflow1.15-pointNet- | a21425c0066c83215d91e1e810418161f2500125 | [
"MIT"
] | 1 | 2021-08-20T10:45:10.000Z | 2021-08-20T10:45:10.000Z | models/pointnet2_part_seg_msg_one_hot.py | zazgf/Tensorflow1.15-pointNet | a21425c0066c83215d91e1e810418161f2500125 | [
"MIT"
] | null | null | null | models/pointnet2_part_seg_msg_one_hot.py | zazgf/Tensorflow1.15-pointNet | a21425c0066c83215d91e1e810418161f2500125 | [
"MIT"
] | null | null | null | import os
import sys
BASE_DIR = os.path.dirname(__file__)
sys.path.append(BASE_DIR)
sys.path.append(os.path.join(BASE_DIR, '../utils'))
import tensorflow as tf
import numpy as np
import tf_util
from pointnet_util import pointnet_sa_module, pointnet_sa_module_msg, pointnet_fp_module
def placeholder_inputs(batch_size, n... | 48.791045 | 220 | 0.722545 |
eef2909a7b5f075cb46feef98377db0144e23f9e | 3,543 | py | Python | script.module.fantastic/lib/resources/lib/sources/gr/gamatotv.py | TheWardoctor/wardoctors-repo | 893f646d9e27251ffc00ca5f918e4eb859a5c8f0 | [
"Apache-2.0"
] | 1 | 2019-03-05T09:38:10.000Z | 2019-03-05T09:38:10.000Z | script.module.fantastic/lib/resources/lib/sources/gr/gamatotv.py | TheWardoctor/wardoctors-repo | 893f646d9e27251ffc00ca5f918e4eb859a5c8f0 | [
"Apache-2.0"
] | null | null | null | script.module.fantastic/lib/resources/lib/sources/gr/gamatotv.py | TheWardoctor/wardoctors-repo | 893f646d9e27251ffc00ca5f918e4eb859a5c8f0 | [
"Apache-2.0"
] | 1 | 2021-11-05T22:16:08.000Z | 2021-11-05T22:16:08.000Z | # -*- coding: utf-8 -*-
'''
Fantastic Add-on
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This pro... | 34.735294 | 122 | 0.586509 |
683d318d2afceb214ebf5bd82464aa014255a891 | 1,334 | py | Python | feedjack/urls.py | elpaso/feedjack | 5c1eb2f58fbf2c9dcb120a73f2b4a4aa0d911a2b | [
"BSD-3-Clause"
] | null | null | null | feedjack/urls.py | elpaso/feedjack | 5c1eb2f58fbf2c9dcb120a73f2b4a4aa0d911a2b | [
"BSD-3-Clause"
] | null | null | null | feedjack/urls.py | elpaso/feedjack | 5c1eb2f58fbf2c9dcb120a73f2b4a4aa0d911a2b | [
"BSD-3-Clause"
] | 1 | 2020-01-15T08:58:53.000Z | 2020-01-15T08:58:53.000Z | # -*- coding: utf-8 -*-
"""
feedjack
Gustavo Picón
urls.py
"""
from django.conf.urls import patterns
from django.views.generic.base import RedirectView
from feedjack import views
urlpatterns = patterns('',
(r'^rss20.xml$', RedirectView.as_view(url='/feed/rss/')),
(r'^feed/$', RedirectView,
{'url':'/... | 30.318182 | 119 | 0.558471 |
b5597c216167416f214b30d574a6d85dd43dda29 | 7,268 | py | Python | benchmarks/f3_wrong_hints_permutations/scaling_ltl_infinite_state/7-extending_bound_29.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | 3 | 2021-04-23T23:29:26.000Z | 2022-03-23T10:00:30.000Z | benchmarks/f3_wrong_hints_permutations/scaling_ltl_infinite_state/7-extending_bound_29.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | null | null | null | benchmarks/f3_wrong_hints_permutations/scaling_ltl_infinite_state/7-extending_bound_29.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | 1 | 2021-11-17T22:02:56.000Z | 2021-11-17T22:02:56.000Z | from typing import Tuple, FrozenSet
from collections import Iterable
from mathsat import msat_term, msat_env
from mathsat import msat_make_constant, msat_declare_function
from mathsat import msat_get_integer_type, msat_get_rational_type, msat_get_bool_type
from mathsat import msat_make_and, msat_make_not, msat_mak... | 36.893401 | 89 | 0.629196 |
532876415b0e26318b817696f8d4476fc49ecf64 | 5,777 | py | Python | pyreportjasper/jasperpy.py | HamburgerJungeJr/pyreportjasper | 131f4371be3b297a779473812e164f29295f6a07 | [
"MIT"
] | null | null | null | pyreportjasper/jasperpy.py | HamburgerJungeJr/pyreportjasper | 131f4371be3b297a779473812e164f29295f6a07 | [
"MIT"
] | null | null | null | pyreportjasper/jasperpy.py | HamburgerJungeJr/pyreportjasper | 131f4371be3b297a779473812e164f29295f6a07 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# The MIT License (MIT)
#
# Copyright (c) 2017 Jadson Bonfim Ribeiro <contato@jadsonbr.com.br>
#
import os
import subprocess
import re
import xml.etree.ElementTree as ET
FORMATS = (
'pdf',
'rtf',
'xls',
'xlsx',
'docx',
'odt',
'ods',
'pptx',
'csv',
'html'... | 30.088542 | 100 | 0.525359 |
1aecfb03f2a098e9e5ac7a43ae9fee5bb3dd912d | 1,475 | py | Python | tests/hunting/test_cvehunting.py | maorkuriel/kube-hunter | e0bacd6e7bd5e728ad3c6010904574adb1687dc5 | [
"Apache-2.0"
] | 1 | 2019-09-25T12:31:33.000Z | 2019-09-25T12:31:33.000Z | tests/hunting/test_cvehunting.py | maorkuriel/kube-hunter | e0bacd6e7bd5e728ad3c6010904574adb1687dc5 | [
"Apache-2.0"
] | null | null | null | tests/hunting/test_cvehunting.py | maorkuriel/kube-hunter | e0bacd6e7bd5e728ad3c6010904574adb1687dc5 | [
"Apache-2.0"
] | null | null | null | import time
import requests_mock
from src.core.events import handler
from src.core.events.types import K8sVersionDisclosure
from src.modules.hunting.cves import K8sClusterCveHunter, ServerApiVersionEndPointAccessPE, ServerApiVersionEndPointAccessDos
cve_counter = 0
def test_K8sCveHunter():
global cve_counter
... | 28.365385 | 125 | 0.727458 |
09d36c04c5f137c3b31774e8311f2d1498b30cbb | 619 | py | Python | examples/zeromq_receiver.py | msabramo/diesel | a1ed7ed0358d0fec8592e23aafc3b7ec167ab649 | [
"BSD-3-Clause"
] | 224 | 2015-01-03T06:33:05.000Z | 2021-11-22T03:19:02.000Z | examples/zeromq_receiver.py | dowski/diesel | d9824e467805caf40e0ba21b88a27db38e64c352 | [
"BSD-3-Clause"
] | 12 | 2015-01-01T03:35:15.000Z | 2021-05-22T23:37:28.000Z | examples/zeromq_receiver.py | dowski/diesel | d9824e467805caf40e0ba21b88a27db38e64c352 | [
"BSD-3-Clause"
] | 37 | 2015-01-04T01:47:55.000Z | 2022-03-03T02:04:15.000Z | from diesel import quickstart, quickstop, sleep
from diesel.protocols.zeromq import DieselZMQSocket, zctx, zmq
import time
def get_messages():
outsock = DieselZMQSocket(zctx.socket(zmq.DEALER), bind="tcp://127.0.0.1:5000")
t = time.time()
for x in xrange(500000):
msg = outsock.recv()
asser... | 24.76 | 83 | 0.612278 |
46ac063bbc8983a5349cb4240567eae80164a2ec | 1,549 | py | Python | nssrc/com/citrix/netscaler/nitro/resource/config/dns/dnssrvrec_args.py | benfinke/ns_python | d651d7aa01d7dc63c1cd435c7b3314d7f5b26659 | [
"Apache-2.0"
] | 1 | 2015-04-05T21:21:26.000Z | 2015-04-05T21:21:26.000Z | nssrc/com/citrix/netscaler/nitro/resource/config/dns/dnssrvrec_args.py | benfinke/ns_python | d651d7aa01d7dc63c1cd435c7b3314d7f5b26659 | [
"Apache-2.0"
] | 1 | 2017-01-20T22:56:58.000Z | 2017-01-20T22:56:58.000Z | nssrc/com/citrix/netscaler/nitro/resource/config/dns/dnssrvrec_args.py | benfinke/ns_python | d651d7aa01d7dc63c1cd435c7b3314d7f5b26659 | [
"Apache-2.0"
] | 6 | 2015-04-21T13:14:08.000Z | 2020-12-03T07:27:52.000Z | #
# Copyright (c) 2008-2015 Citrix Systems, Inc.
#
# 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 l... | 29.226415 | 82 | 0.707553 |
6c2303731040cbfef1209578429e4516f0e2880d | 763 | py | Python | src/assignments/assignment11/good_customer.py | acc-cosc-1336/cosc-1336-spring-2018-Aronpond | b37a6be8c0b909859ccf5ac2ce5eaf82c4ba741b | [
"MIT"
] | null | null | null | src/assignments/assignment11/good_customer.py | acc-cosc-1336/cosc-1336-spring-2018-Aronpond | b37a6be8c0b909859ccf5ac2ce5eaf82c4ba741b | [
"MIT"
] | null | null | null | src/assignments/assignment11/good_customer.py | acc-cosc-1336/cosc-1336-spring-2018-Aronpond | b37a6be8c0b909859ccf5ac2ce5eaf82c4ba741b | [
"MIT"
] | null | null | null | #create import statement for Customer class
from src.assignments.assignment11.customer import Customer
'''
Create a GoodCustomer class that inherits from Customer class with parameters first_name, last_name, and phone_number.
Call the Customer(superclass) constructor method and pass all the parameters including... | 40.157895 | 119 | 0.760157 |
165c52408e97054f59d3b70cf74e46104f53a45b | 5,275 | py | Python | tensorflow_probability/python/math/__init__.py | wataruhashimoto52/probability | 12e3f256544eadea6e863868da825614f4423eb0 | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/math/__init__.py | wataruhashimoto52/probability | 12e3f256544eadea6e863868da825614f4423eb0 | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/math/__init__.py | wataruhashimoto52/probability | 12e3f256544eadea6e863868da825614f4423eb0 | [
"Apache-2.0"
] | 1 | 2020-06-04T23:26:31.000Z | 2020-06-04T23:26:31.000Z | # Copyright 2018 The TensorFlow Probability 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 45.474138 | 109 | 0.823128 |
6d20f52b0f6d0f859022bdbf0af934b251bdd00f | 517 | py | Python | tests/unit/test_backup_common.py | cuducos/alchemydumps | 3475fa0a907e2a2b4134433bdce47a5ad52802b3 | [
"MIT"
] | 86 | 2015-02-02T14:51:55.000Z | 2022-03-17T02:43:43.000Z | tests/unit/test_backup_common.py | cuducos/alchemydumps | 3475fa0a907e2a2b4134433bdce47a5ad52802b3 | [
"MIT"
] | 27 | 2015-01-20T14:12:25.000Z | 2021-09-13T16:57:56.000Z | tests/unit/test_backup_common.py | cuducos/alchemydumps | 3475fa0a907e2a2b4134433bdce47a5ad52802b3 | [
"MIT"
] | 42 | 2015-01-21T02:50:35.000Z | 2022-03-17T02:43:27.000Z | from unittest import TestCase
from flask_alchemydumps.backup import CommonTools
class TestBackup(TestCase):
def setUp(self):
self.backup = CommonTools()
def test_get_timestamp(self):
name = "BRA-19940717123000-ITA.gz"
self.assertEqual("19940717123000", self.backup.get_timestamp(name)... | 28.722222 | 75 | 0.70793 |
c88d50164688dba5a11b450c6164e29c982be180 | 1,837 | py | Python | rurusetto/users/migrations/0017_auto_20210811_1237.py | siddhantdixit/rurusetto | ed3aad56d20fbdc15e9ab7d2b77335de65009b7f | [
"MIT"
] | 19 | 2021-05-09T12:05:40.000Z | 2022-03-02T19:26:36.000Z | rurusetto/users/migrations/0017_auto_20210811_1237.py | siddhantdixit/rurusetto | ed3aad56d20fbdc15e9ab7d2b77335de65009b7f | [
"MIT"
] | 121 | 2021-05-04T19:18:13.000Z | 2022-03-21T22:11:25.000Z | rurusetto/users/migrations/0017_auto_20210811_1237.py | siddhantdixit/rurusetto | ed3aad56d20fbdc15e9ab7d2b77335de65009b7f | [
"MIT"
] | 12 | 2021-05-03T04:44:02.000Z | 2021-10-19T05:40:08.000Z | # Generated by Django 3.2.5 on 2021-08-11 12:37
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0016_auto_20210811_0523'),
]
operations = [
migrations.AlterField(
model_name='profile',
name='about_me',
... | 31.135593 | 87 | 0.553076 |
8a17d392b297fc83c99a90dabd4586a35628de35 | 1,165 | py | Python | python/set_global_step.py | MarkTakken/KataGo | 0d469e01c14f0a0056649276a683064ed9c5a508 | [
"MIT"
] | null | null | null | python/set_global_step.py | MarkTakken/KataGo | 0d469e01c14f0a0056649276a683064ed9c5a508 | [
"MIT"
] | 1 | 2022-03-03T00:44:18.000Z | 2022-03-03T01:31:59.000Z | python/set_global_step.py | MarkTakken/KataGoTF2MacOS | 7fdbf6b49cd0c56c18e9f2f107a14905ad1761b1 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import sys
import os
import argparse
import tensorflow as tf
import numpy as np
tf.compat.v1.disable_eager_execution()
description = """
Hacky script to set the value of global_step in a tensorflow checkpoint
"""
parser = argparse.ArgumentParser(description=description)
parser.add_argument('-check... | 33.285714 | 109 | 0.75279 |
82a46134529c9dbddda762e243ccfd99e5c0ccb5 | 11,744 | py | Python | fewrel/fewshot_re_kit/sentence_encoder.py | bloomberg/emnlp21_fewrel | 894bee155196f99116e2ff12a01e2a942f861242 | [
"MIT"
] | 5 | 2021-11-04T20:55:42.000Z | 2022-02-26T08:03:23.000Z | fewrel/fewshot_re_kit/sentence_encoder.py | bloomberg/emnlp21_fewrel | 894bee155196f99116e2ff12a01e2a942f861242 | [
"MIT"
] | null | null | null | fewrel/fewshot_re_kit/sentence_encoder.py | bloomberg/emnlp21_fewrel | 894bee155196f99116e2ff12a01e2a942f861242 | [
"MIT"
] | 4 | 2021-11-09T05:13:06.000Z | 2022-02-26T13:10:37.000Z | import torch
import torch.nn as nn
import torch.nn.functional as F
import math
import numpy as np
import os
from torch import optim
from . import network
from transformers import BertTokenizer, BertModel, BertForMaskedLM, BertForSequenceClassification, RobertaModel, RobertaTokenizer, RobertaForSequenceClassification
c... | 37.164557 | 163 | 0.574166 |
76554c5f71c2e91d78c896873ae492588c884246 | 26,900 | py | Python | azure/durable_functions/models/DurableOrchestrationClient.py | sebastianburckhardt/azure-functions-durable-python | 634f70887e415f0ff9e7ee1e2fb3f58f90112772 | [
"MIT"
] | null | null | null | azure/durable_functions/models/DurableOrchestrationClient.py | sebastianburckhardt/azure-functions-durable-python | 634f70887e415f0ff9e7ee1e2fb3f58f90112772 | [
"MIT"
] | null | null | null | azure/durable_functions/models/DurableOrchestrationClient.py | sebastianburckhardt/azure-functions-durable-python | 634f70887e415f0ff9e7ee1e2fb3f58f90112772 | [
"MIT"
] | null | null | null | import json
from datetime import datetime
from typing import List, Any, Optional, Dict, Union
from time import time
from asyncio import sleep
from urllib.parse import urlparse, quote
import azure.functions as func
from .PurgeHistoryResult import PurgeHistoryResult
from .DurableOrchestrationStatus import DurableOrches... | 41.131498 | 99 | 0.625204 |
91bc6c743565ac959f741de2f66b11d35de892ca | 10,810 | py | Python | src/lib/datasets/sample/multi_pose_8.20.py | zf020114/CHPDet | b96542aac05c974f9e025ab679cb7e75bc56e268 | [
"MIT"
] | 10 | 2021-04-10T07:03:53.000Z | 2022-02-14T07:13:34.000Z | src/lib/datasets/sample/multi_pose_8.20.py | zf020114/CHPDet | b96542aac05c974f9e025ab679cb7e75bc56e268 | [
"MIT"
] | 3 | 2021-12-02T07:49:56.000Z | 2022-03-22T07:49:11.000Z | src/lib/datasets/sample/multi_pose_8.20.py | zf020114/CHPDet | b96542aac05c974f9e025ab679cb7e75bc56e268 | [
"MIT"
] | 1 | 2021-12-12T06:26:55.000Z | 2021-12-12T06:26:55.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import torch.utils.data as data
import numpy as np
import torch
import json
import cv2
import os
from utils.image import flip, color_aug
from utils.image import get_affine_transform, affine_transform
from utils... | 44.303279 | 106 | 0.595097 |
a604cabadc6f3cd74defbe8d6912ff832fa625ae | 228 | py | Python | jury/metrics/squad/squad.py | Tiamat-Tech/jury | 566ee2ec6b1a1a502f6e13b84f40274b51ef7d48 | [
"MIT"
] | 64 | 2021-07-16T08:37:45.000Z | 2022-02-05T10:28:27.000Z | jury/metrics/squad/squad.py | Tiamat-Tech/jury | 566ee2ec6b1a1a502f6e13b84f40274b51ef7d48 | [
"MIT"
] | 46 | 2021-07-14T22:41:56.000Z | 2022-03-21T07:51:52.000Z | jury/metrics/squad/squad.py | Tiamat-Tech/jury | 566ee2ec6b1a1a502f6e13b84f40274b51ef7d48 | [
"MIT"
] | 9 | 2021-07-15T21:19:06.000Z | 2022-03-17T21:46:15.000Z | from jury.metrics._core import MetricAlias
from jury.metrics.squad.squad_for_language_generation import SquadForLanguageGeneration
__main_class__ = "Squad"
class Squad(MetricAlias):
_SUBCLASS = SquadForLanguageGeneration
| 25.333333 | 87 | 0.846491 |
edeab1bd168bfcd301457d02494947ec2c44c80c | 2,893 | py | Python | test/python/Pista01.py | titos-carrasco/pyplayground | 353ae797c907311b40ddd68c93576ed76b09bfb5 | [
"MIT"
] | null | null | null | test/python/Pista01.py | titos-carrasco/pyplayground | 353ae797c907311b40ddd68c93576ed76b09bfb5 | [
"MIT"
] | null | null | null | test/python/Pista01.py | titos-carrasco/pyplayground | 353ae797c907311b40ddd68c93576ed76b09bfb5 | [
"MIT"
] | null | null | null | import time
import threading
import subprocess
from pyplayground.client.RobotThymio2 import RobotThymio2
class Pista01():
def __init__( self ):
pass
def run( self ):
# levantamos el playground en otro proceso
try:
#pg = subprocess.Popen( [ "python", "-m", "pyplayground.ser... | 27.292453 | 130 | 0.533356 |
22544f6f7874acaa2812070f5f5451841909393d | 161 | py | Python | test/test_qe.py | vitduck/bmt | 3afa969958bf07ab4fe86868b2feda0a6bc676d6 | [
"BSD-3-Clause"
] | null | null | null | test/test_qe.py | vitduck/bmt | 3afa969958bf07ab4fe86868b2feda0a6bc676d6 | [
"BSD-3-Clause"
] | null | null | null | test/test_qe.py | vitduck/bmt | 3afa969958bf07ab4fe86868b2feda0a6bc676d6 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
from qe import Qe
qe = Qe(
prefix = '../run/QE',
input = '../input/QE/Si_512.in' )
qe.info()
qe.build()
qe.run()
qe.summary()
| 12.384615 | 38 | 0.571429 |
ed00953008c3409002dc337dbd485ceff25aa966 | 8,169 | py | Python | delta/config/extensions.py | parkeraddison/delta | 4e4df1d160edc0e8597fc3450f3e13c0ef755a5f | [
"Apache-2.0"
] | 1 | 2021-07-04T17:39:52.000Z | 2021-07-04T17:39:52.000Z | delta/config/extensions.py | parkeraddison/delta | 4e4df1d160edc0e8597fc3450f3e13c0ef755a5f | [
"Apache-2.0"
] | null | null | null | delta/config/extensions.py | parkeraddison/delta | 4e4df1d160edc0e8597fc3450f3e13c0ef755a5f | [
"Apache-2.0"
] | null | null | null | # Copyright © 2020, United States Government, as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All rights reserved.
#
# The DELTA (Deep Earth Learning, Tools, and Analysis) platform is
# licensed under the Apache License, Version 2.0 (the "License");
# you may not use this f... | 26.522727 | 114 | 0.668013 |
81997ed3e6c2e9ee31b711f2652ed06999dab90a | 57,609 | py | Python | sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_07_01/operations/_deployments_operations.py | mohamedshabanofficial/azure-sdk-for-python | 81c585f310cd2ec23d2ad145173958914a075a58 | [
"MIT"
] | 2 | 2021-03-24T06:26:11.000Z | 2021-04-18T15:55:59.000Z | sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_07_01/operations/_deployments_operations.py | mohamedshabanofficial/azure-sdk-for-python | 81c585f310cd2ec23d2ad145173958914a075a58 | [
"MIT"
] | 2 | 2021-11-03T06:10:36.000Z | 2021-12-01T06:29:39.000Z | sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2020_07_01/operations/_deployments_operations.py | mohamedshabanofficial/azure-sdk-for-python | 81c585f310cd2ec23d2ad145173958914a075a58 | [
"MIT"
] | 1 | 2021-05-19T02:55:10.000Z | 2021-05-19T02:55:10.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 may ... | 50.269634 | 236 | 0.656686 |
57d7b5a9d2fc3f23ae8a22807bfef45e49d20cd3 | 2,065 | py | Python | tools/devshell/contrib/gerrit-submit-lib/gerrit_util_test.py | EnderNightLord-ChromeBook/zircon-rpi | b09b1eb3aa7a127c65568229fe10edd251869283 | [
"BSD-2-Clause"
] | 14 | 2020-10-25T05:48:36.000Z | 2021-09-20T02:46:20.000Z | tools/devshell/contrib/gerrit-submit-lib/gerrit_util_test.py | DamieFC/fuchsia | f78a4a1326f4a4bb5834500918756173c01bab4f | [
"BSD-2-Clause"
] | null | null | null | tools/devshell/contrib/gerrit-submit-lib/gerrit_util_test.py | DamieFC/fuchsia | f78a4a1326f4a4bb5834500918756173c01bab4f | [
"BSD-2-Clause"
] | 2 | 2020-10-25T01:13:49.000Z | 2020-10-26T02:32:13.000Z | #!/usr/bin/python3
#
# Copyright 2020 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
import http.server
import threading
from unittest import mock
from typing import List, Optional
import gerrit_util
# ... | 31.287879 | 91 | 0.708475 |
52feb723053e85d4cf346f6030c5816608600dc2 | 1,477 | py | Python | test/test_update_contact_by_id_parameters.py | dialmycalls/python-sdk-v2 | ab6ac61d305ea1729b618bc2530d6101136aa6ea | [
"Apache-2.0"
] | 2 | 2020-07-29T08:51:36.000Z | 2021-01-21T11:18:24.000Z | test/test_update_contact_by_id_parameters.py | dialmycalls/python-sdk-v2 | ab6ac61d305ea1729b618bc2530d6101136aa6ea | [
"Apache-2.0"
] | null | null | null | test/test_update_contact_by_id_parameters.py | dialmycalls/python-sdk-v2 | ab6ac61d305ea1729b618bc2530d6101136aa6ea | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
DialMyCalls API
The DialMyCalls API
OpenAPI spec version: 2.0.1
Contact: support@dialmycalls.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compli... | 27.351852 | 103 | 0.742722 |
cb195865e64372caa6d4d7118fca5051980aca4e | 44,830 | py | Python | pool/pool.py | chiabatta/pool-reference | 36e2890fed21d4c97852398d3a21a8781140c53b | [
"Apache-2.0"
] | 1 | 2021-06-22T08:29:22.000Z | 2021-06-22T08:29:22.000Z | pool/pool.py | chiabatta/pool-reference | 36e2890fed21d4c97852398d3a21a8781140c53b | [
"Apache-2.0"
] | null | null | null | pool/pool.py | chiabatta/pool-reference | 36e2890fed21d4c97852398d3a21a8781140c53b | [
"Apache-2.0"
] | null | null | null | import asyncio
import logging
import pathlib
import time
import traceback
from asyncio import Task
from math import floor
from typing import Dict, Optional, Set, List, Tuple, Callable
from blspy import AugSchemeMPL, G1Element
from chia.consensus.block_rewards import calculate_pool_reward
from chia.pools.pool_wallet_in... | 50.370787 | 120 | 0.641379 |
0d508969f250b4a752a67b2490d2c3772aca8399 | 395 | py | Python | setup.py | rvinas/nnn | 50bc78e745ef7b085b46c3138b4cd2ed9472f4e5 | [
"Apache-2.0"
] | 7 | 2017-09-11T19:25:26.000Z | 2021-12-17T15:01:25.000Z | setup.py | rvinas/python_nn | 50bc78e745ef7b085b46c3138b4cd2ed9472f4e5 | [
"Apache-2.0"
] | null | null | null | setup.py | rvinas/python_nn | 50bc78e745ef7b085b46c3138b4cd2ed9472f4e5 | [
"Apache-2.0"
] | 3 | 2018-03-26T23:55:25.000Z | 2019-04-05T10:44:03.000Z | from setuptools import setup
from setuptools import find_packages
import pip
setup(name='nnn',
version='0.0.1',
description='Numpy Neural Network',
author='Ramon Viñas',
author_email='rvinast@gmail.com',
url='https://github.com/rvinas/nnn',
license='Apache',
packages=find_pack... | 26.333333 | 42 | 0.668354 |
309c2a951f3fea7d7631ca7794433765aaab41dc | 3,365 | py | Python | src/poetry/publishing/publisher.py | danieleades/poetry | 9957f6faa3c311533456104bbf35aadce420c32f | [
"MIT"
] | 1 | 2020-07-31T10:42:34.000Z | 2020-07-31T10:42:34.000Z | src/poetry/publishing/publisher.py | danieleades/poetry | 9957f6faa3c311533456104bbf35aadce420c32f | [
"MIT"
] | 1 | 2021-12-31T19:44:26.000Z | 2022-03-08T20:52:13.000Z | src/poetry/publishing/publisher.py | Anselmoo/poetry | f6022eade7485a3b017ef0c8060dffed12e3cdb2 | [
"MIT"
] | 2 | 2020-12-07T04:26:21.000Z | 2021-09-25T21:46:36.000Z | import logging
from typing import TYPE_CHECKING
from typing import List
from typing import Optional
from typing import Union
from poetry.publishing.uploader import Uploader
from poetry.utils.authenticator import Authenticator
from poetry.utils.helpers import get_cert
from poetry.utils.helpers import get_client_cert
... | 32.990196 | 105 | 0.611887 |
7e9135e736b7f39abd3440d7dd3b56a62117333d | 2,759 | py | Python | rnn.py | apaszke/odsc-2020-workshop | 226e1b49824493a35686d112c7a4fb592b80f092 | [
"BSD-3-Clause"
] | 3 | 2020-04-16T14:42:06.000Z | 2020-09-17T15:51:55.000Z | rnn.py | apaszke/odsc-2020-workshop | 226e1b49824493a35686d112c7a4fb592b80f092 | [
"BSD-3-Clause"
] | null | null | null | rnn.py | apaszke/odsc-2020-workshop | 226e1b49824493a35686d112c7a4fb592b80f092 | [
"BSD-3-Clause"
] | 2 | 2020-04-16T14:22:46.000Z | 2021-03-30T14:45:25.000Z | import time
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from typing import Tuple
from torch import Tensor
LSTMState = Tuple[Tensor, Tensor]
class LSTMCell(nn.Module):
def __init__(self, input_size, hidden_size):
super().__init__()
self.input_size = input_size
... | 34.4875 | 80 | 0.609641 |
aecf22e06ffb0c74dfae571860e5205199352ceb | 21,897 | py | Python | epinet_fun/func_generate_traindata.py | MFerrugem/epinet | c01151660b28683a18060222a9a5ff0e29a06f05 | [
"MIT"
] | 79 | 2018-04-05T07:19:19.000Z | 2022-03-23T06:37:23.000Z | epinet_fun/func_generate_traindata.py | MFerrugem/epinet | c01151660b28683a18060222a9a5ff0e29a06f05 | [
"MIT"
] | 17 | 2018-07-06T06:23:01.000Z | 2022-03-20T13:32:15.000Z | epinet_fun/func_generate_traindata.py | MFerrugem/epinet | c01151660b28683a18060222a9a5ff0e29a06f05 | [
"MIT"
] | 38 | 2018-04-11T02:08:41.000Z | 2022-03-30T14:09:05.000Z | # -*- coding: utf-8 -*-
"""
Created on Thu Nov 15 10:32:22 2018
@author: Shin2018
"""
import numpy as np
def generate_traindata_for_train(traindata_all,traindata_label,input_size,label_size,batch_size,Setting02_AngualrViews,boolmask_img4,boolmask_img6,boolmask_img15):
"""
input: traindata_all (16x512x... | 63.103746 | 244 | 0.621957 |
73b8fd51708592f2eed3f14dcc6c7b3b62430524 | 791 | py | Python | LeetCodeSolutions/python/203_Remove_Linked_List_Elements.py | ChuanleiGuo/AlgorithmsPlayground | 90b6287b742c8bfd3797540c408d679be2821a40 | [
"MIT"
] | 1 | 2017-03-27T13:38:37.000Z | 2017-03-27T13:38:37.000Z | LeetCodeSolutions/python/203_Remove_Linked_List_Elements.py | ChuanleiGuo/AlgorithmsPlayground | 90b6287b742c8bfd3797540c408d679be2821a40 | [
"MIT"
] | null | null | null | LeetCodeSolutions/python/203_Remove_Linked_List_Elements.py | ChuanleiGuo/AlgorithmsPlayground | 90b6287b742c8bfd3797540c408d679be2821a40 | [
"MIT"
] | null | null | null | class ListNode(object):
def __init__(self, x):
self.val = x
self.next = None
class Solution(object):
def removeElements(self, head, val):
"""
:type head: ListNode
:type val: int
:rtype: ListNode
"""
if not head:
return None
d... | 18.833333 | 40 | 0.499368 |
ea6df9981f4473def24c4fa6680ecdc4dd01b9d9 | 2,137 | py | Python | calendar_w_token.py | LeGmask/sbrcalendar | 664fcf50998a2a49e242f0a93522e903ba285686 | [
"MIT"
] | null | null | null | calendar_w_token.py | LeGmask/sbrcalendar | 664fcf50998a2a49e242f0a93522e903ba285686 | [
"MIT"
] | null | null | null | calendar_w_token.py | LeGmask/sbrcalendar | 664fcf50998a2a49e242f0a93522e903ba285686 | [
"MIT"
] | null | null | null | from __future__ import print_function
import datetime
import os.path
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
from google.oauth2.credentials import Credentials
# If modifying these scopes, delete the file token... | 38.160714 | 121 | 0.662143 |
ef97e272cac3d4717f18a76e8d66c0cf87e4bc76 | 1,756 | py | Python | bin/calculations/scratch/SSIM_example.py | michaelneuder/image_quality_analysis | 4b4c934454ced945bdec165e1da99b17688e1608 | [
"MIT"
] | 11 | 2017-06-14T22:14:12.000Z | 2019-03-02T12:36:30.000Z | bin/calculations/scratch/SSIM_example.py | michaelneuder/image_quality_analysis | 4b4c934454ced945bdec165e1da99b17688e1608 | [
"MIT"
] | null | null | null | bin/calculations/scratch/SSIM_example.py | michaelneuder/image_quality_analysis | 4b4c934454ced945bdec165e1da99b17688e1608 | [
"MIT"
] | 1 | 2018-11-22T12:31:18.000Z | 2018-11-22T12:31:18.000Z | #!/usr/bin/env python3
import numpy as np
import scipy as sp
def main():
orig = np.asarray(
[[61,67,70,75,74,70,70,70,70,70,70],
[73,69,68,65,71,72,72,72,72,72,72],
[67,68,69,69,73,71,71,71,71,71,71],
[68,68,70,76,81,82,82,82,82,82,82],
[74,77,79,78,80,85,85,85,85,85,85]... | 33.132075 | 53 | 0.523918 |
c753f885bc4fb076c3ad0dda9c7044e55772c6df | 203 | py | Python | 000989letpy/letpy_081_loop_else_20200504.py | SafonovMikhail/python_000577 | 739f764e80f1ca354386f00b8e9db1df8c96531d | [
"Apache-2.0"
] | null | null | null | 000989letpy/letpy_081_loop_else_20200504.py | SafonovMikhail/python_000577 | 739f764e80f1ca354386f00b8e9db1df8c96531d | [
"Apache-2.0"
] | null | null | null | 000989letpy/letpy_081_loop_else_20200504.py | SafonovMikhail/python_000577 | 739f764e80f1ca354386f00b8e9db1df8c96531d | [
"Apache-2.0"
] | null | null | null | # string = input()
string = 'Восклицательного'
i = 0
while i < len(string):
if string[i] == '!':
break
print(string[i])
i = i + 1
else:
print('Восклицательного знака не найдено') | 18.454545 | 46 | 0.581281 |
60d76e9863fcbb0dce4070f0db1c7cc945b3ef32 | 12,306 | py | Python | try2/lib/python3.9/site-packages/kgx/cli/__init__.py | diatomsRcool/eco-kg | 4251f42ca2ab353838a39b640cb97593db76d4f4 | [
"BSD-3-Clause"
] | 1 | 2021-10-04T18:22:12.000Z | 2021-10-04T18:22:12.000Z | try2/lib/python3.9/site-packages/kgx/cli/__init__.py | diatomsRcool/eco-kg | 4251f42ca2ab353838a39b640cb97593db76d4f4 | [
"BSD-3-Clause"
] | 10 | 2021-06-16T20:48:32.000Z | 2021-10-04T18:22:02.000Z | try2/lib/python3.9/site-packages/kgx/cli/__init__.py | diatomsRcool/eco-kg | 4251f42ca2ab353838a39b640cb97593db76d4f4 | [
"BSD-3-Clause"
] | null | null | null | import kgx
import click
from typing import List, Tuple, Optional, Set
from kgx.config import get_logger, get_config
from kgx.cli.cli_utils import (
get_input_file_types,
parse_source,
apply_operations,
graph_summary,
validate,
neo4j_download,
neo4j_upload,
transform,
merge,
summ... | 27.105727 | 109 | 0.647164 |
dc3ce564a6b799a13e0554f3b62b6a7dcfd66520 | 380 | py | Python | settings/mail.py | skylifewww/handball | 853190e44037086b7749cb8f62d9df6577b379fd | [
"MIT"
] | null | null | null | settings/mail.py | skylifewww/handball | 853190e44037086b7749cb8f62d9df6577b379fd | [
"MIT"
] | null | null | null | settings/mail.py | skylifewww/handball | 853190e44037086b7749cb8f62d9df6577b379fd | [
"MIT"
] | null | null | null | ADMINS = (
('Admin', 'admin@handball.com'),
)
# DEFAULT_FROM_EMAIL = 'robot@tvoy_style.com'
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
DEFAULT_FROM_EMAIL = 'skylifewww@gmail.com'
EMAIL_USE_TLS = True
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = 'skylifewww@gmail.com'
EMAIL_HOST_PASSWORD = 'sk... | 27.142857 | 61 | 0.771053 |
2a14e4dd4783517773bc5b9a18402311b674bf0c | 3,020 | py | Python | sopel/__init__.py | Thermi/strongswan-sopel | 4f858b51d296a54a285a0ba044f1810871e3bb4c | [
"EFL-2.0"
] | null | null | null | sopel/__init__.py | Thermi/strongswan-sopel | 4f858b51d296a54a285a0ba044f1810871e3bb4c | [
"EFL-2.0"
] | null | null | null | sopel/__init__.py | Thermi/strongswan-sopel | 4f858b51d296a54a285a0ba044f1810871e3bb4c | [
"EFL-2.0"
] | null | null | null | # coding=utf-8
"""
__init__.py - Sopel Init Module
Copyright 2008, Sean B. Palmer, inamidst.com
Copyright 2012, Edward Powell, http://embolalia.net
Copyright © 2012, Elad Alfassa <elad@fedoraproject.org>
Licensed under the Eiffel Forum License 2.
http://sopel.chat/
"""
from __future__ import unicode_literals
from __f... | 31.458333 | 83 | 0.600993 |
a8de29ac8acf26f0c75f7ee30ae00d19c56f3cc2 | 25,353 | py | Python | src/mkdocstrings/handlers/base.py | in03/mkdocstrings | 5c0e4d1290e4b54d3098281405b680291fc3639e | [
"ISC"
] | null | null | null | src/mkdocstrings/handlers/base.py | in03/mkdocstrings | 5c0e4d1290e4b54d3098281405b680291fc3639e | [
"ISC"
] | null | null | null | src/mkdocstrings/handlers/base.py | in03/mkdocstrings | 5c0e4d1290e4b54d3098281405b680291fc3639e | [
"ISC"
] | null | null | null | """Base module for handlers.
This module contains the base classes for implementing collectors, renderers, and the combination of the two: handlers.
It also provides two methods:
- `get_handler`, that will cache handlers into the `HANDLERS_CACHE` dictionary.
- `teardown`, that will teardown all the cached handlers, ... | 42.538591 | 121 | 0.638149 |
24e60dd3e152b424fac9c28042bcbe8cb790f125 | 13,311 | py | Python | oscarapi/serializers/fields.py | jayvdb/django-oscar-api | c77c6130d3d1946265461c78278e414b098e69fa | [
"BSD-3-Clause"
] | 311 | 2015-01-30T14:58:01.000Z | 2022-03-27T16:57:38.000Z | oscarapi/serializers/fields.py | jayvdb/django-oscar-api | c77c6130d3d1946265461c78278e414b098e69fa | [
"BSD-3-Clause"
] | 211 | 2015-01-26T23:03:55.000Z | 2022-03-26T19:33:26.000Z | oscarapi/serializers/fields.py | jayvdb/django-oscar-api | c77c6130d3d1946265461c78278e414b098e69fa | [
"BSD-3-Clause"
] | 202 | 2015-01-07T09:20:08.000Z | 2022-03-26T15:21:04.000Z | import logging
import operator
from os.path import basename, join
from urllib.parse import urlsplit, parse_qs
from urllib.request import urlretrieve
from urllib.error import HTTPError
from django.conf import settings
from django.db import IntegrityError
from django.utils.translation import ugettext as _
from django.co... | 37.708215 | 88 | 0.620389 |
9a9cd3b5fb0dbf1f64e5aa7e3f526f253509721d | 7,703 | py | Python | test/functional/wallet_hd.py | btc20/bitcoin2.0 | e7a54b00ebd0e8d20f4d5315cc9a21c77ded25cd | [
"MIT"
] | null | null | null | test/functional/wallet_hd.py | btc20/bitcoin2.0 | e7a54b00ebd0e8d20f4d5315cc9a21c77ded25cd | [
"MIT"
] | null | null | null | test/functional/wallet_hd.py | btc20/bitcoin2.0 | e7a54b00ebd0e8d20f4d5315cc9a21c77ded25cd | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2016-2018 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 Hierarchical Deterministic wallet function."""
import os
import shutil
from test_framework.test_... | 48.753165 | 150 | 0.662339 |
6d3904027a76f058eef7771848d0d5a8b4be4530 | 751 | py | Python | 20180729/Excel_02.py | bijitchakraborty12/MyProjects01 | 503af4cd6e8fa0576add7ac64393f1b4a16456c7 | [
"MIT"
] | null | null | null | 20180729/Excel_02.py | bijitchakraborty12/MyProjects01 | 503af4cd6e8fa0576add7ac64393f1b4a16456c7 | [
"MIT"
] | null | null | null | 20180729/Excel_02.py | bijitchakraborty12/MyProjects01 | 503af4cd6e8fa0576add7ac64393f1b4a16456c7 | [
"MIT"
] | null | null | null | # In your python terminal cd into the directory having the excel file.
import xlrd
book = xlrd.open_workbook("myBook_01.xlsx") # in my case the directory contains the excel file named excel.xls
# Now to print the number of worksheets in the excel file
print("The number of worksheets are ", book.nsheets)
# Now the n... | 37.55 | 110 | 0.727031 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.