hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
39fb4c6ca9ae28efcb16046a1e30c905f41cb094 | 2,895 | py | Python | debug_toolbar/toolbar/loader.py | philz/django-debug-toolbar | aa07a663cb7b94cf626540112d35f991e5195deb | [
"BSD-3-Clause"
] | 4 | 2015-12-16T22:21:14.000Z | 2016-05-09T14:18:20.000Z | debug_toolbar/toolbar/loader.py | boykun/django-debug-toolbar | 08b6a97d759e9808962cafd5a5ef3bab3642ccdb | [
"BSD-3-Clause"
] | null | null | null | debug_toolbar/toolbar/loader.py | boykun/django-debug-toolbar | 08b6a97d759e9808962cafd5a5ef3bab3642ccdb | [
"BSD-3-Clause"
] | null | null | null | """
The main DebugToolbar class that loads and renders the Toolbar.
"""
from django.template.loader import render_to_string
class DebugToolbar(object):
def __init__(self, request):
self.request = request
self.panels = []
self.config = {
'INTERCEPT_REDIRECTS': True,
}
... | 39.657534 | 145 | 0.620725 |
f14e31dc8302ae83fefc9a4de3bb7e919eb10e8f | 1,457 | py | Python | src/beginningMetal/11_AmbientLighting/Final/pyMetal/mScene.py | pome-ta/pystaMetalStudy | 530248ad8621ec951fcbaf450ebd26ac2752e540 | [
"MIT"
] | 1 | 2021-08-05T04:31:02.000Z | 2021-08-05T04:31:02.000Z | src/beginningMetal/11_AmbientLighting/Final/pyMetal/mScene.py | pome-ta/pystaMetalStudy | 530248ad8621ec951fcbaf450ebd26ac2752e540 | [
"MIT"
] | 2 | 2021-08-14T03:33:12.000Z | 2021-11-11T06:25:01.000Z | src/beginningMetal/11_AmbientLighting/Final/pyMetal/mScene.py | pome-ta/pystaMetalStudy | 530248ad8621ec951fcbaf450ebd26ac2752e540 | [
"MIT"
] | null | null | null | import ctypes
from .camera import Camera
from .mNode import Node
from .pyTypes import SceneConstants, Light
class Scene(Node):
def __init__(self, device, size):
super().__init__()
self.device = device
self.size = size
self.camera = Camera()
self.sceneConstants = SceneConstants()
self.light ... | 29.734694 | 73 | 0.706932 |
fcbce2436f0dc65683bb8ac87d5c24907e05698c | 509 | py | Python | algorithm/680-valid-palindrome-2/solution2.py | tonylixu/devops | c820eb396569e1dc8dad7bd682e37498dde081ba | [
"Apache-2.0"
] | null | null | null | algorithm/680-valid-palindrome-2/solution2.py | tonylixu/devops | c820eb396569e1dc8dad7bd682e37498dde081ba | [
"Apache-2.0"
] | null | null | null | algorithm/680-valid-palindrome-2/solution2.py | tonylixu/devops | c820eb396569e1dc8dad7bd682e37498dde081ba | [
"Apache-2.0"
] | null | null | null | def valid_palindrome(s):
"""
:type s: str
:rtype: bool
"""
lo, hi = 0, len(s) - 1
while lo < hi:
if s[lo] != s[hi]:
s1 = s[:lo] + s[lo+1:]
s2 = s[:hi] + s[hi+1:]
return is_palindrome(s1) or is_palindrome(s2)
lo += 1
hi -= 1
return T... | 20.36 | 57 | 0.449902 |
2fa68c92f903edacace4942da6b878ab3e1e79db | 790 | py | Python | apps/users/views/login.py | deniskrumko/deniskrumko | 613c0c3eac953d2e8482a2e66fce7d3570770b2c | [
"MIT"
] | 2 | 2019-07-09T01:42:04.000Z | 2020-04-09T16:44:59.000Z | apps/users/views/login.py | deniskrumko/deniskrumko | 613c0c3eac953d2e8482a2e66fce7d3570770b2c | [
"MIT"
] | 5 | 2019-12-30T22:16:38.000Z | 2020-09-11T18:13:14.000Z | apps/users/views/login.py | deniskrumko/deniskrumko | 613c0c3eac953d2e8482a2e66fce7d3570770b2c | [
"MIT"
] | 1 | 2019-07-09T01:42:07.000Z | 2019-07-09T01:42:07.000Z | from django.contrib.auth import authenticate, login
from core.views import BaseView
class LoginView(BaseView):
"""View for users to log in."""
menu = 'user'
template_name = 'users/login.html'
title = 'DK - Главная'
description = 'DK - Войти'
def post(self, request):
"""Get username ... | 29.259259 | 94 | 0.650633 |
5f450bd03290524368ff21baba792f8c2e5425a8 | 3,226 | py | Python | prepare-commit-msg.py | apiechowicz/git-hooks | a3b26fe8d8395293d932f3d5df80fcf3a06e0caa | [
"Apache-2.0"
] | 1 | 2018-08-11T19:31:25.000Z | 2018-08-11T19:31:25.000Z | prepare-commit-msg.py | apiechowicz/git-hooks | a3b26fe8d8395293d932f3d5df80fcf3a06e0caa | [
"Apache-2.0"
] | 2 | 2018-08-11T15:50:34.000Z | 2018-08-11T22:34:17.000Z | prepare-commit-msg.py | apiechowicz/git-hooks | a3b26fe8d8395293d932f3d5df80fcf3a06e0caa | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import sys
from re import fullmatch
from subprocess import check_output
SKIP_REBASE_COMMITS = True
SKIP_MERGE_COMMITS = True
BRANCH_NAME_PATTERN = '^(?:feature|bugfix)-(\d+)$'
COMMIT_MESSAGE_TAG_TEMPLATE = '[{}]'
COMMIT_MESSAGE_SEPARATOR = ' '
BRANCH_TAG_PREFIX = '#' # 'normal' working branches... | 33.257732 | 95 | 0.753255 |
8f3c0583c77e173d527da73f2468f70259490756 | 8,174 | py | Python | low_level_simulation/src/rosbridge_suite/rosbridge_library/test/capabilities/test_service_capabilities.py | abiantorres/autonomous-vehicles-system-simulation | 3f0112036b2b270f5055729c648a1310976df933 | [
"Apache-2.0"
] | 60 | 2021-09-07T12:42:48.000Z | 2022-03-12T09:30:36.000Z | low_level_simulation/src/rosbridge_suite/rosbridge_library/test/capabilities/test_service_capabilities.py | abiantorres/autonomous-vehicles-system-simulation | 3f0112036b2b270f5055729c648a1310976df933 | [
"Apache-2.0"
] | 222 | 2021-10-29T22:00:27.000Z | 2022-03-29T20:56:34.000Z | low_level_simulation/src/rosbridge_suite/rosbridge_library/test/capabilities/test_service_capabilities.py | abiantorres/autonomous-vehicles-system-simulation | 3f0112036b2b270f5055729c648a1310976df933 | [
"Apache-2.0"
] | 1 | 2021-08-13T08:30:25.000Z | 2021-08-13T08:30:25.000Z | #!/usr/bin/env python
import rospy
import rostest
import unittest
from json import loads, dumps
from rosbridge_library.capabilities.advertise_service import AdvertiseService
from rosbridge_library.capabilities.unadvertise_service import UnadvertiseService
from rosbridge_library.capabilities.call_service import CallSe... | 44.183784 | 89 | 0.592855 |
de38a74ed2236dd2176f62471c6213bdeb0251e5 | 389 | py | Python | src/ontask_lti/utils.py | japesone/ontask_b | 17af441f9893c521d2e14011e7790ba4077e3318 | [
"MIT"
] | 18 | 2015-02-04T06:56:02.000Z | 2021-01-14T08:48:05.000Z | ims_lti_py/utils.py | mitodl/ims_lti_py | d96a6201cf3b63b9e1b33780ef5e29bc65242ceb | [
"MIT"
] | 8 | 2020-06-05T17:03:01.000Z | 2022-03-11T23:12:32.000Z | perspectivesx_project/ims_lti_py/utils.py | UQ-UQx/PerspectivesX | 94b13aa7d4966b8a34116bd9526d8809a25e0baf | [
"MIT"
] | 27 | 2015-04-16T12:05:42.000Z | 2020-12-24T00:32:53.000Z | from uuid import uuid1
def generate_identifier():
return uuid1().__str__()
class InvalidLTIConfigError(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
class InvalidLTIRequestError(Exception):
def __init__(self, value):
self.... | 22.882353 | 40 | 0.678663 |
b5cee94316ceebe7929ee6d019d967b00171c86e | 21,298 | py | Python | examples/get_answer_byrules.py | Borororo/interpretable_ropes | c083cc388998a1cfb6720a92ecb943b0edcee204 | [
"Apache-2.0"
] | 3 | 2020-10-03T04:07:19.000Z | 2020-11-29T13:48:18.000Z | examples/get_answer_byrules.py | Borororo/Interpretable-Modular-KR-for-MRC | cc921b0e04947663fcc60f0552ca8d8907ca6a1b | [
"Apache-2.0"
] | null | null | null | examples/get_answer_byrules.py | Borororo/Interpretable-Modular-KR-for-MRC | cc921b0e04947663fcc60f0552ca8d8907ca6a1b | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8 -*-
import json
from transformers.data.metrics.squad_metrics import (
compute_f1
)
import os
import random
def read_predicted_file(predict_file,pred):
Object_question_words ={"which",'in which','whose','who','what','for which','on which'}
comparative_words =[
'more', 'less', 'high... | 44.932489 | 197 | 0.550897 |
b331e701b53e8e64522bbf7aa02063c808ff8680 | 10,151 | py | Python | openapi_python_client/parser/properties/model_property.py | gmerz/matterapi-generator | 4ba29c7d308c43365b286e41220e3252fa250526 | [
"MIT"
] | null | null | null | openapi_python_client/parser/properties/model_property.py | gmerz/matterapi-generator | 4ba29c7d308c43365b286e41220e3252fa250526 | [
"MIT"
] | null | null | null | openapi_python_client/parser/properties/model_property.py | gmerz/matterapi-generator | 4ba29c7d308c43365b286e41220e3252fa250526 | [
"MIT"
] | null | null | null | from itertools import chain
from typing import ClassVar, Dict, List, NamedTuple, Optional, Set, Tuple, Union
import attr
from ... import schema as oai
from ... import utils
from ..errors import PropertyError
from ..reference import Reference
from .property import Property
from .file_property import FileProperty
from ... | 38.018727 | 119 | 0.685548 |
81b07a350dd22f44077546c48112cccdec1ba031 | 5,112 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_service_association_links_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_service_association_links_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_service_association_links_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"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 ... | 46.899083 | 223 | 0.689358 |
c4e537a2ade2b7c81f73633ee1e9a0a03ed8536d | 3,142 | py | Python | testframework/test.py | SINTEF-9012/config-testing | a8e7b45d1bd3354231d971e868e167d6af187b90 | [
"MIT"
] | null | null | null | testframework/test.py | SINTEF-9012/config-testing | a8e7b45d1bd3354231d971e868e167d6af187b90 | [
"MIT"
] | null | null | null | testframework/test.py | SINTEF-9012/config-testing | a8e7b45d1bd3354231d971e868e167d6af187b90 | [
"MIT"
] | null | null | null | #!/usr/bin/python
#
# 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
#... | 36.114943 | 142 | 0.81254 |
5f66dbab0261512f2292b523db965e01eb4b2071 | 7,293 | py | Python | mmdet/apis/test.py | zjzhou521/mmdet_2backbone | abf6993e3842c96e4d3dfcb172c2eddfac16e1b4 | [
"Apache-2.0"
] | null | null | null | mmdet/apis/test.py | zjzhou521/mmdet_2backbone | abf6993e3842c96e4d3dfcb172c2eddfac16e1b4 | [
"Apache-2.0"
] | null | null | null | mmdet/apis/test.py | zjzhou521/mmdet_2backbone | abf6993e3842c96e4d3dfcb172c2eddfac16e1b4 | [
"Apache-2.0"
] | 1 | 2021-06-18T18:14:38.000Z | 2021-06-18T18:14:38.000Z | import os.path as osp
import pickle
import shutil
import tempfile
import time
import mmcv
import torch
import torch.distributed as dist
from mmcv.image import tensor2imgs
from mmcv.runner import get_dist_info
from mmdet.core import encode_mask_results
def single_gpu_test(model, data_loader_vis, data_loader_ir, show... | 35.75 | 117 | 0.615796 |
b25f090205ccd5b3b20d97236ab7fe65c976cd42 | 976 | py | Python | python/mysql/demo_mysqldb.py | kskumgk63/trace-examples | 1de45b351aa03367c745933b4923f07d436aea3e | [
"BSD-3-Clause"
] | 75 | 2017-03-20T12:17:14.000Z | 2022-03-24T02:55:53.000Z | python/mysql/demo_mysqldb.py | kskumgk63/trace-examples | 1de45b351aa03367c745933b4923f07d436aea3e | [
"BSD-3-Clause"
] | 25 | 2017-05-10T18:21:20.000Z | 2022-01-28T18:36:52.000Z | python/mysql/demo_mysqldb.py | kskumgk63/trace-examples | 1de45b351aa03367c745933b4923f07d436aea3e | [
"BSD-3-Clause"
] | 54 | 2017-05-10T18:13:52.000Z | 2022-01-11T21:04:42.000Z | import logging.config
from ddtrace import Pin, patch
import MySQLdb
logging.config.dictConfig({
'version': 1,
'formatters': {
'verbose': {
'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
},
},
'handlers': {
'console': {
... | 25.684211 | 98 | 0.577869 |
c3c4c86963dc305768bd3e6cd227c1cc7f1e986d | 5,433 | py | Python | samples/python/mnist/mnist_training.py | dennyac/onnxruntime | d5175795d2b7f2db18b0390f394a49238f814668 | [
"MIT"
] | 5 | 2021-02-20T04:53:48.000Z | 2021-03-09T19:29:27.000Z | samples/python/mnist/mnist_training.py | dennyac/onnxruntime | d5175795d2b7f2db18b0390f394a49238f814668 | [
"MIT"
] | 5 | 2021-03-01T21:35:50.000Z | 2022-03-09T05:38:38.000Z | samples/python/mnist/mnist_training.py | dennyac/onnxruntime | d5175795d2b7f2db18b0390f394a49238f814668 | [
"MIT"
] | 2 | 2021-01-29T09:36:51.000Z | 2021-02-01T13:42:40.000Z | # This code is from https://github.com/pytorch/examples/blob/master/mnist/main.py
# with modification to do training using onnxruntime as backend on cuda device.
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
from torchvision import datasets, transforms
import onnxruntime
from onnx... | 37.993007 | 87 | 0.600405 |
8a139fb21352f9b04ad41cec50fba0a027c1ffa4 | 4,405 | py | Python | contrib/devtools/logprint-scanner.py | robinadaptor/chronon | 630b3945824c1b1cd2ea67ca80835a9f669b9124 | [
"MIT"
] | null | null | null | contrib/devtools/logprint-scanner.py | robinadaptor/chronon | 630b3945824c1b1cd2ea67ca80835a9f669b9124 | [
"MIT"
] | null | null | null | contrib/devtools/logprint-scanner.py | robinadaptor/chronon | 630b3945824c1b1cd2ea67ca80835a9f669b9124 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2017-2018 PIVX developers
# Copyright (c) 2018-2019 Chronon developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import os, sys
from subprocess import check_output
def countRelevantC... | 41.556604 | 167 | 0.569807 |
e322e9d55d8881d340b35329d3a0deaddc21dcdb | 7,670 | py | Python | test/functional/test_framework/test_node.py | smthcoin/smthcoin | 3d212b3052297120ff3eee5e20fc3bab9eeddfd6 | [
"MIT"
] | null | null | null | test/functional/test_framework/test_node.py | smthcoin/smthcoin | 3d212b3052297120ff3eee5e20fc3bab9eeddfd6 | [
"MIT"
] | null | null | null | test/functional/test_framework/test_node.py | smthcoin/smthcoin | 3d212b3052297120ff3eee5e20fc3bab9eeddfd6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Class for smthcoind node under test"""
import decimal
import errno
import http.client
import json
import lo... | 40.157068 | 248 | 0.640287 |
4cf307c3e707da871bbde14379a7a6d3c02d1a93 | 3,474 | py | Python | openpyxl/worksheet/tests/test_page.py | VariantXYZ/openpyxl-variant | 873cc3dda43578c098843ebe930325c879d20baf | [
"MIT"
] | null | null | null | openpyxl/worksheet/tests/test_page.py | VariantXYZ/openpyxl-variant | 873cc3dda43578c098843ebe930325c879d20baf | [
"MIT"
] | null | null | null | openpyxl/worksheet/tests/test_page.py | VariantXYZ/openpyxl-variant | 873cc3dda43578c098843ebe930325c879d20baf | [
"MIT"
] | null | null | null | # Copyright (c) 2010-2020 openpyxl
import pytest
from openpyxl.xml.functions import tostring
from openpyxl.tests.helper import compare_xml
@pytest.fixture
def PageMargins():
from .. page import PageMargins
return PageMargins
class TestPageMargins:
def test_ctor(self, PageMargins):
pm = PageMar... | 28.243902 | 164 | 0.613126 |
f0a8b00b799d2be6a09dd1567b39c88872c31f9b | 655 | py | Python | test/测试文件2.py | colinsusie/excelexporter | 747cfe4794b62b03e9ac35d2f6cd9f6e3cfef117 | [
"MIT"
] | 15 | 2020-08-04T03:50:47.000Z | 2022-03-19T14:33:19.000Z | test/测试文件2.py | colinsusie/excelexporter | 747cfe4794b62b03e9ac35d2f6cd9f6e3cfef117 | [
"MIT"
] | 2 | 2021-02-24T08:02:14.000Z | 2021-04-22T11:25:55.000Z | test/测试文件2.py | colinsusie/excelexporter | 747cfe4794b62b03e9ac35d2f6cd9f6e3cfef117 | [
"MIT"
] | 5 | 2020-08-15T02:16:19.000Z | 2021-03-18T09:30:01.000Z | # -*- coding: utf-8 -*-
from excel_exporter import *
define = [
# 第一列:Excel列名 第二列:导出字段名 第三列:字段类型
['编号', 'no', Int()],
['职业', 'job', Int()],
['等级', 'level', Int()],
]
config = {
"source": "测试文件2.xlsx",
"sheet": "Sheet1",
"target": [
["./test2.js", "js", ET_OPT],
["./test2.lua", "lua", ET_OPT],
["./test... | 19.848485 | 58 | 0.558779 |
f9f78d6537bf19e77353c50dacc8367c4a373f62 | 7,261 | py | Python | homeassistant/components/cover/device_trigger.py | ronytomen/core | 2e9acf09b61d93a1b6b5dc5148822b85d65c5d79 | [
"Apache-2.0"
] | null | null | null | homeassistant/components/cover/device_trigger.py | ronytomen/core | 2e9acf09b61d93a1b6b5dc5148822b85d65c5d79 | [
"Apache-2.0"
] | null | null | null | homeassistant/components/cover/device_trigger.py | ronytomen/core | 2e9acf09b61d93a1b6b5dc5148822b85d65c5d79 | [
"Apache-2.0"
] | null | null | null | """Provides device automations for Cover."""
from __future__ import annotations
import voluptuous as vol
from homeassistant.components.automation import AutomationActionType
from homeassistant.components.device_automation import TRIGGER_BASE_SCHEMA
from homeassistant.components.homeassistant.triggers import (
num... | 33.004545 | 85 | 0.597025 |
3a54919ac0eb3e1d2137464091cfe2693eeb595e | 11,886 | py | Python | tests/scripts/thread-cert/test_srp_name_conflicts.py | yogeshsurapaneni/openthread | 14fc9eb3a813331ffb56ba7b6025fc940ae15769 | [
"BSD-3-Clause"
] | 2 | 2019-07-12T13:19:40.000Z | 2019-07-15T13:39:04.000Z | tests/scripts/thread-cert/test_srp_name_conflicts.py | yogeshsurapaneni/openthread | 14fc9eb3a813331ffb56ba7b6025fc940ae15769 | [
"BSD-3-Clause"
] | 9 | 2020-03-05T03:02:18.000Z | 2020-09-28T05:23:48.000Z | tests/scripts/thread-cert/test_srp_name_conflicts.py | yogeshsurapaneni/openthread | 14fc9eb3a813331ffb56ba7b6025fc940ae15769 | [
"BSD-3-Clause"
] | 1 | 2021-01-21T13:50:22.000Z | 2021-01-21T13:50:22.000Z | #!/usr/bin/env python3
#
# Copyright (c) 2021, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# ... | 42.45 | 108 | 0.676426 |
9a3b64e364bfe2acc776d3761f10f9ed04ff1561 | 1,209 | py | Python | src/gamesbyexample/numeralsystems.py | spp2/PythonStdioGames | 7edc6a07ef816a44579800e773f30217541971fa | [
"MIT"
] | null | null | null | src/gamesbyexample/numeralsystems.py | spp2/PythonStdioGames | 7edc6a07ef816a44579800e773f30217541971fa | [
"MIT"
] | null | null | null | src/gamesbyexample/numeralsystems.py | spp2/PythonStdioGames | 7edc6a07ef816a44579800e773f30217541971fa | [
"MIT"
] | null | null | null | """Numeral System Counters, by Al Sweigart al@inventwithpython.com
Shows equivalent numbers in decimal, hexadecimal, and binary.
This and other games are available at https://nostarch.com/XX
Tags: tiny, math"""
__version__ = 0
print('''Numeral System Counters, by Al Sweigart al@inventwithpython.com
This program shows... | 30.225 | 72 | 0.659222 |
ac4aa2cd5ea6e55db5b751566f5ae13feb28a20c | 10,847 | py | Python | python-package/lets_plot/geo_data/core.py | OLarionova-HORIS/lets-plot | 89e30a574fe2de3da17186acdbe1cf427d66d87f | [
"MIT"
] | null | null | null | python-package/lets_plot/geo_data/core.py | OLarionova-HORIS/lets-plot | 89e30a574fe2de3da17186acdbe1cf427d66d87f | [
"MIT"
] | null | null | null | python-package/lets_plot/geo_data/core.py | OLarionova-HORIS/lets-plot | 89e30a574fe2de3da17186acdbe1cf427d66d87f | [
"MIT"
] | null | null | null | from typing import Any, Union, List, Optional
import numpy as np
from pandas import Series
from .gis.geocoding_service import GeocodingService
from .gis.geometry import GeoPoint
from .gis.request import RequestBuilder, RequestKind
from .gis.response import Response, SuccessResponse
from .regions import Regions, _rais... | 30.298883 | 133 | 0.637688 |
d0c5a912c387d5a7f17e50aaf78cd978dac19c71 | 6,529 | py | Python | proxy/core/acceptor/executors.py | Flared/proxy.py | 7199459c69a717bb55f932230ae9a39707430149 | [
"BSD-3-Clause"
] | null | null | null | proxy/core/acceptor/executors.py | Flared/proxy.py | 7199459c69a717bb55f932230ae9a39707430149 | [
"BSD-3-Clause"
] | null | null | null | proxy/core/acceptor/executors.py | Flared/proxy.py | 7199459c69a717bb55f932230ae9a39707430149 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
proxy.py
~~~~~~~~
⚡⚡⚡ Fast, Lightweight, Pluggable, TLS interception capable proxy server focused on
Network monitoring, controls & Application development, testing, debugging.
:copyright: (c) 2013-present by Abhinav Singh and contributors.
:license: BSD, see LICENSE... | 32.004902 | 86 | 0.603768 |
f47690ae6bb55388533a42963e580b535d0479e2 | 6,268 | py | Python | src/pyrin/template/handlers/package.py | wilsonGmn/pyrin | 25dbe3ce17e80a43eee7cfc7140b4c268a6948e0 | [
"BSD-3-Clause"
] | null | null | null | src/pyrin/template/handlers/package.py | wilsonGmn/pyrin | 25dbe3ce17e80a43eee7cfc7140b4c268a6948e0 | [
"BSD-3-Clause"
] | null | null | null | src/pyrin/template/handlers/package.py | wilsonGmn/pyrin | 25dbe3ce17e80a43eee7cfc7140b4c268a6948e0 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
template handlers package module.
"""
import os
import pyrin.utils.path as path_utils
import pyrin.application.services as application_services
from pyrin.core.structs import DTO
from pyrin.template.decorators import template_handler
from pyrin.template.enumerations import TemplateCLIHand... | 36.231214 | 96 | 0.674697 |
890a3cf095a862b0a2fe68526ab9d6e37f489ca2 | 321,689 | py | Python | Uncertainty/data/case-ln/case_ln_142.py | thanever/SOC | 9f30d1a9c7610a68de9c178a1170bdf1c8ca11d4 | [
"MIT"
] | null | null | null | Uncertainty/data/case-ln/case_ln_142.py | thanever/SOC | 9f30d1a9c7610a68de9c178a1170bdf1c8ca11d4 | [
"MIT"
] | null | null | null | Uncertainty/data/case-ln/case_ln_142.py | thanever/SOC | 9f30d1a9c7610a68de9c178a1170bdf1c8ca11d4 | [
"MIT"
] | null | null | null | from numpy import array
def case_ln_142():
ppc = {"version": '2'}
ppc["baseMVA"] = 100.0
ppc["bus"] = array([
[1.0, 1.0, 53.7196, 14.3252, 0.0, 0.0, 1.0, 1.0, 0.0, 220.0, 1.0, 1.1, 0.95, 0.6, 10 ],
[2.0, 1.0, 0.0, 0.0, 0.0, 0.0, ... | 134.260851 | 201 | 0.340705 |
e4a657793f9f05a77c5e81587237f08dc7c7295f | 1,406 | py | Python | code/tools/chgdef.py | jgresula/jagpdf | 6c36958b109e6522e6b57d04144dd83c024778eb | [
"MIT"
] | 54 | 2015-02-16T14:25:16.000Z | 2022-03-16T07:54:25.000Z | code/tools/chgdef.py | jgresula/jagpdf | 6c36958b109e6522e6b57d04144dd83c024778eb | [
"MIT"
] | null | null | null | code/tools/chgdef.py | jgresula/jagpdf | 6c36958b109e6522e6b57d04144dd83c024778eb | [
"MIT"
] | 30 | 2015-03-05T08:52:25.000Z | 2022-02-17T13:49:15.000Z | #!/usr/bin/env python
# Copyright (c) 2005-2009 Jaroslav Gresula
#
# Distributed under the MIT license (See accompanying file
# LICENSE.txt or copy at http://jagpdf.org/LICENSE.txt)
#
import re
class Bunch:
def __init__(self, **kwds):
self.__dict__.update(kwds)
def _rex( text ):
return re.compile( ... | 14.494845 | 84 | 0.536984 |
f0c268bbb2e7118901b53b23d5d2938d10a2dbd8 | 106 | py | Python | esp8266/MicroPython ESP8266/Default files/boot.py | DocVaughan/CRAWLAB-Code-Snippets | 90c946bef0fbe37401f822d58ce5a6b3c5349616 | [
"BSD-3-Clause"
] | 12 | 2015-03-03T18:32:03.000Z | 2021-03-13T18:50:37.000Z | esp8266/MicroPython ESP8266/Default files/boot.py | DocVaughan/CRAWLAB-Code-Snippets | 90c946bef0fbe37401f822d58ce5a6b3c5349616 | [
"BSD-3-Clause"
] | null | null | null | esp8266/MicroPython ESP8266/Default files/boot.py | DocVaughan/CRAWLAB-Code-Snippets | 90c946bef0fbe37401f822d58ce5a6b3c5349616 | [
"BSD-3-Clause"
] | 7 | 2017-01-20T20:31:54.000Z | 2021-12-28T16:52:48.000Z | # This file is executed on every boot (including wake-boot from deepsleep)
import webrepl
webrepl.start()
| 26.5 | 74 | 0.792453 |
94c06786dc42937e7f59dd295823ee08c90d1756 | 289 | py | Python | Section 5/5.2/code.py | PacktPublishing/-Data-Wrangling-with-Python-3.x | 0273db00752a05e347e149d68decb45ed4778d2c | [
"MIT"
] | 16 | 2019-02-07T09:17:11.000Z | 2022-01-30T12:38:47.000Z | Section 5/5.2/code.py | PacktPublishing/-Data-Wrangling-with-Python-3.x | 0273db00752a05e347e149d68decb45ed4778d2c | [
"MIT"
] | 1 | 2019-07-06T15:36:28.000Z | 2019-07-06T15:36:28.000Z | Section 5/5.2/code.py | PacktPublishing/-Data-Wrangling-with-Python-3.x | 0273db00752a05e347e149d68decb45ed4778d2c | [
"MIT"
] | 15 | 2019-02-12T09:46:03.000Z | 2022-01-04T16:54:28.000Z | import pandas as pd
dataset = pd.read_csv('employees.csv')
dataset.dropna(axis = 0, inplace = True)
from sklearn import preprocessing
le = preprocessing.LabelEncoder()
le.fit(dataset['Gender'])
gender_encoded = le.transform(dataset['Gender'])
dataset['Gender_encoded'] = gender_encoded
| 24.083333 | 48 | 0.768166 |
51ad27efa118b1e7ab8939a8d37af56debee4587 | 894 | py | Python | styles.py | imphatic/source-crawler | 9c7f2d95e3f232367d9b6243dc2c9897a9d09442 | [
"MIT"
] | null | null | null | styles.py | imphatic/source-crawler | 9c7f2d95e3f232367d9b6243dc2c9897a9d09442 | [
"MIT"
] | null | null | null | styles.py | imphatic/source-crawler | 9c7f2d95e3f232367d9b6243dc2c9897a9d09442 | [
"MIT"
] | null | null | null | class Styles:
# Colors
colors = {
'background': 'black',
'foreground': 'white'
}
# object styles
object_styles = {
'label': {
'bg': colors['background'],
'fg': colors['foreground'],
'font': 'none 12 bold',
'text': 'Add Label T... | 21.804878 | 61 | 0.474273 |
d37bfd935849cc1a730ce5de39bc9e380ac2b2bb | 7,612 | py | Python | Helper.py | RodiiHernandezz/ZendaJS | 7091716d35c70442897ac47841352865018661fb | [
"MIT"
] | null | null | null | Helper.py | RodiiHernandezz/ZendaJS | 7091716d35c70442897ac47841352865018661fb | [
"MIT"
] | null | null | null | Helper.py | RodiiHernandezz/ZendaJS | 7091716d35c70442897ac47841352865018661fb | [
"MIT"
] | null | null | null | # ***
# * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved.
# * Licensed under the MIT license. See LICENSE file in the project root
# * for full license information.
# *
# * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
# *
# * For related information -... | 31.716667 | 102 | 0.638334 |
24b95b815f5908825ef2e07f686e17a674822dfb | 912 | py | Python | flask-new/main.py | JanakiRaman-2002/owaspLegacyPage | a940a353745317ac2887b65e7b7c397672161f9f | [
"Apache-2.0"
] | null | null | null | flask-new/main.py | JanakiRaman-2002/owaspLegacyPage | a940a353745317ac2887b65e7b7c397672161f9f | [
"Apache-2.0"
] | null | null | null | flask-new/main.py | JanakiRaman-2002/owaspLegacyPage | a940a353745317ac2887b65e7b7c397672161f9f | [
"Apache-2.0"
] | null | null | null | from flask import Flask,redirect,url_for,render_template
import json
app = Flask(__name__)
@app.route("/")
def home():
return render_template("parallax.html", context=len(data_dict))
data_JSON = """
[
{
"name": "Bonda",
"post":"secure",
"link":"www.google.com"
},
{... | 16 | 68 | 0.505482 |
c18f0810be88cb55b0b7a3218bbd98acda2fb189 | 12,655 | py | Python | tests/testcases/test_data_collection.py | jaelgu/towhee | 34c79cf50831dc271ae0ab02f319f9e355c2d0bf | [
"Apache-2.0"
] | null | null | null | tests/testcases/test_data_collection.py | jaelgu/towhee | 34c79cf50831dc271ae0ab02f319f9e355c2d0bf | [
"Apache-2.0"
] | null | null | null | tests/testcases/test_data_collection.py | jaelgu/towhee | 34c79cf50831dc271ae0ab02f319f9e355c2d0bf | [
"Apache-2.0"
] | null | null | null | # coding : UTF-8
import sys
sys.path.append("../../tests")
import towhee
import time
import threading
import numpy as np
import random
import operator
from towhee import pipeline
from common import common_func as cf
from towhee.functional import DataCollection
class TestDataCollectionAPIsInvalid:
""" Test case of ... | 30.347722 | 82 | 0.59115 |
d1b1f6b684725808d36921aa5d4204fd683ee894 | 276 | py | Python | tests/test_repr.py | eikevons/pandas-paddles | 98e519ce847d015b76bc3401d534b8b752dd583d | [
"MIT"
] | 4 | 2022-02-24T09:35:37.000Z | 2022-03-19T19:50:47.000Z | tests/test_repr.py | eikevons/pandas-paddles | 98e519ce847d015b76bc3401d534b8b752dd583d | [
"MIT"
] | null | null | null | tests/test_repr.py | eikevons/pandas-paddles | 98e519ce847d015b76bc3401d534b8b752dd583d | [
"MIT"
] | null | null | null | from pandas_paddles.df_accessor import AccessorBase
from pandas_paddles import DF, S
def test_DF_repr():
r = repr(DF["key"].attrib.method(arg=1))
assert isinstance(r, str)
def test_S_repr():
r = repr(S["key"].attrib.method(arg=1))
assert isinstance(r, str)
| 23 | 51 | 0.702899 |
8617fa92671d4e047cd7cd2f3cdce81bef6571bb | 153 | py | Python | welltrajconvert/__init__.py | bpamos/welltrajconvert | 86ee684fdb1968218ac17e4b260df80c6c88f475 | [
"MIT"
] | 7 | 2020-09-24T09:33:53.000Z | 2022-01-04T14:47:22.000Z | welltrajconvert/__init__.py | bpamos/directional-survey-converter | 86ee684fdb1968218ac17e4b260df80c6c88f475 | [
"MIT"
] | 4 | 2020-06-19T13:54:11.000Z | 2020-08-13T18:11:38.000Z | welltrajconvert/__init__.py | bpamos/directional-survey-converter | 86ee684fdb1968218ac17e4b260df80c6c88f475 | [
"MIT"
] | 3 | 2020-12-07T19:53:08.000Z | 2022-03-15T08:49:29.000Z | from .wellbore_trajectory import *
from .deviation_survey import *
from .data_source import *
from .data_object import *
from .calculable_object import * | 30.6 | 34 | 0.810458 |
f97bb1bb64ff1b5082ffe4a81a1d7e07ceeae7f7 | 6,824 | py | Python | bayenv2_SNPSFILE_breaker/bayenv2_SNPSFILE_breaker.py | tyrmi/PGU | bd04b62599e13124426f0830fe53e4324aca8439 | [
"BSD-3-Clause"
] | 3 | 2017-07-17T07:45:37.000Z | 2019-04-12T21:03:20.000Z | bayenv2_SNPSFILE_breaker/bayenv2_SNPSFILE_breaker.py | tyrmi/PGU | bd04b62599e13124426f0830fe53e4324aca8439 | [
"BSD-3-Clause"
] | null | null | null | bayenv2_SNPSFILE_breaker/bayenv2_SNPSFILE_breaker.py | tyrmi/PGU | bd04b62599e13124426f0830fe53e4324aca8439 | [
"BSD-3-Clause"
] | null | null | null | '''
Copyright © 2017 Jaakko Tyrmi. All Rights Reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the foll... | 47.388889 | 135 | 0.66823 |
5fd3e4174012eb2974141f4e43139ea55efa8649 | 1,408 | py | Python | common/common.py | trinity-project/trinity-eth | a4e4fff1d1dbc0b422d7acc21ed95a308cf51967 | [
"MIT"
] | 15 | 2018-05-11T06:09:47.000Z | 2020-07-30T05:59:41.000Z | common/common.py | trinity-project/trinity-eth | a4e4fff1d1dbc0b422d7acc21ed95a308cf51967 | [
"MIT"
] | null | null | null | common/common.py | trinity-project/trinity-eth | a4e4fff1d1dbc0b422d7acc21ed95a308cf51967 | [
"MIT"
] | 6 | 2018-08-06T19:00:35.000Z | 2020-12-03T02:13:45.000Z | # --*-- coding : utf-8 --*--
"""Author: Trinity Core Team
MIT License
Copyright (c) 2018 Trinity
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... | 38.054054 | 78 | 0.756392 |
bc91fc537d93333b2ea98f567cd7b9a48d1a2a2a | 2,243 | py | Python | aoi-demo-labeling/coco_train_test_split.py | goheesheng/AOI_FHG | e1ae4a11030aa8f9820d55c1c1fe16ca8a4fb3f3 | [
"MIT"
] | null | null | null | aoi-demo-labeling/coco_train_test_split.py | goheesheng/AOI_FHG | e1ae4a11030aa8f9820d55c1c1fe16ca8a4fb3f3 | [
"MIT"
] | null | null | null | aoi-demo-labeling/coco_train_test_split.py | goheesheng/AOI_FHG | e1ae4a11030aa8f9820d55c1c1fe16ca8a4fb3f3 | [
"MIT"
] | null | null | null | from pathlib import Path
import argparse
import json
import copy
import random
import math
def main():
parser = argparse.ArgumentParser()
parser.add_argument("--input_path", default="./data/combined_instances_coco.json",
help="Path to a COCO annotations which shall be split.")
pars... | 30.310811 | 86 | 0.682568 |
fa6e5e23d9fce6ea05bd8e28032644b9746eae03 | 1,528 | py | Python | examples/desaminases/get_variants_in_UTR.py | mahajrod/MAVR | 4db74dff7376a2ffe4426db720b241de9198f329 | [
"MIT"
] | 10 | 2015-04-28T14:15:04.000Z | 2021-03-15T00:07:38.000Z | examples/desaminases/get_variants_in_UTR.py | mahajrod/MAVR | 4db74dff7376a2ffe4426db720b241de9198f329 | [
"MIT"
] | null | null | null | examples/desaminases/get_variants_in_UTR.py | mahajrod/MAVR | 4db74dff7376a2ffe4426db720b241de9198f329 | [
"MIT"
] | 6 | 2017-03-16T22:38:41.000Z | 2021-08-11T00:22:52.000Z | #!/usr/bin/env python
__author__ = 'mahajrod'
import os
from Parsers.VCF import CollectionVCF
def variants_in_UTR(collection, feature_type="5'_UTR"):
UTR_record_list = []
for variant in collection:
if feature_type in variant.info_dict["Ftype"]:
UTR_record_list.append(variant)
return ... | 38.2 | 126 | 0.567408 |
707d64360b9293f9df614c459b8833113b474d6f | 699 | py | Python | pyasdf/tags/unit/tests/test_unit.py | embray/pyasdf | 3e0a314ec01a88bedfb2ce8def83319362adc5a2 | [
"BSD-3-Clause"
] | null | null | null | pyasdf/tags/unit/tests/test_unit.py | embray/pyasdf | 3e0a314ec01a88bedfb2ce8def83319362adc5a2 | [
"BSD-3-Clause"
] | null | null | null | pyasdf/tags/unit/tests/test_unit.py | embray/pyasdf | 3e0a314ec01a88bedfb2ce8def83319362adc5a2 | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, unicode_literals, print_function
from astropy import units as u
from .... import asdf
from ....tests import helpers
# TODO: Implement defunit
def test_invalid_unit():
yaml... | 19.416667 | 82 | 0.67382 |
7da4cbc6cae4c8430e2008c7459825a1ff245a6a | 16,222 | py | Python | stage2/server/UCSServer.py | vallard/KUBaM | abdc60830a810243d198a09e8897366d518dcf33 | [
"Apache-2.0"
] | null | null | null | stage2/server/UCSServer.py | vallard/KUBaM | abdc60830a810243d198a09e8897366d518dcf33 | [
"Apache-2.0"
] | null | null | null | stage2/server/UCSServer.py | vallard/KUBaM | abdc60830a810243d198a09e8897366d518dcf33 | [
"Apache-2.0"
] | null | null | null | from ucsmsdk.ucsexception import UcsException
import re, sys
# given an array and a string of numbers, make sure they are all in the array:
#
def check_values(array, csv):
indexes = csv.split(',')
for i in indexes:
try:
i = int(i) - 1
except:
print "bad value: " + i
... | 36.129176 | 234 | 0.669461 |
b26ed21e0d84dc6ef3708b85d67b17ab3fd8b40b | 42,684 | py | Python | tests/unittests/test_cgr.py | felix-walter/pydtnsim | 89376021fecf1f114c76cde773d7a92ab9fcf464 | [
"MIT"
] | 8 | 2018-12-11T17:39:44.000Z | 2021-05-07T10:24:03.000Z | tests/unittests/test_cgr.py | Elianelin/pydtnsim | 916b0ebfa2b65b7a80af293dd4c39f862eadeae3 | [
"MIT"
] | 13 | 2019-01-14T14:08:15.000Z | 2021-06-12T17:03:43.000Z | tests/unittests/test_cgr.py | Elianelin/pydtnsim | 916b0ebfa2b65b7a80af293dd4c39f862eadeae3 | [
"MIT"
] | 4 | 2019-03-20T15:12:40.000Z | 2022-02-22T06:16:24.000Z | import math
import pytest
from pydtnsim.routing import cgr_anchor
from pydtnsim.routing import cgr_basic
from pydtnsim.routing import scgr
from pydtnsim.backend import QSim
from pydtnsim.routing.cgr_basic import Route, Neighbor
from pydtnsim import Contact, ContactPlan, ContactGraph, Packet
from pydtnsim import Con... | 36.796552 | 79 | 0.582724 |
a2dcba16d7f84d103ddf78a33a64cea8d4d6f1de | 2,494 | py | Python | Demo/crawler_heart/heart/heart.py | zuosc/PythonCode | 3592f5780fc9e335fa880a1f7e9aac0e9d33439e | [
"MIT"
] | 1 | 2017-09-24T19:06:55.000Z | 2017-09-24T19:06:55.000Z | Demo/crawler_heart/heart/heart.py | zuosc/PythonCode | 3592f5780fc9e335fa880a1f7e9aac0e9d33439e | [
"MIT"
] | null | null | null | Demo/crawler_heart/heart/heart.py | zuosc/PythonCode | 3592f5780fc9e335fa880a1f7e9aac0e9d33439e | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
import codecs
import csv
import re
import jieba.analyse
import matplotlib.pyplot as plt
import requests
from scipy.misc import imread
from wordcloud import WordCloud
__author__ = 'liuzhijun'
cookies = {
"ALF": "1489741225",
"SCF": "AlE23pvO55c-tjcvq_9U-BwEK7OzuLdN6XnI-Bg1vQPlNcm7Atblq3... | 28.340909 | 155 | 0.61668 |
5cb8d5a6f969726c0cc6a48d2eaf84d835dbc89e | 94,122 | py | Python | src/sage/manifolds/differentiable/affine_connection.py | tashakim/sage | 467fbc70a08b552b3de33d9065204ee9cbfb02c7 | [
"BSL-1.0"
] | 4 | 2020-07-17T04:49:44.000Z | 2020-07-29T06:33:51.000Z | src/sage/manifolds/differentiable/affine_connection.py | Ivo-Maffei/sage | 467fbc70a08b552b3de33d9065204ee9cbfb02c7 | [
"BSL-1.0"
] | null | null | null | src/sage/manifolds/differentiable/affine_connection.py | Ivo-Maffei/sage | 467fbc70a08b552b3de33d9065204ee9cbfb02c7 | [
"BSL-1.0"
] | null | null | null | r"""
Affine Connections
The class :class:`AffineConnection` implements affine connections on
smooth manifolds.
AUTHORS:
- Eric Gourgoulhon, Michal Bejger (2013-2015) : initial version
- Marco Mancini (2015) : parallelization of some computations
- Florentin Jaffredo (2018) : series expansion with respect to a given
... | 40.223077 | 125 | 0.507777 |
7266f15f4164e7d6acf5c6103440ac0e1f41341f | 1,167 | py | Python | setup.py | claymation/django-toggles | a3687701b7494550eb36f14f85b46472c29591df | [
"MIT"
] | 3 | 2016-07-16T09:57:20.000Z | 2021-04-03T17:39:49.000Z | setup.py | claymation/django-toggles | a3687701b7494550eb36f14f85b46472c29591df | [
"MIT"
] | 1 | 2016-10-22T18:31:06.000Z | 2016-10-22T18:31:06.000Z | setup.py | claymation/django-toggles | a3687701b7494550eb36f14f85b46472c29591df | [
"MIT"
] | null | null | null | import os
from setuptools import setup
README = open(os.path.join(os.path.dirname(__file__), 'README.md')).read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-toggles',
version='0.1',
packages=['toggles'],
... | 31.540541 | 78 | 0.620394 |
c33788391d4396f6d763f3c1d0d3dfa12802c660 | 11,755 | py | Python | tests/snappi/pfc/test_pfc_pause_lossy_with_snappi.py | lolyu/sonic-mgmt | ed888fd1ce26e7f44fd7f70af00c43ace4882668 | [
"Apache-2.0"
] | 132 | 2016-10-19T12:34:44.000Z | 2022-03-16T09:00:39.000Z | tests/snappi/pfc/test_pfc_pause_lossy_with_snappi.py | lolyu/sonic-mgmt | ed888fd1ce26e7f44fd7f70af00c43ace4882668 | [
"Apache-2.0"
] | 3,152 | 2016-09-21T23:05:58.000Z | 2022-03-31T23:29:08.000Z | tests/snappi/pfc/test_pfc_pause_lossy_with_snappi.py | lolyu/sonic-mgmt | ed888fd1ce26e7f44fd7f70af00c43ace4882668 | [
"Apache-2.0"
] | 563 | 2016-09-20T01:00:15.000Z | 2022-03-31T22:43:54.000Z | import logging
import pytest
from files.helper import run_pfc_test
from tests.common.helpers.assertions import pytest_assert, pytest_require
from tests.common.fixtures.conn_graph_facts import conn_graph_facts,\
fanout_graph_facts
from tests.common.snappi.snappi_fixtures import snappi_api_serv_ip, snappi_api_serv_p... | 44.695817 | 95 | 0.604339 |
b8475ca711d95c2b7e81fe8713fd54938b5f1ddc | 1,708 | py | Python | main3.py | mitliagkas/pyliakmon | 28a22be63646faf39f0f96a779a4579f69bfb41a | [
"MIT"
] | 3 | 2016-05-27T13:46:53.000Z | 2017-04-16T22:43:42.000Z | main3.py | mitliagkas/pyliakmon | 28a22be63646faf39f0f96a779a4579f69bfb41a | [
"MIT"
] | null | null | null | main3.py | mitliagkas/pyliakmon | 28a22be63646faf39f0f96a779a4579f69bfb41a | [
"MIT"
] | null | null | null | import numpy as np
from numpy import linalg as la
import time
import subprocess
from streaming import *
import MovieLens
from multiprocessing import Process
from multiprocessing import Array
def runBOI(k,id,arr,allT,nWorkers,doneWithBlock,cond):
boi=ParallelBlockOrthogonal(
id=id,
arr=arr... | 26.276923 | 115 | 0.581967 |
437323aa270e187117807fda8a43a9c258fa41a2 | 3,723 | py | Python | enas_lm/src/data_utils.py | MODU-FTNC/google-research | 7c4f9b6e375eaacf50d8280b26f7e42a06b568aa | [
"Apache-2.0"
] | 1 | 2020-08-14T08:11:30.000Z | 2020-08-14T08:11:30.000Z | enas_lm/src/data_utils.py | robot-ai-machinelearning/google-research | 88481d10a87947ffb9305dc7665682e008b27391 | [
"Apache-2.0"
] | 5 | 2021-08-25T16:15:36.000Z | 2022-02-10T04:34:04.000Z | enas_lm/src/data_utils.py | robot-ai-machinelearning/google-research | 88481d10a87947ffb9305dc7665682e008b27391 | [
"Apache-2.0"
] | 1 | 2020-03-05T09:24:01.000Z | 2020-03-05T09:24:01.000Z | # coding=utf-8
# Copyright 2019 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 38.381443 | 79 | 0.663443 |
9027f8d6b962c9250816fda62320e7ec218cad64 | 1,864 | py | Python | src/job-exporter/test/test_ps.py | wyatuestc/pai | 65b44e1ab37cab0790af392a016cc9fb1d2318fe | [
"MIT"
] | 1,417 | 2019-05-07T00:51:36.000Z | 2022-03-31T10:15:31.000Z | src/job-exporter/test/test_ps.py | wyatuestc/pai | 65b44e1ab37cab0790af392a016cc9fb1d2318fe | [
"MIT"
] | 2,447 | 2019-05-07T01:36:32.000Z | 2022-03-30T08:47:43.000Z | src/job-exporter/test/test_ps.py | wyatuestc/pai | 65b44e1ab37cab0790af392a016cc9fb1d2318fe | [
"MIT"
] | 329 | 2019-05-07T02:28:06.000Z | 2022-03-29T06:12:49.000Z | # Copyright (c) Microsoft Corporation
# All rights reserved.
#
# MIT License
#
# 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 ... | 39.659574 | 128 | 0.723712 |
d959e2f2ce96964d83ca0b160a0eb0d0096cc6a9 | 2,258 | py | Python | src/c3nav/editor/views/base.py | bate/c3nav | 9a86dd3eaeb3a10af3c5fa869575ed1e9300465a | [
"Apache-2.0"
] | null | null | null | src/c3nav/editor/views/base.py | bate/c3nav | 9a86dd3eaeb3a10af3c5fa869575ed1e9300465a | [
"Apache-2.0"
] | null | null | null | src/c3nav/editor/views/base.py | bate/c3nav | 9a86dd3eaeb3a10af3c5fa869575ed1e9300465a | [
"Apache-2.0"
] | null | null | null | from functools import wraps
from django.core.exceptions import PermissionDenied
from django.http import HttpResponseNotModified, HttpResponseRedirect
from django.shortcuts import render
from django.utils.cache import patch_vary_headers
from django.utils.translation import get_language
from c3nav.editor.models import ... | 37.633333 | 113 | 0.689105 |
d70257e7afe34ac2d45d06fc0d243ce5899e4add | 7,053 | py | Python | 08_Convolutional_Neural_Networks/06_Deepdream/06_deepdream.py | varunjha089/tensorflow_cookbook | c1fa5051c860ecb6de875db975465ced06f43ba6 | [
"MIT"
] | 93 | 2018-05-27T08:07:02.000Z | 2022-02-28T11:18:08.000Z | 08_Convolutional_Neural_Networks/06_Deepdream/06_deepdream.py | varunjha089/tensorflow_cookbook | c1fa5051c860ecb6de875db975465ced06f43ba6 | [
"MIT"
] | 2 | 2018-03-07T14:31:22.000Z | 2018-03-07T15:04:17.000Z | 08_Convolutional_Neural_Networks/06_Deepdream/06_deepdream.py | varunjha089/tensorflow_cookbook | c1fa5051c860ecb6de875db975465ced06f43ba6 | [
"MIT"
] | 75 | 2018-06-22T08:02:03.000Z | 2022-03-10T14:38:44.000Z | # Using TensorFlow for Deep Dream
#---------------------------------------
# From: Alexander Mordvintsev
# --https://github.com/tensorflow/tensorflow/tree/master/tensorflow/examples/tutorials/deepdream
#
# Make sure to download the deep dream model here:
# https://storage.googleapis.com/download.tensorflow.org/m... | 36.734375 | 101 | 0.673614 |
1d88410a53e7578d1bb80903d8e4c8ec886ff785 | 2,238 | py | Python | preprocessing/mnist-binary-preprocess.py | johnwikman/miking-ml | 3301f0b92efa5d10f7e50b66ecf7e7ddfb960650 | [
"MIT"
] | null | null | null | preprocessing/mnist-binary-preprocess.py | johnwikman/miking-ml | 3301f0b92efa5d10f7e50b66ecf7e7ddfb960650 | [
"MIT"
] | null | null | null | preprocessing/mnist-binary-preprocess.py | johnwikman/miking-ml | 3301f0b92efa5d10f7e50b66ecf7e7ddfb960650 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# MNIST dataset decoding (http://yann.lecun.com/exdb/mnist/), binary
# representation to ASCII representation, takes roughly ~4x the space of the
# binary file
import struct
import sys
def uint32_from_be(bs):
assert len(bs) == 4
return struct.unpack(">I", bs)[0]
if len(sys.argv) != 4:
... | 35.52381 | 108 | 0.652368 |
e80955ce86346623572b7125fd787576aefbf7fd | 9,557 | py | Python | pydantic/dataclasses.py | raushanraja/pydantic-classy | 97b6d9307b065579c34e724115699212999eaace | [
"MIT"
] | null | null | null | pydantic/dataclasses.py | raushanraja/pydantic-classy | 97b6d9307b065579c34e724115699212999eaace | [
"MIT"
] | 67 | 2021-08-16T04:16:03.000Z | 2022-03-28T04:08:51.000Z | pydantic/dataclasses.py | raushanraja/pydantic-classy | 97b6d9307b065579c34e724115699212999eaace | [
"MIT"
] | null | null | null | from typing import TYPE_CHECKING, Any, Callable, Dict, Optional, Type, TypeVar, Union, overload
from .class_validators import gather_all_validators
from .error_wrappers import ValidationError
from .errors import DataclassTypeError
from .fields import Field, FieldInfo, Required, Undefined
from .main import create_model... | 35.660448 | 115 | 0.673956 |
4ad9a21cf624f06989aaadaf2ef61a0bbd911449 | 2,864 | py | Python | welcome_wizard/datasources.py | nautobot/nautobot-plugin-welcome-wizard | de4dfc8e7fbbc6ee526235c93e5ef1eec7989bc8 | [
"Apache-2.0"
] | 5 | 2021-08-11T19:50:51.000Z | 2022-01-25T18:36:41.000Z | welcome_wizard/datasources.py | nautobot/nautobot-plugin-welcome-wizard | de4dfc8e7fbbc6ee526235c93e5ef1eec7989bc8 | [
"Apache-2.0"
] | 3 | 2021-08-30T18:47:50.000Z | 2021-12-31T22:47:14.000Z | welcome_wizard/datasources.py | nautobot/nautobot-plugin-welcome-wizard | de4dfc8e7fbbc6ee526235c93e5ef1eec7989bc8 | [
"Apache-2.0"
] | 4 | 2021-08-02T22:19:44.000Z | 2021-12-05T21:01:52.000Z | """Datasources for Welcome Wizard."""
import os
from pathlib import Path
import yaml
from django.utils.text import slugify
from nautobot.extras.choices import LogLevelChoices
from nautobot.extras.registry import DatasourceContent
from welcome_wizard.models.importer import ManufacturerImport, DeviceTypeImport
def r... | 37.684211 | 105 | 0.695182 |
ea92b53c614933fec68b872a94f34b6f62411d1b | 13,047 | py | Python | flask_restful/fields.py | whitekid/flask-restful | 9242a0cc3a3272af97502c7c85f1627a4edb7351 | [
"BSD-3-Clause"
] | 1 | 2017-12-30T20:43:28.000Z | 2017-12-30T20:43:28.000Z | flask_restful/fields.py | whitekid/flask-restful | 9242a0cc3a3272af97502c7c85f1627a4edb7351 | [
"BSD-3-Clause"
] | null | null | null | flask_restful/fields.py | whitekid/flask-restful | 9242a0cc3a3272af97502c7c85f1627a4edb7351 | [
"BSD-3-Clause"
] | 1 | 2021-02-12T14:18:02.000Z | 2021-02-12T14:18:02.000Z | from datetime import datetime
from calendar import timegm
import pytz
from decimal import Decimal as MyDecimal, ROUND_HALF_EVEN
from email.utils import formatdate
import six
try:
from urlparse import urlparse, urlunparse
except ImportError:
# python3
from urllib.parse import urlparse, urlunparse
from flask... | 31.212919 | 87 | 0.628114 |
4589b2f7117ad463b68bce78f3c20068feefdcad | 24,636 | py | Python | lib/galaxy/jobs/deferred/data_transfer.py | vimalkumarvelayudhan/galaxy | ea89dd8f149778b6c2f0f3f4a34c8b21f7033af7 | [
"CC-BY-3.0"
] | null | null | null | lib/galaxy/jobs/deferred/data_transfer.py | vimalkumarvelayudhan/galaxy | ea89dd8f149778b6c2f0f3f4a34c8b21f7033af7 | [
"CC-BY-3.0"
] | 1 | 2015-02-21T18:48:19.000Z | 2015-02-27T15:50:32.000Z | lib/galaxy/jobs/deferred/data_transfer.py | vimalkumarvelayudhan/galaxy | ea89dd8f149778b6c2f0f3f4a34c8b21f7033af7 | [
"CC-BY-3.0"
] | 3 | 2015-02-22T13:34:16.000Z | 2020-10-01T01:28:04.000Z | """
Module for managing data transfer jobs.
"""
import logging, urllib2, re, shutil
from galaxy import eggs
from sqlalchemy import and_
from galaxy.util.odict import odict
from galaxy.workflow.modules import module_factory
from galaxy.jobs.actions.post import ActionBox
from galaxy.jobs.deferred import FakeTrans
from... | 63.98961 | 148 | 0.538927 |
c8d3e3d57b11cbd9ae6bb144336728e433ae1d28 | 3,451 | py | Python | docs/conf.py | zzehring/operator | 7ef5543f8d0ef767c4531c2ae002e04bad1e3af3 | [
"Apache-2.0"
] | null | null | null | docs/conf.py | zzehring/operator | 7ef5543f8d0ef767c4531c2ae002e04bad1e3af3 | [
"Apache-2.0"
] | null | null | null | docs/conf.py | zzehring/operator | 7ef5543f8d0ef767c4531c2ae002e04bad1e3af3 | [
"Apache-2.0"
] | null | null | null | # Configuration file for the Sphinx documentation builder.
#
# For a full list of options see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
from pathlib import Path
import sys
sys.path.insert(0, str(Pa... | 35.214286 | 78 | 0.651695 |
fb592d81f10e84fb7065375be72bdd9e70e52a5d | 370 | py | Python | fdk_client/application/models/LogisticValidator.py | kavish-d/fdk-client-python | a1023eb530473322cb52e095fc4ceb226c1e6037 | [
"MIT"
] | null | null | null | fdk_client/application/models/LogisticValidator.py | kavish-d/fdk-client-python | a1023eb530473322cb52e095fc4ceb226c1e6037 | [
"MIT"
] | null | null | null | fdk_client/application/models/LogisticValidator.py | kavish-d/fdk-client-python | a1023eb530473322cb52e095fc4ceb226c1e6037 | [
"MIT"
] | null | null | null | """Class Validators."""
from marshmallow import fields, Schema
from marshmallow.validate import OneOf
from ..enums import *
from ..models.BaseSchema import BaseSchema
class LogisticValidator:
class getTatProduct(BaseSchema):
pass
class getPincodeCity(BaseSchema):
p... | 20.555556 | 44 | 0.662162 |
6a761f995daa221e34f8d88f1d50b178fa2ca4e1 | 961 | py | Python | cogs/inactive/nsfw.py | MiningMark48/Tidal-Bot | 8db6ecb220fd35930ffe1df5653af7a1ca03c8e9 | [
"MIT"
] | 6 | 2020-08-09T15:43:07.000Z | 2022-03-11T15:12:21.000Z | cogs/inactive/nsfw.py | MiningMark48/Tidal-Bot | 8db6ecb220fd35930ffe1df5653af7a1ca03c8e9 | [
"MIT"
] | 6 | 2020-10-29T02:32:40.000Z | 2022-01-13T03:12:45.000Z | cogs/inactive/nsfw.py | MiningMark48/Tidal-Bot | 8db6ecb220fd35930ffe1df5653af7a1ca03c8e9 | [
"MIT"
] | 1 | 2021-06-09T08:06:31.000Z | 2021-06-09T08:06:31.000Z | import random
import aiohttp
from discord.ext import commands
from util.decorators import delete_original
class NSFW(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.trivia_messages = []
self.new_trivia = []
@commands.command(aliases=['porn'], hidden=True)
@commands.i... | 29.121212 | 93 | 0.58897 |
86cbb6a657f789abbe3777094f650379d9f44c61 | 11,164 | py | Python | python/ee/tests/data_test.py | sadsad0557/sadsad0557 | 67371ceca73196dfd2ecd03bf7d3f8b2c3368c34 | [
"Apache-2.0"
] | 1 | 2020-11-03T21:11:55.000Z | 2020-11-03T21:11:55.000Z | python/ee/tests/data_test.py | sadsad0557/sadsad0557 | 67371ceca73196dfd2ecd03bf7d3f8b2c3368c34 | [
"Apache-2.0"
] | null | null | null | python/ee/tests/data_test.py | sadsad0557/sadsad0557 | 67371ceca73196dfd2ecd03bf7d3f8b2c3368c34 | [
"Apache-2.0"
] | 3 | 2017-08-25T05:12:46.000Z | 2019-06-28T07:17:03.000Z | #!/usr/bin/env python
"""Test for the ee.data module."""
import httplib2
import mock
import unittest
import ee
from ee import apitestcase
import ee.image as image
class DataTest(unittest.TestCase):
def testListOperations(self):
mock_http = mock.MagicMock(httplib2.Http)
# Return in three groups.
mock... | 39.17193 | 80 | 0.653529 |
2aad5038b21020dc5b08d173aadbf01890845b98 | 672 | py | Python | djangocms_salesforce_forms/migrations/0006_auto_20171212_1453.py | divio/aldryn-salesforce-forms | 9ab2b3fd7934e6b88a95377b8f3a9b3daa98d2d0 | [
"BSD-3-Clause"
] | null | null | null | djangocms_salesforce_forms/migrations/0006_auto_20171212_1453.py | divio/aldryn-salesforce-forms | 9ab2b3fd7934e6b88a95377b8f3a9b3daa98d2d0 | [
"BSD-3-Clause"
] | 2 | 2019-04-10T14:59:00.000Z | 2019-05-14T06:24:36.000Z | djangocms_salesforce_forms/migrations/0006_auto_20171212_1453.py | divio/aldryn-salesforce-forms | 9ab2b3fd7934e6b88a95377b8f3a9b3daa98d2d0 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2017-12-12 16:53
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('djangocms_salesforce_forms', '0005_auto_20171211_1306'),
]
operations = [
m... | 32 | 241 | 0.671131 |
53563ef82efe2d58e3b84c570182212d20a221f5 | 2,071 | py | Python | browbeat/config.py | zulcss/browbeat | 1aedcebcdabec0d92c0c0002a6ef458858629e88 | [
"Apache-2.0"
] | 19 | 2019-07-12T08:46:58.000Z | 2022-03-11T19:25:28.000Z | browbeat/config.py | zulcss/browbeat | 1aedcebcdabec0d92c0c0002a6ef458858629e88 | [
"Apache-2.0"
] | 1 | 2022-03-30T07:05:53.000Z | 2022-03-30T07:05:53.000Z | browbeat/config.py | zulcss/browbeat | 1aedcebcdabec0d92c0c0002a6ef458858629e88 | [
"Apache-2.0"
] | 31 | 2019-06-10T20:08:44.000Z | 2022-02-23T15:43:32.000Z | # 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
# distributed ... | 36.333333 | 95 | 0.720908 |
3d13d348e7f5c54132dff2b8d93965d01a483c39 | 1,715 | py | Python | catalog/bindings/csw/transaction_type.py | NIVANorge/s-enda-playground | 56ae0a8978f0ba8a5546330786c882c31e17757a | [
"Apache-2.0"
] | null | null | null | catalog/bindings/csw/transaction_type.py | NIVANorge/s-enda-playground | 56ae0a8978f0ba8a5546330786c882c31e17757a | [
"Apache-2.0"
] | null | null | null | catalog/bindings/csw/transaction_type.py | NIVANorge/s-enda-playground | 56ae0a8978f0ba8a5546330786c882c31e17757a | [
"Apache-2.0"
] | null | null | null | from dataclasses import dataclass, field
from typing import List, Optional
from bindings.csw.delete_type import DeleteType
from bindings.csw.insert_type import InsertType
from bindings.csw.request_base_type import RequestBaseType
from bindings.csw.update_type import UpdateType
__NAMESPACE__ = "http://www.opengis.net/c... | 28.583333 | 70 | 0.577259 |
17bde9483d36e9462555a0d4ce738027dddfa8da | 1,040 | py | Python | facebook/main.py | Joish/data_mining | 244c41fa9427e7a8f9c3b66ebe9b70106e7486d2 | [
"MIT"
] | null | null | null | facebook/main.py | Joish/data_mining | 244c41fa9427e7a8f9c3b66ebe9b70106e7486d2 | [
"MIT"
] | null | null | null | facebook/main.py | Joish/data_mining | 244c41fa9427e7a8f9c3b66ebe9b70106e7486d2 | [
"MIT"
] | null | null | null | import os
from .stream import Listener
class FacebookStream():
def __init__(self, ACCESS_TOKEN):
self.ACCESS_TOKEN = ACCESS_TOKEN
self.run()
def get_filter_list(self):
cwd = os.path.dirname(os.path.realpath(__file__))
file_path = os.path.join(cwd, "filter_list.txt")
f... | 27.368421 | 70 | 0.531731 |
d79d61dc388c498327ea1c2fad22914727dacace | 324 | py | Python | bin/experiments/tornado_hello.py | coreyabshire/marv | b2c791eb1b2b5be0f275e3b50d8df362df2e644e | [
"MIT"
] | null | null | null | bin/experiments/tornado_hello.py | coreyabshire/marv | b2c791eb1b2b5be0f275e3b50d8df362df2e644e | [
"MIT"
] | 2 | 2017-10-18T22:48:16.000Z | 2017-10-18T23:30:12.000Z | bin/experiments/tornado_hello.py | coreyabshire/marv | b2c791eb1b2b5be0f275e3b50d8df362df2e644e | [
"MIT"
] | null | null | null | import tornado.ioloop
import tornado.web
class MainHandler(tornado.web.RequestHandler):
def get(self):
self.write("Hello, world")
if __name__ == "__main__":
application = tornado.web.Application([
(r"/", MainHandler),
])
application.listen(8888)
tornado.ioloop.IOLoop.current().star... | 23.142857 | 46 | 0.67284 |
198dae373ecd1aa6c1e5d403abee0eb805848ec0 | 3,647 | py | Python | frontend/tests/api/files_ext/test_controllers.py | vaginessa/irma | 02285080b67b25ef983a99a765044683bd43296c | [
"Apache-2.0"
] | null | null | null | frontend/tests/api/files_ext/test_controllers.py | vaginessa/irma | 02285080b67b25ef983a99a765044683bd43296c | [
"Apache-2.0"
] | null | null | null | frontend/tests/api/files_ext/test_controllers.py | vaginessa/irma | 02285080b67b25ef983a99a765044683bd43296c | [
"Apache-2.0"
] | null | null | null | import io
from unittest import TestCase
from mock import MagicMock, patch
import api.files_ext.controllers as api_files_ext
from api.files_ext.models import FileExt
from api.files_ext.schemas import FileExtSchema
class TestFilesExtRoutes(TestCase):
def assertIsFileExt(self, data):
self.assertTrue(type(... | 37.214286 | 77 | 0.650946 |
822d21c05671db6f27e571d687d59d2297d466f9 | 1,496 | py | Python | workspace/Python/CsvToExcel.py | PinkMemory-sudo/languages | 3687240564919ecd864561b16b588b0b5f562acd | [
"MIT"
] | null | null | null | workspace/Python/CsvToExcel.py | PinkMemory-sudo/languages | 3687240564919ecd864561b16b588b0b5f562acd | [
"MIT"
] | null | null | null | workspace/Python/CsvToExcel.py | PinkMemory-sudo/languages | 3687240564919ecd864561b16b588b0b5f562acd | [
"MIT"
] | null | null | null | # -*- coding:utf-8 –*-
'''
程序用来将csv批量转换为excel文件。指定源路径和目标路径。
在main函数中指定源文件路径source,目标文件路径ob.
这个程序假设csv文件放在:"C:\\Users\\Administrator\\Desktop\\ceshi\\csv文件"
输出excel文件到:"C:\\Users\\Administrator\\Desktop\\ceshi\\xlsx文件"
'''
# 导入pandas
import pandas as pd
import os
# 建立单个文件的excel转换成csv函数,file 是excel文件名,to_file 是csv文件名... | 27.2 | 103 | 0.665775 |
c99df78c772471486293e6d514e2c516388bc6c9 | 503 | py | Python | setup.py | homgwu/eprogress | 26528661f08a25e3192b8a62e1113a6fa6e7bb06 | [
"Apache-2.0"
] | 43 | 2017-07-25T03:38:16.000Z | 2022-03-21T06:45:49.000Z | setup.py | threshi/eprogress | 26528661f08a25e3192b8a62e1113a6fa6e7bb06 | [
"Apache-2.0"
] | 3 | 2018-03-27T05:51:44.000Z | 2020-06-03T11:35:52.000Z | setup.py | threshi/eprogress | 26528661f08a25e3192b8a62e1113a6fa6e7bb06 | [
"Apache-2.0"
] | 21 | 2017-08-07T06:35:39.000Z | 2021-08-30T03:12:17.000Z | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
import eprogress
setup(
name="eprogress",
version=eprogress.__version__,
packages=find_packages(),
author="HomgWu",
author_email="homgwu@gmail.com",
description="A simple and easy to use module for Python3 to print multi and s... | 29.588235 | 118 | 0.701789 |
af9ac38fc0862af444df35b78636123039063808 | 5,081 | py | Python | generator/generate.py | civicdatacoop/civicdatacoop | 7244676c2d77f69e86445d973b979e8f92ba444f | [
"MIT"
] | null | null | null | generator/generate.py | civicdatacoop/civicdatacoop | 7244676c2d77f69e86445d973b979e8f92ba444f | [
"MIT"
] | null | null | null | generator/generate.py | civicdatacoop/civicdatacoop | 7244676c2d77f69e86445d973b979e8f92ba444f | [
"MIT"
] | null | null | null | import datetime
import shutil
from pathlib import Path
from jinja2 import Environment, FileSystemLoader
from dataclasses import dataclass
# Path to TEMPLATES folder (relative to where you run the script)
PATH_TO_TEMPLATES = Path('../generator/TEMPLATES/')
# Path to RESOURCES folder (relative to where you run... | 32.363057 | 210 | 0.624483 |
bed6f0cbdf7b9ff29eb00444a3ed1e4d907ef440 | 659 | py | Python | nabu/neuralnetworks/models/ed_decoders/ed_decoder_factory.py | imatge-upc/speech-2018-janna | f87d942a7225d7b38e0a650d27da8276a1954c47 | [
"MIT"
] | 3 | 2019-02-15T03:28:42.000Z | 2019-06-29T14:39:58.000Z | nabu/neuralnetworks/models/ed_decoders/ed_decoder_factory.py | imatge-upc/speech-2018-janna | f87d942a7225d7b38e0a650d27da8276a1954c47 | [
"MIT"
] | null | null | null | nabu/neuralnetworks/models/ed_decoders/ed_decoder_factory.py | imatge-upc/speech-2018-janna | f87d942a7225d7b38e0a650d27da8276a1954c47 | [
"MIT"
] | 1 | 2019-04-19T06:58:47.000Z | 2019-04-19T06:58:47.000Z | '''@file ed_decoder_factory
contains the ed decoder factory'''
from . import speller, dnn_decoder, hotstart_decoder, dynamic_routing
def factory(decoder):
'''gets an ed decoder class
Args:
decoder: the decoder type
Returns:
An EDDecoder class'''
if decoder == 'speller':
retu... | 26.36 | 69 | 0.681335 |
75329e6dc0c9b5d7836a69d9d72c3752371198ee | 2,775 | py | Python | setup.py | dcarr622/gmusicapi | c84beb6ade27b721b742abadeaa07ad3d68436be | [
"BSD-3-Clause"
] | null | null | null | setup.py | dcarr622/gmusicapi | c84beb6ade27b721b742abadeaa07ad3d68436be | [
"BSD-3-Clause"
] | null | null | null | setup.py | dcarr622/gmusicapi | c84beb6ade27b721b742abadeaa07ad3d68436be | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
from setuptools import setup, find_packages
import sys
# Only 2.6-2.7 are supported.
if not ((2, 6, 0) <= sys.version_info[:3] < (2, 8)):
sys.stderr.write('gmusicapi does not officially support this Python version.\n')
# try to continue anyway
dynamic_r... | 36.513158 | 86 | 0.561802 |
6151e1cd60f060a634af51fca1698f8c048c79b6 | 12,829 | py | Python | sling/nlp/parser/trainer/trace.py | SasCezar/sling | 809e21a9986d2522d5014b5836ba222498c099a2 | [
"Apache-2.0"
] | null | null | null | sling/nlp/parser/trainer/trace.py | SasCezar/sling | 809e21a9986d2522d5014b5836ba222498c099a2 | [
"Apache-2.0"
] | null | null | null | sling/nlp/parser/trainer/trace.py | SasCezar/sling | 809e21a9986d2522d5014b5836ba222498c099a2 | [
"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, s... | 37.732353 | 80 | 0.631304 |
7b3fc7b9b7b233717444e50b864512ecee1a85a6 | 1,370 | py | Python | OpenWeatherMap.py | BrianDunneKK/GettingStarted-Python | 9fc666ae73401921a73aa99c02a4d6691daed97a | [
"MIT"
] | null | null | null | OpenWeatherMap.py | BrianDunneKK/GettingStarted-Python | 9fc666ae73401921a73aa99c02a4d6691daed97a | [
"MIT"
] | null | null | null | OpenWeatherMap.py | BrianDunneKK/GettingStarted-Python | 9fc666ae73401921a73aa99c02a4d6691daed97a | [
"MIT"
] | null | null | null | import pyowm
from datetime import datetime, timedelta
loc = 'Kilkenny,Ireland'
owm = pyowm.OWM('f8c5ed2d5acaf51d22e984cb02a99d7a')
observation = owm.weather_at_place(loc)
w = observation.get_weather()
wi = w.get_wind() # {'speed': 4.6, 'deg': 330}
hm = w.get_humidity() # 87
tm = w.get_te... | 33.414634 | 114 | 0.69562 |
b3c051371228a07a73436dd29f8ee666e25f67d9 | 10,353 | py | Python | gamestonk_terminal/cryptocurrency/onchain/bitquery_view.py | b17z/GamestonkTerminal | 135eedb8d995fd10baff6283de525e8a4d124cae | [
"MIT"
] | 1 | 2022-02-18T04:02:52.000Z | 2022-02-18T04:02:52.000Z | gamestonk_terminal/cryptocurrency/onchain/bitquery_view.py | b17z/GamestonkTerminal | 135eedb8d995fd10baff6283de525e8a4d124cae | [
"MIT"
] | null | null | null | gamestonk_terminal/cryptocurrency/onchain/bitquery_view.py | b17z/GamestonkTerminal | 135eedb8d995fd10baff6283de525e8a4d124cae | [
"MIT"
] | null | null | null | """The BitQuery view"""
__docformat__ = "numpy"
import logging
import os
from gamestonk_terminal.cryptocurrency.dataframe_helpers import (
prettify_column_names,
lambda_very_long_number_formatter,
)
from gamestonk_terminal.cryptocurrency.onchain import bitquery_model
from gamestonk_terminal.decorators import ... | 27.461538 | 106 | 0.61132 |
96f16834fcc2ff5066f3916911f749b04f93a7f9 | 45,979 | py | Python | tensorflow/python/data/experimental/ops/data_service_ops.py | dongxiao92/tensorflow | 72ac61dbed0ea43dce96431b2b72aa0a7bc83a93 | [
"Apache-2.0"
] | 2 | 2021-03-02T12:53:15.000Z | 2021-10-20T21:28:21.000Z | tensorflow/python/data/experimental/ops/data_service_ops.py | dongxiao92/tensorflow | 72ac61dbed0ea43dce96431b2b72aa0a7bc83a93 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/data/experimental/ops/data_service_ops.py | dongxiao92/tensorflow | 72ac61dbed0ea43dce96431b2b72aa0a7bc83a93 | [
"Apache-2.0"
] | 2 | 2021-11-02T15:46:38.000Z | 2022-03-08T11:39:35.000Z | # Copyright 2020 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... | 47.894792 | 90 | 0.717197 |
2a1aa82c4adbb0cbf1994953ce9a237ea564fa19 | 1,879 | py | Python | discoseg/model/vocab.py | faithannong/DPLP-faith | 7768a9e84d6fa3a0cffa50c4abd818076d45fc40 | [
"MIT"
] | 113 | 2015-09-22T16:02:46.000Z | 2022-02-21T14:57:57.000Z | discoseg/model/vocab.py | faithannong/DPLP-faith | 7768a9e84d6fa3a0cffa50c4abd818076d45fc40 | [
"MIT"
] | 8 | 2015-02-24T22:40:59.000Z | 2020-10-05T03:34:33.000Z | discoseg/model/vocab.py | faithannong/DPLP-faith | 7768a9e84d6fa3a0cffa50c4abd818076d45fc40 | [
"MIT"
] | 44 | 2015-03-06T06:47:26.000Z | 2022-03-13T17:33:08.000Z | ## vocab.py
## Author: Yangfeng Ji
## Date: 05-02-2015
## Time-stamp: <yangfeng 05/03/2015 03:45:40>
""" Build vocab
1, read each document for creating the feature list
2, collecting all features with their frequency
3, creating vocab with feature selection
"""
from collections import defaultdict
from feature import ... | 26.097222 | 57 | 0.56892 |
d9a479f29ebcf582943bb14b7b5b7340acdda6de | 4,186 | py | Python | game/yaml/serializer.py | Sage-of-Mirrors/CosmoRen | 6f74b5c3b5eda2de5756a38d39d9f5f4ab922116 | [
"MIT"
] | null | null | null | game/yaml/serializer.py | Sage-of-Mirrors/CosmoRen | 6f74b5c3b5eda2de5756a38d39d9f5f4ab922116 | [
"MIT"
] | null | null | null | game/yaml/serializer.py | Sage-of-Mirrors/CosmoRen | 6f74b5c3b5eda2de5756a38d39d9f5f4ab922116 | [
"MIT"
] | null | null | null |
__all__ = ['Serializer', 'SerializerError']
from yaml.error import YAMLError
from yaml.events import *
from yaml.nodes import *
class SerializerError(YAMLError):
pass
class Serializer(object):
ANCHOR_TEMPLATE = u'id%03d'
def __init__(self, encoding=None,
explicit_start=None, explicit_end=N... | 37.375 | 82 | 0.583373 |
572a9f63da146ba25cad0d8e6f08f777a3155f65 | 8,142 | py | Python | model.py | MG2033/Action-Conditional-Video-Prediction | 02b7fb123729c95f1ebff2c26e2236f7d7913c17 | [
"Apache-2.0"
] | 2 | 2020-08-28T06:34:05.000Z | 2020-10-01T11:41:33.000Z | model.py | MG2033/Action-Conditional-Video-Prediction | 02b7fb123729c95f1ebff2c26e2236f7d7913c17 | [
"Apache-2.0"
] | null | null | null | model.py | MG2033/Action-Conditional-Video-Prediction | 02b7fb123729c95f1ebff2c26e2236f7d7913c17 | [
"Apache-2.0"
] | null | null | null | import tensorflow as tf
from layers import conv2d, conv2d_transpose, pad, flatten, dense, action_transform, get_deconv_filter
class ACVP:
"""ACVP is implemented here!"""
def __init__(self, args, prediction_steps, reuse=False):
self.args = args
self.X = None
self.y = None
self.... | 58.157143 | 119 | 0.550602 |
24d2351d67055fc56179a539351e248df0aa6128 | 9,055 | py | Python | examples/pytorch/seal/sampler.py | ketyi/dgl | a1b859c29b63a673c148d13231a49504740e0e01 | [
"Apache-2.0"
] | 9,516 | 2018-12-08T22:11:31.000Z | 2022-03-31T13:04:33.000Z | examples/pytorch/seal/sampler.py | ketyi/dgl | a1b859c29b63a673c148d13231a49504740e0e01 | [
"Apache-2.0"
] | 2,494 | 2018-12-08T22:43:00.000Z | 2022-03-31T21:16:27.000Z | examples/pytorch/seal/sampler.py | ketyi/dgl | a1b859c29b63a673c148d13231a49504740e0e01 | [
"Apache-2.0"
] | 2,529 | 2018-12-08T22:56:14.000Z | 2022-03-31T13:07:41.000Z | import os.path as osp
from tqdm import tqdm
from copy import deepcopy
import torch
import dgl
from torch.utils.data import DataLoader, Dataset
from dgl import DGLGraph, NID
from dgl.dataloading.negative_sampler import Uniform
from dgl import add_self_loop
from utils import drnl_node_labeling
class GraphDataSet(Datase... | 34.826923 | 111 | 0.608393 |
e4714ac7e9213e5f0d9aa3942a914a7bb81965ee | 1,288 | py | Python | aliyun-python-sdk-sas/aliyunsdksas/request/v20181203/DescribeExposedStatisticsRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 1,001 | 2015-07-24T01:32:41.000Z | 2022-03-25T01:28:18.000Z | aliyun-python-sdk-sas/aliyunsdksas/request/v20181203/DescribeExposedStatisticsRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 363 | 2015-10-20T03:15:00.000Z | 2022-03-08T12:26:19.000Z | aliyun-python-sdk-sas/aliyunsdksas/request/v20181203/DescribeExposedStatisticsRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 682 | 2015-09-22T07:19:02.000Z | 2022-03-22T09:51:46.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 40.25 | 84 | 0.773292 |
5a88d2e913264d15e3bb3e26112c9dfd3c09d833 | 8,138 | py | Python | lib/js.py | walchko/rambler | dbd4357b7aaab582280155e6b722868896b1b8dd | [
"MIT"
] | null | null | null | lib/js.py | walchko/rambler | dbd4357b7aaab582280155e6b722868896b1b8dd | [
"MIT"
] | null | null | null | lib/js.py | walchko/rambler | dbd4357b7aaab582280155e6b722868896b1b8dd | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# by Kevin J. Walchko 26 Aug 2014
#
# PS4 has 6 axes, 14 buttons, 1 hat
# This program doesn't grab all buttons, just the most useful :)
# Warning: this code needs to be updated to support the new py2/py3 library. This
# may crash under py3 and hasn't been tested with the currentl pygecko libra... | 23.119318 | 82 | 0.624846 |
edb0d233c62a5d3da7ffdc1195008f602cea7e7b | 1,827 | py | Python | examples/series_getitem/series_getitem_scalar_multiple_result.py | samir-nasibli/sdc | b9144c8799d6454dec3e5c550e305963b24c1570 | [
"BSD-2-Clause"
] | null | null | null | examples/series_getitem/series_getitem_scalar_multiple_result.py | samir-nasibli/sdc | b9144c8799d6454dec3e5c550e305963b24c1570 | [
"BSD-2-Clause"
] | null | null | null | examples/series_getitem/series_getitem_scalar_multiple_result.py | samir-nasibli/sdc | b9144c8799d6454dec3e5c550e305963b24c1570 | [
"BSD-2-Clause"
] | null | null | null | # *****************************************************************************
# Copyright (c) 2019, Intel Corporation All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of sou... | 41.522727 | 79 | 0.684729 |
d588e9b5a61fed8a452f7c1ec1bf58c32d5843fe | 65,466 | py | Python | google/cloud/bigquery/job/query.py | quentin-sommer/python-bigquery | 1312093855b1b6bd81c5f6e9e358151cfbd366b8 | [
"Apache-2.0"
] | null | null | null | google/cloud/bigquery/job/query.py | quentin-sommer/python-bigquery | 1312093855b1b6bd81c5f6e9e358151cfbd366b8 | [
"Apache-2.0"
] | null | null | null | google/cloud/bigquery/job/query.py | quentin-sommer/python-bigquery | 1312093855b1b6bd81c5f6e9e358151cfbd366b8 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 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, s... | 35.911135 | 134 | 0.645831 |
709c33b3cc28e41f2b28d27ba50d95eb4f24ecc8 | 835 | py | Python | app/views/callback.py | Md-Kais/spotify-playing-readme | 3e78b3bc7ab9e90160eaae8b09884a125a387fd8 | [
"Apache-2.0"
] | 1 | 2021-08-13T04:31:06.000Z | 2021-08-13T04:31:06.000Z | app/views/callback.py | Md-Kais/spotify-playing-readme | 3e78b3bc7ab9e90160eaae8b09884a125a387fd8 | [
"Apache-2.0"
] | null | null | null | app/views/callback.py | Md-Kais/spotify-playing-readme | 3e78b3bc7ab9e90160eaae8b09884a125a387fd8 | [
"Apache-2.0"
] | null | null | null | from flask import Blueprint, Response, request, render_template
from app import database
from app.config import BASE_URL, GITHUB_URL
from app.utils import generate_token, get_user_info
callback = Blueprint("/callback", __name__, template_folder="templates")
@callback.route("/callback")
def callback_():
code = r... | 26.09375 | 73 | 0.688623 |
b73bbb6d771590b792104a0096a4db69711cbd14 | 736 | py | Python | ehr_functions/models/types/nn.py | fdabek1/EHR-Functions | e6bd0b6fa213930358c4a19be31c459ac7430ca9 | [
"MIT"
] | null | null | null | ehr_functions/models/types/nn.py | fdabek1/EHR-Functions | e6bd0b6fa213930358c4a19be31c459ac7430ca9 | [
"MIT"
] | null | null | null | ehr_functions/models/types/nn.py | fdabek1/EHR-Functions | e6bd0b6fa213930358c4a19be31c459ac7430ca9 | [
"MIT"
] | null | null | null | # from livelossplot.keras import PlotLossesCallback
from ehr_functions.models.types._base import Model
import numpy as np
class NeuralNetwork(Model):
def __init__(self, model, epochs=10, batch_size=32, round_output=False, **kwargs):
super().__init__(**kwargs)
self.model = model
self.epochs... | 30.666667 | 98 | 0.66712 |
e5f67f8f1babb8dcaa0899a7af4fb2f546e42b6e | 3,088 | py | Python | gen_potential_employees.py | ab-go/enron_graph | 35ead456e27736bbb4fae20fe179ebe788dcbdc9 | [
"MIT"
] | null | null | null | gen_potential_employees.py | ab-go/enron_graph | 35ead456e27736bbb4fae20fe179ebe788dcbdc9 | [
"MIT"
] | null | null | null | gen_potential_employees.py | ab-go/enron_graph | 35ead456e27736bbb4fae20fe179ebe788dcbdc9 | [
"MIT"
] | null | null | null | import os
import sys
import csv
from names_dataset import NameDataset
import re
import argparse
def generate_potential_employees(f_path):
"""
open the email_employee.csv and parse it to create more employees
"""
f_name = os.path.join(f_path, 'email_employee.csv')
nd = NameDataset()
p = re.comp... | 33.565217 | 110 | 0.590674 |
d78db1a6d84b50bb668ab7ac0dd317f5035153c3 | 1,137 | py | Python | test/modules/http2/test_501_proxy_serverheader.py | ICLXLxqj0g/chenrichard10y | df2619419646f6f8b2514680445955782a2a3c0a | [
"Apache-2.0"
] | 2,529 | 2015-01-02T11:52:53.000Z | 2022-03-30T19:54:27.000Z | test/modules/http2/test_501_proxy_serverheader.py | ICLXLxqj0g/chenrichard10y | df2619419646f6f8b2514680445955782a2a3c0a | [
"Apache-2.0"
] | 133 | 2015-04-21T05:50:45.000Z | 2022-03-30T14:23:40.000Z | test/modules/http2/test_501_proxy_serverheader.py | ICLXLxqj0g/chenrichard10y | df2619419646f6f8b2514680445955782a2a3c0a | [
"Apache-2.0"
] | 1,113 | 2015-01-01T14:47:02.000Z | 2022-03-29T16:47:18.000Z | import pytest
from .env import H2Conf
class TestProxyServerHeader:
@pytest.fixture(autouse=True, scope='class')
def _class_scope(self, env):
conf = H2Conf(env, extras={
f'cgi.{env.http_tld}': [
"Header unset Server",
"Header always set Server cgi",
... | 31.583333 | 63 | 0.57168 |
e8d3b893668e7b789a00e6cab0f8b80a42bc0e68 | 1,232 | py | Python | sympy/strategies/traverse.py | msgoff/sympy | 1e7daef7514902f5e89718fa957b7b36c6669a10 | [
"BSD-3-Clause"
] | null | null | null | sympy/strategies/traverse.py | msgoff/sympy | 1e7daef7514902f5e89718fa957b7b36c6669a10 | [
"BSD-3-Clause"
] | null | null | null | sympy/strategies/traverse.py | msgoff/sympy | 1e7daef7514902f5e89718fa957b7b36c6669a10 | [
"BSD-3-Clause"
] | null | null | null | """Strategies to Traverse a Tree."""
from __future__ import print_function, division
from sympy.strategies.util import basic_fns
from sympy.strategies.core import chain, do_one
def top_down(rule, fns=basic_fns):
"""Apply a rule down a tree running it on the top nodes first."""
return chain(rule, lambda expr:... | 30.8 | 77 | 0.660714 |
e24536f42ec572ab9573485d6f8da0568be0ecb6 | 9,682 | py | Python | distributed/cifar10-100/multi_device_multi_process_classification.py | JonathanLehner/nnabla-examples | 2971b987484945e12fb171594181908789485a0f | [
"Apache-2.0"
] | null | null | null | distributed/cifar10-100/multi_device_multi_process_classification.py | JonathanLehner/nnabla-examples | 2971b987484945e12fb171594181908789485a0f | [
"Apache-2.0"
] | null | null | null | distributed/cifar10-100/multi_device_multi_process_classification.py | JonathanLehner/nnabla-examples | 2971b987484945e12fb171594181908789485a0f | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2017 Sony 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 applicabl... | 38.268775 | 96 | 0.664532 |
a39d23037248b808541df07f89166fbe78dd4d0f | 790 | py | Python | src/util/decorate_all.py | pgecsenyi/fst | 1d4f579fb3cccd022fe1ab0e61aa00693e7234c1 | [
"MIT"
] | 1 | 2019-12-04T20:35:34.000Z | 2019-12-04T20:35:34.000Z | src/util/decorate_all.py | pgecsenyi/router-fs | 1d4f579fb3cccd022fe1ab0e61aa00693e7234c1 | [
"MIT"
] | null | null | null | src/util/decorate_all.py | pgecsenyi/router-fs | 1d4f579fb3cccd022fe1ab0e61aa00693e7234c1 | [
"MIT"
] | null | null | null | from types import FunctionType
def decorate_all(decorator):
class DecorateAll(type):
def __new__(cls, name, bases, dct):
for attr, value in dct.items():
if do_decorate(attr, value):
dct[attr] = decorator(value)
return super(DecorateAll, cls)._... | 23.939394 | 73 | 0.601266 |
7d5b0a3f77f58e673c6e7a5c6d5912711653bd8c | 4,335 | py | Python | sdk/python/pulumi_azure_nextgen/databoxedge/v20200501preview/get_bandwidth_schedule.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/databoxedge/v20200501preview/get_bandwidth_schedule.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/databoxedge/v20200501preview/get_bandwidth_schedule.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
__a... | 32.593985 | 161 | 0.626759 |
ecad6c8921aa07d60c8d34e3b3f75a91bb4cf221 | 2,650 | py | Python | posthog/models/filters/mixins/stickiness.py | alx-a/posthog | a76959bb2a7640ca8cf367a4d3a0e4ca67f65a5e | [
"MIT"
] | null | null | null | posthog/models/filters/mixins/stickiness.py | alx-a/posthog | a76959bb2a7640ca8cf367a4d3a0e4ca67f65a5e | [
"MIT"
] | null | null | null | posthog/models/filters/mixins/stickiness.py | alx-a/posthog | a76959bb2a7640ca8cf367a4d3a0e4ca67f65a5e | [
"MIT"
] | null | null | null | from datetime import datetime
from typing import Callable, Optional, Union
from rest_framework.exceptions import ValidationError
from posthog.constants import DATE_FROM, DATE_TO, STICKINESS_DAYS
from posthog.models.filters.mixins.common import BaseParamMixin, DateMixin, IntervalMixin
from posthog.models.filters.mixin... | 36.30137 | 116 | 0.690566 |
201c4e761c104ba2860fd932d4670576d8fd6ba2 | 409 | py | Python | venv/Scripts/pip-script.py | Shubhraaaj/Blogging | b57d3bceed2c9ac661f0a3eafc8c2b948a5ee3ce | [
"Apache-2.0"
] | null | null | null | venv/Scripts/pip-script.py | Shubhraaaj/Blogging | b57d3bceed2c9ac661f0a3eafc8c2b948a5ee3ce | [
"Apache-2.0"
] | null | null | null | venv/Scripts/pip-script.py | Shubhraaaj/Blogging | b57d3bceed2c9ac661f0a3eafc8c2b948a5ee3ce | [
"Apache-2.0"
] | null | null | null | #!C:\Users\shubh\PycharmProjects\Python_1\venv\Scripts\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'pip==9.0.3','console_scripts','pip'
__requires__ = 'pip==9.0.3'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]... | 31.461538 | 69 | 0.667482 |
926ab9082f5cea5eb161c160242dbca8da3eaa72 | 442 | py | Python | src/deprecated_src_files/cropper.py | IW276/IW276WS21-P20 | 06680a879b34166dc9104004686b195803b3bb56 | [
"MIT"
] | null | null | null | src/deprecated_src_files/cropper.py | IW276/IW276WS21-P20 | 06680a879b34166dc9104004686b195803b3bb56 | [
"MIT"
] | null | null | null | src/deprecated_src_files/cropper.py | IW276/IW276WS21-P20 | 06680a879b34166dc9104004686b195803b3bb56 | [
"MIT"
] | null | null | null | from cv2 import imread, IMREAD_COLOR
def create_crops(image_path, crop_coordinates):
resulting_crops = []
image = imread(image_path, IMREAD_COLOR)
for row in crop_coordinates.itertuples():
top = row[3]
left = row[4]
height = row[5]
width = row[6]
resulting_crops.app... | 26 | 47 | 0.597285 |
8182bb40615f6d27e1dc8e9bbc613289874c1d39 | 1,230 | py | Python | bin/combine_pdf.py | aerorahul/dotfiles | 4b0031d303b7db778229c6e88a8926e1886133e0 | [
"MIT"
] | null | null | null | bin/combine_pdf.py | aerorahul/dotfiles | 4b0031d303b7db778229c6e88a8926e1886133e0 | [
"MIT"
] | null | null | null | bin/combine_pdf.py | aerorahul/dotfiles | 4b0031d303b7db778229c6e88a8926e1886133e0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
###############################################################
# combine_pdf.py - script used to combine multiple pdf's into one
###############################################################
import os
import sys
import subprocess
from argparse import ArgumentParser, ArgumentDefaultsHelpFormat... | 33.243243 | 91 | 0.614634 |
fd4cd54f45ed30c86f86d9c3b07c14e881463d5b | 42,000 | py | Python | discord/webhook.py | niborus/discord.py | 23aaa75802e46ea13f49375c6abdc48e7b8c40dc | [
"MIT"
] | 1 | 2021-05-01T13:52:04.000Z | 2021-05-01T13:52:04.000Z | discord/webhook.py | niborus/discord.py | 23aaa75802e46ea13f49375c6abdc48e7b8c40dc | [
"MIT"
] | null | null | null | discord/webhook.py | niborus/discord.py | 23aaa75802e46ea13f49375c6abdc48e7b8c40dc | [
"MIT"
] | 1 | 2021-09-13T12:23:38.000Z | 2021-09-13T12:23:38.000Z | """
The MIT License (MIT)
Copyright (c) 2015-present Rapptz
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, merg... | 34.511093 | 120 | 0.593071 |
ffcff8ad8e0b39d7965dd2c25331a3dfad136954 | 648 | py | Python | Coursera/Week.2/Task.46.py | v1nnyb0y/Coursera.BasePython | bbfb3184dc27a4cdb16b087123890991afbc5506 | [
"MIT"
] | null | null | null | Coursera/Week.2/Task.46.py | v1nnyb0y/Coursera.BasePython | bbfb3184dc27a4cdb16b087123890991afbc5506 | [
"MIT"
] | null | null | null | Coursera/Week.2/Task.46.py | v1nnyb0y/Coursera.BasePython | bbfb3184dc27a4cdb16b087123890991afbc5506 | [
"MIT"
] | null | null | null | '''
Максимальное число подряд идущих равных
'''
a = int(input())
b = int(input())
max = 1
n = 1
while 0 == 0:
if b == 0 or a == 0:
break
while a > b:
if b == 0:
break
n += 1
if n > max:
max = n
a = b
b = int(input())
else:
... | 17.052632 | 39 | 0.324074 |
5e82f4a790c103c9550fb48e550e7c2f038dca1f | 2,645 | py | Python | networkmonitor/src/cleanTime.py | luther38/NetworkMonitor | bd5e9336342e7af71c19ca484f8d386b6b79ad69 | [
"MIT"
] | null | null | null | networkmonitor/src/cleanTime.py | luther38/NetworkMonitor | bd5e9336342e7af71c19ca484f8d386b6b79ad69 | [
"MIT"
] | null | null | null | networkmonitor/src/cleanTime.py | luther38/NetworkMonitor | bd5e9336342e7af71c19ca484f8d386b6b79ad69 | [
"MIT"
] | null | null | null |
import datetime
class CleanTime():
"""
This class cleans and checks the refresh timer.
If the value is higher then expected it will be cleaned up.
Methods:
"""
def __init__(self):
self.nextDay:bool = True
self.hour:int = 0
self.minute: int = 0
se... | 26.989796 | 77 | 0.514178 |
2b785663df7a7f14cb6a2cef320e7e9ad4bde272 | 3,041 | py | Python | samples/modules/tensorflow/magic_wand/train/train_test.py | lviala-zaack/zephyr | bf3c6e7ba415dd85f1b68eb69ea2779b234c686f | [
"Apache-2.0"
] | 6,224 | 2016-06-24T20:04:19.000Z | 2022-03-31T20:33:45.000Z | samples/modules/tensorflow/magic_wand/train/train_test.py | Conexiotechnologies/zephyr | fde24ac1f25d09eb9722ce4edc6e2d3f844b5bce | [
"Apache-2.0"
] | 32,027 | 2017-03-24T00:02:32.000Z | 2022-03-31T23:45:53.000Z | samples/modules/tensorflow/magic_wand/train/train_test.py | Conexiotechnologies/zephyr | fde24ac1f25d09eb9722ce4edc6e2d3f844b5bce | [
"Apache-2.0"
] | 4,374 | 2016-08-11T07:28:47.000Z | 2022-03-31T14:44:59.000Z | # Lint as: python3
# Copyright 2019 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
#
# Unl... | 38.493671 | 81 | 0.664255 |
a9380bd9fde05212416699847c1942e9dca3009b | 10,001 | py | Python | google/appengine/tools/gen_protorpc.py | vladushakov987/appengine_python3 | 0dd481c73e2537a50ee10f1b79cd65938087e555 | [
"Apache-2.0"
] | null | null | null | google/appengine/tools/gen_protorpc.py | vladushakov987/appengine_python3 | 0dd481c73e2537a50ee10f1b79cd65938087e555 | [
"Apache-2.0"
] | null | null | null | google/appengine/tools/gen_protorpc.py | vladushakov987/appengine_python3 | 0dd481c73e2537a50ee10f1b79cd65938087e555 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2011 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 o... | 32.683007 | 80 | 0.69913 |
df1c08ad4f1e03bb72c5c8af0872403b8e289ffc | 5,702 | py | Python | configs/NoC/system_setup.py | Maiux92/gem5-NVM-multiple-memory-spaces | 0996bfd34638a7f3f05382cc1e7a813a177eed7f | [
"MIT"
] | 3 | 2021-04-24T16:08:00.000Z | 2022-03-22T22:07:40.000Z | configs/NoC/system_setup.py | Maiux92/gem5-NVM-multiple-memory-spaces | 0996bfd34638a7f3f05382cc1e7a813a177eed7f | [
"MIT"
] | null | null | null | configs/NoC/system_setup.py | Maiux92/gem5-NVM-multiple-memory-spaces | 0996bfd34638a7f3f05382cc1e7a813a177eed7f | [
"MIT"
] | 1 | 2021-03-25T16:55:08.000Z | 2021-03-25T16:55:08.000Z | #!/usr/bin/python3
import optparse
import m5
from m5.defines import buildEnv
from m5.objects import *
from m5.util import addToPath, fatal
addToPath('../../gem5-20.1/configs/')
#addToPath('../../')
import json
import os
# from network import Network
from common import Options
from noc_network import NoCSystem
from... | 34.557576 | 93 | 0.520344 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.