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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2d9269c66a25eaaac8585fb4c5dea9abeada8449 | 9,238 | py | Python | pandaclient/PchainScript.py | PanDAWMS/panda-client | 2e5dc7ad977934fa382c18858aad79f7dadb9f38 | [
"Apache-2.0"
] | 7 | 2016-01-26T21:37:26.000Z | 2020-09-10T07:44:54.000Z | pandaclient/PchainScript.py | PanDAWMS/panda-client | 2e5dc7ad977934fa382c18858aad79f7dadb9f38 | [
"Apache-2.0"
] | 12 | 2017-10-11T09:15:01.000Z | 2021-11-17T00:23:18.000Z | pandaclient/PchainScript.py | PanDAWMS/panda-client | 2e5dc7ad977934fa382c18858aad79f7dadb9f38 | [
"Apache-2.0"
] | 9 | 2017-07-20T08:06:36.000Z | 2021-11-15T04:22:06.000Z | import sys
import re
import os
import shlex
import atexit
from pandaclient.Group_argparse import GroupArgParser
from pandaclient import PLogger
from pandaclient import PandaToolsPkgInfo
from pandaclient import MiscUtils
from pandaclient import Client
from pandaclient import PsubUtils
from pandaclient import PrunScript... | 40.165217 | 121 | 0.617017 |
2d92830d9bf231cf7c12726d8a1e139b75746f50 | 2,868 | py | Python | run_time/src/gae_server/third_party/fonttools/Lib/fontTools/ttLib/tables/_h_e_a_d.py | moyogo/tachyfont | 05c8b3e7357e7a13af37ef81b719a0ff749105a5 | [
"Apache-2.0"
] | null | null | null | run_time/src/gae_server/third_party/fonttools/Lib/fontTools/ttLib/tables/_h_e_a_d.py | moyogo/tachyfont | 05c8b3e7357e7a13af37ef81b719a0ff749105a5 | [
"Apache-2.0"
] | null | null | null | run_time/src/gae_server/third_party/fonttools/Lib/fontTools/ttLib/tables/_h_e_a_d.py | moyogo/tachyfont | 05c8b3e7357e7a13af37ef81b719a0ff749105a5 | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function, division, absolute_import
from fontTools.misc.py23 import *
from fontTools.misc import sstruct
from fontTools.misc.textTools import safeEval, num2binary, binary2num
from fontTools.misc.timeTools import timestampFromString, timestampToString, timestampNow
from . import DefaultTable... | 31.173913 | 89 | 0.667015 |
2d929c71a5508c6cc8a9c90692da9bb5f04a5bfd | 6,380 | py | Python | survae/tests/transforms/bijections/coupling/coupling_splines.py | alisiahkoohi/survae_flows | e1747b05524c7ab540a211ed360ab3e67bc3e96d | [
"MIT"
] | 262 | 2020-07-05T20:57:44.000Z | 2022-03-28T02:24:43.000Z | survae/tests/transforms/bijections/coupling/coupling_splines.py | alisiahkoohi/survae_flows | e1747b05524c7ab540a211ed360ab3e67bc3e96d | [
"MIT"
] | 17 | 2020-08-15T05:43:34.000Z | 2022-01-31T12:24:21.000Z | survae/tests/transforms/bijections/coupling/coupling_splines.py | alisiahkoohi/survae_flows | e1747b05524c7ab540a211ed360ab3e67bc3e96d | [
"MIT"
] | 35 | 2020-08-24T06:55:37.000Z | 2022-02-11T05:17:58.000Z | import numpy as np
import torch
import torch.nn as nn
import torchtestcase
import unittest
from survae.transforms.bijections.coupling import *
from survae.nn.layers import ElementwiseParams, ElementwiseParams2d
from survae.tests.transforms.bijections import BijectionTest
class LinearSplineCouplingBijectionTest(Biject... | 50.23622 | 149 | 0.570846 |
2d92b0c4bc9a8b94381a4f58b1875d0181f3c4f9 | 1,966 | py | Python | antarest/core/interfaces/eventbus.py | AntaresSimulatorTeam/antaREST | d686d2a86a52737c211ae67f3cee591f559909f2 | [
"Apache-2.0"
] | 2 | 2021-11-15T09:26:33.000Z | 2022-02-24T09:53:54.000Z | antarest/core/interfaces/eventbus.py | AntaresSimulatorTeam/antaREST | d686d2a86a52737c211ae67f3cee591f559909f2 | [
"Apache-2.0"
] | 542 | 2021-01-11T13:23:47.000Z | 2022-03-31T15:38:10.000Z | antarest/core/interfaces/eventbus.py | AntaresSimulatorTeam/antaREST | d686d2a86a52737c211ae67f3cee591f559909f2 | [
"Apache-2.0"
] | 1 | 2020-10-01T12:18:15.000Z | 2020-10-01T12:18:15.000Z | from abc import ABC, abstractmethod
from dataclasses import dataclass
from typing import Any, Callable, Optional, List, Awaitable
class EventType:
STUDY_CREATED = "STUDY_CREATED"
STUDY_DELETED = "STUDY_DELETED"
STUDY_EDITED = "STUDY_EDITED"
STUDY_JOB_STARTED = "STUDY_JOB_STARTED"
STUDY_JOB_LOG_UPD... | 25.532468 | 115 | 0.652085 |
2d92bfefce8ab4a80a69f54115e877d89b207abd | 5,391 | py | Python | pydemic/utils/formatting.py | PyDemic/pydemic | 7e748e4bbe5c1f7fb209271af0ff8afb8fbd4fd5 | [
"MIT"
] | 3 | 2020-05-10T23:52:41.000Z | 2021-08-31T14:38:24.000Z | pydemic/utils/formatting.py | PyDemic/pydemic | 7e748e4bbe5c1f7fb209271af0ff8afb8fbd4fd5 | [
"MIT"
] | 1 | 2020-09-27T03:26:51.000Z | 2022-03-30T12:18:08.000Z | pydemic/utils/formatting.py | PyDemic/pydemic | 7e748e4bbe5c1f7fb209271af0ff8afb8fbd4fd5 | [
"MIT"
] | 1 | 2020-10-01T04:07:39.000Z | 2020-10-01T04:07:39.000Z | import re
from functools import singledispatch, lru_cache
from gettext import gettext as _
from itertools import chain
from math import log10
from numbers import Number
from types import MappingProxyType
import numpy as np
from .sequences import rpartition
N_RE = re.compile(r"(-?)(\d+)(\.\d{,2})?\d*")
identity = lam... | 23.748899 | 79 | 0.533296 |
2d92ce286d72cdd2b4eadf65e2274470297dfb89 | 2,431 | py | Python | pyram/rot2/dump_prg_MJ.py | Hoseung/pyRamAn | f9386fa5a9f045f98590039988d3cd50bc488dc2 | [
"MIT"
] | 1 | 2021-11-25T16:11:56.000Z | 2021-11-25T16:11:56.000Z | pyram/rot2/dump_prg_MJ.py | Hoseung/pyRamAn | f9386fa5a9f045f98590039988d3cd50bc488dc2 | [
"MIT"
] | 6 | 2020-02-17T13:44:43.000Z | 2020-06-25T15:35:05.000Z | pyram/rot2/dump_prg_MJ.py | Hoseung/pyRamAn | f9386fa5a9f045f98590039988d3cd50bc488dc2 | [
"MIT"
] | 1 | 2021-11-25T16:11:56.000Z | 2021-11-25T16:11:56.000Z | import pickle
import numpy as np
import tree
import os
from rot2 import refined_tree
def mkdir(dirpath):
if not os.path.isdir(dirpath):
os.mkdir(dirpath)
def fname(fidx, is_gal=False):
if is_gal:
return "all_direct_prgs_"+str(fidx)+"_gal.pickle"
else:
return "all_direct_prgs_"+str(fidx)+"_hal.pickle... | 30.012346 | 100 | 0.519539 |
2d92e68ec10f884bf2f7197deb1a69969aca2a78 | 31,890 | py | Python | sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/operations/_tokens_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-09T08:59:13.000Z | 2022-03-09T08:59:13.000Z | sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/operations/_tokens_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01_preview/operations/_tokens_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-04T06:21:56.000Z | 2022-03-04T06:21:56.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 ... | 43.328804 | 207 | 0.668329 |
2d92e83519f2a1e99f72a8f9ecc77f1d9d70fcd0 | 1,544 | py | Python | recordwhat/records/busy.py | mrakitin/recordwhat | c68b8fca69836bdba0075726e829325f2c8918a8 | [
"BSD-3-Clause"
] | 1 | 2016-06-08T15:14:15.000Z | 2016-06-08T15:14:15.000Z | recordwhat/records/busy.py | mrakitin/recordwhat | c68b8fca69836bdba0075726e829325f2c8918a8 | [
"BSD-3-Clause"
] | 12 | 2016-02-11T15:01:05.000Z | 2019-09-23T17:28:32.000Z | recordwhat/records/busy.py | mrakitin/recordwhat | c68b8fca69836bdba0075726e829325f2c8918a8 | [
"BSD-3-Clause"
] | 4 | 2016-06-08T15:03:07.000Z | 2019-09-23T17:05:38.000Z | from ophyd import (EpicsSignal, EpicsSignalRO)
from .. import (RecordBase, _register_record_type,
FieldComponent as Cpt)
@_register_record_type('busy')
class BusyRecord(RecordBase):
alarm_status = Cpt(EpicsSignalRO, '.STAT')
last_value_alarmed = Cpt(EpicsSignalRO, '.LALM')
last_value_moni... | 37.658537 | 66 | 0.69171 |
2d93159d6241ce9ec898f5d818dfcbab987ebeba | 288 | py | Python | oscar/lib/python2.7/site-packages/phonenumbers/data/alt_format_34.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/phonenumbers/data/alt_format_34.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/phonenumbers/data/alt_format_34.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | """Auto-generated file, do not edit by hand. 34 metadata"""
from ..phonemetadata import NumberFormat
PHONE_ALT_FORMAT_34 = [NumberFormat(pattern='([5-9]\\d{2})(\\d{3})(\\d{3})', format='\\1 \\2 \\3'), NumberFormat(pattern='(9\\d)(\\d{3})(\\d{2})(\\d{2})', format='\\1 \\2 \\3 \\4')]
| 57.6 | 182 | 0.586806 |
2d9324427f1f7231739e857c0d33f83ca7da8629 | 53,894 | py | Python | qcodes/instrument_drivers/tektronix/AWG70000A.py | WilliamHPNielsen/Qcodes | 0d51cb3f8de87b792f86eb8ae7a8d752295062ef | [
"MIT"
] | null | null | null | qcodes/instrument_drivers/tektronix/AWG70000A.py | WilliamHPNielsen/Qcodes | 0d51cb3f8de87b792f86eb8ae7a8d752295062ef | [
"MIT"
] | 2 | 2017-04-24T07:57:50.000Z | 2018-12-11T11:30:46.000Z | qcodes/instrument_drivers/tektronix/AWG70000A.py | WilliamHPNielsen/Qcodes | 0d51cb3f8de87b792f86eb8ae7a8d752295062ef | [
"MIT"
] | null | null | null | import datetime as dt
import time
import struct
import io
import zipfile as zf
import logging
from functools import partial
from typing import List, Sequence, Dict, Union, Optional
import time
import xml.etree.ElementTree as ET
import numpy as np
from qcodes import Instrument, VisaInstrument, validators as vals
from ... | 39.51173 | 87 | 0.51644 |
2d933a4feafc6f6d9701043a05a83a69d17f6c7c | 1,107 | py | Python | g2ppy/phonetisaurus/foo.py | ishine/g2ps | 49083b0ca8a49d094dcbb2c57a0869e05ab320f2 | [
"MIT"
] | 72 | 2018-09-04T07:48:54.000Z | 2022-03-09T16:07:16.000Z | g2ppy/phonetisaurus/foo.py | shenyileirob/g2ps | 49083b0ca8a49d094dcbb2c57a0869e05ab320f2 | [
"MIT"
] | null | null | null | g2ppy/phonetisaurus/foo.py | shenyileirob/g2ps | 49083b0ca8a49d094dcbb2c57a0869e05ab320f2 | [
"MIT"
] | 14 | 2019-09-06T22:59:18.000Z | 2022-03-09T14:02:50.000Z | #/usr/bin/python3
'''train_g2ps.py workdir
For each dictionary in workdir/train, train a G2P using phonetisaurus, put it in workdir/models.
If dev/dictionary also exists, then use it to calculate phone error rate.
'''
import os,sys,re,itertools
if __name__=="__main__":
if len(sys.argv)<2:
print(__do... | 38.172414 | 112 | 0.67299 |
2d9362a5cc43affb6de91bbc285c52ebe9a957be | 58 | py | Python | hollywood/__init__.py | grilo/hollywood | 0478d334b47712914afd3a6858e621bb917071ee | [
"MIT"
] | 1 | 2018-06-29T16:35:26.000Z | 2018-06-29T16:35:26.000Z | hollywood/__init__.py | grilo/hollywood | 0478d334b47712914afd3a6858e621bb917071ee | [
"MIT"
] | 2 | 2018-06-20T09:59:30.000Z | 2018-06-20T10:00:28.000Z | hollywood/__init__.py | grilo/hollywood | 0478d334b47712914afd3a6858e621bb917071ee | [
"MIT"
] | 1 | 2018-06-20T08:55:02.000Z | 2018-06-20T08:55:02.000Z | from hollywood.system import System
__all__ = ['System']
| 14.5 | 35 | 0.758621 |
2d9397a086fa0885f33164333086bbdb809dd468 | 652 | py | Python | func_tests/pages/createdatasenderquestionnairepage/create_data_sender_questionnaire_page.py | ICT4H/dcs-web | fb0f53fad4401cfac1c1789ff28b9d5bda40c975 | [
"Apache-2.0"
] | 1 | 2015-11-02T09:11:12.000Z | 2015-11-02T09:11:12.000Z | func_tests/pages/createdatasenderquestionnairepage/create_data_sender_questionnaire_page.py | ICT4H/dcs-web | fb0f53fad4401cfac1c1789ff28b9d5bda40c975 | [
"Apache-2.0"
] | null | null | null | func_tests/pages/createdatasenderquestionnairepage/create_data_sender_questionnaire_page.py | ICT4H/dcs-web | fb0f53fad4401cfac1c1789ff28b9d5bda40c975 | [
"Apache-2.0"
] | null | null | null | # vim: ai ts=4 sts=4 et sw=4 encoding=utf-8
from framework.utils.global_constant import WAIT_FOR_TITLE
from pages.page import Page
from pages.createdatasenderquestionnairepage.create_data_sender_questionnaire_locator import *
class CreateDataSenderQuestionnairePage(Page):
def __init__(self, driver):
Page.... | 32.6 | 94 | 0.740798 |
2d93b2f20c69f4afbfb23caf05740246da357299 | 3,550 | py | Python | predict.py | scott-trinkle/nuclei-finder | d0be6e85ac22a11a3aef4e0a4263ae262f7d5683 | [
"MIT"
] | null | null | null | predict.py | scott-trinkle/nuclei-finder | d0be6e85ac22a11a3aef4e0a4263ae262f7d5683 | [
"MIT"
] | 1 | 2021-12-01T06:18:51.000Z | 2021-12-01T17:23:42.000Z | predict.py | scott-trinkle/nuclei-finder | d0be6e85ac22a11a3aef4e0a4263ae262f7d5683 | [
"MIT"
] | null | null | null | import tensorflow as tf
import numpy as np
from skimage.color import gray2rgb
from model import get_model
from scipy.ndimage import binary_fill_holes
def img_to_tiles(img, tgt_shape):
'''Takes an RGB or RGBA ndarray image (img) and returns a list of
overlappingtiles of shape=tgt_shape'''
tgt_h, tgt_w, tg... | 29.338843 | 78 | 0.548169 |
2d93be8e93973e36768dbbc950e5c5faafc35d5c | 656 | py | Python | backend/base/urls.py | pSN0W/notes-generator | 7dac8e37ad1cc4b9b4b6df45253f917c25c42f0a | [
"MIT"
] | 1 | 2021-12-11T14:23:05.000Z | 2021-12-11T14:23:05.000Z | backend/base/urls.py | pSN0W/notes-generator | 7dac8e37ad1cc4b9b4b6df45253f917c25c42f0a | [
"MIT"
] | null | null | null | backend/base/urls.py | pSN0W/notes-generator | 7dac8e37ad1cc4b9b4b6df45253f917c25c42f0a | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
urlpatterns = [
path('',views.get_routes,name="routes"),
path('login/', views.MyTokenObtainPairView.as_view(),name='token_obtain_pair'),
path('notes/',views.get_notes,name="notes"),
path('notes/create',views.create_notes,name="notes-create"),
path('n... | 46.857143 | 83 | 0.71189 |
2d93cc9b99e5086f2de6ab097023d2204a7a45c5 | 8,698 | py | Python | submit_nik.py | NikolasGialitsis/GraphINVENT | 3bbaf5f1ca8be93b5cc4d105f353b8c818959a03 | [
"MIT"
] | null | null | null | submit_nik.py | NikolasGialitsis/GraphINVENT | 3bbaf5f1ca8be93b5cc4d105f353b8c818959a03 | [
"MIT"
] | null | null | null | submit_nik.py | NikolasGialitsis/GraphINVENT | 3bbaf5f1ca8be93b5cc4d105f353b8c818959a03 | [
"MIT"
] | null | null | null | # load general packages and functions
import csv
import os
import subprocess
import time
# example submission script
# define what you want to do for the specified job(s)
dataset = "Toxic"
job_type = "generate" # "preprocess", "train", "generate", or "test"
jobdir_start_idx = 0 # where to start indexing j... | 38.149123 | 230 | 0.611405 |
2d93ed06a141254df0d4d939abe7a131c3b914ec | 17,335 | py | Python | src/jdk.internal.vm.compiler/.mx.graal/mx_graal_9.py | siweilxy/openjdkstudy | 8597674ec1d6809faf55cbee1f45f4e9149d670d | [
"Apache-2.0"
] | 2 | 2018-06-19T05:43:32.000Z | 2018-06-23T10:04:56.000Z | src/jdk.internal.vm.compiler/.mx.graal/mx_graal_9.py | siweilxy/openjdkstudy | 8597674ec1d6809faf55cbee1f45f4e9149d670d | [
"Apache-2.0"
] | null | null | null | src/jdk.internal.vm.compiler/.mx.graal/mx_graal_9.py | siweilxy/openjdkstudy | 8597674ec1d6809faf55cbee1f45f4e9149d670d | [
"Apache-2.0"
] | null | null | null | #
# ----------------------------------------------------------------------------------------------------
#
# Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify ... | 39.668192 | 241 | 0.650764 |
2d93f98045f05dd543ecca158c26a512ca9532f8 | 957 | py | Python | algorithms/1700-1799/1730. Shortest Path to Get Food.py | USTCLink/LeetcodeSolutions | ec64fea0d6cb3c56ad3d7268982be8701786700b | [
"MIT"
] | 3 | 2020-10-28T20:14:30.000Z | 2020-11-03T01:27:04.000Z | algorithms/1700-1799/1730. Shortest Path to Get Food.py | USTCLink/LeetcodeSolutions | ec64fea0d6cb3c56ad3d7268982be8701786700b | [
"MIT"
] | null | null | null | algorithms/1700-1799/1730. Shortest Path to Get Food.py | USTCLink/LeetcodeSolutions | ec64fea0d6cb3c56ad3d7268982be8701786700b | [
"MIT"
] | null | null | null | class Solution:
def getFood(self, grid: List[List[str]]) -> int:
if not grid or not grid[0]:
return -1
n, m = len(grid), len(grid[0])
for i in range(n):
for j in range(m):
if grid[i][j] == "*":
x, y = i, j
queue = collection... | 34.178571 | 62 | 0.347962 |
2d941b300b70d8c001a379d35a245cdcf8cec2e2 | 795 | py | Python | src/Solution940.py | ArkiWang/LeetcodePy | 6b4af8da843910823f7f53989bbda4ec8e6dad15 | [
"MIT"
] | null | null | null | src/Solution940.py | ArkiWang/LeetcodePy | 6b4af8da843910823f7f53989bbda4ec8e6dad15 | [
"MIT"
] | null | null | null | src/Solution940.py | ArkiWang/LeetcodePy | 6b4af8da843910823f7f53989bbda4ec8e6dad15 | [
"MIT"
] | null | null | null | class Solution:
def distinctSubseqII(self, S: str) -> int:
dp = [0] * (len(S)+1)
dp[0] = 1
last = {}
for i in range(len(S)):
dp[i+1] = 2*dp[i]
if S[i] in last:
dp[i+1] -= dp[last[S[i]]]
last[S[i]] = i
print(dp)
retu... | 22.714286 | 46 | 0.442767 |
2d942af597c180576ebe65e26ad39923754092f3 | 15,174 | py | Python | tensorflow/python/grappler/datasets_test.py | tianyapiaozi/tensorflow | fb3ce0467766a8e91f1da0ad7ada7c24fde7a73a | [
"Apache-2.0"
] | 71 | 2017-05-25T16:02:15.000Z | 2021-06-09T16:08:08.000Z | tensorflow/python/grappler/datasets_test.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 133 | 2017-04-26T16:49:49.000Z | 2019-10-15T11:39:26.000Z | tensorflow/python/grappler/datasets_test.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 31 | 2018-09-11T02:17:17.000Z | 2021-12-15T10:33:35.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 33.870536 | 80 | 0.633584 |
2d943fa26612606b0dc7031fb47df70abf214b0d | 5,800 | py | Python | spyder/plugins/editor/utils/debugger.py | Nicztin/spyder | 1c7b2232d2abbf1e101a1e2ab0552b32e8472bd6 | [
"MIT"
] | 1 | 2019-09-25T15:08:24.000Z | 2019-09-25T15:08:24.000Z | spyder/plugins/editor/utils/debugger.py | jorgeps86/spyder | 1c7b2232d2abbf1e101a1e2ab0552b32e8472bd6 | [
"MIT"
] | null | null | null | spyder/plugins/editor/utils/debugger.py | jorgeps86/spyder | 1c7b2232d2abbf1e101a1e2ab0552b32e8472bd6 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""
Contains the text debugger manager.
"""
import os.path as osp
from qtpy.QtWidgets import QInputDialog, QLineEdit
from spyder.config.manager import CONF
from spy... | 34.939759 | 77 | 0.621897 |
2d944c632823c2fcb4006386205f213066a01369 | 1,449 | py | Python | tests/mdts/lib/topology_manager.py | duarten/midonet | c7a5aa352a8038bdc6a463c68abc47bb411a1e7c | [
"Apache-2.0"
] | 1 | 2015-05-19T08:36:55.000Z | 2015-05-19T08:36:55.000Z | tests/mdts/lib/topology_manager.py | duarten/midonet | c7a5aa352a8038bdc6a463c68abc47bb411a1e7c | [
"Apache-2.0"
] | null | null | null | tests/mdts/lib/topology_manager.py | duarten/midonet | c7a5aa352a8038bdc6a463c68abc47bb411a1e7c | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 Midokura SARL
#
# 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.931818 | 74 | 0.672878 |
2d94927b148eeb43aa59366956fa50f65e0c3451 | 527 | py | Python | api_pets/application.py | RobertoRosa7/python | 449f3908a38814ec7ec3b3ce1051b8abe70069d2 | [
"MIT"
] | null | null | null | api_pets/application.py | RobertoRosa7/python | 449f3908a38814ec7ec3b3ce1051b8abe70069d2 | [
"MIT"
] | 2 | 2020-07-19T15:36:35.000Z | 2022-02-02T20:30:16.000Z | api_pets/application.py | RobertoRosa7/python | 449f3908a38814ec7ec3b3ce1051b8abe70069d2 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from flask import Flask
from flask_mongoengine import MongoEngine
db = MongoEngine()
def create_app(**config_overrides):
app = Flask(__name__)
# loading config
app.config.from_pyfile('settings.py')
# apply overrides for test
app.config.update(config_overrides)
# set db
db.init... | 18.821429 | 41 | 0.741935 |
2d9497450e098f90823fd4dae8dc800798ef2803 | 1,242 | py | Python | benchmarks/returns_benchmark.py | cnheider/warg | 4bcc5d3e86dd843773ca6cbca21bcab3b8ae84eb | [
"Apache-2.0"
] | 1 | 2019-03-16T10:05:51.000Z | 2019-03-16T10:05:51.000Z | benchmarks/returns_benchmark.py | aivclab/warg | 4bcc5d3e86dd843773ca6cbca21bcab3b8ae84eb | [
"Apache-2.0"
] | 49 | 2019-04-02T12:06:10.000Z | 2019-08-31T14:30:12.000Z | benchmarks/returns_benchmark.py | cnHeider/warg | 4bcc5d3e86dd843773ca6cbca21bcab3b8ae84eb | [
"Apache-2.0"
] | 1 | 2019-03-16T13:56:03.000Z | 2019-03-16T13:56:03.000Z | from collections import namedtuple
import sorcery
from benchmarks.benchmark_func import benchmark_func
from warg.data_structures.named_ordered_dictionary import NOD
def returns_benchmark():
""" """
a = 1
b = 2
c = 3
RandomABC = namedtuple("RandomABC", ("a", "b", "c"))
def implicit_return():... | 19.40625 | 61 | 0.520934 |
2d94d546dbcaf87067c3dcc6354e46e1808e04b9 | 1,287 | py | Python | server/resources/helpers/execution.py | simon-dube/CARMIN-server | 1481d2c4231458d33119c57ab2e3e480375da63b | [
"MIT"
] | 1 | 2018-03-12T23:08:12.000Z | 2018-03-12T23:08:12.000Z | server/resources/helpers/execution.py | simon-dube/CARMIN-server | 1481d2c4231458d33119c57ab2e3e480375da63b | [
"MIT"
] | 15 | 2018-03-15T04:23:31.000Z | 2018-06-28T21:46:15.000Z | server/resources/helpers/execution.py | simon-dube/CARMIN-server | 1481d2c4231458d33119c57ab2e3e480375da63b | [
"MIT"
] | null | null | null | import os
from pathlib import PurePath
from server import app
from server.resources.helpers.pathnames import EXECUTIONS_DIRNAME
def extract_execution_identifier_from_path(
absolute_path_to_resource: str) -> str:
rel_path = PurePath(
os.path.relpath(absolute_path_to_resource,
... | 33.868421 | 79 | 0.676768 |
2d94e570a5fb66ee4ea2b0b645009575fe90c529 | 4,419 | py | Python | pyroute/compress/compress.py | ftrimble/route-grower | d4343ecc9b13a3e1701c8460c8a1792d08b74567 | [
"Apache-2.0"
] | null | null | null | pyroute/compress/compress.py | ftrimble/route-grower | d4343ecc9b13a3e1701c8460c8a1792d08b74567 | [
"Apache-2.0"
] | null | null | null | pyroute/compress/compress.py | ftrimble/route-grower | d4343ecc9b13a3e1701c8460c8a1792d08b74567 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#----------------------------------------------------------------
#
#------------------------------------------------------
# Usage:
#
#------------------------------------------------------
# Copyright 2007, Oliver White
#
# This program is free software: you can redistribute it and/or modify
# it un... | 31.340426 | 218 | 0.56687 |
2d94fdb66dcc3a0c777104d16279c331a4a5f7b1 | 12,976 | py | Python | reinforce.py | mbp28/dpp_nets | 86859b7612433cc6349b427b47c54986224e702a | [
"MIT"
] | 1 | 2021-06-05T11:14:13.000Z | 2021-06-05T11:14:13.000Z | reinforce.py | mbp28/dpp_nets | 86859b7612433cc6349b427b47c54986224e702a | [
"MIT"
] | null | null | null | reinforce.py | mbp28/dpp_nets | 86859b7612433cc6349b427b47c54986224e702a | [
"MIT"
] | null | null | null | import argparse
import os
import shutil
import nltk
from collections import defaultdict
from tqdm import tqdm
import gc
import torch
import torch.nn as nn
from torch.autograd import Variable
from torch.utils.data.dataloader import DataLoader
from dpp_nets.utils.language import Vocabulary, BeerDataset, simple_collate,... | 39.926154 | 270 | 0.622996 |
2d95072d9ad2dd146b88e2d4fbae4043a9c107f1 | 7,196 | py | Python | neutron/tests/tempest/api/test_metering_extensions.py | kklimonda/neutron | ccdddad358a4bf802d59b3fbbfe88a1e9881c96c | [
"Apache-2.0"
] | 4 | 2018-08-05T00:43:03.000Z | 2021-10-13T00:45:45.000Z | neutron/tests/tempest/api/test_metering_extensions.py | kklimonda/neutron | ccdddad358a4bf802d59b3fbbfe88a1e9881c96c | [
"Apache-2.0"
] | 8 | 2018-06-14T14:50:16.000Z | 2018-11-13T16:30:42.000Z | neutron/tests/tempest/api/test_metering_extensions.py | kklimonda/neutron | ccdddad358a4bf802d59b3fbbfe88a1e9881c96c | [
"Apache-2.0"
] | 7 | 2018-06-12T18:57:04.000Z | 2019-05-09T15:42:30.000Z | # Copyright (C) 2014 eNovance SAS <licensing@enovance.com>
#
# 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 applicabl... | 46.425806 | 79 | 0.683852 |
2d95427f55be1e61a2c53c6fe1666ffeeade4618 | 4,410 | py | Python | gaffer/pm/main.py | mikiec84/gaffer | 8c5d5b5e2ff3fcb1f7cc7c8fbfc623f97dd0da8d | [
"MIT",
"Unlicense"
] | null | null | null | gaffer/pm/main.py | mikiec84/gaffer | 8c5d5b5e2ff3fcb1f7cc7c8fbfc623f97dd0da8d | [
"MIT",
"Unlicense"
] | null | null | null | gaffer/pm/main.py | mikiec84/gaffer | 8c5d5b5e2ff3fcb1f7cc7c8fbfc623f97dd0da8d | [
"MIT",
"Unlicense"
] | 1 | 2018-10-28T00:59:17.000Z | 2018-10-28T00:59:17.000Z | # -*- coding: utf-8 -
#
# This file is part of gaffer. See the NOTICE for more information.
import argparse
import os
import sys
from .. import __version__
from ..procfile import Procfile
from .commands import get_commands
COMMANDS = [
('start', 'start [name]', 'start a process'),
('run', 'run <cmd>', 'run o... | 31.056338 | 72 | 0.552381 |
2d956779249b95c8418ee4239e80b16a30a4bc70 | 2,457 | py | Python | jina/parsers/hub/build.py | HarshCasper/jina | 81ab098b140b74ad1cfdfde9218cec7a40923749 | [
"Apache-2.0"
] | 1 | 2021-02-25T19:28:50.000Z | 2021-02-25T19:28:50.000Z | jina/parsers/hub/build.py | HarshCasper/jina | 81ab098b140b74ad1cfdfde9218cec7a40923749 | [
"Apache-2.0"
] | 1 | 2021-02-27T05:56:45.000Z | 2021-02-27T05:57:03.000Z | jina/parsers/hub/build.py | deepampatel/jina | 97f9e97a4a678a28bdeacbc7346eaf7bbd2aeb89 | [
"Apache-2.0"
] | null | null | null | from ..helper import add_arg_group
from ...enums import BuildTestLevel
def mixin_hub_build_parser(parser):
gp = add_arg_group(parser, title='Build')
gp.add_argument('path', type=str, help='path to the directory containing '
'Dockerfile, manifest.yml, README.md '
... | 70.2 | 116 | 0.612536 |
2d9583081c014d5803058b8c7ae21dae744cb143 | 760 | py | Python | tests/integration/test_client.py | krisek/karapace | 27c84fa7ebbd85228010d3a7e8a223e57b7ab96c | [
"Apache-2.0"
] | null | null | null | tests/integration/test_client.py | krisek/karapace | 27c84fa7ebbd85228010d3a7e8a223e57b7ab96c | [
"Apache-2.0"
] | null | null | null | tests/integration/test_client.py | krisek/karapace | 27c84fa7ebbd85228010d3a7e8a223e57b7ab96c | [
"Apache-2.0"
] | null | null | null | from karapace.schema_reader import SchemaType, TypedSchema
from karapace.serialization import SchemaRegistryClient
from tests.utils import schema_avro_json
async def test_remote_client(registry_async_client):
schema_avro = TypedSchema.parse(SchemaType.AVRO, schema_avro_json)
reg_cli = SchemaRegistryClient()
... | 44.705882 | 114 | 0.788158 |
2d95c28bd7478245354562fee850fb4a48db7ca8 | 389 | py | Python | oscar/lib/python2.7/site-packages/txclib/exceptions.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/txclib/exceptions.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/txclib/exceptions.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Exception classes for the tx client.
"""
class UnInitializedError(Exception):
"""The project directory has not been initialized."""
class UnknownCommandError(Exception):
"""The provided command is not supported."""
# HTTP exceptions
class HttpNotFound(Excep... | 15.56 | 58 | 0.658098 |
2d95da576ffa3e5ba8cd1c48de54819ea07618c4 | 22,933 | py | Python | deconz-tool/deconzapi.py | JasperAlgra/ha-scripts | f6bbd6d1298954d9b6f463e3513cc59a5a664eb8 | [
"Apache-2.0"
] | null | null | null | deconz-tool/deconzapi.py | JasperAlgra/ha-scripts | f6bbd6d1298954d9b6f463e3513cc59a5a664eb8 | [
"Apache-2.0"
] | null | null | null | deconz-tool/deconzapi.py | JasperAlgra/ha-scripts | f6bbd6d1298954d9b6f463e3513cc59a5a664eb8 | [
"Apache-2.0"
] | null | null | null | """Python wrapper for DeCONZ API, to easily rename devices."""
"""
The DeCONZ data structure is flawed, it stores everything under lights and sensors.
Power sockets are partially in lights and sensors (confusing).
"""
import datetime
import json
import logging
import requests
import dateutil
from dateutil.parser im... | 37.228896 | 123 | 0.514019 |
2d95e1970be2ac5b32f46c411543f6fcdfcff2c4 | 4,424 | py | Python | base_config.py | bobenxia/Centripetal-SGD | e33350464504085a641a2a969d3c06e3d5cc4765 | [
"Apache-2.0"
] | 35 | 2019-10-08T15:14:33.000Z | 2021-12-15T08:28:39.000Z | base_config.py | bobenxia/Centripetal-SGD | e33350464504085a641a2a969d3c06e3d5cc4765 | [
"Apache-2.0"
] | 7 | 2019-10-16T12:44:21.000Z | 2021-08-17T09:09:06.000Z | base_config.py | bobenxia/Centripetal-SGD | e33350464504085a641a2a969d3c06e3d5cc4765 | [
"Apache-2.0"
] | 11 | 2019-09-29T01:14:29.000Z | 2022-02-14T09:46:19.000Z | from collections import namedtuple
from model_map import get_dataset_name_by_model_name
import numpy as np
BaseConfigByEpoch = namedtuple('BaseConfigByEpoch', ['network_type', 'dataset_name', 'dataset_subset', 'global_batch_size', 'num_node', 'device',
'weight_decay', 'weight_dec... | 76.275862 | 198 | 0.625 |
2d95f1b39efde8bf3b3674acfcf24d1fb736a711 | 1,218 | py | Python | setup.py | wmonteiro92/xmoai-examples | 0286d57e15cb60693f57cdff386cbb246787442b | [
"MIT"
] | 1 | 2021-03-22T11:31:00.000Z | 2021-03-22T11:31:00.000Z | setup.py | wmonteiro92/xmoai-examples | 0286d57e15cb60693f57cdff386cbb246787442b | [
"MIT"
] | null | null | null | setup.py | wmonteiro92/xmoai-examples | 0286d57e15cb60693f57cdff386cbb246787442b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Jul 11 14:18:52 2020
@author: wellington
"""
import setuptools
from pymoo import __version__
__name__ = 'xmoai-examples'
__author__ = 'Wellington R Monteiro'
__url__ = 'https://github.com/wmonteiro92/xmoai-examples'
with open("README.md", "r") as fh... | 28.325581 | 99 | 0.623974 |
2d95f7e19d8267ce551764e9ed4662b438883bff | 9,506 | py | Python | vmoe/checkpoints/periodic_actions.py | google-research/vmoe | 38a1e4f75c3eb268b974f8860497ec9f17b46504 | [
"Apache-2.0"
] | 205 | 2021-11-10T12:04:30.000Z | 2022-03-30T08:26:18.000Z | vmoe/checkpoints/periodic_actions.py | google-research/vmoe | 38a1e4f75c3eb268b974f8860497ec9f17b46504 | [
"Apache-2.0"
] | 3 | 2022-01-18T08:13:17.000Z | 2022-01-25T05:46:11.000Z | vmoe/checkpoints/periodic_actions.py | google-research/vmoe | 38a1e4f75c3eb268b974f8860497ec9f17b46504 | [
"Apache-2.0"
] | 27 | 2022-01-14T05:38:47.000Z | 2022-03-17T05:20:55.000Z | # Copyright 2022 Google LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 42.81982 | 80 | 0.699453 |
2d95fd9e3650419cf5e8e8bf91a343805c6ddacb | 238 | py | Python | Code Forces/Problem Set/B/easter_eggs.py | mishrakeshav/Competitive-Programming | b25dcfeec0fb9a9c71bf3a05644b619f4ca83dd2 | [
"MIT"
] | 2 | 2020-06-25T21:10:32.000Z | 2020-12-10T06:53:45.000Z | Code Forces/Problem Set/B/easter_eggs.py | mishrakeshav/Competitive-Programming | b25dcfeec0fb9a9c71bf3a05644b619f4ca83dd2 | [
"MIT"
] | null | null | null | Code Forces/Problem Set/B/easter_eggs.py | mishrakeshav/Competitive-Programming | b25dcfeec0fb9a9c71bf3a05644b619f4ca83dd2 | [
"MIT"
] | 3 | 2020-05-15T14:17:09.000Z | 2021-07-25T13:18:20.000Z | n = int(input())
colors = ['R', 'O', 'Y', 'G', 'B', 'I', 'V']
c = "".join(colors)
w = "GBIV"
seq = c
count = 7
if count == n:
print(seq)
else:
c = 0
for i in range(7, n):
seq += w[c % 4]
c += 1
print(seq)
| 14.875 | 44 | 0.415966 |
2d960f3664dab6b34359b741338b1b7153c2e9a8 | 1,436 | py | Python | scripts/evaluate.py | ratulesrar3/sotu-approval-analysis | 4e4575e81795d09ce951ae289eb30158392ef37d | [
"MIT"
] | null | null | null | scripts/evaluate.py | ratulesrar3/sotu-approval-analysis | 4e4575e81795d09ce951ae289eb30158392ef37d | [
"MIT"
] | null | null | null | scripts/evaluate.py | ratulesrar3/sotu-approval-analysis | 4e4575e81795d09ce951ae289eb30158392ef37d | [
"MIT"
] | null | null | null | # evaluation module
import pylab as pl
import itertools
import numpy as np
def plot_confusion_matrix(cm, classes,
normalize=False,
title='Confusion matrix',
cmap=pl.cm.Blues):
'''
This function prints and plots the confusion matri... | 27.09434 | 92 | 0.607939 |
2d96230562513ab76107cd93af42d3b138c6594b | 448 | py | Python | Chapter11/ch11/custom_timestamp.py | clperez/Learn-Python-Programming-Second-Edition | e43fc293726c510e16475d7fb5551d5cbb5ee303 | [
"MIT"
] | 55 | 2018-07-04T10:12:15.000Z | 2022-03-03T19:51:54.000Z | Chapter11/ch11/custom_timestamp.py | clperez/Learn-Python-Programming-Second-Edition | e43fc293726c510e16475d7fb5551d5cbb5ee303 | [
"MIT"
] | 6 | 2020-03-24T16:37:46.000Z | 2021-06-10T21:04:36.000Z | Chapter11/ch11/custom_timestamp.py | clperez/Learn-Python-Programming-Second-Edition | e43fc293726c510e16475d7fb5551d5cbb5ee303 | [
"MIT"
] | 32 | 2018-07-10T05:56:31.000Z | 2021-09-04T23:19:42.000Z | from time import sleep
def debug(*msg, timestamp=[None]):
print(*msg)
from time import time # local import
if timestamp[0] is None:
timestamp[0] = time() #1
else:
now = time()
print(
' Time elapsed: {:.3f}s'.format(now - timestamp[0])
)
timestamp[0... | 20.363636 | 63 | 0.566964 |
2d963bc927344bd311963f8dffa88a84ba7b1ade | 9,084 | py | Python | evaluate_explanations_function.py | marnixm/lime_experiments | 0b6b2acddff3f55c022c7a5eb28a150ab9e4c846 | [
"BSD-2-Clause"
] | null | null | null | evaluate_explanations_function.py | marnixm/lime_experiments | 0b6b2acddff3f55c022c7a5eb28a150ab9e4c846 | [
"BSD-2-Clause"
] | null | null | null | evaluate_explanations_function.py | marnixm/lime_experiments | 0b6b2acddff3f55c022c7a5eb28a150ab9e4c846 | [
"BSD-2-Clause"
] | null | null | null | import sys
import copy
sys.path.append('..')
import argparse
import explainers
import parzen_windows
import numpy as np
import pickle
import sklearn
from load_datasets import *
from sklearn.metrics import accuracy_score
#added
import datetime
from explanability_metric import *
import shap
from scipy import *
from scipy... | 47.810526 | 165 | 0.647622 |
2d964580ef716271d5b8a45986a8163bda34cbdc | 1,462 | py | Python | zubhub_backend/zubhub/projects/urls.py | NdibeRaymond/zubhub | 23907202af4f4f4f85a108ed15e811abb3d22407 | [
"MIT"
] | 1 | 2022-01-21T14:15:24.000Z | 2022-01-21T14:15:24.000Z | zubhub_backend/zubhub/projects/urls.py | NdibeRaymond/zubhub | 23907202af4f4f4f85a108ed15e811abb3d22407 | [
"MIT"
] | null | null | null | zubhub_backend/zubhub/projects/urls.py | NdibeRaymond/zubhub | 23907202af4f4f4f85a108ed15e811abb3d22407 | [
"MIT"
] | null | null | null | from django.urls import path
from .views import *
app_name = "projects"
urlpatterns = [
path('', ProjectListAPIView.as_view(), name='list_projects'),
path('tags/search/', ProjectTagSearchAPIView.as_view(), name='search_tags'),
path('search/', ProjectSearchAPIView.as_view(), name='search_projects'),
pa... | 50.413793 | 85 | 0.69357 |
2d96a281ec12cdbfaccecca4f6a7206c41fab3e4 | 3,959 | py | Python | harun/src/checkin.py | wangrl2016/coding | fd6cd342cade42379c4a0447d83e17c6596fd3a3 | [
"MIT"
] | 4 | 2021-02-20T03:47:48.000Z | 2021-11-09T17:25:43.000Z | harun/src/checkin.py | wangrl2016/coding | fd6cd342cade42379c4a0447d83e17c6596fd3a3 | [
"MIT"
] | null | null | null | harun/src/checkin.py | wangrl2016/coding | fd6cd342cade42379c4a0447d83e17c6596fd3a3 | [
"MIT"
] | null | null | null | import inspect
from src import phone
from src.info import activities
# 对于无法通过Activity进行启动的图标需要定位
# 不同手机位置不同
# 设置成为4x6的图标布局模式
ROWS = [340, 600, 900, 1170, 1420, 1690]
COLUMNS = [160, 420, 660, 910]
def jingdong(device, w, h, gap=10):
phone.go_home(device)
phone.tap(device, COLUMNS[0], ROWS[1], gap)
def fa... | 25.216561 | 78 | 0.683506 |
2d96e5b4290387496ddfa405ecaf252bdbe03724 | 5,646 | py | Python | basic/models/net.py | Zx55/pytorch-examples | fafbb3a2bcec8beeaf19628749abea47980db1bd | [
"MIT"
] | null | null | null | basic/models/net.py | Zx55/pytorch-examples | fafbb3a2bcec8beeaf19628749abea47980db1bd | [
"MIT"
] | null | null | null | basic/models/net.py | Zx55/pytorch-examples | fafbb3a2bcec8beeaf19628749abea47980db1bd | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
from abc import ABCMeta
import time
from tqdm import tqdm
import torch
from torch.nn import Module
from tensorboardX import SummaryWriter
from .metric import Metric
class Net(Module, metaclass=ABCMeta):
"""
A wrapper for torch.nn.Module.
"""
def __init__(self, visual=False):... | 32.262857 | 86 | 0.540914 |
2d96ee16dec8458605032d6e0ffeb03c8f37b7f6 | 3,562 | py | Python | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/aio/_configuration.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-02-01T18:50:12.000Z | 2022-02-01T18:50:12.000Z | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/aio/_configuration.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/aio/_configuration.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | # 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 ... | 48.794521 | 130 | 0.70438 |
2d9763eb49c4211bd72c53cad1bd270492ad5959 | 2,506 | py | Python | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/additional_unattend_content.py | pjquirk/azure-sdk-for-python | cbf02ec4f177b96eae1dbbba87c34c2c93880150 | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/additional_unattend_content.py | pjquirk/azure-sdk-for-python | cbf02ec4f177b96eae1dbbba87c34c2c93880150 | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/additional_unattend_content.py | xiafu-msft/azure-sdk-for-python | 4d9560cfd519ee60667f3cc2f5295a58c18625db | [
"MIT"
] | 1 | 2019-06-17T22:18:23.000Z | 2019-06-17T22:18:23.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 ... | 47.283019 | 81 | 0.674381 |
2d9788bf8119c7149a01446811c3ffb37c6fdabe | 127 | py | Python | ext/NN/__init__.py | Jie-Yuan/1_DataMining | f5338388b4f883233f350d4fb9c5903180883430 | [
"Apache-2.0"
] | 14 | 2019-06-25T13:46:32.000Z | 2020-10-27T02:04:59.000Z | ext/NN/__init__.py | Jie-Yuan/2_DataMining | f5338388b4f883233f350d4fb9c5903180883430 | [
"Apache-2.0"
] | null | null | null | ext/NN/__init__.py | Jie-Yuan/2_DataMining | f5338388b4f883233f350d4fb9c5903180883430 | [
"Apache-2.0"
] | 7 | 2019-06-25T13:26:16.000Z | 2020-10-27T02:05:03.000Z | #!/usr/bin/env python
#-*- coding: utf-8 -*-
"""
__title__ = '__init__.py'
__author__ = 'JieYuan'
__mtime__ = '2019/4/12'
"""
| 14.111111 | 25 | 0.606299 |
2d97907bd95960ff06feea71a17392583325294c | 756 | py | Python | client/paddleflow/pipeline/dsl/options/__init__.py | qiaoshuangshuang/PaddleFlow | 15155a553587f18b09d4edfc604cb64a1fbe01a7 | [
"Apache-2.0"
] | 23 | 2021-12-31T02:36:13.000Z | 2022-03-29T07:38:43.000Z | client/paddleflow/pipeline/dsl/options/__init__.py | qiaoshuangshuang/PaddleFlow | 15155a553587f18b09d4edfc604cb64a1fbe01a7 | [
"Apache-2.0"
] | 10 | 2022-01-05T08:47:37.000Z | 2022-03-29T11:59:43.000Z | client/paddleflow/pipeline/dsl/options/__init__.py | qiaoshuangshuang/PaddleFlow | 15155a553587f18b09d4edfc604cb64a1fbe01a7 | [
"Apache-2.0"
] | 19 | 2021-12-30T14:37:24.000Z | 2022-03-23T03:30:32.000Z | """
Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserve.
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... | 37.8 | 72 | 0.808201 |
2d97d410066cf02ebb19d6cb8eaba495d02df22b | 12,842 | py | Python | StoreManagement.py | fermihacker/Random_Projects | 171129e77e5d3f65ed233c5f74465d2f54818576 | [
"Unlicense"
] | 1 | 2020-06-15T02:23:58.000Z | 2020-06-15T02:23:58.000Z | StoreManagement.py | fermihacker/Random_Projects | 171129e77e5d3f65ed233c5f74465d2f54818576 | [
"Unlicense"
] | null | null | null | StoreManagement.py | fermihacker/Random_Projects | 171129e77e5d3f65ed233c5f74465d2f54818576 | [
"Unlicense"
] | null | null | null | '''
This is an Employee Management system...
Author : Aliasgar Khimani
:D
'''
'''The 'Store' class is the Parent class the contains the data and
methods for the store'''
class Store:
'''storeList contains a list of all stores registered'''
storeList = []
assigned_Budget = dict()
customer_... | 29.454128 | 115 | 0.545865 |
2d97dc92191a033b74eadf9a34340ac633cb61c6 | 589 | py | Python | practicity/progressTracker/urls.py | pkhurt/practicity | e638a67f091696de15d2852d26f310e3556bdf79 | [
"MIT"
] | null | null | null | practicity/progressTracker/urls.py | pkhurt/practicity | e638a67f091696de15d2852d26f310e3556bdf79 | [
"MIT"
] | null | null | null | practicity/progressTracker/urls.py | pkhurt/practicity | e638a67f091696de15d2852d26f310e3556bdf79 | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
app_name = 'progressTracker'
urlpatterns = [
# ex: /progressTracker
path('', views.index, name='index'),
path('exercise_detail/<int:pk>/', views.ExerciseDetailView.as_view(), name='exercise_detail'), # generic view
path('exercise_execution/<int:exercis... | 42.071429 | 114 | 0.719864 |
2d97dd2886c1a6d2cbc353195578d81276f9cd19 | 371 | py | Python | component/scripts/__init__.py | ingdanielguerrero/gwb | 162f7e1a885945814c584a188e78d571a32a9d80 | [
"MIT"
] | null | null | null | component/scripts/__init__.py | ingdanielguerrero/gwb | 162f7e1a885945814c584a188e78d571a32a9d80 | [
"MIT"
] | null | null | null | component/scripts/__init__.py | ingdanielguerrero/gwb | 162f7e1a885945814c584a188e78d571a32a9d80 | [
"MIT"
] | null | null | null | # if you only have few funcitions a module is not necessary and you can simply use a scripts.py file
# in a big module with lot of functions, it can make sense to split things in separate for the sake of maintenance
# if you use a module import all the functions here to only have 1 call to make
from .pre_processing i... | 53 | 114 | 0.770889 |
2d97ffcc2252de021b598e37bb252e171d613788 | 160 | py | Python | pydeepgenomics/preprocess/vcf/__init__.py | digitalepidemiologylab/pydeepgenomics | 331f6506e068d6a35faee44b9d0371f2f1f2cafb | [
"MIT"
] | 1 | 2017-01-18T08:03:51.000Z | 2017-01-18T08:03:51.000Z | pydeepgenomics/preprocess/vcf/__init__.py | salathegroup/pydeepgenomics | 331f6506e068d6a35faee44b9d0371f2f1f2cafb | [
"MIT"
] | null | null | null | pydeepgenomics/preprocess/vcf/__init__.py | salathegroup/pydeepgenomics | 331f6506e068d6a35faee44b9d0371f2f1f2cafb | [
"MIT"
] | 1 | 2021-01-07T13:13:09.000Z | 2021-01-07T13:13:09.000Z | import os
import sys
PATH_TO_ROOT_OF_MODULE = os.path.abspath(os.path.join(
os.getcwd(),
"..",
"..",
".."))
sys.path.append(PATH_TO_ROOT_OF_MODULE)
| 17.777778 | 55 | 0.65625 |
2d9806737557cf610b252ae3273b53f6e38fa92f | 3,858 | py | Python | Part4/app-files/settings.py | ProgZone/it-cert-automation-project | e81a89cf2cb12154302cea102405ab31b50a3f11 | [
"Apache-2.0"
] | 14 | 2020-04-14T18:24:59.000Z | 2022-03-21T17:35:40.000Z | Part4/app-files/settings.py | ProgZone/it-cert-automation-project | e81a89cf2cb12154302cea102405ab31b50a3f11 | [
"Apache-2.0"
] | 1 | 2020-09-30T20:23:13.000Z | 2020-09-30T20:23:13.000Z | Part4/app-files/settings.py | ProgZone/it-cert-automation-project | e81a89cf2cb12154302cea102405ab31b50a3f11 | [
"Apache-2.0"
] | 16 | 2020-04-20T13:43:40.000Z | 2022-03-13T10:07:06.000Z | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 27.361702 | 91 | 0.705288 |
2d981b2b645183fec575dd3d03b4fba00e369660 | 6,781 | py | Python | GPdoemd/design_criteria.py | scwolof/GPdoemd | 485265a66585a8ebe88d1ba3da957199159dbcbf | [
"MIT"
] | 28 | 2018-07-04T21:46:18.000Z | 2022-01-10T07:48:59.000Z | GPdoemd/design_criteria.py | scwolof/GPdoemd | 485265a66585a8ebe88d1ba3da957199159dbcbf | [
"MIT"
] | 1 | 2018-10-03T22:40:00.000Z | 2018-10-04T17:49:49.000Z | GPdoemd/design_criteria.py | scwolof/GPdoemd | 485265a66585a8ebe88d1ba3da957199159dbcbf | [
"MIT"
] | 5 | 2018-09-18T18:43:19.000Z | 2020-11-28T22:07:22.000Z | """
MIT License
Copyright (c) 2018 Simon Olofsson
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 restriction, including without limitation the rights
to use, copy, modify, merge, publish... | 27.677551 | 78 | 0.639286 |
2d982a8aad6a32f560f454f2b17fd940196c6d9a | 20,679 | py | Python | scripts/report.py | hyuunnn/ALEAPP | 5e167eb7262ad81f7eaaadb20767ff4ccaca2202 | [
"MIT"
] | null | null | null | scripts/report.py | hyuunnn/ALEAPP | 5e167eb7262ad81f7eaaadb20767ff4ccaca2202 | [
"MIT"
] | null | null | null | scripts/report.py | hyuunnn/ALEAPP | 5e167eb7262ad81f7eaaadb20767ff4ccaca2202 | [
"MIT"
] | null | null | null | import html
import os
import pathlib
import shutil
from collections import OrderedDict
from scripts.html_parts import *
from scripts.ilapfuncs import logfunc
from scripts.version_info import aleapp_version, aleapp_contributors
def get_icon_name(category, artifact):
''' Returns the icon name from the feathericons ... | 49.828916 | 143 | 0.583539 |
2d984aca83ed37023e52450d0e1413ebd1f94f5d | 23,224 | py | Python | vacuum.py | n0whereRuoxi/aima-python | 777fa52b73830a534e27b33abf535933ace32a95 | [
"MIT"
] | 1 | 2019-11-12T21:13:47.000Z | 2019-11-12T21:13:47.000Z | vacuum.py | n0whereRuoxi/aima-python | 777fa52b73830a534e27b33abf535933ace32a95 | [
"MIT"
] | null | null | null | vacuum.py | n0whereRuoxi/aima-python | 777fa52b73830a534e27b33abf535933ace32a95 | [
"MIT"
] | null | null | null | '''
This is hosted on github.
This is heavily based on the example from Artificial Intelligence: A Modern Approach located here:
http://aima.cs.berkeley.edu/python/agents.html
http://aima.cs.berkeley.edu/python/agents.py
'''
import inspect
from utils import *
import random, copy
from functools import partial
import m... | 40.530541 | 156 | 0.614709 |
2d9867dedcd356553ae48b40ec0d04b2c8c40abc | 3,823 | py | Python | benchmark/lsh_benchmark.py | yrik/datasketch | 82d9639bc0011932a952bbae1d4b5bd5ac03c7c8 | [
"MIT"
] | null | null | null | benchmark/lsh_benchmark.py | yrik/datasketch | 82d9639bc0011932a952bbae1d4b5bd5ac03c7c8 | [
"MIT"
] | null | null | null | benchmark/lsh_benchmark.py | yrik/datasketch | 82d9639bc0011932a952bbae1d4b5bd5ac03c7c8 | [
"MIT"
] | null | null | null | import time, argparse, sys, json
from hashlib import sha1
from sklearn.datasets import fetch_20newsgroups
import numpy as np
import scipy.stats
from datasketch import MinHashLSH, MinHash
from lshforest_benchmark import bootstrap_data, _compute_jaccard
def benchmark_lsh(num_perm, threshold, index_data, query_data):
... | 37.851485 | 112 | 0.634057 |
2d98727a7264ce5469e2341df2e4a2b338c83cc0 | 3,481 | py | Python | train.py | scylla/seq2seq_tf | 7678dbd09be065f4753a6f408a2d4b102e87d2af | [
"Apache-2.0"
] | null | null | null | train.py | scylla/seq2seq_tf | 7678dbd09be065f4753a6f408a2d4b102e87d2af | [
"Apache-2.0"
] | null | null | null | train.py | scylla/seq2seq_tf | 7678dbd09be065f4753a6f408a2d4b102e87d2af | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#-*-coding:utf-8-*-
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
import argparse
import numpy as np
import tensorflow as tf
import data_utils
from tensorflow.python.platform import gfile
import seq2seq_autoencoder_model
import os
def main():
parser = argparse.ArgumentParser()
ar... | 51.191176 | 224 | 0.693766 |
2d9889a5b8431ad327c6633c1b1a45a93a2b21ff | 1,273 | py | Python | day02/solution1.py | evanbrumley/aoc2021 | 96e66be2a003eebc942c8cb2845925277bd28645 | [
"MIT"
] | null | null | null | day02/solution1.py | evanbrumley/aoc2021 | 96e66be2a003eebc942c8cb2845925277bd28645 | [
"MIT"
] | null | null | null | day02/solution1.py | evanbrumley/aoc2021 | 96e66be2a003eebc942c8cb2845925277bd28645 | [
"MIT"
] | null | null | null | import re
class Submarine:
def __init__(self):
self.x = 0
self.y = 0
self.z = 0
def move_forward(self, distance):
self.x = self.x + distance
def move_backward(self, distance):
self.x = self.x - distance
def move_up(self, distance):
self.z = self.z + di... | 23.574074 | 97 | 0.582875 |
2d989b982d6e16410c0aecde07df321bd8c9f2b3 | 5,617 | py | Python | rgb7seg/is31fl3235a.py | skullydazed/rgb7seg.py | 91acf81248ba993274a9fd7a760ebf42ae6a2aec | [
"MIT"
] | null | null | null | rgb7seg/is31fl3235a.py | skullydazed/rgb7seg.py | 91acf81248ba993274a9fd7a760ebf42ae6a2aec | [
"MIT"
] | null | null | null | rgb7seg/is31fl3235a.py | skullydazed/rgb7seg.py | 91acf81248ba993274a9fd7a760ebf42ae6a2aec | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from smbus import SMBus
class IS31FL3235A(object):
"""A low-level class that represents a single is31fl3235a.
"""
def __init__(self, ic_address=None, i2c_bus=None, buffered=False, pmw_33kHz=True, skip_init=False):
"""Sets up the state for the is31fl3235a driver.
... | 36.00641 | 161 | 0.598718 |
2d989f4884bdc0fd13970ba0d74f92fc805cd1b5 | 20,175 | py | Python | model/Detectors.py | ZhangHanbo/Visual-Manipulation-Relationship-Network-Pytorch | 9dd24947db318f6e404918d4758f1d824eea3748 | [
"MIT"
] | 26 | 2019-10-31T08:21:46.000Z | 2022-03-11T13:58:43.000Z | build/lib.linux-x86_64-3.5/model/Detectors.py | moli1026/regrad | f66c38c00405b22cb746cc3f5c38d2b49f77d854 | [
"MIT"
] | 12 | 2019-11-07T09:12:50.000Z | 2022-03-12T02:58:18.000Z | build/lib.linux-x86_64-3.5/model/Detectors.py | moli1026/regrad | f66c38c00405b22cb746cc3f5c38d2b49f77d854 | [
"MIT"
] | 11 | 2019-10-30T08:44:47.000Z | 2022-03-11T13:58:48.000Z | import torch
from torch import nn
import torch.nn.functional as F
import numpy as np
from utils.config import cfg
from utils.net_utils import set_bn_fix, set_bn_eval, set_bn_unfix, set_bn_train
import abc
from basenet.resnet import resnet_initializer
from basenet.vgg import vgg_initializer
from model.op2l.op2l import... | 46.061644 | 122 | 0.581512 |
2d98cd79c59ef4bc2cad019a69acd8dbd6e32aaa | 3,621 | py | Python | scapy/scapy/layers/ppi.py | jreynders/BLESuite-1 | 1c3c15fc2d4e30c3f9c1a15e0268cae84685784b | [
"MIT"
] | null | null | null | scapy/scapy/layers/ppi.py | jreynders/BLESuite-1 | 1c3c15fc2d4e30c3f9c1a15e0268cae84685784b | [
"MIT"
] | null | null | null | scapy/scapy/layers/ppi.py | jreynders/BLESuite-1 | 1c3c15fc2d4e30c3f9c1a15e0268cae84685784b | [
"MIT"
] | null | null | null | # This file is part of Scapy
# See http://www.secdev.org/projects/scapy for more informations
# Scapy 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 2 of the License, or
# any later version.
#
... | 35.5 | 115 | 0.667495 |
2d98e622cdf15490e528b782743db4140382ac90 | 17,883 | py | Python | sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_data_connectors_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-02-01T18:50:12.000Z | 2022-02-01T18:50:12.000Z | sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_data_connectors_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_data_connectors_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | # 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 ... | 44.155556 | 267 | 0.678633 |
2d9942df1603dbf6362e14f9b39012424cd5cb8a | 2,416 | py | Python | archive/nexus-api-v2/Mongo/Taskboard/Collections/LinkedResources/__init__.py | cloud-hybrid/delta | 402b00ed5aaa32ccef628361e9635879b7ace44f | [
"BSD-3-Clause"
] | null | null | null | archive/nexus-api-v2/Mongo/Taskboard/Collections/LinkedResources/__init__.py | cloud-hybrid/delta | 402b00ed5aaa32ccef628361e9635879b7ace44f | [
"BSD-3-Clause"
] | null | null | null | archive/nexus-api-v2/Mongo/Taskboard/Collections/LinkedResources/__init__.py | cloud-hybrid/delta | 402b00ed5aaa32ccef628361e9635879b7ace44f | [
"BSD-3-Clause"
] | 1 | 2022-01-03T05:33:15.000Z | 2022-01-03T05:33:15.000Z | #!/usr/bin/env python3
# -*- Coding: UTF-8 -*- #
# -*- System: Linux -*- #
# -*- Usage: *.py -*- #
# Owner: Jacob B. Sanders
# Source: code.cloud-technology.io
# License: BSD 2-Clause License
"""
...
"""
# =============================================================================
# Standard Library
# ===... | 21.765766 | 79 | 0.440397 |
2d99a2ab2cf4eb72117bbd49d7262a17ef7bc581 | 10,523 | py | Python | examples/run_rl/utils.py | simonr98/Reinforcement-Learning-with-Videos | e40cec6b8d817276375e940696b290fc4e1e8bc7 | [
"MIT"
] | 25 | 2020-12-02T23:13:29.000Z | 2022-02-25T07:57:30.000Z | examples/run_rl/utils.py | simonr98/Reinforcement-Learning-with-Videos | e40cec6b8d817276375e940696b290fc4e1e8bc7 | [
"MIT"
] | 8 | 2020-12-12T14:11:58.000Z | 2021-12-10T20:06:04.000Z | examples/run_rl/utils.py | simonr98/Reinforcement-Learning-with-Videos | e40cec6b8d817276375e940696b290fc4e1e8bc7 | [
"MIT"
] | 8 | 2020-12-25T19:43:15.000Z | 2021-10-13T02:53:58.000Z | import multiprocessing
import argparse
from distutils.util import strtobool
import json
import os
import rl_with_videos.algorithms.utils as alg_utils
import rl_with_videos.environments.utils as env_utils
from rl_with_videos.misc.utils import datetimestamp
DEFAULT_TASK = 'StateDoorPullEnv-v0'
DEFAULT_ALGORITHM = 'SAC'... | 30.413295 | 94 | 0.60439 |
2d99b747f22d835b1cbfa76def878ace7b884a89 | 894 | py | Python | tests/apps/minimal2/views.py | blazelibs/blazeweb | b120a6a2e38c8b53da2b73443ff242e2d1438053 | [
"BSD-3-Clause"
] | null | null | null | tests/apps/minimal2/views.py | blazelibs/blazeweb | b120a6a2e38c8b53da2b73443ff242e2d1438053 | [
"BSD-3-Clause"
] | 6 | 2016-11-01T18:42:34.000Z | 2020-11-16T16:52:14.000Z | tests/apps/minimal2/views.py | blazelibs/blazeweb | b120a6a2e38c8b53da2b73443ff242e2d1438053 | [
"BSD-3-Clause"
] | 1 | 2020-01-22T18:20:46.000Z | 2020-01-22T18:20:46.000Z | from blazeweb.globals import rg, user
from blazeweb.views import asview, forward
@asview('/')
def index():
return 'index'
@asview()
def workingview():
return 'hello foo!'
@asview()
def nosession():
assert not rg.session
# but we still have a user object, even though info won't get persisted
as... | 14.419355 | 75 | 0.638702 |
2d9a1a3209fc5cd7e3d0ceefa12e1b176f2cef55 | 308 | py | Python | scrappy/core/utils.py | V-in/scrappy | d083614e5c6b0821ebffd68dacab7b9301b3f579 | [
"MIT"
] | 6 | 2019-04-26T00:32:10.000Z | 2020-06-20T12:57:37.000Z | scrappy/core/utils.py | V-in/scrappy | d083614e5c6b0821ebffd68dacab7b9301b3f579 | [
"MIT"
] | null | null | null | scrappy/core/utils.py | V-in/scrappy | d083614e5c6b0821ebffd68dacab7b9301b3f579 | [
"MIT"
] | null | null | null | from os import path, makedirs, mkdir
def ensure_dir(dir_path):
"""Creates a directory if it does not exist
"""
if not path.exists(dir_path):
mkdir(dir_path)
def chunks(l, n):
"""Yield successive n-sized chunks from l."""
for i in range(0, len(l), n):
yield l[i:i + n]
| 20.533333 | 49 | 0.61039 |
2d9a1cf376fb3baaa0e8b342c6f7fa50fe4a8a50 | 3,536 | py | Python | worktable_DC/jobs/load_tick_from_csv.py | caizhanjin/vnpy | c0886dbd8eba7f506634b1700dfd09b0b098ef26 | [
"MIT"
] | 5 | 2020-09-13T05:07:38.000Z | 2020-12-26T15:10:00.000Z | worktable_DC/jobs/load_tick_from_csv.py | caizhanjin/vnpy | c0886dbd8eba7f506634b1700dfd09b0b098ef26 | [
"MIT"
] | null | null | null | worktable_DC/jobs/load_tick_from_csv.py | caizhanjin/vnpy | c0886dbd8eba7f506634b1700dfd09b0b098ef26 | [
"MIT"
] | 2 | 2020-06-03T06:40:31.000Z | 2020-06-12T14:55:17.000Z | import os
import sys
ROOT_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
sys.path.append(ROOT_PATH)
if not os.path.exists("../.vntrader"):
os.mkdir("../.vntrader")
import csv
from datetime import datetime
import time
from pytz import timezone
from tzlocal import get_localzone
from vnpy.tra... | 26.787879 | 74 | 0.502262 |
2d9a373afd7914300bbff18b0ad054892b33c4dd | 3,181 | py | Python | heuristics/voronoi_heuristic.py | TeamJumpstart/InformatiCup2021 | a4d07992f772d3a1e9ef715fa8e9ce2234cd47a4 | [
"MIT"
] | 10 | 2021-04-18T17:54:02.000Z | 2021-07-26T19:58:41.000Z | heuristics/voronoi_heuristic.py | DiddiZ/InformatiCup2021 | a4d07992f772d3a1e9ef715fa8e9ce2234cd47a4 | [
"MIT"
] | 1 | 2021-04-21T15:13:41.000Z | 2021-04-21T15:13:41.000Z | heuristics/voronoi_heuristic.py | DiddiZ/InformatiCup2021 | a4d07992f772d3a1e9ef715fa8e9ce2234cd47a4 | [
"MIT"
] | 1 | 2021-04-20T09:42:50.000Z | 2021-04-20T09:42:50.000Z | import time
import numpy as np
from scipy.ndimage import morphology
from heuristics.heuristic import Heuristic
class VoronoiHeuristic(Heuristic):
"""Tries to maximize the area that can be reached by the agent before the opponents."""
def __init__(self, max_steps=40, opening_iterations=0, minimize_opponents=... | 45.442857 | 111 | 0.636907 |
2d9a4edda1fdeaf952528190bb33f4978c60b119 | 37,577 | py | Python | modules/core/filters/base.py | nursix/DRKCM | 09328289ff721c416494398aa751ff99906327cb | [
"MIT"
] | 3 | 2022-01-26T08:07:54.000Z | 2022-03-21T21:53:52.000Z | modules/core/filters/base.py | nursix/eden-asp | e49f46cb6488918f8d5a163dcd5a900cd686978c | [
"MIT"
] | null | null | null | modules/core/filters/base.py | nursix/eden-asp | e49f46cb6488918f8d5a163dcd5a900cd686978c | [
"MIT"
] | null | null | null | """
Interactive filters
Copyright: 2013-2022 (c) Sahana Software Foundation
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
restriction, including without limitati... | 35.217432 | 100 | 0.493813 |
2d9a6466c98f1f1a40838d78bd8e37306a197f47 | 2,420 | py | Python | survae/tests/transforms/bijections/autoregressive/autoregressive_splines.py | alisiahkoohi/survae_flows | e1747b05524c7ab540a211ed360ab3e67bc3e96d | [
"MIT"
] | 262 | 2020-07-05T20:57:44.000Z | 2022-03-28T02:24:43.000Z | survae/tests/transforms/bijections/autoregressive/autoregressive_splines.py | alisiahkoohi/survae_flows | e1747b05524c7ab540a211ed360ab3e67bc3e96d | [
"MIT"
] | 17 | 2020-08-15T05:43:34.000Z | 2022-01-31T12:24:21.000Z | survae/tests/transforms/bijections/autoregressive/autoregressive_splines.py | alisiahkoohi/survae_flows | e1747b05524c7ab540a211ed360ab3e67bc3e96d | [
"MIT"
] | 35 | 2020-08-24T06:55:37.000Z | 2022-02-11T05:17:58.000Z | import numpy as np
import torch
import torch.nn as nn
import torchtestcase
import unittest
from survae.transforms.bijections.autoregressive import *
from survae.nn.nets.autoregressive import MADE
from survae.tests.transforms.bijections import BijectionTest
class LinearSplineAutoregressiveBijectionTest(BijectionTest):... | 35.072464 | 118 | 0.726446 |
2d9a805490581eb043eb0537d241c9058dcca9b4 | 33,448 | py | Python | input_data_gen_mars.py | hugokitano/cs229_project | b9f68282523e65f54bb4d7baa870c0fa6300ba06 | [
"MIT"
] | 1 | 2020-01-07T16:35:18.000Z | 2020-01-07T16:35:18.000Z | input_data_gen_mars.py | hugokitano/DeepMoon---Lunar-Crater-Counting-Through-Deep-Learning | b9f68282523e65f54bb4d7baa870c0fa6300ba06 | [
"MIT"
] | 7 | 2020-09-26T00:20:55.000Z | 2022-02-10T00:21:24.000Z | input_data_gen_mars.py | hugokitano/DeepMoon---Lunar-Crater-Counting-Through-Deep-Learning | b9f68282523e65f54bb4d7baa870c0fa6300ba06 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Input Image Dataset Generator Functions
Functions for generating input and target image datasets from Lunar digital
elevation maps and crater catalogues.
"""
from __future__ import absolute_import, division, print_function
import numpy as np
import pandas as pd
from PIL import Image
import ca... | 36.79648 | 79 | 0.608975 |
2d9a8ac7e96c9d85490e19757a66db25867ca0f4 | 5,386 | py | Python | api/medicine_api/readers/utils.py | maxwelld90/medicine-for-ukraine | f10152929a3827b9de055d993103b352959f3b33 | [
"MIT"
] | 2 | 2022-03-21T14:00:27.000Z | 2022-03-21T17:17:51.000Z | api/medicine_api/readers/utils.py | maxwelld90/medicine-for-ukraine | f10152929a3827b9de055d993103b352959f3b33 | [
"MIT"
] | 19 | 2022-03-21T14:14:26.000Z | 2022-03-31T07:49:40.000Z | api/medicine_api/readers/utils.py | maxwelld90/medicine-for-ukraine | f10152929a3827b9de055d993103b352959f3b33 | [
"MIT"
] | 4 | 2022-03-02T13:56:30.000Z | 2022-03-22T10:49:00.000Z | import re
import statistics
from medicine_api.models import LinkMetadata
URL_VALIDATOR = re.compile(
r'^(?:http|ftp)s?://' # http:// or https://
r'(?:(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+(?:[A-Z]{2,6}\.?|[A-Z0-9-]{2,}\.?)|' #domain...
r'localhost|' #localhost...
r'\d{1,3}\.\d{1,3... | 37.402778 | 142 | 0.642221 |
2d9ae1f9a94c7829461b9826b5f10fff4babb63c | 373 | py | Python | backend/apps/volontulo/templatetags/offer_utilities.py | ponycalypsenow/volontulo | 8f7886aa3c8ea5ec0ca84711a089bea60fb69598 | [
"MIT"
] | 4 | 2018-05-19T23:34:08.000Z | 2022-03-31T23:26:41.000Z | backend/apps/volontulo/templatetags/offer_utilities.py | ponycalypsenow/volontulo | 8f7886aa3c8ea5ec0ca84711a089bea60fb69598 | [
"MIT"
] | null | null | null | backend/apps/volontulo/templatetags/offer_utilities.py | ponycalypsenow/volontulo | 8f7886aa3c8ea5ec0ca84711a089bea60fb69598 | [
"MIT"
] | 1 | 2021-01-28T12:12:28.000Z | 2021-01-28T12:12:28.000Z | # -*- coding: utf-8 -*-
u"""
.. module:: offer_utilities
"""
from django import template
register = template.Library()
@register.filter(name='can_edit_offer')
def can_edit_offer(userprofile, offer):
u"""Return whether the user can edit an offer based on an ID."""
if userprofile is None:
return Fals... | 20.722222 | 68 | 0.699732 |
2d9af688a8ae83813d8b1ea9772601f15ea050f0 | 347 | py | Python | Courses/Udacity/CS101/Lesson_3_How_to_Manage_Data/27-Index/supplied/studentMain.py | leparrav/Playground | dcb90a2dd2bc1867511cfe621eb21248a60e357f | [
"Unlicense"
] | 1 | 2019-02-13T12:02:26.000Z | 2019-02-13T12:02:26.000Z | Courses/Udacity/CS101/Lesson_3_How_to_Manage_Data/27-Index/supplied/studentMain.py | leparrav/Playground | dcb90a2dd2bc1867511cfe621eb21248a60e357f | [
"Unlicense"
] | 1 | 2018-08-13T15:58:33.000Z | 2018-08-13T15:58:33.000Z | Courses/Udacity/CS101/Lesson_3_How_to_Manage_Data/27-Index/supplied/studentMain.py | leparrav/Playground | dcb90a2dd2bc1867511cfe621eb21248a60e357f | [
"Unlicense"
] | 2 | 2017-08-10T20:01:29.000Z | 2021-07-01T08:39:13.000Z | # Define a procedure, find_element,
# using index that takes as its
# inputs a list and a value of any
# type, and returns the index of
# the first element in the input
# list that matches the value.
# If there is no matching element,
# return -1.
#print find_element([1,2,3],3)
#>>> 2
#print find_element(['alph... | 17.35 | 45 | 0.680115 |
2d9b0371fa2d4597e86308d2d933cdb29eab62d7 | 2,423 | py | Python | isp2/isp2_serial.py | elliotta/hephaestus | 67efe7490e1ef5572537627c3278d0cf9256960d | [
"MIT"
] | null | null | null | isp2/isp2_serial.py | elliotta/hephaestus | 67efe7490e1ef5572537627c3278d0cf9256960d | [
"MIT"
] | null | null | null | isp2/isp2_serial.py | elliotta/hephaestus | 67efe7490e1ef5572537627c3278d0cf9256960d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Read data in Innovate Serial Protocol version 2 (ISP2).
For data format specifications, see
http://www.innovatemotorsports.com/support/manual/OT-2%20SDK.pdf
http://www.innovatemotorsports.com/support/downloads/Seriallog-2.pdf
"""
import struct
import threading
import serial
import packet
c... | 26.922222 | 128 | 0.617829 |
2d9b0e02cf4380f7ac94f5b24e7bab1fc525e931 | 13,436 | py | Python | floris/simulation/wake_velocity/gaussianModels/gauss.py | tangsmall/floris | 51e4e15c6a9b0c8f55bf01772111799803acf224 | [
"Apache-2.0"
] | null | null | null | floris/simulation/wake_velocity/gaussianModels/gauss.py | tangsmall/floris | 51e4e15c6a9b0c8f55bf01772111799803acf224 | [
"Apache-2.0"
] | null | null | null | floris/simulation/wake_velocity/gaussianModels/gauss.py | tangsmall/floris | 51e4e15c6a9b0c8f55bf01772111799803acf224 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 NREL
# 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
# distri... | 36.610354 | 99 | 0.565645 |
2d9b33aa68c5d9cf4cf660456c0d4aa693746989 | 9,497 | py | Python | biosimulators_mpbn/utils.py | pauleve/Biosimulators_mpbn | b4eb27700c6bfdad0fffe8a193a2258a6af64a2b | [
"MIT"
] | null | null | null | biosimulators_mpbn/utils.py | pauleve/Biosimulators_mpbn | b4eb27700c6bfdad0fffe8a193a2258a6af64a2b | [
"MIT"
] | null | null | null | biosimulators_mpbn/utils.py | pauleve/Biosimulators_mpbn | b4eb27700c6bfdad0fffe8a193a2258a6af64a2b | [
"MIT"
] | null | null | null |
import os
from biosimulators_utils.report.data_model import VariableResults
from biosimulators_utils.sedml.data_model import ( # noqa: F401
ModelLanguage, )
from biosimulators_utils.simulator.utils import get_algorithm_substitution_policy
from biosimulators_utils.warnings import warn, BioSimulatorsWarning
import ... | 37.836653 | 137 | 0.637359 |
2d9b4eb90201126a83845bfec7464474de98565f | 2,704 | py | Python | src/ggrc/models/audit_object.py | Killswitchz/ggrc-core | 2460df94daf66727af248ad821462692917c97a9 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/ggrc/models/audit_object.py | Killswitchz/ggrc-core | 2460df94daf66727af248ad821462692917c97a9 | [
"ECL-2.0",
"Apache-2.0"
] | 10 | 2018-07-06T00:04:23.000Z | 2021-02-26T21:13:20.000Z | src/ggrc/models/audit_object.py | Killswitchz/ggrc-core | 2460df94daf66727af248ad821462692917c97a9 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2017-11-11T22:16:56.000Z | 2017-11-11T22:16:56.000Z | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
from ggrc import db
from sqlalchemy.ext.associationproxy import association_proxy
from sqlalchemy.ext.declarative import declared_attr
from ggrc.models.mixins import Base
from ggrc.models import reflection
... | 29.391304 | 78 | 0.676405 |
2d9b5aad5e9b19cecd91ffeb011aea42715de4ab | 685 | py | Python | codechef/cooling.py | shauryachawla/misc | e50eb7c8979f9b3f7ecc43464cf7ccc91bf4d0bb | [
"MIT"
] | null | null | null | codechef/cooling.py | shauryachawla/misc | e50eb7c8979f9b3f7ecc43464cf7ccc91bf4d0bb | [
"MIT"
] | null | null | null | codechef/cooling.py | shauryachawla/misc | e50eb7c8979f9b3f7ecc43464cf7ccc91bf4d0bb | [
"MIT"
] | 1 | 2019-10-07T08:22:09.000Z | 2019-10-07T08:22:09.000Z | def sort(l):
n = len(l)
for i in range(0, n):
j = i+1
m = i
while j < n:
if (l[j] < l[m]):
m = j
j += 1
l[i], l[m] = l[m], l[i]
return l
if __name__ == '__main__':
t = input('')
for _ in xrange(t):
n = input('')
... | 22.833333 | 48 | 0.353285 |
2d9b7dc52972da0ba8bec18e60b85661fa3d43a7 | 292 | py | Python | applications/shop/signals.py | dev-easyshares/mighty | a6cf473fb8cfbf5b92db68c7b068fc8ae2911b8b | [
"MIT"
] | null | null | null | applications/shop/signals.py | dev-easyshares/mighty | a6cf473fb8cfbf5b92db68c7b068fc8ae2911b8b | [
"MIT"
] | 1 | 2022-03-12T00:57:37.000Z | 2022-03-12T00:57:37.000Z | applications/shop/signals.py | dev-easyshares/mighty | a6cf473fb8cfbf5b92db68c7b068fc8ae2911b8b | [
"MIT"
] | null | null | null | from django.db.models.signals import m2m_changed
from mighty.models import Bill
def AddOrRemoveDiscount(sender, instance, action, **kwargs):
if action == 'post_add' or action == 'post_remove':
instance.save()
m2m_changed.connect(AddOrRemoveDiscount, sender=Bill.discount.through) | 41.714286 | 70 | 0.770548 |
2d9b85e12fe283ff7186b5ed138c2f6f34fdd0a9 | 1,904 | py | Python | zscore.py | jessicatwes/peak_finder | e268ae0819e6f6ad3b5916086ef800841f2244d7 | [
"MIT"
] | null | null | null | zscore.py | jessicatwes/peak_finder | e268ae0819e6f6ad3b5916086ef800841f2244d7 | [
"MIT"
] | null | null | null | zscore.py | jessicatwes/peak_finder | e268ae0819e6f6ad3b5916086ef800841f2244d7 | [
"MIT"
] | null | null | null | import math
import statistics
def zscore_conv(tf_data):
""" input = a list of integer motif counts
output = a list of float zscores """
max_motif_count = max(tf_data)
if max_motif_count <= 2:
return False
num_bins = max_motif_count+1
num_25_percentile = max([int(math.floor(num_bins... | 35.924528 | 90 | 0.685399 |
2d9b957d05fc7b116770764ae3abbbc2a8181846 | 7,714 | py | Python | YOLOv3-complete-pruning/detect.py | riciche/SimpleCVReproduction | 4075de39f9c61f1359668a413f6a5d98903fcf97 | [
"Apache-2.0"
] | 923 | 2020-01-11T06:36:53.000Z | 2022-03-31T00:26:57.000Z | YOLOv3-complete-pruning/detect.py | riciche/SimpleCVReproduction | 4075de39f9c61f1359668a413f6a5d98903fcf97 | [
"Apache-2.0"
] | 25 | 2020-02-27T08:35:46.000Z | 2022-01-25T08:54:19.000Z | YOLOv3-complete-pruning/detect.py | riciche/SimpleCVReproduction | 4075de39f9c61f1359668a413f6a5d98903fcf97 | [
"Apache-2.0"
] | 262 | 2020-01-02T02:19:40.000Z | 2022-03-23T04:56:16.000Z | import argparse
from sys import platform
from models import * # set ONNX_EXPORT in models.py
from utils.datasets import *
from utils.utils import *
import csv
import os
os.environ['CUDA_VISIBLE_DEVICES'] = "1"
def detect(save_txt=False, save_img=True):
content = []
# (320, 192) or (416, 256) or (608, 352... | 37.629268 | 119 | 0.54978 |
2d9bc9b017a62d461d7742ccd23a39132d0de453 | 2,841 | py | Python | tests/common.py | adborden/openFEC | 53a0a2b1a56292c5ca8e7a3185832baaed4a63d9 | [
"CC0-1.0"
] | null | null | null | tests/common.py | adborden/openFEC | 53a0a2b1a56292c5ca8e7a3185832baaed4a63d9 | [
"CC0-1.0"
] | null | null | null | tests/common.py | adborden/openFEC | 53a0a2b1a56292c5ca8e7a3185832baaed4a63d9 | [
"CC0-1.0"
] | 1 | 2020-03-04T00:21:16.000Z | 2020-03-04T00:21:16.000Z | import os
import json
import codecs
import unittest
import subprocess
from webtest import TestApp
from nplusone.ext.flask_sqlalchemy import NPlusOne
import manage
from webservices import rest
from webservices import __API_VERSION__
TEST_CONN = os.getenv('SQLA_TEST_CONN', 'postgresql:///cfdm-unit-test')
rest.app.co... | 27.317308 | 102 | 0.658571 |
2d9bd4219ec1e8ed7b75689f2483a9c5706b38bb | 1,065 | py | Python | repos/spikewidgets/spikewidgets/example_datasets/synthesize_timeseries.py | tjd2002/spikeforest2 | 2e393564b858b2995aa2ccccd9bd73065681b5de | [
"Apache-2.0"
] | null | null | null | repos/spikewidgets/spikewidgets/example_datasets/synthesize_timeseries.py | tjd2002/spikeforest2 | 2e393564b858b2995aa2ccccd9bd73065681b5de | [
"Apache-2.0"
] | null | null | null | repos/spikewidgets/spikewidgets/example_datasets/synthesize_timeseries.py | tjd2002/spikeforest2 | 2e393564b858b2995aa2ccccd9bd73065681b5de | [
"Apache-2.0"
] | null | null | null | import numpy as np
def synthesize_timeseries(*, sorting, waveforms, noise_level=1, samplerate=30000, duration=60, waveform_upsamplefac=13):
num_timepoints = np.int64(samplerate * duration)
waveform_upsamplefac = int(waveform_upsamplefac)
W = waveforms
M, TT, K = W.shape[0], W.shape[1], W.shape[2]
... | 35.5 | 120 | 0.573709 |
2d9be799c46b31a433c8c17f927169398d753626 | 17,939 | py | Python | tests/test_integration.py | jesman/dash | 2c182b14b070228efc9a69cfa96c57578e801e93 | [
"MIT"
] | 1 | 2019-01-05T16:44:49.000Z | 2019-01-05T16:44:49.000Z | tests/test_integration.py | jesman/dash | 2c182b14b070228efc9a69cfa96c57578e801e93 | [
"MIT"
] | null | null | null | tests/test_integration.py | jesman/dash | 2c182b14b070228efc9a69cfa96c57578e801e93 | [
"MIT"
] | null | null | null | import json
from multiprocessing import Value
import datetime
import itertools
import re
import time
import dash_html_components as html
import dash_dangerously_set_inner_html
import dash_core_components as dcc
import dash_flow_example
import dash
from dash.dependencies import Input, Output, State
from dash.exception... | 32.206463 | 103 | 0.518535 |
2d9bebd7ec5d800ce4b14d87f24d964cb434d737 | 3,661 | py | Python | ufora/distributed/util/testSocketCode.py | ufora/ufora | 04db96ab049b8499d6d6526445f4f9857f1b6c7e | [
"Apache-2.0",
"CC0-1.0",
"MIT",
"BSL-1.0",
"BSD-3-Clause"
] | 571 | 2015-11-05T20:07:07.000Z | 2022-01-24T22:31:09.000Z | ufora/distributed/util/testSocketCode.py | timgates42/ufora | 04db96ab049b8499d6d6526445f4f9857f1b6c7e | [
"Apache-2.0",
"CC0-1.0",
"MIT",
"BSL-1.0",
"BSD-3-Clause"
] | 218 | 2015-11-05T20:37:55.000Z | 2021-05-30T03:53:50.000Z | ufora/distributed/util/testSocketCode.py | timgates42/ufora | 04db96ab049b8499d6d6526445f4f9857f1b6c7e | [
"Apache-2.0",
"CC0-1.0",
"MIT",
"BSL-1.0",
"BSD-3-Clause"
] | 40 | 2015-11-07T21:42:19.000Z | 2021-05-23T03:48:19.000Z | # Copyright 2015 Ufora 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 i... | 29.764228 | 76 | 0.593827 |
2d9c07a2dc5586b8ef2024a14befadc63c448816 | 24,369 | py | Python | qkeras-master/qkeras/utils.py | filipemlins/nas-hls4ml | b35afc4f684d803d352776c40f3a6cbbf47c4b1c | [
"MIT"
] | null | null | null | qkeras-master/qkeras/utils.py | filipemlins/nas-hls4ml | b35afc4f684d803d352776c40f3a6cbbf47c4b1c | [
"MIT"
] | null | null | null | qkeras-master/qkeras/utils.py | filipemlins/nas-hls4ml | b35afc4f684d803d352776c40f3a6cbbf47c4b1c | [
"MIT"
] | null | null | null | # Copyright 2019 Google LLC
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | 34.565957 | 84 | 0.682383 |
2d9c19e94219506e7be85e9d48909d8a2480fce0 | 3,196 | py | Python | examples/tutorials/recurrent_networks/rppo.py | lorenzosteccanella/machin | 9d3ce87dbed820b5019211b0690b54613084d9e4 | [
"MIT"
] | 287 | 2020-06-13T05:19:50.000Z | 2022-03-31T04:46:32.000Z | examples/tutorials/recurrent_networks/rppo.py | lorenzosteccanella/machin | 9d3ce87dbed820b5019211b0690b54613084d9e4 | [
"MIT"
] | 19 | 2020-08-19T05:33:45.000Z | 2022-03-27T15:16:03.000Z | examples/tutorials/recurrent_networks/rppo.py | lorenzosteccanella/machin | 9d3ce87dbed820b5019211b0690b54613084d9e4 | [
"MIT"
] | 44 | 2020-07-06T00:41:44.000Z | 2022-03-29T17:05:08.000Z | from machin.env.utils.openai_gym import disable_view_window
from machin.frame.algorithms import PPO
from machin.utils.logging import default_logger as logger
from torch.distributions import Categorical
import gym
import torch as t
import torch.nn as nn
from util import convert
# configurations
env = gym.make("Frostb... | 29.592593 | 82 | 0.572278 |
2d9c202f2c90dfd454337b0d96e3250f67503c9d | 26,097 | py | Python | aries-cloudagent-python/aries_cloudagent/protocols/endorse_transaction/v1_0/manager.py | sed-szeged/IndyPerf | 68bb48c7c651cae113cf30696110825ff3267ccc | [
"CC0-1.0"
] | null | null | null | aries-cloudagent-python/aries_cloudagent/protocols/endorse_transaction/v1_0/manager.py | sed-szeged/IndyPerf | 68bb48c7c651cae113cf30696110825ff3267ccc | [
"CC0-1.0"
] | null | null | null | aries-cloudagent-python/aries_cloudagent/protocols/endorse_transaction/v1_0/manager.py | sed-szeged/IndyPerf | 68bb48c7c651cae113cf30696110825ff3267ccc | [
"CC0-1.0"
] | 1 | 2022-02-02T17:05:27.000Z | 2022-02-02T17:05:27.000Z | """Class to manage transactions."""
import json
import logging
import uuid
from asyncio import shield
from time import time
from ....connections.models.conn_record import ConnRecord
from ....core.error import BaseError
from ....core.profile import ProfileSession
from ....indy.issuer import IndyIssuerError
from ....l... | 36.756338 | 90 | 0.653102 |
2d9c35ad917d82c7ea97b66a4f71639d5a9fd385 | 2,232 | py | Python | setup.py | nicholasamorim/opentracing-python-instrumentation | 8a8b88a7cb4a4cebc0a257a1b1f05ef54badea8b | [
"MIT"
] | null | null | null | setup.py | nicholasamorim/opentracing-python-instrumentation | 8a8b88a7cb4a4cebc0a257a1b1f05ef54badea8b | [
"MIT"
] | null | null | null | setup.py | nicholasamorim/opentracing-python-instrumentation | 8a8b88a7cb4a4cebc0a257a1b1f05ef54badea8b | [
"MIT"
] | 1 | 2022-03-01T02:09:57.000Z | 2022-03-01T02:09:57.000Z | from setuptools import setup, find_packages
with open('README.md', 'r') as fh:
long_description = fh.read()
setup(
name='opentracing_instrumentation',
version='3.3.2.dev0',
author='Yuri Shkuro',
author_email='ys@uber.com',
description='Tracing Instrumentation using OpenTracing API '
... | 31.43662 | 76 | 0.544355 |
2d9c836a20662edf3cdf941ad04c213364b917d5 | 629 | py | Python | site_scons/ackward/tests/test_class_property.py | abingham/ackward | f1a45293de570f4b4429d9eaeb3f6c4da7d245bf | [
"MIT"
] | null | null | null | site_scons/ackward/tests/test_class_property.py | abingham/ackward | f1a45293de570f4b4429d9eaeb3f6c4da7d245bf | [
"MIT"
] | null | null | null | site_scons/ackward/tests/test_class_property.py | abingham/ackward | f1a45293de570f4b4429d9eaeb3f6c4da7d245bf | [
"MIT"
] | null | null | null | import unittest
from ..class_property import ClassProperty
from . import scratch
class TestClassProperty(unittest.TestCase):
def _process(self, m):
list(m.process(
scratch, 'header',
{'class_name': 'MethodTest'}))
list(m.process(
scratch, 'impl',
{'... | 24.192308 | 43 | 0.572337 |
2d9c92878c0fa7497f7401c8fb15c36e1ffb26ed | 3,050 | py | Python | tests/test_subscribe_order_update_event.py | xiaohuid/huobi_Python | ebc84b2fc560f77fd77457f36ff91906c43646e3 | [
"Apache-2.0"
] | 1 | 2020-12-28T07:04:45.000Z | 2020-12-28T07:04:45.000Z | tests/test_subscribe_order_update_event.py | xiaohuid/huobi_Python | ebc84b2fc560f77fd77457f36ff91906c43646e3 | [
"Apache-2.0"
] | null | null | null | tests/test_subscribe_order_update_event.py | xiaohuid/huobi_Python | ebc84b2fc560f77fd77457f36ff91906c43646e3 | [
"Apache-2.0"
] | 1 | 2022-03-27T10:36:04.000Z | 2022-03-27T10:36:04.000Z | import unittest
from huobi.impl.websocketrequestimpl import WebsocketRequestImpl
from huobi.model import *
from huobi.impl.utils import *
from huobi.model import *
from tests.mock_websocket_connection import MockWebsocketConnection
from huobi.impl.restapirequestimpl import account_info_map
data = '''
{
"op": "noti... | 32.105263 | 69 | 0.671803 |
2d9c98a992e2809d2a22c407a1d693a7e53a4089 | 5,957 | py | Python | tests/chainer_tests/utils_tests/test_conv.py | asrlabncku/RAP | 11fab37c8d98257ec0aed1b306aa9709a3a51328 | [
"MIT"
] | null | null | null | tests/chainer_tests/utils_tests/test_conv.py | asrlabncku/RAP | 11fab37c8d98257ec0aed1b306aa9709a3a51328 | [
"MIT"
] | null | null | null | tests/chainer_tests/utils_tests/test_conv.py | asrlabncku/RAP | 11fab37c8d98257ec0aed1b306aa9709a3a51328 | [
"MIT"
] | null | null | null | import unittest
import numpy
from six import moves
from chainer import cuda
from chainer import testing
from chainer.testing import attr
from chainer.utils import conv
class TestConv(unittest.TestCase):
def check_conv_outsize(self, size, k, s, p, d):
# When cover_all == False, `outsize` is the maximum ... | 34.633721 | 77 | 0.501595 |
2d9ca6cd97227e6bf42977065587adf14369a841 | 136 | py | Python | aaaaaa/Shield.py | ROYALBEFF/aaaaaa_arcade_game | 36eb8e9a9cdc54f13d54c28fd4ba990faa14f7c0 | [
"MIT"
] | null | null | null | aaaaaa/Shield.py | ROYALBEFF/aaaaaa_arcade_game | 36eb8e9a9cdc54f13d54c28fd4ba990faa14f7c0 | [
"MIT"
] | 3 | 2019-02-26T18:06:50.000Z | 2019-05-10T08:33:35.000Z | aaaaaa/Shield.py | ROYALBEFF/aaaaaa_arcade_game | 36eb8e9a9cdc54f13d54c28fd4ba990faa14f7c0 | [
"MIT"
] | null | null | null | from aaaaaa.Powerup import Powerup
class Shield(Powerup):
def __init__(self):
super().__init__((255, 200, 10, 255), 250)
| 17 | 50 | 0.661765 |
2d9cf2a4e95f2884a2747807d4b00a0e9aed21eb | 2,812 | py | Python | ExcelCompare/compare.py | cafesun/expython | fae2db6f343577c3008a533e8adab3ec35ffa313 | [
"MIT"
] | null | null | null | ExcelCompare/compare.py | cafesun/expython | fae2db6f343577c3008a533e8adab3ec35ffa313 | [
"MIT"
] | null | null | null | ExcelCompare/compare.py | cafesun/expython | fae2db6f343577c3008a533e8adab3ec35ffa313 | [
"MIT"
] | null | null | null | import xlwings as xw
import os, sys
def parseBasicExcel(mapData) :
try :
app = xw.App(visible=False, add_book=False)
excelTblPath = r"E:\Data\Excel\基础功能测试需求-设计需求关系.xlsx"
excelTbl = app.books.open(excelTblPath)
print("open " + excelTblPath + " OK!")
iSheetsCount = excelTbl.sh... | 33.47619 | 63 | 0.591038 |
2d9d090f5ee5a62cc4da03d7eaa0d31c1798721d | 5,053 | py | Python | tests/test_native_treatment_curve_adapter.py | Reveal-Energy-Services/orchid | 4c177ac5a511a80a3588ab8da873fc2d74358da8 | [
"Apache-2.0"
] | null | null | null | tests/test_native_treatment_curve_adapter.py | Reveal-Energy-Services/orchid | 4c177ac5a511a80a3588ab8da873fc2d74358da8 | [
"Apache-2.0"
] | null | null | null | tests/test_native_treatment_curve_adapter.py | Reveal-Energy-Services/orchid | 4c177ac5a511a80a3588ab8da873fc2d74358da8 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2017-2022 Reveal Energy Services, 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 applicabl... | 42.108333 | 120 | 0.720958 |
2d9d4c315f142809b3272b9fc7c959b047fbfdd2 | 3,135 | py | Python | src/ssl_smtp_handler/__init__.py | nablabits/ssl-smtp-handler | 0d6d1290c744724b126473c801dd3c1430f463c4 | [
"MIT"
] | null | null | null | src/ssl_smtp_handler/__init__.py | nablabits/ssl-smtp-handler | 0d6d1290c744724b126473c801dd3c1430f463c4 | [
"MIT"
] | null | null | null | src/ssl_smtp_handler/__init__.py | nablabits/ssl-smtp-handler | 0d6d1290c744724b126473c801dd3c1430f463c4 | [
"MIT"
] | 1 | 2021-08-30T07:11:37.000Z | 2021-08-30T07:11:37.000Z | from email.message import EmailMessage
from email.utils import localtime
from logging import LogRecord
from logging.handlers import SMTPHandler
from smtplib import SMTP_SSL
from smtplib import SMTP_SSL_PORT
from ssl import SSLContext
from typing import Optional
from typing import Union
class SSLSMTPHandler(SMTPHandle... | 33 | 79 | 0.55949 |
2d9d79988fa18a41417d8a19d1ae7c1c1b4364a8 | 8,486 | py | Python | openpnm/utils/Grid.py | Eravalord/OpenPNM | 505bc37318a3ba40d8343f89cd347d0073dd9d14 | [
"MIT"
] | null | null | null | openpnm/utils/Grid.py | Eravalord/OpenPNM | 505bc37318a3ba40d8343f89cd347d0073dd9d14 | [
"MIT"
] | null | null | null | openpnm/utils/Grid.py | Eravalord/OpenPNM | 505bc37318a3ba40d8343f89cd347d0073dd9d14 | [
"MIT"
] | null | null | null | import terminaltables as tt
class Tableist():
def __init__(self, rows=1, cols=1, blank='---', style='ascii'):
super().__init__()
self.blank = blank
header = [blank for i in range(cols)]
self._grid = tt.AsciiTable([])
_ = [self._grid.table_data.append(header.copy()) for _ i... | 28.962457 | 81 | 0.533113 |
2d9d7cfe284aacadfb503e3b6bfacadce246cd12 | 1,114 | py | Python | filter.py | zpeterg/bmig_5003_parse_words_distance_to_db | 6808b08d96f3bc84cbbe6c029e43f483a7dab2ea | [
"MIT"
] | null | null | null | filter.py | zpeterg/bmig_5003_parse_words_distance_to_db | 6808b08d96f3bc84cbbe6c029e43f483a7dab2ea | [
"MIT"
] | null | null | null | filter.py | zpeterg/bmig_5003_parse_words_distance_to_db | 6808b08d96f3bc84cbbe6c029e43f483a7dab2ea | [
"MIT"
] | null | null | null | from utils import cleanWord
class Filter:
"""
A class that receives arguments, and then provides a call-back function that filters each word
"""
def __init__(self, options):
self.start = options['start'].lower()
self.stop = options['stop'].lower()
self.finish = options['finish'... | 31.828571 | 112 | 0.584381 |
2d9d9947785f7b307854850134537a0e355b0316 | 4,476 | py | Python | erpfil/deal.py | avtomaton/kiss-erp | a9f6b65a4fd180cded55de52ec5c65acf4bb0f06 | [
"Apache-2.0"
] | null | null | null | erpfil/deal.py | avtomaton/kiss-erp | a9f6b65a4fd180cded55de52ec5c65acf4bb0f06 | [
"Apache-2.0"
] | null | null | null | erpfil/deal.py | avtomaton/kiss-erp | a9f6b65a4fd180cded55de52ec5c65acf4bb0f06 | [
"Apache-2.0"
] | null | null | null | from flask import (
Blueprint, flash, g, redirect, render_template, request, url_for
)
from werkzeug.exceptions import abort
from erpfil.auth import login_required
from erpfil import db as database
bp = Blueprint('deal', __name__, url_prefix='/deal')
def deal_defaults():
return {
'title': '',
... | 27.975 | 84 | 0.561886 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.