hexsha stringlengths 40 40 | size int64 2 1.05M | ext stringclasses 9
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 193 | max_stars_repo_name stringlengths 6 109 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 36.6k ⌀ | 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 193 | max_issues_repo_name stringlengths 6 109 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 29.8k ⌀ | 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 193 | max_forks_repo_name stringlengths 6 109 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 11.2k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.05M | avg_line_length float64 1 404k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9123da9dcf4a7b31fd2ef2870f9ca36cb5b8cb0f | 3,149 | py | Python | aries-cloudagent-python/aries_cloudagent/protocols/present_proof/v1_0/handlers/presentation_proposal_handler.py | sed-szeged/IndyPerf | 68bb48c7c651cae113cf30696110825ff3267ccc | [
"CC0-1.0"
] | null | null | null | aries-cloudagent-python/aries_cloudagent/protocols/present_proof/v1_0/handlers/presentation_proposal_handler.py | sed-szeged/IndyPerf | 68bb48c7c651cae113cf30696110825ff3267ccc | [
"CC0-1.0"
] | null | null | null | aries-cloudagent-python/aries_cloudagent/protocols/present_proof/v1_0/handlers/presentation_proposal_handler.py | sed-szeged/IndyPerf | 68bb48c7c651cae113cf30696110825ff3267ccc | [
"CC0-1.0"
] | 1 | 2022-02-02T17:05:27.000Z | 2022-02-02T17:05:27.000Z | """Presentation proposal message handler."""
from .....ledger.error import LedgerError
from .....messaging.base_handler import BaseHandler, HandlerException
from .....messaging.request_context import RequestContext
from .....messaging.responder import BaseResponder
from .....storage.error import StorageError
from ....... | 38.402439 | 88 | 0.637028 |
91242ec30bd13a5afc431ce0719783e1c213bddd | 6,311 | py | Python | bitcoin-ticker.py | Neosegment/Raspberry-Pi | 3f5735ebe2d37e44c55ad61ba9b273f2380eaef9 | [
"MIT"
] | 2 | 2017-11-17T01:30:17.000Z | 2019-01-17T20:31:35.000Z | bitcoin-ticker.py | Neosegment/Raspberry-Pi | 3f5735ebe2d37e44c55ad61ba9b273f2380eaef9 | [
"MIT"
] | null | null | null | bitcoin-ticker.py | Neosegment/Raspberry-Pi | 3f5735ebe2d37e44c55ad61ba9b273f2380eaef9 | [
"MIT"
] | null | null | null | import time
import datetime
import math
import json
import urllib2
from neopixel import *
NEOSEGMENT_COUNT = 8
# LED strip configuration:
LED_COUNT = 7 * NEOSEGMENT_COUNT # Number of LED pixels.
LED_PIN = 18 # GPIO pin connected to the pixels (18 uses PWM!).
LED_FREQ_HZ = 800000 # LED signal fr... | 29.629108 | 120 | 0.684836 |
9124455f5e6d5931d59058503bc46c4eab526a73 | 4,696 | py | Python | bot/commands/abstract/guessinggame.py | NMisko/monkalot | 965a16ca6a4921c8a9e6e996e9a0e3a9beb8444b | [
"MIT"
] | 20 | 2017-09-08T21:13:38.000Z | 2022-01-29T03:24:13.000Z | bot/commands/abstract/guessinggame.py | NMisko/monkalot | 965a16ca6a4921c8a9e6e996e9a0e3a9beb8444b | [
"MIT"
] | 32 | 2017-08-20T17:46:14.000Z | 2021-11-18T22:54:59.000Z | bot/commands/abstract/guessinggame.py | NMisko/monkalot | 965a16ca6a4921c8a9e6e996e9a0e3a9beb8444b | [
"MIT"
] | 10 | 2017-08-19T01:13:41.000Z | 2021-08-07T08:45:30.000Z | import random
from typing import List
from twisted.internet import reactor
from functools import partial
from bot.utilities.permission import Permission
from bot.utilities.startgame import start_game
from bot.utilities.tools import is_call_id_active
from .command import Command
class GuessingGame(Command):
"""A... | 31.306667 | 96 | 0.587947 |
91246a2deb2c007bcbba2c40ded9e953859628da | 1,735 | py | Python | API/src/main/resources/Lib/robot/parsing/comments.py | TagExpress/SikuliX1 | de9da11794dd94b3821eddc5c01b534d3f2fe828 | [
"MIT"
] | null | null | null | API/src/main/resources/Lib/robot/parsing/comments.py | TagExpress/SikuliX1 | de9da11794dd94b3821eddc5c01b534d3f2fe828 | [
"MIT"
] | null | null | null | API/src/main/resources/Lib/robot/parsing/comments.py | TagExpress/SikuliX1 | de9da11794dd94b3821eddc5c01b534d3f2fe828 | [
"MIT"
] | null | null | null | # Copyright (c) 2010-2020, sikuli.org, sikulix.com - MIT license
#
# 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 b... | 27.539683 | 80 | 0.661671 |
91246c998d650e5a9787642303b2033d54d55c82 | 5,806 | py | Python | improver/psychrometric_calculations/significant_phase_mask.py | owena11/improver | ff658db31364c0bdf3af3940736c260e10544705 | [
"BSD-3-Clause"
] | 77 | 2017-04-26T07:47:40.000Z | 2022-03-31T09:40:49.000Z | improver/psychrometric_calculations/significant_phase_mask.py | owena11/improver | ff658db31364c0bdf3af3940736c260e10544705 | [
"BSD-3-Clause"
] | 1,440 | 2017-03-29T10:04:15.000Z | 2022-03-28T10:11:29.000Z | improver/psychrometric_calculations/significant_phase_mask.py | MoseleyS/improver | ca028e3a1c842e3ff00b188c8ea6eaedd0a07149 | [
"BSD-3-Clause"
] | 72 | 2017-03-17T16:53:45.000Z | 2022-02-16T09:41:37.000Z | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# (C) British Crown Copyright 2017-2021 Met Office.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions a... | 38.966443 | 91 | 0.645022 |
9124738b440b7603545d4faf237b57a7bbbdb427 | 18,279 | py | Python | nemo/collections/asr/models/label_models.py | JMichaelStringer/NeMo | b5b29a69ccb0ec3d8c9ace2f33872ee99858a559 | [
"Apache-2.0"
] | 2 | 2021-06-23T19:16:59.000Z | 2022-02-23T18:49:07.000Z | nemo/collections/asr/models/label_models.py | JMichaelStringer/NeMo | b5b29a69ccb0ec3d8c9ace2f33872ee99858a559 | [
"Apache-2.0"
] | null | null | null | nemo/collections/asr/models/label_models.py | JMichaelStringer/NeMo | b5b29a69ccb0ec3d8c9ace2f33872ee99858a559 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020, NVIDIA CORPORATION. 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... | 44.366505 | 163 | 0.675529 |
912483af1da2e267bc5383cda7be9163e896ccea | 1,272 | py | Python | Wrapper/lccor.py | ahmadryan/TurbAn | b8866d103a2ca2f5fbad73bcd4416f19299f22b2 | [
"BSD-2-Clause-Patent"
] | null | null | null | Wrapper/lccor.py | ahmadryan/TurbAn | b8866d103a2ca2f5fbad73bcd4416f19299f22b2 | [
"BSD-2-Clause-Patent"
] | null | null | null | Wrapper/lccor.py | ahmadryan/TurbAn | b8866d103a2ca2f5fbad73bcd4416f19299f22b2 | [
"BSD-2-Clause-Patent"
] | 10 | 2019-03-22T15:30:12.000Z | 2021-02-10T02:55:50.000Z | #!/usr/bin/env python
def lccor(rc,bs=0,fs=1,step=1,kind='int'):
import numpy as np
from AnalysisFunctions import fcorr
ie=1/np.e
rc.vars2load(['bx','by','bz'])
tt = np.zeros((fs-bs)/step)
lxc = np.zeros((fs-bs)/step)
lyc = np.zeros((fs-bs)/step)
lc = np.zeros((fs-bs)/step)
for i in range(... | 32.615385 | 61 | 0.583333 |
9124b705239dcb522e11fb9b41fa87bca04a6a4b | 1,248 | py | Python | asyncmongo/__init__.py | bufferx/asyncmongo | c68ba72a79507e21f28c5525e1f6954cc68db4cf | [
"Apache-2.0"
] | null | null | null | asyncmongo/__init__.py | bufferx/asyncmongo | c68ba72a79507e21f28c5525e1f6954cc68db4cf | [
"Apache-2.0"
] | null | null | null | asyncmongo/__init__.py | bufferx/asyncmongo | c68ba72a79507e21f28c5525e1f6954cc68db4cf | [
"Apache-2.0"
] | null | null | null | #!/bin/env python
#
# Copyright 2010 bit.ly
#
# 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... | 31.2 | 122 | 0.749199 |
9124c265973ef000b94d8e22246fa86d81b05192 | 1,119 | py | Python | ast_monitor/tests/test_tcxreader.py | alenrajsp/AST-Monitor | 56b7dc64852bec27de9c18a676a6020fa2e92322 | [
"MIT"
] | null | null | null | ast_monitor/tests/test_tcxreader.py | alenrajsp/AST-Monitor | 56b7dc64852bec27de9c18a676a6020fa2e92322 | [
"MIT"
] | null | null | null | ast_monitor/tests/test_tcxreader.py | alenrajsp/AST-Monitor | 56b7dc64852bec27de9c18a676a6020fa2e92322 | [
"MIT"
] | null | null | null | import os
from tcxreader.tcxreader import TCXReader
from unittest import TestCase
class TestTCXReader(TestCase):
def setUp(self):
filename = os.path.join(os.path.dirname(__file__), "test_data", "15.tcx")
self.tcx = TCXReader().read(filename)
def test_distance(self):
self.assertEqual(s... | 27.975 | 81 | 0.686327 |
9124f21eaeb1d7af85f9e35898854ef89890f143 | 678 | py | Python | src/command_modules/azure-cli-cdn/azure/cli/command_modules/cdn/__init__.py | v-Ajnava/azure-cli | febec631d79bfca151e84267b5b409594bad598e | [
"MIT"
] | null | null | null | src/command_modules/azure-cli-cdn/azure/cli/command_modules/cdn/__init__.py | v-Ajnava/azure-cli | febec631d79bfca151e84267b5b409594bad598e | [
"MIT"
] | 3 | 2021-03-26T00:48:20.000Z | 2022-03-29T22:05:39.000Z | src/command_modules/azure-cli-cdn/azure/cli/command_modules/cdn/__init__.py | v-Ajnava/azure-cli | febec631d79bfca151e84267b5b409594bad598e | [
"MIT"
] | 1 | 2017-12-28T04:51:44.000Z | 2017-12-28T04:51:44.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 45.2 | 106 | 0.567847 |
9124fb1f19408dab68bd9391436e3580dab9d7a2 | 3,980 | py | Python | src/server/classes/parsers/super_parser.py | LiteralGenie/HvData | e4a8cac99c7443d7c6be41b4586b1d5a01e27a2b | [
"MIT"
] | null | null | null | src/server/classes/parsers/super_parser.py | LiteralGenie/HvData | e4a8cac99c7443d7c6be41b4586b1d5a01e27a2b | [
"MIT"
] | null | null | null | src/server/classes/parsers/super_parser.py | LiteralGenie/HvData | e4a8cac99c7443d7c6be41b4586b1d5a01e27a2b | [
"MIT"
] | null | null | null | from config import paths
from ..models.super_auction import SuperAuction, SuperAuctionItem
from utils.date_utils import utc_date_to_timestamp
from bs4 import BeautifulSoup
from hvpytils import EquipParser
from urlpath import URL
import re, requests
class SuperParser:
session: requests.Session
def __init__(... | 29.924812 | 90 | 0.546231 |
912509449662b489980ff1d3de40d797fb80a9b6 | 3,386 | py | Python | pyvista_gui/console.py | akaszynski/pyvista-gui | 4ed7e3a52026dfeab4e82a300b92a92f43060dda | [
"MIT"
] | 6 | 2019-11-20T20:08:42.000Z | 2022-02-24T12:24:20.000Z | pyvista_gui/console.py | akaszynski/pyvista-gui | 4ed7e3a52026dfeab4e82a300b92a92f43060dda | [
"MIT"
] | 6 | 2020-01-27T16:15:11.000Z | 2021-04-12T11:42:11.000Z | pyvista_gui/console.py | akaszynski/pyvista-gui | 4ed7e3a52026dfeab4e82a300b92a92f43060dda | [
"MIT"
] | null | null | null | import sys
from pydoc import help
# from qtconsole.manager import QtKernelManager
import qdarkstyle
from qtconsole.inprocess import QtInProcessKernelManager
from qtconsole.rich_jupyter_widget import RichJupyterWidget
FROZEN = getattr(sys, 'frozen', False)
def _complete(self):
""" Performs completion at the curr... | 29.964602 | 71 | 0.617247 |
91251089efb26ef874c8f0a61b75c34c621a0e36 | 5,501 | py | Python | appengine/findit/waterfall/waterfall_config.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | 2 | 2021-04-13T21:22:18.000Z | 2021-09-07T02:11:57.000Z | appengine/findit/waterfall/waterfall_config.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | 21 | 2020-09-06T02:41:05.000Z | 2022-03-02T04:40:01.000Z | appengine/findit/waterfall/waterfall_config.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2015 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.
"""Determines support level for different steps for masters."""
from services.deps import GetOSPlatformName
from model.wf_config import FinditConfig
# Expli... | 32.744048 | 79 | 0.733139 |
912532dd7c028573ea6415185fa702001034d53d | 9,845 | py | Python | plastering/uis/cmdline_ui.py | MingzheWu418/plastering | 322531e934c3acf2ecc8f520b37a6d255b9959c2 | [
"MIT"
] | 29 | 2018-09-19T01:16:27.000Z | 2022-03-29T14:35:36.000Z | plastering/uis/cmdline_ui.py | MingzheWu418/plastering | 322531e934c3acf2ecc8f520b37a6d255b9959c2 | [
"MIT"
] | 14 | 2019-04-12T18:37:36.000Z | 2022-02-10T00:27:55.000Z | plastering/uis/cmdline_ui.py | MingzheWu418/plastering | 322531e934c3acf2ecc8f520b37a6d255b9959c2 | [
"MIT"
] | 14 | 2019-03-05T23:44:11.000Z | 2022-03-18T07:29:31.000Z | import pdb
import sys
from functools import reduce
import numpy as np
from prompt_toolkit import prompt
from tabulate import tabulate
from ..metadata_interface import *
from ..common import *
class ReplUi(object):
def __init__(self, all_tagsets, pgid=None):
self._init_brick(all_tagsets)
self.pg... | 38.607843 | 89 | 0.493652 |
9125348b36801a8f366c28e39caeda82de3224ae | 14,302 | py | Python | tests/manage/pv_services/test_resource_deletion_during_pvc_pod_creation_and_io.py | nbalacha/ocs-ci | 9c5a5474d62777e868b80894d6b0f3567a7b605d | [
"MIT"
] | null | null | null | tests/manage/pv_services/test_resource_deletion_during_pvc_pod_creation_and_io.py | nbalacha/ocs-ci | 9c5a5474d62777e868b80894d6b0f3567a7b605d | [
"MIT"
] | null | null | null | tests/manage/pv_services/test_resource_deletion_during_pvc_pod_creation_and_io.py | nbalacha/ocs-ci | 9c5a5474d62777e868b80894d6b0f3567a7b605d | [
"MIT"
] | null | null | null | import logging
from concurrent.futures import ThreadPoolExecutor
import pytest
from functools import partial
from ocs_ci.framework.testlib import ManageTest, tier4, tier4c, ignore_leftover_label
from ocs_ci.ocs import constants
from ocs_ci.ocs.resources.pod import (
get_mds_pods,
get_mon_pods,
get_mgr_pods... | 37.148052 | 88 | 0.592714 |
912553d14e61ee6266482da9303e1ee1707463ac | 221 | py | Python | libical/libical-1.0/src/python/Error.py | imx6uldev/depedency_tools | 0748392a4e97ded2a770b6fbcab281dd3fda2db7 | [
"MIT"
] | null | null | null | libical/libical-1.0/src/python/Error.py | imx6uldev/depedency_tools | 0748392a4e97ded2a770b6fbcab281dd3fda2db7 | [
"MIT"
] | null | null | null | libical/libical-1.0/src/python/Error.py | imx6uldev/depedency_tools | 0748392a4e97ded2a770b6fbcab281dd3fda2db7 | [
"MIT"
] | null | null | null |
class LibicalError(Exception):
"Libical Error"
def __init__(self,str):
Exception.__init__(self,str)
def __str__(self):
return Exception.__str__(self)+"\nLibical errno: "+icalerror_perror()
| 20.090909 | 77 | 0.674208 |
91256c652f3dfea2b47c0d02ac6c6e7dd6b8fafc | 1,777 | py | Python | scraper/utils.py | CivicDataLab/twitter-scraper | bee53893c81aef8c6bf83d6fe6264defb874ea62 | [
"MIT"
] | null | null | null | scraper/utils.py | CivicDataLab/twitter-scraper | bee53893c81aef8c6bf83d6fe6264defb874ea62 | [
"MIT"
] | 10 | 2019-06-27T07:53:03.000Z | 2021-06-02T00:18:38.000Z | scraper/utils.py | CivicDataLab/twitter-scraper | bee53893c81aef8c6bf83d6fe6264defb874ea62 | [
"MIT"
] | null | null | null | """
Some of this code was extracted from other sources. Copyright information
may be found at the links provided.
"""
def resolve(obj, attrspec):
"""
Resolve elements from an object.
Works with objects and dicts.
From: http://stackoverflow.com/a/9101577/1309774
"""
for attr in attrspec.split(... | 28.66129 | 81 | 0.635903 |
9125a662a50b0a9cd8468fa27f57341a2de02253 | 2,373 | py | Python | savu/plugins/loaders/full_field_loaders/random_3d_tomo_loader.py | elainehoml/Savu | e4772704606f71d6803d832084e10faa585e7358 | [
"Apache-2.0"
] | 39 | 2015-03-30T14:03:42.000Z | 2022-03-16T16:50:33.000Z | savu/plugins/loaders/full_field_loaders/random_3d_tomo_loader.py | elainehoml/Savu | e4772704606f71d6803d832084e10faa585e7358 | [
"Apache-2.0"
] | 670 | 2015-02-11T11:08:09.000Z | 2022-03-21T09:27:57.000Z | savu/plugins/loaders/full_field_loaders/random_3d_tomo_loader.py | elainehoml/Savu | e4772704606f71d6803d832084e10faa585e7358 | [
"Apache-2.0"
] | 54 | 2015-02-13T14:09:52.000Z | 2022-01-24T13:57:09.000Z | # Copyright 2014 Diamond Light Source Ltd.
#
# 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 t... | 37.666667 | 75 | 0.721871 |
9125c99b12199637327e0926e71b576c75767e57 | 561 | py | Python | app_ccf/base_test.py | richardmobikasa/cash-assistance-platform | fafc117823c9bb7b5b6115d11c66afb459e1ec5f | [
"MIT"
] | 10 | 2020-10-02T20:03:08.000Z | 2022-01-05T17:27:54.000Z | app_ccf/base_test.py | richardmobikasa/cash-assistance-platform | fafc117823c9bb7b5b6115d11c66afb459e1ec5f | [
"MIT"
] | 3 | 2020-10-06T14:44:28.000Z | 2020-10-07T15:33:23.000Z | app_ccf/base_test.py | richardmobikasa/cash-assistance-platform | fafc117823c9bb7b5b6115d11c66afb459e1ec5f | [
"MIT"
] | 6 | 2020-09-22T22:39:38.000Z | 2021-07-13T06:45:53.000Z |
from django.test import TestCase
from app_ccf.twilio import twilio_client
import mock
import time
class CcfBaseTest(TestCase):
def setUp(self):
super().setUp()
if not hasattr(twilio_client.trigger_text_messages, 'mock'):
mock.patch.object(twilio_client,
... | 28.05 | 77 | 0.672014 |
9125d6b3f939b868af0091f1934268aab3524211 | 6,027 | py | Python | assemblyline/filestore/transport/s3.py | malvidin/assemblyline-base | 6e7de0c15fbca2cf586e33f04df7d3717bd0c0b5 | [
"MIT"
] | null | null | null | assemblyline/filestore/transport/s3.py | malvidin/assemblyline-base | 6e7de0c15fbca2cf586e33f04df7d3717bd0c0b5 | [
"MIT"
] | null | null | null | assemblyline/filestore/transport/s3.py | malvidin/assemblyline-base | 6e7de0c15fbca2cf586e33f04df7d3717bd0c0b5 | [
"MIT"
] | null | null | null | import boto3
import logging
import os
import tempfile
from botocore.exceptions import ClientError, EndpointConnectionError, ConnectionClosedError
from io import BytesIO
from assemblyline.common.exceptions import ChainAll
from assemblyline.filestore.transport.base import Transport, TransportException
try:
from bo... | 34.44 | 119 | 0.616393 |
9125f3946d4f466f5fafd65ee18bd1d67e01b651 | 20,306 | py | Python | Tensorflow_Pandas_Numpy/source3.6/keras_applications/mobilenet.py | Con-Mi/lambda-packs | b23a8464abdd88050b83310e1d0e99c54dac28ab | [
"MIT"
] | 31 | 2018-10-19T15:28:36.000Z | 2022-02-14T03:01:25.000Z | Tensorflow_Pandas_Numpy/source3.6/keras_applications/mobilenet.py | Con-Mi/lambda-packs | b23a8464abdd88050b83310e1d0e99c54dac28ab | [
"MIT"
] | 4 | 2020-03-24T16:06:51.000Z | 2021-06-10T20:48:41.000Z | Tensorflow_Pandas_Numpy/source3.6/keras_applications/mobilenet.py | Con-Mi/lambda-packs | b23a8464abdd88050b83310e1d0e99c54dac28ab | [
"MIT"
] | 10 | 2019-01-10T04:02:12.000Z | 2021-11-17T01:52:15.000Z | """MobileNet v1 models for Keras.
MobileNet is a general architecture and can be used for multiple use cases.
Depending on the use case, it can use different input layer size and
different width factors. This allows different width models to reduce
the number of multiply-adds and thereby
reduce inference cost on mobil... | 43.388889 | 83 | 0.574805 |
9125fb3eed84e52cbc570b971462a54742b70d31 | 1,282 | py | Python | tests/test_engine/test_pipeline/test_schedule.py | rahulgupta9202/ColossalAI | 993088d45eaa032e39cf5959df2a506f0663bc2e | [
"Apache-2.0"
] | 1 | 2022-03-12T04:49:19.000Z | 2022-03-12T04:49:19.000Z | tests/test_engine/test_pipeline/test_schedule.py | rahulgupta9202/ColossalAI | 993088d45eaa032e39cf5959df2a506f0663bc2e | [
"Apache-2.0"
] | null | null | null | tests/test_engine/test_pipeline/test_schedule.py | rahulgupta9202/ColossalAI | 993088d45eaa032e39cf5959df2a506f0663bc2e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
import os.path as osp
import pytest
from colossalai.context import ParallelMode
from colossalai.core import global_context as gpc
from colossalai.initialize import initialize
from colossalai.logging import get_global_dist_logger
NUM_BATCH = 128
BATCH_SIZE = 32
SEQ_LE... | 24.653846 | 75 | 0.730889 |
91260b0a42fba2d0bd30e3273a9315f102da190d | 201 | py | Python | tredis/compat.py | gmr/tredis | 2e91c6a58a35460be0525c51ac6a98fde3b506ad | [
"BSD-3-Clause"
] | 22 | 2015-11-16T18:24:23.000Z | 2019-01-22T06:41:51.000Z | tredis/compat.py | gmr/tredis | 2e91c6a58a35460be0525c51ac6a98fde3b506ad | [
"BSD-3-Clause"
] | 8 | 2016-01-26T21:55:15.000Z | 2020-11-17T18:00:13.000Z | tredis/compat.py | gmr/tredis | 2e91c6a58a35460be0525c51ac6a98fde3b506ad | [
"BSD-3-Clause"
] | 9 | 2015-11-28T19:32:14.000Z | 2020-10-19T06:47:26.000Z | """
Python 2 & 3 Compatibility Functions
"""
def ascii(value):
"""Return the string of value
:param mixed value: The value to return
:rtype: str
"""
return '{0}'.format(value)
| 13.4 | 43 | 0.606965 |
912626e86698cb6ae23868e72c38bc38adabdcfd | 2,759 | py | Python | cutesy_mvc/helpers/test.py | dvanderweele/Cutesy_MVC | 6e073adc34ef1deb4932dae018f3561176db9e8f | [
"MIT"
] | null | null | null | cutesy_mvc/helpers/test.py | dvanderweele/Cutesy_MVC | 6e073adc34ef1deb4932dae018f3561176db9e8f | [
"MIT"
] | null | null | null | cutesy_mvc/helpers/test.py | dvanderweele/Cutesy_MVC | 6e073adc34ef1deb4932dae018f3561176db9e8f | [
"MIT"
] | null | null | null | """
Defines two classes for creating and running suites of tests.
"""
import sys
class Test:
"""
Define and run a test case.
Parameters
----------
name : str
The name of the test case, for use in output.
callback
Must be a callback function that performs testing logic and... | 28.153061 | 205 | 0.531714 |
91264edb98374f7ab3f0380042d6b09e6d920698 | 9,243 | py | Python | tests/test_main.py | ine-rmotr-projects/pyp-w1-gw-tic-tac-toe | 1e2a9b08c4c821aa25374f808722e7d797b92dba | [
"MIT"
] | 3 | 2021-01-07T11:58:05.000Z | 2021-06-05T10:27:07.000Z | tests/test_main.py | ine-rmotr-projects/pyp-w1-gw-tic-tac-toe | 1e2a9b08c4c821aa25374f808722e7d797b92dba | [
"MIT"
] | 28 | 2016-05-20T17:09:53.000Z | 2017-06-07T02:08:46.000Z | tests/test_main.py | ine-rmotr-projects/pyp-w1-gw-tic-tac-toe | 1e2a9b08c4c821aa25374f808722e7d797b92dba | [
"MIT"
] | 142 | 2016-05-19T22:27:29.000Z | 2020-02-26T21:00:55.000Z | # -*- coding: utf-8 -*-
import unittest
from tic_tac_toe import (
start_new_game, get_board_as_string, move, get_winner,
get_next_turn, _position_is_valid, _position_is_empty_in_board,
_board_is_full, _check_winning_combinations, _board_is_full,
InvalidMovement, GameOver)
class TestTicTacToe(unittest... | 32.893238 | 79 | 0.460565 |
91265f087f008254d70fb6ca5822422c664ba8f4 | 961 | py | Python | src/dcos_e2e_cli/dcos_vagrant/commands/web.py | cprovencher/dcos-e2e | c54b3d41f246efe3f90dcf225b0bffdc1f615daa | [
"Apache-2.0"
] | null | null | null | src/dcos_e2e_cli/dcos_vagrant/commands/web.py | cprovencher/dcos-e2e | c54b3d41f246efe3f90dcf225b0bffdc1f615daa | [
"Apache-2.0"
] | null | null | null | src/dcos_e2e_cli/dcos_vagrant/commands/web.py | cprovencher/dcos-e2e | c54b3d41f246efe3f90dcf225b0bffdc1f615daa | [
"Apache-2.0"
] | null | null | null | """
Tools for opening a cluster's web UI.
"""
import click
from dcos_e2e_cli.common.options import (
existing_cluster_id_option,
verbosity_option,
)
from dcos_e2e_cli.common.utils import check_cluster_id_exists, set_logging
from ._common import ClusterVMs, existing_cluster_ids
@click.command('web')
@existi... | 26.694444 | 74 | 0.736733 |
91269529e5ed1349c08091581ff5c3860f802a00 | 20,914 | py | Python | highway_env/vehicle/behavior.py | liuxin00738/highway-env | 13052b1443b905507aa9451e702b2179d933647f | [
"MIT"
] | null | null | null | highway_env/vehicle/behavior.py | liuxin00738/highway-env | 13052b1443b905507aa9451e702b2179d933647f | [
"MIT"
] | null | null | null | highway_env/vehicle/behavior.py | liuxin00738/highway-env | 13052b1443b905507aa9451e702b2179d933647f | [
"MIT"
] | null | null | null | from typing import Tuple, Union
import numpy as np
from highway_env.road.road import Road, Route, LaneIndex
from highway_env.utils import Vector
from highway_env.vehicle.controller import ControlledVehicle
from highway_env import utils
from highway_env.vehicle.kinematics import Vehicle
class IDMVehicle(ControlledVe... | 43.032922 | 123 | 0.605862 |
9126dde6d6ebaf9d7af8a3334dbbbcc17fedff77 | 3,291 | py | Python | linux/rest/workspace/wsservice.py | petergyorgy/virtue | 3b4dbfbdf9f5e121d9c9887d675fdd3065ecdd3b | [
"BSD-3-Clause"
] | null | null | null | linux/rest/workspace/wsservice.py | petergyorgy/virtue | 3b4dbfbdf9f5e121d9c9887d675fdd3065ecdd3b | [
"BSD-3-Clause"
] | null | null | null | linux/rest/workspace/wsservice.py | petergyorgy/virtue | 3b4dbfbdf9f5e121d9c9887d675fdd3065ecdd3b | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python3
import os
import sys
import pprint
import time
import traceback
import togo
import radoop
import pc
import icon
import gui
import ezfuncs
try:
ezfuncs.url = sys.argv[1]
except:
ezfuncs.url = 'https://cc.prod.virtue.com:4443'
pc.pc('Starting windows service')
ezfuncs.loadconf()
icon.crfolder... | 17.051813 | 114 | 0.683987 |
9127267cf57246c584bed7790a5a59cde06fe125 | 96 | py | Python | vyperlogix/zip/getZipFilesAnalysis.py | raychorn/chrome_gui | f1fade70b61af12ee43c55c075aa9cfd32caa962 | [
"CC0-1.0"
] | 1 | 2020-09-29T01:36:33.000Z | 2020-09-29T01:36:33.000Z | vyperlogix/zip/getZipFilesAnalysis.py | raychorn/chrome_gui | f1fade70b61af12ee43c55c075aa9cfd32caa962 | [
"CC0-1.0"
] | null | null | null | vyperlogix/zip/getZipFilesAnalysis.py | raychorn/chrome_gui | f1fade70b61af12ee43c55c075aa9cfd32caa962 | [
"CC0-1.0"
] | null | null | null | from vyperlogix.zip import getZipFilesAnalysis
from vyperlogix.zip import getZipFilesAnalysis2
| 24 | 47 | 0.885417 |
91273fd4efa3799cbab3abed24bfdf0e37bdc3b0 | 129 | py | Python | blog/utils.py | ryanleonbutler/rbo | f51d19c5fd056ebdfba1416a9377b225eb1015e6 | [
"Apache-2.0"
] | null | null | null | blog/utils.py | ryanleonbutler/rbo | f51d19c5fd056ebdfba1416a9377b225eb1015e6 | [
"Apache-2.0"
] | 8 | 2021-04-28T21:02:47.000Z | 2022-03-25T20:35:57.000Z | blog/utils.py | ryanleonbutler/rbo | f51d19c5fd056ebdfba1416a9377b225eb1015e6 | [
"Apache-2.0"
] | null | null | null | def get_post_content_from_file(filename):
with open(filename) as f:
lines = f.readlines()
return "".join(lines)
| 21.5 | 41 | 0.666667 |
912748b32cbe5e5d80cf2cb3f1cfe3e9b9eb6d6a | 996 | py | Python | CTF/pwnables/coin1/test.py | RegaledSeer/netsecnoobie | d3366937ec8c67a9742f61e47698239ae693af49 | [
"MIT"
] | null | null | null | CTF/pwnables/coin1/test.py | RegaledSeer/netsecnoobie | d3366937ec8c67a9742f61e47698239ae693af49 | [
"MIT"
] | null | null | null | CTF/pwnables/coin1/test.py | RegaledSeer/netsecnoobie | d3366937ec8c67a9742f61e47698239ae693af49 | [
"MIT"
] | null | null | null | from pwn import *
import re
def get_weight(start,end,r):
send_str = ""
if start == end:
r.sendline(str(start))
else:
for i in range(start,end + 1 ):
send_str = send_str + str(i)+" "
r.sendline(send_str)
result = r.recvline()
return int(result)
def choose_coin(nu... | 24.292683 | 61 | 0.541165 |
9127923bcc5d6bff219e07ec091cca4e39157179 | 1,688 | py | Python | src/augraphy/augmentations/dustyink.py | faizan1041/augraphy | 9ea0502516606f1bc73b4067b18955308b7c6332 | [
"MIT"
] | null | null | null | src/augraphy/augmentations/dustyink.py | faizan1041/augraphy | 9ea0502516606f1bc73b4067b18955308b7c6332 | [
"MIT"
] | null | null | null | src/augraphy/augmentations/dustyink.py | faizan1041/augraphy | 9ea0502516606f1bc73b4067b18955308b7c6332 | [
"MIT"
] | null | null | null | import numpy as np
import random
from augraphy.base.augmentation import Augmentation
from augraphy.base.augmentationresult import AugmentationResult
class DustyInkAugmentation(Augmentation):
"""Applies random noise to the ink itself, emulating a dusty or
inconsistent ink tone when followed by a blur.
:p... | 36.695652 | 122 | 0.662322 |
91280ddbc71eac30320b7ec560a07a98bf91de50 | 27,180 | py | Python | Sklearn_scipy_numpy/source/sklearn/metrics/ranking.py | Con-Mi/lambda-packs | b23a8464abdd88050b83310e1d0e99c54dac28ab | [
"MIT"
] | 1 | 2019-06-27T12:09:44.000Z | 2019-06-27T12:09:44.000Z | Sklearn_scipy_numpy/source/sklearn/metrics/ranking.py | Con-Mi/lambda-packs | b23a8464abdd88050b83310e1d0e99c54dac28ab | [
"MIT"
] | null | null | null | Sklearn_scipy_numpy/source/sklearn/metrics/ranking.py | Con-Mi/lambda-packs | b23a8464abdd88050b83310e1d0e99c54dac28ab | [
"MIT"
] | null | null | null | """Metrics to assess performance on classification task given scores
Functions named as ``*_score`` return a scalar value to maximize: the higher
the better
Function named as ``*_error`` or ``*_loss`` return a scalar value to minimize:
the lower the better
"""
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.... | 35.904888 | 79 | 0.643672 |
912818686a774180ac047828283cf97f04c1de57 | 29,427 | py | Python | atom/proton/python/proton_api/api/annuities_api.py | AbhiGupta03/SDK | f3a61aae7a847f07f0c22a154ca88dc378e9d25e | [
"Apache-2.0"
] | 11 | 2019-04-16T02:11:17.000Z | 2021-12-16T22:51:40.000Z | atom/proton/python/proton_api/api/annuities_api.py | AbhiGupta03/SDK | f3a61aae7a847f07f0c22a154ca88dc378e9d25e | [
"Apache-2.0"
] | 81 | 2019-11-19T23:24:28.000Z | 2022-03-28T11:35:47.000Z | atom/proton/python/proton_api/api/annuities_api.py | AbhiGupta03/SDK | f3a61aae7a847f07f0c22a154ca88dc378e9d25e | [
"Apache-2.0"
] | 11 | 2020-07-08T02:29:56.000Z | 2022-03-28T10:05:33.000Z | # coding: utf-8
"""
Hydrogen Proton API
Financial engineering module of Hydrogen Atom # noqa: E501
OpenAPI spec version: 1.9.2
Contact: info@hydrogenplatform.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import re # noqa: F401... | 46.783784 | 181 | 0.666735 |
912820fe10e640f4425ec802acdcd003fb895312 | 411 | py | Python | python-patterns-guide/creational-patterns/abstract-factory/build-by-object-instance.py | leemengtaiwan/design-patterns | 1657caab1a5654b253e1c6f9b8c4af1017d79c4c | [
"MIT"
] | 2 | 2021-06-20T01:25:43.000Z | 2021-07-06T16:16:55.000Z | python-patterns-guide/creational-patterns/abstract-factory/build-by-object-instance.py | leemengtaiwan/design-patterns | 1657caab1a5654b253e1c6f9b8c4af1017d79c4c | [
"MIT"
] | null | null | null | python-patterns-guide/creational-patterns/abstract-factory/build-by-object-instance.py | leemengtaiwan/design-patterns | 1657caab1a5654b253e1c6f9b8c4af1017d79c4c | [
"MIT"
] | null | null | null | from decimal import Decimal
class DecimalFactory(object):
def build(self, string):
return Decimal(string.lstrip('$'))
class Loader(object):
@staticmethod
def load(string, factory):
string = string.rstrip(',') # allow trailing comma
return [factory.build(item) for item in string.... | 21.631579 | 66 | 0.6618 |
912847150454675ae2f6adb873388306f369d7cc | 2,041 | py | Python | tests/common/test_op/ascend/batch_reindex_layer.py | tianjiashuo/akg | a9cbf642063fb1086a93e8bc6be6feb145689817 | [
"Apache-2.0"
] | 286 | 2020-06-23T06:40:44.000Z | 2022-03-30T01:27:49.000Z | tests/common/test_op/ascend/batch_reindex_layer.py | tianjiashuo/akg | a9cbf642063fb1086a93e8bc6be6feb145689817 | [
"Apache-2.0"
] | 10 | 2020-07-31T03:26:59.000Z | 2021-12-27T15:00:54.000Z | tests/common/test_op/ascend/batch_reindex_layer.py | tianjiashuo/akg | a9cbf642063fb1086a93e8bc6be6feb145689817 | [
"Apache-2.0"
] | 30 | 2020-07-17T01:04:14.000Z | 2021-12-27T14:05:19.000Z | # Copyright 2019-2021 Huawei Technologies Co., Ltd
#
# 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 agre... | 32.396825 | 96 | 0.66242 |
9128572a6dfe7d639b1c39f89aa2a7c116dd258b | 18,946 | py | Python | src/pathme/utils.py | brucetony/PathMe | c7d758ff76f6787a4eb349b95f9c06bf1afb0754 | [
"Apache-2.0"
] | 12 | 2019-01-24T11:00:55.000Z | 2022-01-26T19:39:00.000Z | src/pathme/utils.py | brucetony/PathMe | c7d758ff76f6787a4eb349b95f9c06bf1afb0754 | [
"Apache-2.0"
] | 17 | 2019-01-24T12:33:01.000Z | 2021-06-09T07:08:50.000Z | src/pathme/utils.py | brucetony/PathMe | c7d758ff76f6787a4eb349b95f9c06bf1afb0754 | [
"Apache-2.0"
] | 2 | 2019-07-29T08:29:33.000Z | 2021-04-13T02:13:40.000Z | # -*- coding: utf-8 -*-
"""Methods for various purposes."""
import collections
import itertools as itt
import logging
import os
import pickle
from typing import Dict, Iterable, List, Optional, Set, Tuple
from urllib.parse import urlparse
from urllib.request import urlretrieve
import click
import pandas as pd
import ... | 33.651865 | 120 | 0.657711 |
91285ee0de96f6562a03d66b54a579d58324b877 | 550 | py | Python | setup.py | bdarnell/codegenloader | a4b98787e2a97386008658e9b34a55865269b061 | [
"MIT"
] | 8 | 2015-11-05T07:40:26.000Z | 2020-10-19T02:37:13.000Z | setup.py | bdarnell/codegenloader | a4b98787e2a97386008658e9b34a55865269b061 | [
"MIT"
] | null | null | null | setup.py | bdarnell/codegenloader | a4b98787e2a97386008658e9b34a55865269b061 | [
"MIT"
] | 3 | 2015-03-15T23:07:42.000Z | 2020-11-25T14:51:04.000Z | #!/usr/bin/env python
from distutils.core import setup
version = "0.2"
setup(
name="codegenloader",
version=version,
packages=[
"codegenloader",
"codegenloader.test",
"codegenloader.test.proto",
],
package_data={
"codegenloader.test.proto": ["simple.proto"],
... | 23.913043 | 79 | 0.625455 |
9128807d95894178c1e2a178e47f7442b05a671b | 8,770 | py | Python | userspace/py/bin/clock.py | monday-lesley/ponyos | aec744f0a2740d8bb6b8e59c53b135a49e297603 | [
"CC-BY-3.0"
] | null | null | null | userspace/py/bin/clock.py | monday-lesley/ponyos | aec744f0a2740d8bb6b8e59c53b135a49e297603 | [
"CC-BY-3.0"
] | null | null | null | userspace/py/bin/clock.py | monday-lesley/ponyos | aec744f0a2740d8bb6b8e59c53b135a49e297603 | [
"CC-BY-3.0"
] | null | null | null | #!/usr/bin/python3
"""
Fancy clock.
"""
import math
import os
import sys
import time
import cairo
import yutani
import text_region
import toaru_fonts
import fswait
from menu_bar import MenuBarWidget, MenuEntryAction, MenuEntrySubmenu, MenuEntryDivider, MenuWindow
from about_applet import AboutAppletWindow
import yu... | 28.199357 | 145 | 0.544128 |
91289b4531c068def6b3a0440fa73fa87d7e5b77 | 1,247 | py | Python | olm/occlusion/strategies/unk_replace.py | DFKI-NLP/OLM | ec6d281e77a980e6f8f89ba3be2e8d034031b22c | [
"MIT"
] | 8 | 2020-04-21T10:25:06.000Z | 2022-03-08T18:46:04.000Z | olm/occlusion/strategies/unk_replace.py | DFKI-NLP/OLM | ec6d281e77a980e6f8f89ba3be2e8d034031b22c | [
"MIT"
] | null | null | null | olm/occlusion/strategies/unk_replace.py | DFKI-NLP/OLM | ec6d281e77a980e6f8f89ba3be2e8d034031b22c | [
"MIT"
] | 2 | 2020-04-27T07:49:58.000Z | 2020-08-11T17:56:25.000Z | from typing import List
from overrides import overrides
from olm import InputInstance, OccludedInstance
from olm.occlusion import Strategy, OcclusionStrategy
@Strategy.register("unk_replacement")
class UnkReplacement(OcclusionStrategy):
def __init__(self, unk_token: str,
std: bool = False,
... | 37.787879 | 89 | 0.655974 |
91289cf53c160ff7da5752148686188aeaf3a743 | 2,543 | py | Python | flashbang/extract_tracers.py | zacjohnston/bangpy | 674248695efaa6cabf73525e6fdf600414abec57 | [
"MIT"
] | null | null | null | flashbang/extract_tracers.py | zacjohnston/bangpy | 674248695efaa6cabf73525e6fdf600414abec57 | [
"MIT"
] | null | null | null | flashbang/extract_tracers.py | zacjohnston/bangpy | 674248695efaa6cabf73525e6fdf600414abec57 | [
"MIT"
] | null | null | null | import numpy as np
import xarray as xr
from scipy.interpolate import interp1d
import astropy.units as units
# flashbang
from .tools import printv
g_to_msun = units.g.to(units.M_sun)
def extract_multi_tracers(mass_grid, profiles, params, verbose=True):
"""Iterate over chk profiles and interpolate mass shell trac... | 32.189873 | 90 | 0.631144 |
9128d6db3af66a87317c2ff610d34f7e731b6d6f | 13,015 | py | Python | readthedocs/donate/tests.py | gamearming/readthedocs | 53d0094f657f549326a86b8bd0ccf924c2126941 | [
"MIT"
] | null | null | null | readthedocs/donate/tests.py | gamearming/readthedocs | 53d0094f657f549326a86b8bd0ccf924c2126941 | [
"MIT"
] | null | null | null | readthedocs/donate/tests.py | gamearming/readthedocs | 53d0094f657f549326a86b8bd0ccf924c2126941 | [
"MIT"
] | null | null | null | import json
import mock
from django.test import TestCase
from django.core.urlresolvers import reverse
from django.core.cache import cache
from django.test.client import RequestFactory
from readthedocs.core.middleware import FooterNoSessionMiddleware
from django_dynamic_fixture import get
from .models import Support... | 35.657534 | 97 | 0.580407 |
91290c382a9dcfdb90bb2ccefbb391447ccaa720 | 1,367 | py | Python | LC/126.py | szhu3210/LeetCode_Solutions | 64747eb172c2ecb3c889830246f3282669516e10 | [
"MIT"
] | 2 | 2018-02-24T17:20:02.000Z | 2018-02-24T17:25:43.000Z | LC/126.py | szhu3210/LeetCode_Solutions | 64747eb172c2ecb3c889830246f3282669516e10 | [
"MIT"
] | null | null | null | LC/126.py | szhu3210/LeetCode_Solutions | 64747eb172c2ecb3c889830246f3282669516e10 | [
"MIT"
] | null | null | null | class Solution(object):
def findLadders(self, beginWord, endWord, wordlist):
"""
:type beginWord: str
:type endWord: str
:type wordlist: Set[str]
:rtype: List[List[int]]
"""
# add endWord into list
wordlist.add(endWord)
# create a map of neig... | 32.547619 | 64 | 0.405999 |
91293abf3b3089f46280e6510ccb66581a3f1a2c | 1,326 | py | Python | loops/views.py | whiteisnick/nickpale | 77ad44fa4f2f3b22d0e04419c9625f0fc2dbda02 | [
"MIT"
] | null | null | null | loops/views.py | whiteisnick/nickpale | 77ad44fa4f2f3b22d0e04419c9625f0fc2dbda02 | [
"MIT"
] | 9 | 2018-03-25T18:00:11.000Z | 2022-03-11T23:16:16.000Z | loops/views.py | nickpale/nickpale | 77ad44fa4f2f3b22d0e04419c9625f0fc2dbda02 | [
"MIT"
] | null | null | null | from django.shortcuts import get_object_or_404, render
from django.utils import timezone
from django.views import generic
from .models import Loop
class LoopIndexView(generic.ListView):
template_name = 'loops/index.html'
context_object_name = 'latest_loop_list'
def get_queryset(self):
"""
... | 30.837209 | 94 | 0.66365 |
912965314b137c429b1d543af3ca57b099e1ff17 | 19,613 | py | Python | open-hackathon-server/src/hackathon/azureformation/service.py | akondasif/open-hackathon-bak_01 | d60ad764edf689a95b6ffcc56815338b380801de | [
"MIT"
] | null | null | null | open-hackathon-server/src/hackathon/azureformation/service.py | akondasif/open-hackathon-bak_01 | d60ad764edf689a95b6ffcc56815338b380801de | [
"MIT"
] | null | null | null | open-hackathon-server/src/hackathon/azureformation/service.py | akondasif/open-hackathon-bak_01 | d60ad764edf689a95b6ffcc56815338b380801de | [
"MIT"
] | 1 | 2019-04-03T19:47:22.000Z | 2019-04-03T19:47:22.000Z | # -*- coding: utf-8 -*-
"""
Copyright (c) Microsoft Open Technologies (Shanghai) Co. Ltd. All rights reserved.
The MIT License (MIT)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without res... | 46.697619 | 119 | 0.585173 |
91296603db8cece99aabbda13638763204e01c70 | 1,773 | py | Python | Hackers-vs-Neural-Networks-Game-on/utils/preprocessing.py | Blacklord100/Medium-Hackers-vs-Neural-Networks-Game-on | 771e544b960b60014e8be7adf8ca51c88c86e488 | [
"Apache-2.0"
] | 1 | 2021-03-11T10:44:29.000Z | 2021-03-11T10:44:29.000Z | Hackers-vs-Neural-Networks-Game-on/utils/preprocessing.py | Blacklord100/Medium-Hackers-vs-Neural-Networks-Game-on | 771e544b960b60014e8be7adf8ca51c88c86e488 | [
"Apache-2.0"
] | null | null | null | Hackers-vs-Neural-Networks-Game-on/utils/preprocessing.py | Blacklord100/Medium-Hackers-vs-Neural-Networks-Game-on | 771e544b960b60014e8be7adf8ca51c88c86e488 | [
"Apache-2.0"
] | null | null | null | #########
######### Preprocessing file to adapat all your images to vgg input.
######### This formatting is needed as we will be using the last prediction layer which is a fully connected layer (size matter :D)
#########
from keras.preprocessing.image import load_img,img_to_array
from keras.applications import vgg16
im... | 35.46 | 131 | 0.673435 |
9129a9f3796498f3b1fd9c0cba2d61451fc40b76 | 2,566 | py | Python | ui/layout.py | xieguo/sublime_db | f2a7b0e55e9f0b77b90a9aa2ea4c4f9136db1315 | [
"MIT"
] | 1 | 2019-01-21T17:37:32.000Z | 2019-01-21T17:37:32.000Z | ui/layout.py | xieguo/sublime_db | f2a7b0e55e9f0b77b90a9aa2ea4c4f9136db1315 | [
"MIT"
] | null | null | null | ui/layout.py | xieguo/sublime_db | f2a7b0e55e9f0b77b90a9aa2ea4c4f9136db1315 | [
"MIT"
] | null | null | null | from sublime_db.core.typecheck import (
List,
Optional,
Callable,
TYPE_CHECKING
)
if TYPE_CHECKING: from .component import Component
import sublime
import os
from sublime_db import core
_all_css = ''
def import_css(file: str):
f = open(file, 'r')
global _all_css
_all_css += f.read()
f.close()
class Layou... | 24.912621 | 123 | 0.715511 |
9129e0d2eddeae6e1e45f6e5510525a48fd44f21 | 5,227 | py | Python | src/utils/convert_to_records.py | npujcong/speaker_adaptation_voicenet | 24ae3ff41479e217aafa55e24d77a3e6c1357a60 | [
"Apache-2.0"
] | 66 | 2017-06-10T12:10:19.000Z | 2021-11-23T11:31:07.000Z | src/utils/convert_to_records.py | npujcong/speaker_adaptation_voicenet | 24ae3ff41479e217aafa55e24d77a3e6c1357a60 | [
"Apache-2.0"
] | null | null | null | src/utils/convert_to_records.py | npujcong/speaker_adaptation_voicenet | 24ae3ff41479e217aafa55e24d77a3e6c1357a60 | [
"Apache-2.0"
] | 11 | 2017-07-09T03:20:25.000Z | 2020-11-23T03:13:18.000Z | # Copyright 2016 ASLP@NPU. 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 ag... | 36.552448 | 91 | 0.651617 |
912a11924258e459de42223088778bf0795c60f2 | 81 | py | Python | AzusaBot/Azusa/modules/chat/group/__init__.py | ethpch/AzusaBot_old | 067e4985d4b8d60c98db758f3e103a4f409c9599 | [
"MIT"
] | 2 | 2021-09-23T14:43:00.000Z | 2021-09-26T12:01:07.000Z | AzusaBot/Azusa/modules/chat/group/__init__.py | ethpch/AzusaBot_old | 067e4985d4b8d60c98db758f3e103a4f409c9599 | [
"MIT"
] | null | null | null | AzusaBot/Azusa/modules/chat/group/__init__.py | ethpch/AzusaBot_old | 067e4985d4b8d60c98db758f3e103a4f409c9599 | [
"MIT"
] | null | null | null | from .command import *
__plugin_name__ = '群聊'
__plugin_usage__ = '在群中做出各种互动吧'
| 13.5 | 31 | 0.740741 |
912a22d458d2c7b47580aea7fd6a185949466964 | 2,487 | py | Python | hax/hax/ha/__init__.py | papan-singh/cortx-hare | 4d6a533750dffe0b71c633a3707da79d9883b3dd | [
"Apache-2.0"
] | null | null | null | hax/hax/ha/__init__.py | papan-singh/cortx-hare | 4d6a533750dffe0b71c633a3707da79d9883b3dd | [
"Apache-2.0"
] | null | null | null | hax/hax/ha/__init__.py | papan-singh/cortx-hare | 4d6a533750dffe0b71c633a3707da79d9883b3dd | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021 Seagate Technology LLC and/or its Affiliates
#
# 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 appl... | 35.028169 | 78 | 0.724166 |
912a52e57ca6b9e161e66b811e61cfabc8ec48cc | 73,183 | py | Python | src/weatherservice.py | Vistaus/my-weather-indicator | 32aaa77a14cf2f85edbfb72c45d154e1676abe83 | [
"MIT"
] | null | null | null | src/weatherservice.py | Vistaus/my-weather-indicator | 32aaa77a14cf2f85edbfb72c45d154e1676abe83 | [
"MIT"
] | null | null | null | src/weatherservice.py | Vistaus/my-weather-indicator | 32aaa77a14cf2f85edbfb72c45d154e1676abe83 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# A library for accesssing to gunderground api
#
# Copyright (C) 2012-2014 Lorenzo Carbonell
# lorenzo.carbonell.cerezo@gmail.com
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published ... | 71.888998 | 240 | 0.587923 |
912a555892b83cb9128a5e8b024f72cad0630e9f | 18 | py | Python | src/model_processors/track_utils/__init__.py | patrick-ubc/Huawei_HiFly_Drone | 5dae1b56f49c2b86c3b852bbc5e3a63e84ccd490 | [
"Apache-2.0"
] | 25 | 2020-11-20T09:01:35.000Z | 2022-03-29T10:35:38.000Z | src/model_processors/track_utils/__init__.py | patrick-ubc/Huawei_HiFly_Drone | 5dae1b56f49c2b86c3b852bbc5e3a63e84ccd490 | [
"Apache-2.0"
] | 8 | 2021-07-05T21:41:53.000Z | 2022-02-15T19:46:13.000Z | tests/__init__.py | serbant/simple_netem | e16e556497b91368a2c69afefdf403275c317f9b | [
"Apache-2.0"
] | 16 | 2020-12-06T07:26:13.000Z | 2022-03-01T07:51:55.000Z | """__init__.py"""
| 9 | 17 | 0.555556 |
912a77d26055dd9180c260ae4f906288d7e2b010 | 198 | py | Python | abc/021/B.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | 2 | 2022-01-22T07:56:58.000Z | 2022-01-24T00:29:37.000Z | abc/021/B.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | null | null | null | abc/021/B.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | null | null | null | N = int(input())
a, b = map(int, input().split())
K = int(input())
S = {a, b}
P = list(map(int, input().split()))
for p in P:
S.add(p)
if len(S) == 2 + K:
print("YES")
else:
print("NO")
| 16.5 | 35 | 0.5 |
912a8eb58772b679099917fa048ef74386df33b3 | 2,838 | py | Python | mesh.py | LRussianStand/ljTransparent | e0bd31a1bf3c5ab6056157e8c5233689b1c41d53 | [
"MIT"
] | 3 | 2021-06-08T04:23:13.000Z | 2021-07-13T07:42:20.000Z | mesh.py | LRussianStand/ljTransparent | e0bd31a1bf3c5ab6056157e8c5233689b1c41d53 | [
"MIT"
] | null | null | null | mesh.py | LRussianStand/ljTransparent | e0bd31a1bf3c5ab6056157e8c5233689b1c41d53 | [
"MIT"
] | null | null | null | #-*- coding: utf-8 -*-
#!/usr/bin/env python3
# Copyright 2004-present Facebook. All Rights Reserved.
#隐式表达网络,sdf采样点 转 mesh
import logging
import numpy as np
import plyfile
import skimage.measure
import time
import paddle
def convert_sdf_samples_to_ply(
p3d_sdf_tensor,
voxel_grid_origin,
... | 30.191489 | 96 | 0.646582 |
912aad0e2814842838803c63a7118b7aebf5457a | 1,803 | py | Python | tests/test_utils.py | icon-project/icon-rpc-server | ece07a48cfe987c35a583c81ee5e063c75c90a89 | [
"Apache-2.0"
] | 15 | 2018-08-24T06:00:09.000Z | 2021-07-16T22:12:58.000Z | tests/test_utils.py | icon-project/icon-rpc-server | ece07a48cfe987c35a583c81ee5e063c75c90a89 | [
"Apache-2.0"
] | 28 | 2018-10-16T04:46:00.000Z | 2021-12-15T03:36:31.000Z | tests/test_utils.py | icon-project/icon-rpc-server | ece07a48cfe987c35a583c81ee5e063c75c90a89 | [
"Apache-2.0"
] | 22 | 2018-09-10T05:45:56.000Z | 2022-02-10T03:28:26.000Z | import pytest
from jsonrpcclient.response import Response, SuccessResponse
from mock import MagicMock
from iconrpcserver.dispatcher.v3.icx import IcxDispatcher
from iconrpcserver.dispatcher.validator import validate_jsonschema
from iconrpcserver.utils import json_rpc
@pytest.fixture
def mock_server(monkeypatch):
... | 35.352941 | 115 | 0.677205 |
912abd4af9308e3b6d8562dc82b9df208a62e594 | 121,801 | py | Python | sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/models/_models_py3.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/models/_models_py3.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/edgeorder/azure-mgmt-edgeorder/azure/mgmt/edgeorder/v2020_12_01_preview/models/_models_py3.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.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 ... | 39.240013 | 165 | 0.672425 |
912aed29f4097464b5400f03df7340be617c729a | 28,334 | py | Python | CNCList.py | hdo/bCNC | c0c6489c80265f95b554e6566835874497cf969d | [
"MIT",
"BSD-3-Clause"
] | null | null | null | CNCList.py | hdo/bCNC | c0c6489c80265f95b554e6566835874497cf969d | [
"MIT",
"BSD-3-Clause"
] | null | null | null | CNCList.py | hdo/bCNC | c0c6489c80265f95b554e6566835874497cf969d | [
"MIT",
"BSD-3-Clause"
] | null | null | null | # -*- coding: ascii -*-
# $Id: CNCEditor.py,v 1.9 2014/10/15 15:04:38 bnv Exp $
#
# Author: vvlachoudis@gmail.com
# Date: 24-Aug-2014
from __future__ import print_function
try:
from cStringIO import StringIO
except ImportError:
from io import StringIO
try:
import cPickle as pickle
except ImportError:
import ... | 29.919747 | 98 | 0.546834 |
912b00dcb102ba26d11df1c491412272508bcb6c | 841 | py | Python | emerald/tasks.py | vladcalin/servreg | ea6e4835aa30bb13f272335ef5094e0a02ec511b | [
"MIT"
] | 1 | 2016-12-17T23:25:55.000Z | 2016-12-17T23:25:55.000Z | emerald/tasks.py | vladcalin/servreg | ea6e4835aa30bb13f272335ef5094e0a02ec511b | [
"MIT"
] | 1 | 2016-12-17T11:57:25.000Z | 2016-12-17T11:57:25.000Z | emerald/tasks.py | vladcalin/servreg | ea6e4835aa30bb13f272335ef5094e0a02ec511b | [
"MIT"
] | null | null | null | from emerald.database import Service, Incident
def update_services_status(session_class):
statuses = {
True: "alive",
False: "dead"
}
session = session_class()
for service in session.query(Service).filter():
old_status = service.is_alive
service.update_is_alive()
... | 29 | 103 | 0.608799 |
912b268552f50018e8934d62bcaf51b53febf658 | 3,561 | py | Python | oauth/models.py | WyattPQ/Django-blog | eae42c30bd232442b305f8563c17b8b5ab5cf29e | [
"MIT"
] | 1 | 2019-06-07T10:45:24.000Z | 2019-06-07T10:45:24.000Z | oauth/models.py | WyattPQ/Django-blog | eae42c30bd232442b305f8563c17b8b5ab5cf29e | [
"MIT"
] | null | null | null | oauth/models.py | WyattPQ/Django-blog | eae42c30bd232442b305f8563c17b8b5ab5cf29e | [
"MIT"
] | null | null | null | from django.db import models
from django.conf import settings
from django.utils.timezone import now
from django.core.exceptions import ValidationError
# github 用户信息
'''
{"login": "enjoy-binbin", "id": 22811481, "node_id": "MDQ6VXNlcjIyODExNDgx",
"avatar_url": "https://avatars1.githubusercontent.com/u/22811481?v=4", "... | 45.075949 | 112 | 0.689975 |
912b3100c7c99cb64fdf3efb0aa229b8fd4a529f | 1,198 | py | Python | troncli/constants.py | seancrx/tron-cli | 1507b4c650a1da0785e5515feccca6a9aa375d25 | [
"MIT"
] | null | null | null | troncli/constants.py | seancrx/tron-cli | 1507b4c650a1da0785e5515feccca6a9aa375d25 | [
"MIT"
] | null | null | null | troncli/constants.py | seancrx/tron-cli | 1507b4c650a1da0785e5515feccca6a9aa375d25 | [
"MIT"
] | null | null | null | """Constants"""
JAVA_TRON_RELEASES_URL = 'https://github.com/tronprotocol/java-tron/releases/download/'
JAVA_TRON_LASTEST_VERSION = '4.1.3'
JAVA_TRON_EVENT_NODE_GIT_URL = 'https://github.com/tronprotocol/java-tron.git'
JAVA_TRON_EVENT_NODE_BRANCH_NAME = 'event_parser'
TRON_GRID_GIT_URL = 'https://github.com/tronproto... | 26.622222 | 87 | 0.797162 |
912b3445d2a588701edc2dd89c81ab8a55d791c1 | 2,697 | py | Python | tests/test_model_cache.py | Zozman/mindmeld | d86cc823c9b36dbafc8fc8f8ea04085ca1ffdeb5 | [
"Apache-2.0"
] | 1 | 2022-02-09T13:39:41.000Z | 2022-02-09T13:39:41.000Z | tests/test_model_cache.py | Zozman/mindmeld | d86cc823c9b36dbafc8fc8f8ea04085ca1ffdeb5 | [
"Apache-2.0"
] | null | null | null | tests/test_model_cache.py | Zozman/mindmeld | d86cc823c9b36dbafc8fc8f8ea04085ca1ffdeb5 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_model_cache
----------------------------------
Tests the generated model cache has to correct key value types.
"""
import os
# pylint: disable=locally-disabled,redefined-outer-name
import shutil
from mindmeld.components import NaturalLanguageProcessor
from min... | 31 | 88 | 0.738598 |
912b45903d38ab157bd343b217172ebbf8d48b4d | 2,789 | py | Python | modules/local_k8s_service/tests/test_local_k8s_service.py | run-x/opta | 64606498334f2b1aa79f5a431465eafdf5ca5ed7 | [
"Apache-2.0"
] | 595 | 2021-05-21T22:30:48.000Z | 2022-03-31T15:40:25.000Z | modules/local_k8s_service/tests/test_local_k8s_service.py | run-x/opta | 64606498334f2b1aa79f5a431465eafdf5ca5ed7 | [
"Apache-2.0"
] | 463 | 2021-05-24T21:32:59.000Z | 2022-03-31T17:12:33.000Z | modules/local_k8s_service/tests/test_local_k8s_service.py | run-x/opta | 64606498334f2b1aa79f5a431465eafdf5ca5ed7 | [
"Apache-2.0"
] | 29 | 2021-05-21T22:27:52.000Z | 2022-03-28T16:43:45.000Z | # type: ignore
import os
from pytest_mock import MockFixture
from modules.local_k8s_service.local_k8s_service import LocalK8sServiceProcessor
from opta.layer import Layer
class TestLocalK8sServiceProcessor:
def test_all_good(self, mocker: MockFixture):
layer = Layer.load_from_yaml(
os.path.j... | 50.709091 | 90 | 0.573324 |
912b4c72967b40f2e26c95834d2c1b3a093daece | 12,416 | py | Python | chapter4/yolov4_ascend/train.py | hu-qi/mindspore-21-days-tutorials | a9d3a024a0b17e48ae758de66195923b14f8ea6c | [
"Apache-2.0"
] | null | null | null | chapter4/yolov4_ascend/train.py | hu-qi/mindspore-21-days-tutorials | a9d3a024a0b17e48ae758de66195923b14f8ea6c | [
"Apache-2.0"
] | null | null | null | chapter4/yolov4_ascend/train.py | hu-qi/mindspore-21-days-tutorials | a9d3a024a0b17e48ae758de66195923b14f8ea6c | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Huawei Technologies Co., Ltd
#
# 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... | 43.111111 | 120 | 0.671311 |
912b55975b1e72901af4d7cd3339b12388bed3fa | 2,310 | py | Python | lastcheckpoint.py | leonavery/KSFD | 090e388df13a2674676cbaa53171f2a87291ba9b | [
"MIT"
] | null | null | null | lastcheckpoint.py | leonavery/KSFD | 090e388df13a2674676cbaa53171f2a87291ba9b | [
"MIT"
] | null | null | null | lastcheckpoint.py | leonavery/KSFD | 090e388df13a2674676cbaa53171f2a87291ba9b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
lastcheckpoint is a simple kludge to identify and print out the name
of the last checkpoint TimeSeries produced by a previous run of
ksfdsolver2.py. Typical usage is
export LASTCHECK=`python lastcheckpoint.py checks/checks115/options115e`
The argument (checks/checks115/options115e in t... | 36.09375 | 76 | 0.677922 |
912b601fc8c8ba53901b701cbd76fbce4043c8bc | 5,024 | py | Python | src/login/bklogin/components/license.py | Canway-shiisa/bk-user | a049e80d12082960828015742cea4b041f4af796 | [
"MIT"
] | null | null | null | src/login/bklogin/components/license.py | Canway-shiisa/bk-user | a049e80d12082960828015742cea4b041f4af796 | [
"MIT"
] | null | null | null | src/login/bklogin/components/license.py | Canway-shiisa/bk-user | a049e80d12082960828015742cea4b041f4af796 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS
Community Edition) available.
Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | 39.873016 | 115 | 0.720143 |
912b6dbea0df10f459e166cdffa0db4d6605fc0f | 500 | py | Python | wargame/designpatterns/traditional_orcfighter.py | jeantardelli/wargameRepo | 1e11ae40281f7eafa65ea6e40e045304b20e3824 | [
"MIT"
] | 1 | 2020-12-01T20:30:27.000Z | 2020-12-01T20:30:27.000Z | wargame/designpatterns/traditional_orcfighter.py | jeantardelli/wargameRepo | 1e11ae40281f7eafa65ea6e40e045304b20e3824 | [
"MIT"
] | null | null | null | wargame/designpatterns/traditional_orcfighter.py | jeantardelli/wargameRepo | 1e11ae40281f7eafa65ea6e40e045304b20e3824 | [
"MIT"
] | null | null | null | """traditional_orcfighter
This is one of the different GameUnits that are used in the desing patterns examples.
:copyright: 2020, Jean Tardelli
:license: The MIT license (MIT). See LICENSE file for further details.
"""
from traditional_abstractgameunit import AbstractGameUnit
class OrcFighter(AbstractGameUnit):
... | 31.25 | 85 | 0.742 |
912b85089f2bc04876999125241aa6f9bc26459b | 25 | py | Python | maquinaria/alquileres/views/__init__.py | CFredy9/Maquinaria | 7b55d2e882702b62cdbb11f9684ab54d9b485199 | [
"MIT"
] | null | null | null | maquinaria/alquileres/views/__init__.py | CFredy9/Maquinaria | 7b55d2e882702b62cdbb11f9684ab54d9b485199 | [
"MIT"
] | null | null | null | maquinaria/alquileres/views/__init__.py | CFredy9/Maquinaria | 7b55d2e882702b62cdbb11f9684ab54d9b485199 | [
"MIT"
] | null | null | null | from .alquileres import * | 25 | 25 | 0.8 |
912b8a99b17c85527f160f234e16d3bfc418c025 | 205 | py | Python | tests/test_main.py | rudisimo/ansible-generator | fe24de0c76a31ef10d9cadf9101f16e659982e4b | [
"MIT"
] | 2 | 2017-11-11T04:52:25.000Z | 2017-11-11T18:59:40.000Z | tests/test_main.py | rudisimo/ansible-generator | fe24de0c76a31ef10d9cadf9101f16e659982e4b | [
"MIT"
] | null | null | null | tests/test_main.py | rudisimo/ansible-generator | fe24de0c76a31ef10d9cadf9101f16e659982e4b | [
"MIT"
] | 1 | 2017-11-11T18:46:49.000Z | 2017-11-11T18:46:49.000Z | import unittest
import ansig
class TestMain(unittest.TestCase):
def test_version_semver(self):
self.assertRegexpMatches(
ansig.__version__, r'^(?:(\d+)\.)?(?:(\d+)\.)?(\*|\d+)$')
| 22.777778 | 69 | 0.6 |
912bb56bdd90dc8c408618aaae73b8452aaaed32 | 631 | py | Python | data-structures/sorting/quicksort/test/test.py | andrenbrandao/algorithm-problems | a6413cc7b3810008dd80766ae0d398a7edc58407 | [
"MIT"
] | null | null | null | data-structures/sorting/quicksort/test/test.py | andrenbrandao/algorithm-problems | a6413cc7b3810008dd80766ae0d398a7edc58407 | [
"MIT"
] | null | null | null | data-structures/sorting/quicksort/test/test.py | andrenbrandao/algorithm-problems | a6413cc7b3810008dd80766ae0d398a7edc58407 | [
"MIT"
] | null | null | null | import sys
import os
tests = int(sys.argv[1])
for i in range(tests):
print(f"Test #{str(i)}")
os.system(f"python3 gen.py {str(i)} > input.txt")
os.system(f"python3 ../quicksort-naive.py < input.txt > model.txt")
os.system(f"python3 ../quicksort-randomized.py < input.txt > main.txt")
with open("... | 21.758621 | 75 | 0.562599 |
912bc73fdc2137e334259e77c67cf4a59dd1149f | 849 | py | Python | moderation/__init__.py | EnvSys/django-moderation | afa80926354bdc263d6d9214eb983000334d77e2 | [
"BSD-3-Clause"
] | 97 | 2015-03-21T02:18:39.000Z | 2022-02-22T01:30:19.000Z | moderation/__init__.py | EnvSys/django-moderation | afa80926354bdc263d6d9214eb983000334d77e2 | [
"BSD-3-Clause"
] | 85 | 2015-05-05T05:22:23.000Z | 2022-03-28T10:32:00.000Z | moderation/__init__.py | EnvSys/django-moderation | afa80926354bdc263d6d9214eb983000334d77e2 | [
"BSD-3-Clause"
] | 70 | 2015-04-13T07:29:32.000Z | 2022-03-24T10:54:58.000Z | # -*- coding: utf-8 -*-
__version__ = '0.7.0'
default_app_config = "moderation.apps.ModerationConfig"
class _ModerationProxy:
"""Proxy the ModerationManager()
It must not be created here for Django >= 1.8, because __init__ is invoked
too early, but must be present once a module registers its models.
... | 27.387097 | 78 | 0.698469 |
912be91ddebbb82a00bf0e1231f3ea4d3613c1db | 9,452 | py | Python | salt/modules/rvm.py | epoelke/salt | 80ae64e54f9f336d3cdb6e03e42f2a50469ec8f2 | [
"Apache-2.0"
] | 1 | 2016-12-20T20:11:21.000Z | 2016-12-20T20:11:21.000Z | salt/modules/rvm.py | epoelke/salt | 80ae64e54f9f336d3cdb6e03e42f2a50469ec8f2 | [
"Apache-2.0"
] | null | null | null | salt/modules/rvm.py | epoelke/salt | 80ae64e54f9f336d3cdb6e03e42f2a50469ec8f2 | [
"Apache-2.0"
] | null | null | null | '''
Manage ruby installations and gemsets with RVM, the Ruby Version Manager.
'''
# Import python libs
import re
import os
import logging
log = logging.getLogger(__name__)
# Don't shadow built-in's.
__func_alias__ = {
'list_': 'list'
}
__opts__ = {
'rvm.runas': None,
}
def _get_rvm_location(runas=None):
... | 23.053659 | 89 | 0.584638 |
912bef9c873177cd2a98114e0b3108f83c1e6c34 | 330 | py | Python | src/scorers/result_scorer_f1_binary_factory.py | elangovana/large-scale-ptm-ppi | cc835df915d12dd20c35f9cea5e40365200a6d3d | [
"MIT"
] | 1 | 2022-02-25T22:06:39.000Z | 2022-02-25T22:06:39.000Z | src/scorers/result_scorer_f1_binary_factory.py | elangovana/ppi-aimed | cc835df915d12dd20c35f9cea5e40365200a6d3d | [
"MIT"
] | null | null | null | src/scorers/result_scorer_f1_binary_factory.py | elangovana/ppi-aimed | cc835df915d12dd20c35f9cea5e40365200a6d3d | [
"MIT"
] | null | null | null | from scorers.base_classification_scorer_factory import BaseClassificationScorerFactory
from scorers.result_scorer_f1_binary import ResultScorerF1Binary
class ResultScorerF1BinaryFactory(BaseClassificationScorerFactory):
"""
Factory for F1 results_scorer
"""
def get(self):
return ResultScorerF... | 27.5 | 86 | 0.809091 |
912c0f99e8d839d44936fa5bd0c1013ae9d0a398 | 24,652 | py | Python | ost/s1_core/batch_burst.py | Scartography/OpenSarToolkit | 53c19e1c6c21260e73518eb9106ce7305539a83d | [
"MIT"
] | null | null | null | ost/s1_core/batch_burst.py | Scartography/OpenSarToolkit | 53c19e1c6c21260e73518eb9106ce7305539a83d | [
"MIT"
] | null | null | null | ost/s1_core/batch_burst.py | Scartography/OpenSarToolkit | 53c19e1c6c21260e73518eb9106ce7305539a83d | [
"MIT"
] | null | null | null | import os
from os.path import join as opj
import shutil
import glob
import time
import logging
import datetime
import itertools
from tempfile import TemporaryDirectory
from retry import retry
from godale import Executor
import gdal
from ost.helpers import vector as vec, raster as ras, utils as h
from ost.s1_core imp... | 37.295008 | 82 | 0.480123 |
912c1e3722bbad78e16769b7b5c6c255af1318ff | 534 | py | Python | python/dynamic_programming/0070_climbing_stairs.py | linshaoyong/leetcode | ea052fad68a2fe0cbfa5469398508ec2b776654f | [
"MIT"
] | 6 | 2019-07-15T13:23:57.000Z | 2020-01-22T03:12:01.000Z | python/dynamic_programming/0070_climbing_stairs.py | linshaoyong/leetcode | ea052fad68a2fe0cbfa5469398508ec2b776654f | [
"MIT"
] | null | null | null | python/dynamic_programming/0070_climbing_stairs.py | linshaoyong/leetcode | ea052fad68a2fe0cbfa5469398508ec2b776654f | [
"MIT"
] | 1 | 2019-07-24T02:15:31.000Z | 2019-07-24T02:15:31.000Z | class Solution:
def climbStairs(self, n):
"""
:type n: int
:rtype: int
"""
if n == 1:
return 1
if n == 2:
return 2
a, b = 1, 2
v = 0
for i in range(3, n + 1):
v = a + b
a, b = b, v
return ... | 19.777778 | 33 | 0.43633 |
912c3bf6aa5bcc7a6cbfa2d0a9bebf1d1ac1a37d | 1,641 | py | Python | setup.py | derwentx/Zendesk-Ticket-Viewer | 205c31b55d1823d0013621744d4261016b646ed2 | [
"MIT"
] | null | null | null | setup.py | derwentx/Zendesk-Ticket-Viewer | 205c31b55d1823d0013621744d4261016b646ed2 | [
"MIT"
] | 2 | 2018-10-07T02:01:09.000Z | 2018-10-08T04:57:13.000Z | setup.py | derwentx/Zendesk-Ticket-Viewer | 205c31b55d1823d0013621744d4261016b646ed2 | [
"MIT"
] | null | null | null | """
A setuptools based setup module.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""
from io import open
from os import path
import sys
# Always prefer setuptools over distutils
from setuptools import setup
HERE = path.abspath(path.dirname(__file__))
PKG_NAME ... | 24.492537 | 76 | 0.646557 |
912c3ee00e47edce10e9fd129e38cbafb8d8c938 | 24 | py | Python | next/database_client/PermStore/__init__.py | sumeetsk/NEXT-1 | c42badbcaeb0ab79ab1f74b6303ecc3864b1c7ee | [
"Apache-2.0"
] | null | null | null | next/database_client/PermStore/__init__.py | sumeetsk/NEXT-1 | c42badbcaeb0ab79ab1f74b6303ecc3864b1c7ee | [
"Apache-2.0"
] | null | null | null | next/database_client/PermStore/__init__.py | sumeetsk/NEXT-1 | c42badbcaeb0ab79ab1f74b6303ecc3864b1c7ee | [
"Apache-2.0"
] | 2 | 2017-06-07T16:03:16.000Z | 2021-03-01T08:48:27.000Z | from .PermStore import * | 24 | 24 | 0.791667 |
912c4f531a0e1ba6946cc35a65fac669a5faddd0 | 2,333 | py | Python | src/pactor/nodes_expression.py | kstrempel/pactor | bc12dd6253bec7c08f691697108dcabd2a1c0e00 | [
"MIT"
] | 1 | 2021-03-19T21:36:35.000Z | 2021-03-19T21:36:35.000Z | src/pactor/nodes_expression.py | kstrempel/pactor | bc12dd6253bec7c08f691697108dcabd2a1c0e00 | [
"MIT"
] | null | null | null | src/pactor/nodes_expression.py | kstrempel/pactor | bc12dd6253bec7c08f691697108dcabd2a1c0e00 | [
"MIT"
] | null | null | null | from pactor.vm import VM
from pactor.node_stack_helper import two_pop_value, push, pop_value, pop
from pactor.node_parent import AstNode
class BooleanNode(AstNode):
def __init__(self, value, ctx):
super().__init__(ctx)
self.__value = value
def run(self, vm: VM):
vm.stack.append(self)
def __repr__(s... | 25.358696 | 72 | 0.670381 |
912c5444a0aa5cda6721a138f0034cbf047eb1f9 | 731 | py | Python | joj/horse/utils/version.py | joint-online-judge/horse | ec08ecd0528f6a4fad3fa5f5932aef1495721437 | [
"MIT"
] | 6 | 2020-12-28T07:05:52.000Z | 2022-01-16T04:44:02.000Z | joj/horse/utils/version.py | joint-online-judge/horse | ec08ecd0528f6a4fad3fa5f5932aef1495721437 | [
"MIT"
] | 56 | 2021-02-02T02:21:52.000Z | 2022-03-13T02:39:05.000Z | joj/horse/utils/version.py | joint-online-judge/horse | ec08ecd0528f6a4fad3fa5f5932aef1495721437 | [
"MIT"
] | 3 | 2021-01-28T17:52:58.000Z | 2021-12-17T17:42:42.000Z | from datetime import datetime, timezone
import git
import pbr.version
from loguru import logger
def get_version() -> str:
return str(pbr.version.VersionInfo("joj-horse"))
def get_git_version() -> str:
try:
repo = git.Repo(__file__, search_parent_directories=True)
return (
repo.g... | 26.107143 | 65 | 0.607387 |
912c6746fa6c4719d690294dda5cf49f237f906a | 1,309 | py | Python | monobank_api/signature.py | edicasoft/monobank-api | 111ec0d7b4c8e43e2594a554b8d7e61c0da1f4f5 | [
"MIT"
] | 3 | 2019-12-25T11:23:16.000Z | 2021-07-15T08:28:53.000Z | monobank_api/signature.py | edicasoft/monobank-api | 111ec0d7b4c8e43e2594a554b8d7e61c0da1f4f5 | [
"MIT"
] | null | null | null | monobank_api/signature.py | edicasoft/monobank-api | 111ec0d7b4c8e43e2594a554b8d7e61c0da1f4f5 | [
"MIT"
] | null | null | null | import os
import ecdsa
import base64
import hashlib
import binascii
class SignKey(object):
def __init__(self, private_key):
"""
Initialize a private key.
:param private_key: Private key file path
"""
self._private_key = self._load_private_key(private_key)
self._publ... | 31.166667 | 81 | 0.627196 |
912c89d6cf9ce2cf72513d875d125f09016d9caa | 11,163 | py | Python | smooth/components/component_battery.py | LauWien/smooth | 3d2ee96e3c2b2f9d5d805da1a920748f2dbbd538 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | smooth/components/component_battery.py | LauWien/smooth | 3d2ee96e3c2b2f9d5d805da1a920748f2dbbd538 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | smooth/components/component_battery.py | LauWien/smooth | 3d2ee96e3c2b2f9d5d805da1a920748f2dbbd538 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | """
This module represents a stationary battery.
*****
Scope
*****
Batteries are crucial in effectively integrating high shares of renewable
energy electricity sources in diverse energy systems. They can be particularly
useful for off-grid energy systems, or for the management of grid stability
and flexibility. This f... | 40.740876 | 98 | 0.654663 |
912c8fdf48061d690bb2801ae60bb48557ded788 | 2,261 | py | Python | scielomanager/validator/tests/doubles.py | patymori/scielo-manager | 0945f377376de8ef0ada83c35b4e2312062cdf45 | [
"BSD-2-Clause"
] | 8 | 2015-07-07T03:09:16.000Z | 2019-03-16T04:46:32.000Z | scielomanager/validator/tests/doubles.py | DalavanCloud/scielo-manager | 0945f377376de8ef0ada83c35b4e2312062cdf45 | [
"BSD-2-Clause"
] | 245 | 2015-01-14T13:29:58.000Z | 2022-01-13T00:48:44.000Z | scielomanager/validator/tests/doubles.py | DalavanCloud/scielo-manager | 0945f377376de8ef0ada83c35b4e2312062cdf45 | [
"BSD-2-Clause"
] | 5 | 2016-02-19T15:47:08.000Z | 2019-03-16T04:46:20.000Z | import packtools
# packtools.stylechecker double
class XMLValidatorDouble(object):
@classmethod
def parse(cls, file, dtd=None, no_doctype=False):
pass
def validate_all(self, fail_fast=False):
return True, None
@property
def meta(self):
return {
'article_title... | 26.916667 | 117 | 0.576736 |
912c9cc933f5879dcf0a80013da83c690999e5b5 | 1,291 | py | Python | backend-tests/tests/infra/docker.py | spockfish/mender-integration | 09441e4ec88c837605aa12d70db4faa8f1a16b59 | [
"Apache-2.0"
] | null | null | null | backend-tests/tests/infra/docker.py | spockfish/mender-integration | 09441e4ec88c837605aa12d70db4faa8f1a16b59 | [
"Apache-2.0"
] | null | null | null | backend-tests/tests/infra/docker.py | spockfish/mender-integration | 09441e4ec88c837605aa12d70db4faa8f1a16b59 | [
"Apache-2.0"
] | 1 | 2020-08-18T15:39:46.000Z | 2020-08-18T15:39:46.000Z | # Copyright 2018 Northern.tech AS
#
# 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 a... | 39.121212 | 89 | 0.702556 |
912ca13922ca707e8f11d8fbaeabc29047ac446f | 346 | py | Python | sdscli/cloud/gcp/utils.py | sdskit/sdscli | 9bb96e880c8251d1dce56b901c1289ed80f83ce7 | [
"Apache-2.0"
] | null | null | null | sdscli/cloud/gcp/utils.py | sdskit/sdscli | 9bb96e880c8251d1dce56b901c1289ed80f83ce7 | [
"Apache-2.0"
] | 24 | 2018-03-14T15:37:38.000Z | 2021-11-30T21:59:44.000Z | sdscli/cloud/gcp/utils.py | sdskit/sdscli | 9bb96e880c8251d1dce56b901c1289ed80f83ce7 | [
"Apache-2.0"
] | 13 | 2018-02-22T15:01:35.000Z | 2019-02-07T18:58:57.000Z | from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from sdscli.log_utils import logger
def is_configured():
"""Return if GCP account is configu... | 21.625 | 46 | 0.820809 |
912ca70f0f4294b7b4e64545f4c139ba3fc793be | 5,130 | py | Python | Recognize.py | DefUs3r/DoIKnowYou | 30fc37ff3503c66099cd5f86f0be8e8f254aac69 | [
"MIT"
] | null | null | null | Recognize.py | DefUs3r/DoIKnowYou | 30fc37ff3503c66099cd5f86f0be8e8f254aac69 | [
"MIT"
] | null | null | null | Recognize.py | DefUs3r/DoIKnowYou | 30fc37ff3503c66099cd5f86f0be8e8f254aac69 | [
"MIT"
] | 2 | 2020-11-27T18:32:53.000Z | 2022-01-27T12:04:52.000Z | import cv2
import os
import sys
import argparse as arg
import numpy as np
from face_detect import *
class Recognizer():
def __init__(self,cascadePath,train_file,lbph_var):
self._Face_Cascade = cv2.CascadeClassifier(cascadePath)
self._Recognizer = cv2.face.LBPHFaceRecognizer_create(lbph_var[0],
... | 43.474576 | 106 | 0.559649 |
912cd64a14f76cde66a96c0287c56e24f53af4a8 | 1,812 | py | Python | data/process_data.py | dun-li/figure8-disaster-text-analysis | 9714e83a29b2f60cdc396e97a6afe9b30047e021 | [
"MIT"
] | null | null | null | data/process_data.py | dun-li/figure8-disaster-text-analysis | 9714e83a29b2f60cdc396e97a6afe9b30047e021 | [
"MIT"
] | null | null | null | data/process_data.py | dun-li/figure8-disaster-text-analysis | 9714e83a29b2f60cdc396e97a6afe9b30047e021 | [
"MIT"
] | null | null | null | # import packages
import sys
import pandas as pd
from sqlalchemy import create_engine
def extract_data():
"""
data extraction from csv files
"""
messages = pd.read_csv(messages_filename)
categories = pd.read_csv(categories_filename)
return messages, categories
def transform_data(messages, cat... | 28.3125 | 78 | 0.667219 |
912ce7b7520aade285134dc2e45f49af8ff76aef | 3,802 | py | Python | test/unit/gen_libs/cp_dir.py | deepcoder42/python-lib | 249f456fdd41a6883206fea8e19c9e098cc969e5 | [
"MIT"
] | null | null | null | test/unit/gen_libs/cp_dir.py | deepcoder42/python-lib | 249f456fdd41a6883206fea8e19c9e098cc969e5 | [
"MIT"
] | null | null | null | test/unit/gen_libs/cp_dir.py | deepcoder42/python-lib | 249f456fdd41a6883206fea8e19c9e098cc969e5 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# Classification (U)
"""Program: cp_dir.py
Description: Unit testing of cp_dir in gen_libs.py.
Usage:
test/unit/gen_libs/cp_dir.py
Arguments:
"""
# Libraries and Global Variables
# Standard
import sys
import os
import shutil
if sys.version_info < (2, 7):
import unitte... | 21.122222 | 79 | 0.599684 |
912d1192eb581823a1308767de0bc963bd5aaa72 | 224 | py | Python | test/runtime/frontend_test/keras_test/util.py | gunpowder78/webdnn | c659ea49007f91d178ce422a1eebe289516a71ee | [
"MIT"
] | 1 | 2018-07-26T13:52:21.000Z | 2018-07-26T13:52:21.000Z | test/runtime/frontend_test/keras_test/util.py | gunpowder78/webdnn | c659ea49007f91d178ce422a1eebe289516a71ee | [
"MIT"
] | null | null | null | test/runtime/frontend_test/keras_test/util.py | gunpowder78/webdnn | c659ea49007f91d178ce422a1eebe289516a71ee | [
"MIT"
] | null | null | null | import logging
logging.getLogger("tensorflow").setLevel(logging.WARNING)
# noinspection PyUnresolvedReferences
import keras
# noinspection PyUnresolvedReferences
from webdnn.frontend.keras.converter import KerasConverter
| 22.4 | 58 | 0.857143 |
912d19d0a2540e7d1247690a97165e0542617726 | 10,273 | py | Python | oscar/lib/python2.7/site-packages/coverage/templite.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/coverage/templite.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/coverage/templite.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt
"""A simple Python template renderer, for a nano-subset of Django syntax.
For a detailed discussion of this code, see this chapter from 500 Lines:
http://aos... | 35.181507 | 84 | 0.508323 |
912d1f5e96321b20edc1a7db92286b91ebafacef | 6,668 | py | Python | manage.py | leticiarosemberg/EcoOng | 15c2ec1eabeeb12f3c7491eb22c2663fd10229ed | [
"MIT"
] | 1 | 2022-01-11T20:20:48.000Z | 2022-01-11T20:20:48.000Z | manage.py | leticiarosemberg/EcoOng | 15c2ec1eabeeb12f3c7491eb22c2663fd10229ed | [
"MIT"
] | 1 | 2021-12-16T03:51:01.000Z | 2021-12-16T03:51:01.000Z | manage.py | leticiarosemberg/EcoOng | 15c2ec1eabeeb12f3c7491eb22c2663fd10229ed | [
"MIT"
] | 1 | 2022-02-19T19:11:11.000Z | 2022-02-19T19:11:11.000Z | """manage.py was auto-generated by flaskstarter.
Flaskstarter is an opensource tool that aims to help
developers to start and maintain a flask backend project.
Copyright 2021 Felipe Bastos Nunes
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in complia... | 39.455621 | 207 | 0.666317 |
912d2640c666a4953129c114b875b44160a088b4 | 939 | py | Python | components/amp-utility/python/ucollections.py | ekmixon/AliOS-Things | 00334295af8aa474d818724149726ca93da4645d | [
"Apache-2.0"
] | 4,538 | 2017-10-20T05:19:03.000Z | 2022-03-30T02:29:30.000Z | components/amp-utility/python/ucollections.py | ekmixon/AliOS-Things | 00334295af8aa474d818724149726ca93da4645d | [
"Apache-2.0"
] | 1,088 | 2017-10-21T07:57:22.000Z | 2022-03-31T08:15:49.000Z | components/amp-utility/python/ucollections.py | willianchanlovegithub/AliOS-Things | 637c0802cab667b872d3b97a121e18c66f256eab | [
"Apache-2.0"
] | 1,860 | 2017-10-20T05:22:35.000Z | 2022-03-27T10:54:14.000Z | # * coding: UTF8 *
"""
该模块实现相应CPython模块的子集,主要提供命名元组功能
函数
------------------------------
"""
def namedtuple(name,fields):
"""
用以创建具有特定名称和字段集的命名元组函数。命名元组为元组的子类, 它可以通过数值索引或具有符号字段名的属性访问语法来访问其字段,字段是指定字段名的字符串序列。
使用示例::
from ucollections import namedtuple
MyTuple = namedtuple("MyTupl... | 14.904762 | 85 | 0.474973 |
912d427859c251f2156cf6953192bcfcb665bba6 | 2,189 | py | Python | setup.py | equinor/osdu-cli | 579922556925ea7ad759a6230498378cf724b445 | [
"MIT"
] | 3 | 2021-08-19T05:59:39.000Z | 2021-11-10T08:02:58.000Z | setup.py | equinor/osdu-cli | 579922556925ea7ad759a6230498378cf724b445 | [
"MIT"
] | 2 | 2021-09-13T11:10:15.000Z | 2021-11-25T13:21:54.000Z | setup.py | equinor/osdu-cli | 579922556925ea7ad759a6230498378cf724b445 | [
"MIT"
] | null | null | null | # -----------------------------------------------------------------------------
# Copyright (c) Equinor ASA. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# -----------------------------------------------------------------------------
"""OSDU CLI ... | 34.746032 | 112 | 0.619461 |
912d74ce5f709024c8c37ac0060c9c7f29df914c | 18,636 | py | Python | test/integration/ggrc/__init__.py | farcry4998/ggrc-core | c469039dabb55033c1b379850feb19e8dda2e2a1 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2019-01-04T10:55:14.000Z | 2019-01-04T10:55:14.000Z | test/integration/ggrc/__init__.py | farcry4998/ggrc-core | c469039dabb55033c1b379850feb19e8dda2e2a1 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | test/integration/ggrc/__init__.py | farcry4998/ggrc-core | c469039dabb55033c1b379850feb19e8dda2e2a1 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Copyright (C) 2018 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Base test case for all ggrc integration tests."""
from collections import defaultdict
import contextlib
import json
import logging
import os
import tempfile
import csv
from StringIO import StringIO
from m... | 34.06947 | 79 | 0.658135 |
912d75d08e50620eb6721b9732a783a3fb2ed1c8 | 5,336 | py | Python | coinlendingbot/ExchangeApi.py | m3h7/coinlendingbot | d6d217d46fc6e04caf0d4a963278b9895e6737e9 | [
"MIT"
] | 3 | 2018-07-13T12:42:48.000Z | 2021-03-22T01:15:32.000Z | coinlendingbot/ExchangeApi.py | m3h7/coinlendingbot | d6d217d46fc6e04caf0d4a963278b9895e6737e9 | [
"MIT"
] | 1 | 2018-07-29T14:43:19.000Z | 2022-01-16T13:53:11.000Z | coinlendingbot/ExchangeApi.py | m3h7/coinlendingbot | d6d217d46fc6e04caf0d4a963278b9895e6737e9 | [
"MIT"
] | 3 | 2020-05-05T12:41:37.000Z | 2022-01-21T14:48:17.000Z | """
Exchange API Base class
"""
from abc import ABC, abstractmethod
import calendar
import time
class ExchangeApi(ABC):
def __str__(self):
return self.__class__.__name__.upper()
def __repr__(self):
return self.__str__()
@staticmethod
def create_time_stamp(datestr, formatting="%Y-%m-... | 32.938272 | 102 | 0.602136 |
912d7849d57f9d0c842c155d6ac5d31db26dcf1c | 2,335 | py | Python | remo/base/tests/__init__.py | acidburn0zzz/remo | caa7adc40928d7f83475cf4bd78f8d609967bc87 | [
"BSD-3-Clause"
] | 1 | 2018-04-05T13:29:30.000Z | 2018-04-05T13:29:30.000Z | remo/base/tests/__init__.py | acidburn0zzz/remo | caa7adc40928d7f83475cf4bd78f8d609967bc87 | [
"BSD-3-Clause"
] | 3 | 2021-03-20T05:31:34.000Z | 2021-06-10T23:43:06.000Z | remo/base/tests/__init__.py | Acidburn0zzz/remo | caa7adc40928d7f83475cf4bd78f8d609967bc87 | [
"BSD-3-Clause"
] | null | null | null | from contextlib import contextmanager, nested
from django.http import HttpResponseRedirect
from django.shortcuts import redirect
from django.test import TestCase as BaseTestCase
from django.test.client import Client
from django.test.utils import override_settings
from django_jinja.backend import Template as Jinja_Tem... | 33.84058 | 78 | 0.667666 |
912d9bc436f7d295f8bd28fe89ccc6595c37c77f | 7,193 | py | Python | opta/core/gcp.py | run-x/opta | 64606498334f2b1aa79f5a431465eafdf5ca5ed7 | [
"Apache-2.0"
] | 595 | 2021-05-21T22:30:48.000Z | 2022-03-31T15:40:25.000Z | opta/core/gcp.py | run-x/opta | 64606498334f2b1aa79f5a431465eafdf5ca5ed7 | [
"Apache-2.0"
] | 463 | 2021-05-24T21:32:59.000Z | 2022-03-31T17:12:33.000Z | opta/core/gcp.py | run-x/opta | 64606498334f2b1aa79f5a431465eafdf5ca5ed7 | [
"Apache-2.0"
] | 29 | 2021-05-21T22:27:52.000Z | 2022-03-28T16:43:45.000Z | import os
from typing import TYPE_CHECKING, Dict, List, Optional, Tuple
import google.auth.transport.requests
from google.auth import default
from google.auth.credentials import Credentials
from google.auth.exceptions import DefaultCredentialsError, GoogleAuthError
from google.cloud import storage # type: ignore
from... | 43.071856 | 128 | 0.667872 |
912dac7c3d84f094c2b260b94b4660a3ad2087d4 | 1,482 | py | Python | clif/testing/python/diamond_inheritance_test.py | timgates42/clif | b865c88beff70b31068889926d1184d5ddc0b9eb | [
"Apache-2.0"
] | null | null | null | clif/testing/python/diamond_inheritance_test.py | timgates42/clif | b865c88beff70b31068889926d1184d5ddc0b9eb | [
"Apache-2.0"
] | null | null | null | clif/testing/python/diamond_inheritance_test.py | timgates42/clif | b865c88beff70b31068889926d1184d5ddc0b9eb | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Google 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 law or agreed to in writing,... | 32.933333 | 75 | 0.744939 |
912de4c5811d6c304d138045379621e995347633 | 2,715 | py | Python | gwlfe/MultiUse_Fxns/Discharge/AgQTotal.py | mudkipmaster/gwlf-e | 9e058445537dd32d1916f76c4b73ca64261771cd | [
"Apache-2.0"
] | null | null | null | gwlfe/MultiUse_Fxns/Discharge/AgQTotal.py | mudkipmaster/gwlf-e | 9e058445537dd32d1916f76c4b73ca64261771cd | [
"Apache-2.0"
] | 6 | 2018-07-24T22:46:28.000Z | 2018-07-29T19:13:09.000Z | gwlfe/MultiUse_Fxns/Discharge/AgQTotal.py | mudkipmaster/gwlf-e | 9e058445537dd32d1916f76c4b73ca64261771cd | [
"Apache-2.0"
] | 1 | 2018-07-24T18:22:01.000Z | 2018-07-24T18:22:01.000Z | from numpy import array
from numpy import sum
from numpy import zeros
from gwlfe.Input.LandUse.Ag.AgAreaTotal import AgAreaTotal
# from Timer import time_function
from gwlfe.Input.WaterBudget.Water import Water
from gwlfe.Memoization import memoize
from gwlfe.MultiUse_Fxns.Runoff.Qrun import Qrun, Qrun_f
from gwlfe.Mu... | 46.810345 | 107 | 0.53628 |
912dfab03a630e7a299672c6ccad62c090cbaba6 | 9,228 | py | Python | tests/integration/shipping/test_model_method.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | tests/integration/shipping/test_model_method.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | tests/integration/shipping/test_model_method.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | from decimal import Decimal as D
from django.test import TestCase
from oscar.apps.offer.applicator import Applicator
from oscar.apps.offer.models import Benefit
from oscar.apps.shipping.models import OrderAndItemCharges, WeightBased
from oscar.apps.shipping.repository import Repository
from oscar.core.compat ... | 41.013333 | 84 | 0.679887 |
912e2444d808b0debf7e728f32ceec8e4489d793 | 3,757 | py | Python | 03_OD_matrix_estimation_journal18/GLS_Jul_weekday_MD.py | jingzbu/InverseVITraffic | c0d33d91bdd3c014147d58866c1a2b99fb8a9608 | [
"MIT"
] | null | null | null | 03_OD_matrix_estimation_journal18/GLS_Jul_weekday_MD.py | jingzbu/InverseVITraffic | c0d33d91bdd3c014147d58866c1a2b99fb8a9608 | [
"MIT"
] | null | null | null | 03_OD_matrix_estimation_journal18/GLS_Jul_weekday_MD.py | jingzbu/InverseVITraffic | c0d33d91bdd3c014147d58866c1a2b99fb8a9608 | [
"MIT"
] | null | null | null | from util import *
# implement GLS method to estimate OD demand matrix
def GLS(x, A, L):
"""
x: sample matrix, each column is a link flow vector sample; 24 * K
A: path-link incidence matrix
P: logit route choice probability matrix
L: dimension of xi
----------------
return: xi
---------... | 27.028777 | 110 | 0.581315 |
912e5c456c959e7a17e9d33439aae54e2f2b92d8 | 3,336 | py | Python | alipay/aop/api/domain/AlipayOpenAppAppcontentItemQueryModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/domain/AlipayOpenAppAppcontentItemQueryModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/domain/AlipayOpenAppAppcontentItemQueryModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class AlipayOpenAppAppcontentItemQueryModel(object):
def __init__(self):
self._alipay_app_id = None
self._item_status = None
self._item_title = None
self._page_num = Non... | 28.758621 | 77 | 0.579736 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.