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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
23da0c0d49653c618ac8d67a4ddcb6c90f60383d | 4,489 | py | Python | exp/legacy_exp/run_exp.py | Lossless-Virtual-Switching/Backdraft | 99e8f7acf833d1755a109898eb397c3412fff159 | [
"MIT"
] | null | null | null | exp/legacy_exp/run_exp.py | Lossless-Virtual-Switching/Backdraft | 99e8f7acf833d1755a109898eb397c3412fff159 | [
"MIT"
] | null | null | null | exp/legacy_exp/run_exp.py | Lossless-Virtual-Switching/Backdraft | 99e8f7acf833d1755a109898eb397c3412fff159 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import os
import sys
from time import sleep
import argparse
import subprocess
import json
sys.path.insert(0, '../')
from bkdrft_common import *
cur_script_dir = os.path.dirname(os.path.abspath(__file__))
pipeline_config_file = os.path.join(cur_script_dir,
'pipeline.bess')
def _stop_everythin... | 30.746575 | 116 | 0.655825 |
b8cd904fb69e3d6cdcc6586ca9f289f2c3105b74 | 1,805 | py | Python | source/machine_connector/utils/tests/test_init_msg_metadata.py | aws-solutions/machine-to-cloud-connectivity-framework | 980f2892ea2636ace604ea8f33b594091a9f24d2 | [
"Apache-2.0",
"MIT"
] | 1 | 2021-10-30T13:03:09.000Z | 2021-10-30T13:03:09.000Z | source/machine_connector/utils/tests/test_init_msg_metadata.py | aws-solutions/machine-to-cloud-connectivity-framework | 980f2892ea2636ace604ea8f33b594091a9f24d2 | [
"Apache-2.0",
"MIT"
] | 2 | 2021-11-03T12:00:12.000Z | 2022-03-08T06:03:51.000Z | source/machine_connector/utils/tests/test_init_msg_metadata.py | aws-solutions/machine-to-cloud-connectivity-framework | 980f2892ea2636ace604ea8f33b594091a9f24d2 | [
"Apache-2.0",
"MIT"
] | 2 | 2021-10-30T13:03:03.000Z | 2022-03-21T00:11:20.000Z | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
import os
from unittest import mock
@mock.patch.dict(os.environ, {"SITE_NAME": "test_site", "AREA": "test_area", "PROCESS": "test_process", "MACHINE_NAME": "test_machine_name"})
def test_init_user_message_init(... | 45.125 | 141 | 0.751247 |
80c068b15c898a0671aeea15c742439b49cd1e36 | 15,817 | py | Python | examples/pytorch/name_entity_recognition/main.py | amanapte/graph4nlp | 1ec5464b5d6b1f9c36297171cfedf617021273c3 | [
"Apache-2.0"
] | 1 | 2021-12-09T21:56:49.000Z | 2021-12-09T21:56:49.000Z | examples/pytorch/name_entity_recognition/main.py | amanapte/graph4nlp | 1ec5464b5d6b1f9c36297171cfedf617021273c3 | [
"Apache-2.0"
] | null | null | null | examples/pytorch/name_entity_recognition/main.py | amanapte/graph4nlp | 1ec5464b5d6b1f9c36297171cfedf617021273c3 | [
"Apache-2.0"
] | null | null | null | import argparse
import os
import torch
import torch.backends.cudnn as cudnn
import torch.multiprocessing
import torch.optim as optim
from torch.utils.data import DataLoader
from graph4nlp.pytorch.data.data import from_batch
from graph4nlp.pytorch.modules.evaluation.accuracy import Accuracy
from graph4nlp.pytorch.modul... | 39.941919 | 102 | 0.626351 |
9dfa731282bc36b38cb39f666f657b7150df9fea | 3,205 | py | Python | launchable/commands/record/build.py | yoshiori/cli | 327ff6c2dd7672546c9fd95f5fd46eebc9ff0923 | [
"Apache-2.0"
] | null | null | null | launchable/commands/record/build.py | yoshiori/cli | 327ff6c2dd7672546c9fd95f5fd46eebc9ff0923 | [
"Apache-2.0"
] | null | null | null | launchable/commands/record/build.py | yoshiori/cli | 327ff6c2dd7672546c9fd95f5fd46eebc9ff0923 | [
"Apache-2.0"
] | null | null | null | import re
import click
import subprocess
import json
import os
from ...utils.token import parse_token
from .commit import commit
from ...utils.env_keys import REPORT_ERROR_KEY
from ...utils.http_client import LaunchableClient
@click.command()
@click.option(
'--name',
'build_name',
help='build name',
r... | 31.116505 | 102 | 0.589392 |
c98bfac9ee6dc79e87c404f65662771e7b1e5e2a | 9,606 | py | Python | src/frr/tests/topotests/lib/ltemplate.py | zhouhaifeng/vpe | 9c644ffd561988e5740021ed26e0f7739844353d | [
"Apache-2.0"
] | null | null | null | src/frr/tests/topotests/lib/ltemplate.py | zhouhaifeng/vpe | 9c644ffd561988e5740021ed26e0f7739844353d | [
"Apache-2.0"
] | null | null | null | src/frr/tests/topotests/lib/ltemplate.py | zhouhaifeng/vpe | 9c644ffd561988e5740021ed26e0f7739844353d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Part of NetDEF Topology Tests
#
# Copyright (c) 2017 by
# Network Device Education Foundation, Inc. ("NetDEF")
#
# Permission to use, copy, modify, and/or distribute this software
# for any purpose with or without fee is hereby granted, provided
# that the above copyright notice and this perm... | 29.925234 | 88 | 0.607849 |
9a26cf7e42638037793aa32578c21b3018e9320e | 40 | py | Python | yabs/__init__.py | mar10/yabs | 6144398c67e9b0a9f12e7e2cf3583041ba7a960e | [
"MIT"
] | 8 | 2020-07-05T18:08:07.000Z | 2022-03-03T18:22:44.000Z | yabs/__init__.py | mar10/yabs | 6144398c67e9b0a9f12e7e2cf3583041ba7a960e | [
"MIT"
] | 4 | 2021-04-01T16:38:21.000Z | 2021-04-01T16:38:28.000Z | yabs/__init__.py | mar10/yabs | 6144398c67e9b0a9f12e7e2cf3583041ba7a960e | [
"MIT"
] | null | null | null | # flake8: noqa
__version__ = "0.4.1-a1"
| 13.333333 | 24 | 0.65 |
3aba5d4030c4a3ad19fdc5d2934d3cd1555ac4f9 | 2,842 | py | Python | qnet_agent.py | opplieam/Pong-Deep-RL | 28850a46bff0fb22374a39a7ab391175a9105673 | [
"Apache-2.0"
] | null | null | null | qnet_agent.py | opplieam/Pong-Deep-RL | 28850a46bff0fb22374a39a7ab391175a9105673 | [
"Apache-2.0"
] | null | null | null | qnet_agent.py | opplieam/Pong-Deep-RL | 28850a46bff0fb22374a39a7ab391175a9105673 | [
"Apache-2.0"
] | null | null | null | import torch
from deep_network import NeuralNetwork
from utils import preprocess_frame, save_model
use_cuda = torch.cuda.is_available()
device = torch.device("cuda:0" if use_cuda else "cpu")
# torch.manual_seed(1)
class QNet_Agent(object):
save_model_frequency = 10000
number_of_frames = 0
def __init__(... | 35.525 | 114 | 0.644616 |
5a7ff8078f691095e196cb032f62369a0f6cd277 | 4,954 | py | Python | test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/operations/_operation_group_two_operations.py | changlong-liu/autorest.python | 1f03e4c6a11934d385fab050dc44041f1e91e9ff | [
"MIT"
] | null | null | null | test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/operations/_operation_group_two_operations.py | changlong-liu/autorest.python | 1f03e4c6a11934d385fab050dc44041f1e91e9ff | [
"MIT"
] | null | null | null | test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/operations/_operation_group_two_operations.py | changlong-liu/autorest.python | 1f03e4c6a11934d385fab050dc44041f1e91e9ff | [
"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 ... | 38.107692 | 133 | 0.677836 |
dd250cc1529bea0acd79a4d38787d9efb611e13a | 10,491 | py | Python | mpllayout.py | mchels/FolderBrowser | 2915634ebae8b093f26117d65f6bd97a3de59f07 | [
"MIT"
] | 1 | 2016-11-04T11:06:05.000Z | 2016-11-04T11:06:05.000Z | mpllayout.py | mchels/FolderBrowser | 2915634ebae8b093f26117d65f6bd97a3de59f07 | [
"MIT"
] | null | null | null | mpllayout.py | mchels/FolderBrowser | 2915634ebae8b093f26117d65f6bd97a3de59f07 | [
"MIT"
] | 3 | 2017-08-07T15:04:59.000Z | 2019-03-22T13:25:00.000Z | from PyQt5 import QtCore, QtWidgets
from PyQt5.QtWidgets import QSizePolicy
from plotcontrols import PlotControls
from matplotlib.backends.backend_qt5 import NavigationToolbar2QT
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg
from matplotlib.backend_bases import key_press_handler
from matplotlib.figur... | 37.602151 | 77 | 0.632923 |
d3430f6676c4f69185af22c57640886b392715e9 | 4,872 | py | Python | src/py/PrjPublish/PublishByPara.py | PrQiang/aods | b743754740f5b5bb4217f06fd790dffa303f871f | [
"MIT"
] | 2 | 2020-12-14T14:24:56.000Z | 2021-06-16T09:22:13.000Z | example/PrjPublish/PublishByPara.py | PrQiang/aods | b743754740f5b5bb4217f06fd790dffa303f871f | [
"MIT"
] | 1 | 2020-12-30T10:25:27.000Z | 2020-12-30T10:25:44.000Z | example/PrjPublish/PublishByPara.py | PrQiang/aods | b743754740f5b5bb4217f06fd790dffa303f871f | [
"MIT"
] | 1 | 2021-06-16T09:22:17.000Z | 2021-06-16T09:22:17.000Z |
""" 实现版本脚本发布功能
"""
import zipfile, random, time, json, os, sys, zlib, paramiko
from Logger import*
from DataModel import DataModel
from RestfulApiClient import RestfulApiClient
class Publish:
def __init__(self, ftpsInfo, pubUrl):
"""
# ftpsInfo: ftp上传信息集, 如: [("127.0.0.1", 22, 'usr', 'pwd')]
... | 44.290909 | 125 | 0.58436 |
93cf12c4437198c721d630413047a7bbb38f9c70 | 3,247 | py | Python | Selenium_Scripts/login_improper.py | RankyLea/conduit | 501f132e0d95de2b2ddc0bdd8d3ef971eb9b1357 | [
"MIT"
] | null | null | null | Selenium_Scripts/login_improper.py | RankyLea/conduit | 501f132e0d95de2b2ddc0bdd8d3ef971eb9b1357 | [
"MIT"
] | null | null | null | Selenium_Scripts/login_improper.py | RankyLea/conduit | 501f132e0d95de2b2ddc0bdd8d3ef971eb9b1357 | [
"MIT"
] | null | null | null | import string
import time
import random
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains
from random_signup import my_test_user
from random_signup import my_email
from rand... | 34.542553 | 92 | 0.716046 |
4720b28ecb44e8e39e44dfbab7af6650246d02d1 | 503 | py | Python | vcfx/field/calendar/nodes.py | Pholey/vcfx | 1c0e58fc420cdd85bcafb46ebb19389470aa9209 | [
"MIT"
] | 1 | 2016-02-08T10:19:09.000Z | 2016-02-08T10:19:09.000Z | vcfx/field/calendar/nodes.py | Pholey/vcfx | 1c0e58fc420cdd85bcafb46ebb19389470aa9209 | [
"MIT"
] | null | null | null | vcfx/field/calendar/nodes.py | Pholey/vcfx | 1c0e58fc420cdd85bcafb46ebb19389470aa9209 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from builtins import super
from future import standard_library
standard_library.install_aliases()
from vcfx.field.nodes import Field
#######
# TODO(cassidy): Figure out w... | 27.944444 | 78 | 0.759443 |
e0e7760d2225e0f83dfe580058ae2c868e215b82 | 14,399 | py | Python | tests/oauth2_utils.py | jvanasco/pyramid_oauthlib_lowlevel | ab1a867f63252128274dde12f41960a20037f1d4 | [
"BSD-2-Clause"
] | 1 | 2019-05-21T21:01:02.000Z | 2019-05-21T21:01:02.000Z | tests/oauth2_utils.py | jvanasco/pyramid_oauthlib_lowlevel | ab1a867f63252128274dde12f41960a20037f1d4 | [
"BSD-2-Clause"
] | null | null | null | tests/oauth2_utils.py | jvanasco/pyramid_oauthlib_lowlevel | ab1a867f63252128274dde12f41960a20037f1d4 | [
"BSD-2-Clause"
] | null | null | null | # stdlib
import pdb
import datetime
# pypi
import sqlalchemy
import sqlalchemy.orm
from oauthlib.oauth2 import Server
from oauthlib.oauth2 import WebApplicationServer
# local module
from pyramid_oauthlib_lowlevel.oauth2.validator import OAuth2RequestValidator_Hooks
from pyramid_oauthlib_lowlevel.oauth2.validator imp... | 38.603217 | 111 | 0.654629 |
aefebdec369cb160637f5728f26046d3ecad4f93 | 2,310 | py | Python | py/tests/test_auth.py | robopsi/semaphore | f61f301c7d3b845af7ac063544066d6866eda749 | [
"MIT"
] | null | null | null | py/tests/test_auth.py | robopsi/semaphore | f61f301c7d3b845af7ac063544066d6866eda749 | [
"MIT"
] | null | null | null | py/tests/test_auth.py | robopsi/semaphore | f61f301c7d3b845af7ac063544066d6866eda749 | [
"MIT"
] | 1 | 2020-07-03T00:58:05.000Z | 2020-07-03T00:58:05.000Z | import uuid
import semaphore
import pytest
def test_basic_key_functions():
sk, pk = semaphore.generate_key_pair()
signature = sk.sign(b'some secret data')
assert pk.verify(b'some secret data', signature)
assert not pk.verify(b'some other data', signature)
def test_challenge_response():
resp = se... | 72.1875 | 362 | 0.827273 |
81411abc782bf9b1f6f3f22e5119bf12fc73f345 | 5,777 | py | Python | moe/bandit/ucb/ucb_interface.py | dstoeckel/MOE | 5b5a6a2c6c3cf47320126f7f5894e2a83e347f5c | [
"Apache-2.0"
] | 966 | 2015-01-10T05:27:30.000Z | 2022-03-26T21:04:36.000Z | moe/bandit/ucb/ucb_interface.py | dstoeckel/MOE | 5b5a6a2c6c3cf47320126f7f5894e2a83e347f5c | [
"Apache-2.0"
] | 46 | 2015-01-16T22:33:08.000Z | 2019-09-04T16:33:27.000Z | moe/bandit/ucb/ucb_interface.py | dstoeckel/MOE | 5b5a6a2c6c3cf47320126f7f5894e2a83e347f5c | [
"Apache-2.0"
] | 143 | 2015-01-07T03:57:19.000Z | 2022-02-28T01:10:45.000Z | # -*- coding: utf-8 -*-
"""Classes (Python) to compute the Bandit UCB (Upper Confidence Bound) arm allocation and choosing the arm to pull next.
See :mod:`moe.bandit.bandit_interface` for further details on bandit.
"""
import copy
from abc import abstractmethod
from moe.bandit.bandit_interface import BanditInterfac... | 41.561151 | 171 | 0.701229 |
58240783179f0f625d2fcf5128e5fa70d688d446 | 2,603 | py | Python | scraping/reddit/reddit_scraping.py | Bahrifirass/rg_dataset | fe315f9bf0c3b59e781c1c3d57c9c4c59443ea75 | [
"MIT"
] | 3 | 2021-03-02T07:41:02.000Z | 2021-06-01T18:22:39.000Z | scraping/reddit/reddit_scraping.py | Bahrifirass/rg_dataset | fe315f9bf0c3b59e781c1c3d57c9c4c59443ea75 | [
"MIT"
] | 1 | 2021-03-15T08:05:58.000Z | 2021-03-15T08:05:58.000Z | scraping/reddit/reddit_scraping.py | Bahrifirass/rg_dataset | fe315f9bf0c3b59e781c1c3d57c9c4c59443ea75 | [
"MIT"
] | 5 | 2021-03-14T20:25:30.000Z | 2022-01-17T14:05:21.000Z | import praw
import json
SAVED_RESULTS = ['reddit.jsonl', 'reddit.json']
# you can use your own credentials if you want
CLIENT_ID = 'EZ57p7KGDL0_ZQ'
CLIENT_SECRET = 'FXYfQdTXOpiHEnF94s1Kcg2oeHeqWA'
USER_AGENT = 'Reddit WebScrapping'
def authenticate(id, secret, name):
''' authentication function to the Reddit i... | 37.185714 | 117 | 0.718018 |
991b6381f50e88c92c1c995f77a8349ed6515fb6 | 43,409 | py | Python | gamestonk_terminal/stocks/options/options_controller.py | dakhouya/GamestonkTerminal | 006b3570b795215a17c64841110b649b03db9a98 | [
"MIT"
] | null | null | null | gamestonk_terminal/stocks/options/options_controller.py | dakhouya/GamestonkTerminal | 006b3570b795215a17c64841110b649b03db9a98 | [
"MIT"
] | 1 | 2022-03-29T13:45:05.000Z | 2022-03-29T13:45:05.000Z | gamestonk_terminal/stocks/options/options_controller.py | dakhouya/GamestonkTerminal | 006b3570b795215a17c64841110b649b03db9a98 | [
"MIT"
] | 1 | 2021-06-20T02:42:40.000Z | 2021-06-20T02:42:40.000Z | """ Options Controller Module """
__docformat__ = "numpy"
import argparse
import os
from datetime import datetime, timedelta
from typing import List
from colorama import Style
import pandas as pd
from prompt_toolkit.completion import NestedCompleter
from gamestonk_terminal.parent_classes import BaseController
from ga... | 34.979049 | 117 | 0.478173 |
f9de4e59414e071ea70e5ca9831e47c8be4bea5e | 9,862 | py | Python | easywrk/common.py | riag/easy-wrk | 107684f118225fce480d693c12d4127cc82a9f90 | [
"Apache-2.0"
] | null | null | null | easywrk/common.py | riag/easy-wrk | 107684f118225fce480d693c12d4127cc82a9f90 | [
"Apache-2.0"
] | null | null | null | easywrk/common.py | riag/easy-wrk | 107684f118225fce480d693c12d4127cc82a9f90 | [
"Apache-2.0"
] | null | null | null | #coding:utf8
import os
import sys
import attr
import logging
import base64
from pathlib import Path
from requests import Request
from dotenv import load_dotenv
from jinja2 import Environment, FileSystemLoader
import requests
from typing import List, Dict, Tuple, Any, IO
import cattr
from .validates import validate_... | 26.726287 | 101 | 0.629284 |
94c080ed5531e72eb83c4d7eee663d48195295c0 | 493 | py | Python | nina_xmpp/__main__.py | magicbrothers/nina_xmpp | f8886c115a454db0dcaab15e37cc5ca8263ca644 | [
"MIT"
] | 15 | 2021-07-28T21:50:51.000Z | 2022-03-17T20:20:00.000Z | nina_xmpp/__main__.py | magicbrothers/nina_xmpp | f8886c115a454db0dcaab15e37cc5ca8263ca644 | [
"MIT"
] | 22 | 2021-02-08T09:31:31.000Z | 2022-02-04T19:48:58.000Z | nina_xmpp/__main__.py | magicbrothers/nina_xmpp | f8886c115a454db0dcaab15e37cc5ca8263ca644 | [
"MIT"
] | 7 | 2021-02-07T12:45:05.000Z | 2021-12-26T00:49:38.000Z | import asyncio
from . import NinaXMPP
def main():
import yaml
import argparse
from argparse_logging import add_log_level_argument
parser = argparse.ArgumentParser()
parser.add_argument('config_file', type=argparse.FileType('r'))
add_log_level_argument(parser)
args = parser.parse_args()
... | 18.961538 | 67 | 0.703854 |
3230ce524e2374e8b065d2820be9c652c70d2be3 | 10,442 | py | Python | pySDC/projects/AsympConv/PFASST_conv_Linf.py | brownbaerchen/pySDC | 31293859d731646aa09cef4345669eac65501550 | [
"BSD-2-Clause"
] | 20 | 2015-03-21T09:02:55.000Z | 2022-02-26T20:22:21.000Z | pySDC/projects/AsympConv/PFASST_conv_Linf.py | brownbaerchen/pySDC | 31293859d731646aa09cef4345669eac65501550 | [
"BSD-2-Clause"
] | 61 | 2015-03-02T09:35:55.000Z | 2022-03-17T12:42:48.000Z | pySDC/projects/AsympConv/PFASST_conv_Linf.py | brownbaerchen/pySDC | 31293859d731646aa09cef4345669eac65501550 | [
"BSD-2-Clause"
] | 19 | 2015-02-20T11:52:33.000Z | 2022-02-02T10:46:27.000Z | import csv
import os
# import matplotlib
# matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
from pySDC.helpers.stats_helper import filter_stats, sort_stats
from pySDC.implementations.collocation_classes.gauss_radau_right import CollGaussRadau_Right
from pySDC.implementations.controller_classes... | 34.013029 | 120 | 0.650642 |
d198467dcbf804d949e206c8253cd2f90edecbd9 | 7,213 | py | Python | compiler/testdata/expected/python.asyncio/service_extension_same_file/f_BasePinger.py | BunnyLINE/frugal | 1f82fb86b9aace8b78fcc0fedb1d60a9d60ffc31 | [
"Apache-2.0"
] | 144 | 2017-08-17T15:51:58.000Z | 2022-01-14T21:36:55.000Z | compiler/testdata/expected/python.asyncio/service_extension_same_file/f_BasePinger.py | BunnyLINE/frugal | 1f82fb86b9aace8b78fcc0fedb1d60a9d60ffc31 | [
"Apache-2.0"
] | 930 | 2017-08-17T17:53:30.000Z | 2022-03-28T14:04:49.000Z | compiler/testdata/expected/python.asyncio/service_extension_same_file/f_BasePinger.py | BunnyLINE/frugal | 1f82fb86b9aace8b78fcc0fedb1d60a9d60ffc31 | [
"Apache-2.0"
] | 77 | 2017-08-17T15:54:31.000Z | 2021-12-25T15:18:34.000Z | #
# Autogenerated by Frugal Compiler (3.14.10)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
import asyncio
from datetime import timedelta
import inspect
from frugal.aio.processor import FBaseProcessor
from frugal.aio.processor import FProcessorFunction
from frugal.exceptions import TApplic... | 31.77533 | 151 | 0.628587 |
ace57cf6494e8d34b4c048263eddbfb763434eaa | 8,768 | py | Python | phy/apps/__init__.py | PaulMAnderson/phy | 134264e6c1ec586f797459633fa4e71352fafb4e | [
"BSD-3-Clause"
] | null | null | null | phy/apps/__init__.py | PaulMAnderson/phy | 134264e6c1ec586f797459633fa4e71352fafb4e | [
"BSD-3-Clause"
] | null | null | null | phy/apps/__init__.py | PaulMAnderson/phy | 134264e6c1ec586f797459633fa4e71352fafb4e | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""CLI tool."""
#------------------------------------------------------------------------------
# Imports
#------------------------------------------------------------------------------
from contextlib import contextmanager
import logging
from pathlib import Path
import sys
from traceback im... | 35.354839 | 98 | 0.577669 |
c42239ea333ce610904b70c839f1bc4813381294 | 414 | py | Python | demo/classification/criteo_ctr/run_demo_ctr.py | bluesjjw/xlearn | 6da54dbef3edb6edaa3c0cd189704d72ef1b5e21 | [
"Apache-2.0"
] | 1 | 2021-01-06T08:27:27.000Z | 2021-01-06T08:27:27.000Z | demo/classification/criteo_ctr/run_demo_ctr.py | bluesjjw/xlearn | 6da54dbef3edb6edaa3c0cd189704d72ef1b5e21 | [
"Apache-2.0"
] | null | null | null | demo/classification/criteo_ctr/run_demo_ctr.py | bluesjjw/xlearn | 6da54dbef3edb6edaa3c0cd189704d72ef1b5e21 | [
"Apache-2.0"
] | null | null | null | import xlearn as xl
# Training task
ffm_model = xl.create_ffm()
ffm_model.setTrain("./small_train.txt")
ffm_model.setValidate("./small_test.txt")
param = {'task':'binary', 'lr':0.2,
'lambda':0.002, 'metric':'acc'}
ffm_model.fit(param, './model.out')
# Prediction task
ffm_model.setTest("./small_test.txt")
#... | 25.875 | 48 | 0.695652 |
62c56984b854c8c4157cedc75759097cf79bfacd | 11,283 | py | Python | zazu.py | PatiMohit/ZazuML | c5247859353cacf0e4a58f9c530a07038d9e12cf | [
"MIT"
] | 1 | 2020-12-31T18:02:41.000Z | 2020-12-31T18:02:41.000Z | zazu.py | PatiMohit/ZazuML | c5247859353cacf0e4a58f9c530a07038d9e12cf | [
"MIT"
] | null | null | null | zazu.py | PatiMohit/ZazuML | c5247859353cacf0e4a58f9c530a07038d9e12cf | [
"MIT"
] | null | null | null | from model_selector import find_model
from launch_pad import Launcher
from hyperparameter_tuner import Tuner, OngoingTrials
from spec import ConfigSpec, OptModel
from spec import ModelsSpec
from logging_utils import init_logging, logginger
from dataloop_services import deploy_model, deploy_zazu, push_package, update_s... | 44.77381 | 227 | 0.66321 |
02d560a1ea200edb9fdf8f9c412bf90076e75cd6 | 573 | py | Python | ProDy/distance.py | wojdyr/pdb-benchmarks | 6f99ef1ad7151c0c637f5f2a2c35a5b4ceb042fe | [
"MIT"
] | 30 | 2016-05-21T18:07:36.000Z | 2022-02-25T15:10:49.000Z | ProDy/distance.py | wojdyr/pdb-benchmarks | 6f99ef1ad7151c0c637f5f2a2c35a5b4ceb042fe | [
"MIT"
] | 7 | 2016-06-20T22:40:50.000Z | 2020-06-17T17:06:10.000Z | ProDy/distance.py | wojdyr/pdb-benchmarks | 6f99ef1ad7151c0c637f5f2a2c35a5b4ceb042fe | [
"MIT"
] | 6 | 2016-05-26T14:44:28.000Z | 2020-05-26T09:50:47.000Z | # Benchmark the calculation of a distance in a PDB file
# The distance is the closest distance between any atoms of residues 50 and 60
# of chain A in 1AKE
import time
from prody import *
pdb_filepath = "data/1AKE.pdb"
struc = parsePDB(pdb_filepath)
def distance():
min_dist = float("inf")
for atom_a in str... | 23.875 | 78 | 0.670157 |
ac901e5eb1a71c25b62d71b016f86ba8580c259a | 4,710 | py | Python | _site/lib/entry.py | niklasbt/notebook | a1144028f57ef735371c5795b708527ef5beca01 | [
"MIT"
] | null | null | null | _site/lib/entry.py | niklasbt/notebook | a1144028f57ef735371c5795b708527ef5beca01 | [
"MIT"
] | null | null | null | _site/lib/entry.py | niklasbt/notebook | a1144028f57ef735371c5795b708527ef5beca01 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import importlib
from datetime import datetime
### Functions ##################################################################
def getFiles(path,type):
if type == 'project':
files = [f for f in os.listdir(path) if f.endswith('.md')]
files = [os.path.splitext(f)[0] ... | 30.387097 | 86 | 0.563694 |
8ddc861a1b6c0b098ec7cc32abf72e3744d1640a | 228 | py | Python | boxdb/table_checkup.py | kshitij1235/boxdb | 4aa121f856c148c5136368041a610a584fb1dbc6 | [
"MIT"
] | 1 | 2022-01-31T17:21:02.000Z | 2022-01-31T17:21:02.000Z | boxdb/table_checkup.py | kshitij1235/boxdb | 4aa121f856c148c5136368041a610a584fb1dbc6 | [
"MIT"
] | null | null | null | boxdb/table_checkup.py | kshitij1235/boxdb | 4aa121f856c148c5136368041a610a584fb1dbc6 | [
"MIT"
] | null | null | null | """
boxdb/table_checkup.py -> v0.3
This file contain code for
1)to check table
"""
from os import path
def check_table(table_name):
"""
checks if table exist's or not
"""
return path.exists(f"./{table_name}")
| 15.2 | 41 | 0.653509 |
469acc25fd3f1c2d6a3bdf40d6ec95ebe12e4a7f | 5,356 | py | Python | friendly/source_cache.py | MrGreenTea/friendly | 091f6af1d3c2be8fee078e52db6e16074d5518e5 | [
"MIT"
] | null | null | null | friendly/source_cache.py | MrGreenTea/friendly | 091f6af1d3c2be8fee078e52db6e16074d5518e5 | [
"MIT"
] | null | null | null | friendly/source_cache.py | MrGreenTea/friendly | 091f6af1d3c2be8fee078e52db6e16074d5518e5 | [
"MIT"
] | null | null | null | """source_cache.py
Used to cache and retrieve source code.
This is especially useful when a custom REPL is used.
Note that we monkeypatch Python's linecache.getlines.
"""
import linecache
import time
old_getlines = linecache.getlines
idle_get_lines = None
class Cache:
"""Class used to store source of files ... | 34.779221 | 81 | 0.622293 |
051f9e21a1f420101115302ad07e0edae7742bb6 | 607 | py | Python | lib/sqlalchemy/ext/asyncio/base.py | Dreamsorcerer/sqlalchemy | 153671df9d4cd7f2cdb3e14e6221f529269885d9 | [
"MIT"
] | 1 | 2021-04-04T10:13:08.000Z | 2021-04-04T10:13:08.000Z | lib/sqlalchemy/ext/asyncio/base.py | Dreamsorcerer/sqlalchemy | 153671df9d4cd7f2cdb3e14e6221f529269885d9 | [
"MIT"
] | null | null | null | lib/sqlalchemy/ext/asyncio/base.py | Dreamsorcerer/sqlalchemy | 153671df9d4cd7f2cdb3e14e6221f529269885d9 | [
"MIT"
] | 1 | 2020-12-04T14:51:39.000Z | 2020-12-04T14:51:39.000Z | import abc
from . import exc as async_exc
class StartableContext(abc.ABC):
@abc.abstractmethod
async def start(self) -> "StartableContext":
pass
def __await__(self):
return self.start().__await__()
async def __aenter__(self):
return await self.start()
@abc.abstractmetho... | 23.346154 | 78 | 0.649094 |
deebf591cd10f3db91717d3d24d0b370936955eb | 818 | py | Python | setup.py | vuhcl/cs110_final_project | fe72f9a17799dd770786f3e7279f140c30284f63 | [
"MIT"
] | null | null | null | setup.py | vuhcl/cs110_final_project | fe72f9a17799dd770786f3e7279f140c30284f63 | [
"MIT"
] | null | null | null | setup.py | vuhcl/cs110_final_project | fe72f9a17799dd770786f3e7279f140c30284f63 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
setup(
... | 27.266667 | 64 | 0.665037 |
7dacc7015e98af041ec2d9972b1e2a749989d4b7 | 596 | py | Python | src/event/api/urls.py | brijeshgzp05/yantragene2k19 | 139f5a8e084b03eec58bd6da5878dc3c16b2a5cb | [
"MIT"
] | 3 | 2019-10-27T10:26:01.000Z | 2020-02-28T16:33:42.000Z | src/event/api/urls.py | brijeshgzp05/yantragene2k19 | 139f5a8e084b03eec58bd6da5878dc3c16b2a5cb | [
"MIT"
] | null | null | null | src/event/api/urls.py | brijeshgzp05/yantragene2k19 | 139f5a8e084b03eec58bd6da5878dc3c16b2a5cb | [
"MIT"
] | null | null | null | from django.urls import path,re_path
from .views import (
EventDetailAPIView,
ParticipantCreateAPIView,
ParticipantListAPIView,
ParticipantDeleteAPIView,
)
app_name = 'event-api'
urlpatterns = [
path('participatedin/', ParticipantListAPIView.as_view(), name='participant-list'),
re_path(r'^(?P<slug>[\w... | 33.111111 | 116 | 0.734899 |
de85e696b501875e637d70451cc7f5b17c076d61 | 3,361 | py | Python | Widen/LC464_can_I_win.py | crazywiden/Leetcode_daily_submit | 15637e260ab547022ac0c828dd196337bd8d50a3 | [
"MIT"
] | null | null | null | Widen/LC464_can_I_win.py | crazywiden/Leetcode_daily_submit | 15637e260ab547022ac0c828dd196337bd8d50a3 | [
"MIT"
] | null | null | null | Widen/LC464_can_I_win.py | crazywiden/Leetcode_daily_submit | 15637e260ab547022ac0c828dd196337bd8d50a3 | [
"MIT"
] | null | null | null | """
LC464 -- can I win
In the "100 game," two players take turns adding, to a running total, any integer from 1..10. The player who first causes the running total to reach or exceed 100 wins.
What if we change the game so that players cannot re-use integers?
For example, two players might take turns drawing from a co... | 38.632184 | 168 | 0.611723 |
81e6c0f11a050e3a59bf1ed662b22850fa1ef3d2 | 1,639 | py | Python | src/userChatLog.py | liusoon/wechat-alfred-workflow | 449995275dd700bcb3686abcfe2ed9c63ea826a3 | [
"MIT"
] | 929 | 2018-03-18T07:36:28.000Z | 2022-03-25T07:33:46.000Z | src/userChatLog.py | liusoon/wechat-alfred-workflow | 449995275dd700bcb3686abcfe2ed9c63ea826a3 | [
"MIT"
] | 57 | 2018-03-18T14:03:51.000Z | 2021-05-28T01:14:01.000Z | src/userChatLog.py | liusoon/wechat-alfred-workflow | 449995275dd700bcb3686abcfe2ed9c63ea826a3 | [
"MIT"
] | 141 | 2018-03-21T07:53:39.000Z | 2022-03-28T07:51:15.000Z | # -*- coding:utf-8 -*-
import json,sys,os
from workflow import Workflow, web
reload(sys)
sys.setdefaultencoding('utf-8')
def main(wf):
userId = os.getenv('userId')
baseUrl = os.getenv('baseUrl')
url = baseUrl + 'chatlog?userId=' + userId + '&count=45'
try:
result = web.get(url=url)
res... | 34.87234 | 153 | 0.519219 |
0e708407f81a1c877e0f5ffc15d3c334cb691899 | 9,410 | py | Python | meltingpot/python/utils/scenarios/scenario_test.py | Rohan138/meltingpot | d4e3839225b78babcedbbbf95cf747ff9e0a87b5 | [
"Apache-2.0"
] | null | null | null | meltingpot/python/utils/scenarios/scenario_test.py | Rohan138/meltingpot | d4e3839225b78babcedbbbf95cf747ff9e0a87b5 | [
"Apache-2.0"
] | null | null | null | meltingpot/python/utils/scenarios/scenario_test.py | Rohan138/meltingpot | d4e3839225b78babcedbbbf95cf747ff9e0a87b5 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 DeepMind Technologies Limited.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 34.723247 | 79 | 0.60085 |
278c8ca41bc2707dde6327c5c71d395b042a9074 | 2,244 | py | Python | freezer-dr-7.1.0/freezer_dr/main.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 15 | 2016-05-25T08:14:59.000Z | 2022-03-10T11:36:00.000Z | freezer-dr-7.1.0/freezer_dr/main.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 5 | 2019-08-14T06:46:03.000Z | 2021-12-13T20:01:25.000Z | freezer-dr-7.1.0/freezer_dr/main.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 3 | 2019-01-10T10:40:36.000Z | 2019-03-19T06:33:01.000Z | # (c) Copyright 2014,2015 Hewlett-Packard Development Company, L.P.
#
# 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 a... | 38.689655 | 77 | 0.731729 |
07c7ea3fac4902afa878b1c347349553ca96d18d | 163 | py | Python | moto/organizations/urls.py | gtourkas/moto | 307104417b579d23d02f670ff55217a2d4a16bee | [
"Apache-2.0"
] | 5,460 | 2015-01-01T01:11:17.000Z | 2022-03-31T23:45:38.000Z | moto/organizations/urls.py | gtourkas/moto | 307104417b579d23d02f670ff55217a2d4a16bee | [
"Apache-2.0"
] | 4,475 | 2015-01-05T19:37:30.000Z | 2022-03-31T13:55:12.000Z | moto/organizations/urls.py | gtourkas/moto | 307104417b579d23d02f670ff55217a2d4a16bee | [
"Apache-2.0"
] | 1,831 | 2015-01-14T00:00:44.000Z | 2022-03-31T20:30:04.000Z | from .responses import OrganizationsResponse
url_bases = [r"https?://organizations\.(.+)\.amazonaws\.com"]
url_paths = {"{0}/$": OrganizationsResponse.dispatch}
| 27.166667 | 61 | 0.730061 |
13a38022977e55fa9f6f4f12695adf1aa2234607 | 273 | py | Python | src/downward/experiments/issue919/translator_additional_parser.py | ScarfZapdos/conan-bge-questgen | 4d184c5bf0ae4b768b8043cec586395df9ce1451 | [
"MIT"
] | 1 | 2021-09-09T13:03:02.000Z | 2021-09-09T13:03:02.000Z | src/downward/experiments/issue919/translator_additional_parser.py | ScarfZapdos/conan-bge-questgen | 4d184c5bf0ae4b768b8043cec586395df9ce1451 | [
"MIT"
] | null | null | null | src/downward/experiments/issue919/translator_additional_parser.py | ScarfZapdos/conan-bge-questgen | 4d184c5bf0ae4b768b8043cec586395df9ce1451 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import hashlib
from lab.parser import Parser
def add_hash_value(content, props):
props['translator_output_sas_hash'] = hashlib.sha512(content).hexdigest()
parser = Parser()
parser.add_function(add_hash_value, file="output.sas")
parser.parse()
| 21 | 77 | 0.769231 |
f6f224b0bb884c9d83b61218dd536aecccb1d161 | 1,549 | py | Python | main.py | camilos-ufm/OSPoolThreads | fc8e182a0d2d37a90b71dd90ec0518a2f79029ac | [
"CNRI-Python",
"CECILL-B"
] | 1 | 2021-04-17T07:05:03.000Z | 2021-04-17T07:05:03.000Z | main.py | camilos-ufm/OSPoolThreads | fc8e182a0d2d37a90b71dd90ec0518a2f79029ac | [
"CNRI-Python",
"CECILL-B"
] | null | null | null | main.py | camilos-ufm/OSPoolThreads | fc8e182a0d2d37a90b71dd90ec0518a2f79029ac | [
"CNRI-Python",
"CECILL-B"
] | null | null | null | from mat_mult import mat_mult
from csv_manager import csv_manager
import sys, time
import sys
# python main file1 file2 pool_size fileoutput
def show_help():
print("Help Menu\n\n"
"fileA:\n Archivo (matriz) de entrada 1 de 2.\n"
"\nfileB:\n Archivo (matriz) de entrada 2 de 2.\n"
"... | 33.673913 | 118 | 0.622983 |
25133b3f5335050737c10c820cf76c838eea2ae6 | 323 | py | Python | tests/test_cli.py | fakegit/pytube | fae2e46c300ec8c41ddc60f5a4eb8ce7cdd47cf5 | [
"MIT-0"
] | null | null | null | tests/test_cli.py | fakegit/pytube | fae2e46c300ec8c41ddc60f5a4eb8ce7cdd47cf5 | [
"MIT-0"
] | null | null | null | tests/test_cli.py | fakegit/pytube | fae2e46c300ec8c41ddc60f5a4eb8ce7cdd47cf5 | [
"MIT-0"
] | null | null | null | # -*- coding: utf-8 -*-
import mock
from pytube import cli
@mock.patch("pytube.cli.YouTube")
@mock.patch("pytube.cli.sys")
def test_download(MockYouTube, mock_sys):
instance = MockYouTube.return_value
instance.prefetch_init.return_value = None
instance.streams = mock.Mock()
cli.download("asdf", "asdf... | 23.071429 | 46 | 0.712074 |
3a8382b37ed6e3cc7aa4af996a753d5b54dac9b9 | 9,105 | py | Python | demos/kernelmethod/server_kernelmethod.py | monadyn/fedlearn-algo | c4459d421139b0bb765527d636fff123bf17bda4 | [
"Apache-2.0"
] | 86 | 2021-07-20T01:54:21.000Z | 2021-10-06T04:02:40.000Z | demos/kernelmethod/server_kernelmethod.py | fedlearnAI/fedlearnalgo | 63d9ceb64d331ff2b5103ae49e54229cad7e2095 | [
"Apache-2.0"
] | 5 | 2021-07-23T21:22:16.000Z | 2021-09-12T15:48:35.000Z | demos/kernelmethod/server_kernelmethod.py | fedlearnAI/fedlearnalgo | 63d9ceb64d331ff2b5103ae49e54229cad7e2095 | [
"Apache-2.0"
] | 28 | 2021-07-20T07:15:33.000Z | 2021-08-22T20:04:57.000Z | # Copyright 2021 Fedlearn authors.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | 39.586957 | 115 | 0.582757 |
685eb6df68d793b9c7baf533b2cdda8f79f95ba2 | 2,623 | py | Python | demo-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper_service.py | zouzhberk/ambaridemo | 90068c5ee7adf83ba9dde9a8ad8d396b2fbf87c8 | [
"Apache-2.0"
] | null | null | null | demo-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper_service.py | zouzhberk/ambaridemo | 90068c5ee7adf83ba9dde9a8ad8d396b2fbf87c8 | [
"Apache-2.0"
] | null | null | null | demo-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper_service.py | zouzhberk/ambaridemo | 90068c5ee7adf83ba9dde9a8ad8d396b2fbf87c8 | [
"Apache-2.0"
] | null | null | null | """
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 use this ... | 38.014493 | 112 | 0.749905 |
e641d0b209cde5111b660437d9adc2a929c44b40 | 2,323 | py | Python | src/ingest/seasonal_team_gamelogs.py | Langutang/Marauder.AI | fd25af74d3c9a99ed6e0cd7092cd5846041605a9 | [
"MIT"
] | null | null | null | src/ingest/seasonal_team_gamelogs.py | Langutang/Marauder.AI | fd25af74d3c9a99ed6e0cd7092cd5846041605a9 | [
"MIT"
] | null | null | null | src/ingest/seasonal_team_gamelogs.py | Langutang/Marauder.AI | fd25af74d3c9a99ed6e0cd7092cd5846041605a9 | [
"MIT"
] | null | null | null | import requests
from requests.auth import HTTPBasicAuth
import time
url = "https://api.mysportsfeeds.com/v2.1/pull/nhl/2021-2022-regular/games.csv"
token = "4e92f126-d598-4577-98e3-bb0674"
password = "MYSPORTSFEEDS"
top_directory = r"C:\Users\John Lang\Documents\Marauder\NHL\core"
years = ["2017","2018","2019"... | 40.754386 | 127 | 0.529918 |
c0ad2600cc8fe5da9310b85afbd1059684147120 | 12,684 | py | Python | image_split_tools/sheet_music_detailed.py | ftshijt/Music-Project | db73f92cfd8ebd34ae9623d26e131c2094961bf3 | [
"MIT"
] | 3 | 2019-02-26T13:36:20.000Z | 2019-08-16T13:40:21.000Z | image_split_tools/sheet_music_detailed.py | ftshijt/Music-Project | db73f92cfd8ebd34ae9623d26e131c2094961bf3 | [
"MIT"
] | null | null | null | image_split_tools/sheet_music_detailed.py | ftshijt/Music-Project | db73f92cfd8ebd34ae9623d26e131c2094961bf3 | [
"MIT"
] | 1 | 2019-03-08T15:42:35.000Z | 2019-03-08T15:42:35.000Z | # -*- coding: utf-8 -*-
"""
Created on Jan 29 14:48:16 2019
@author: GS_qbr
"""
from PIL import Image
from PIL import ImageDraw
import cv2 as cv
import numpy as np
from sklearn.cluster import KMeans
import matplotlib.pyplot as plt
import os
import pandas as pd
import csv
def Traversing_dir(folder_name): # 根据后缀名,遍历文... | 37.976048 | 155 | 0.621649 |
9159d24beac4f2c4e4ce1e8d3dfbfc90376a6dab | 361 | py | Python | SistemaWebAuditorias/Apps/Auditoria/migrations/0004_auto_20191120_2137.py | diegoquirozramirez/Sistema-Web-Auditorias | d070a7c85a9dad1740dea5bc397fd3cfb3735ba8 | [
"MIT"
] | null | null | null | SistemaWebAuditorias/Apps/Auditoria/migrations/0004_auto_20191120_2137.py | diegoquirozramirez/Sistema-Web-Auditorias | d070a7c85a9dad1740dea5bc397fd3cfb3735ba8 | [
"MIT"
] | null | null | null | SistemaWebAuditorias/Apps/Auditoria/migrations/0004_auto_20191120_2137.py | diegoquirozramirez/Sistema-Web-Auditorias | d070a7c85a9dad1740dea5bc397fd3cfb3735ba8 | [
"MIT"
] | null | null | null | # Generated by Django 2.0 on 2019-11-21 02:37
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('Auditoria', '0003_convocatoria'),
]
operations = [
migrations.AlterUniqueTogether(
name='convocatoria',
unique_together={('aud... | 20.055556 | 57 | 0.609418 |
2c288ee33822b47fa9dab04287b651b1bfe2513c | 2,175 | py | Python | main.py | rauner/DeepLearning-Lemon-Markets-Trading | 41412d6f7c0851739ed43befd2594a5e7a6f00f6 | [
"MIT"
] | null | null | null | main.py | rauner/DeepLearning-Lemon-Markets-Trading | 41412d6f7c0851739ed43befd2594a5e7a6f00f6 | [
"MIT"
] | null | null | null | main.py | rauner/DeepLearning-Lemon-Markets-Trading | 41412d6f7c0851739ed43befd2594a5e7a6f00f6 | [
"MIT"
] | null | null | null | #from dotenv import load_dotenv
from handlers.lemon import LemonMarketsAPI
#load_dotenv()
import pandas as pd
import numpy as np
import yfinance as yf
from datetime import datetime, timedelta, date
from handlers import model
from handlers import helpers
# show data for different tickers
#isin = os.environ.get("i... | 20.138889 | 115 | 0.72092 |
aacee9ccc520c1eac175132e0740c996dee2f046 | 1,237 | py | Python | pytglib/api/types/background_type_pattern.py | iTeam-co/pytglib | e5e75e0a85f89b77762209b32a61b0a883c0ae61 | [
"MIT"
] | 6 | 2019-10-30T08:57:27.000Z | 2021-02-08T14:17:43.000Z | pytglib/api/types/background_type_pattern.py | iTeam-co/python-telegram | e5e75e0a85f89b77762209b32a61b0a883c0ae61 | [
"MIT"
] | 1 | 2021-08-19T05:44:10.000Z | 2021-08-19T07:14:56.000Z | pytglib/api/types/background_type_pattern.py | iTeam-co/python-telegram | e5e75e0a85f89b77762209b32a61b0a883c0ae61 | [
"MIT"
] | 5 | 2019-12-04T05:30:39.000Z | 2021-05-21T18:23:32.000Z |
from ..utils import Object
class BackgroundTypePattern(Object):
"""
A PNG or TGV (gzipped subset of SVG with MIME type "application/x-tgwallpattern") pattern to be combined with the background fill chosen by the user
Attributes:
ID (:obj:`str`): ``BackgroundTypePattern``
Args:
fill... | 30.170732 | 152 | 0.637025 |
79ca4ddfca11b5041323c1fa25aece0f30a506f7 | 5,739 | py | Python | userbot/modules/system_stats.py | edomiredo/One4uBot | e427814b0a5fbc6b5a96602d7590d1b9e77f9e69 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/system_stats.py | edomiredo/One4uBot | e427814b0a5fbc6b5a96602d7590d1b9e77f9e69 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/system_stats.py | edomiredo/One4uBot | e427814b0a5fbc6b5a96602d7590d1b9e77f9e69 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 1 | 2020-03-21T03:39:58.000Z | 2020-03-21T03:39:58.000Z | # Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.d (the "License");
# you may not use this file except in compliance with the License.
#
""" Userbot module for getting information about the server. """
from asyncio import create_subprocess_shell as asyncr... | 33.561404 | 83 | 0.541384 |
cbe62ff7020ba764b9c65657d2edba9988f5c168 | 2,480 | py | Python | src/tars/strategies/trend_following_strategy.py | fredmontet/tars | 922786e8c6456fc0cc1a9db07714f11dd78219d9 | [
"MIT"
] | 3 | 2022-02-06T14:41:07.000Z | 2022-03-25T16:27:45.000Z | src/tars/strategies/trend_following_strategy.py | fredmontet/tars | 922786e8c6456fc0cc1a9db07714f11dd78219d9 | [
"MIT"
] | 6 | 2021-09-20T03:33:31.000Z | 2022-03-24T09:00:48.000Z | src/tars/strategies/trend_following_strategy.py | fredmontet/tars | 922786e8c6456fc0cc1a9db07714f11dd78219d9 | [
"MIT"
] | null | null | null | import pandas as pd
from scipy.signal import savgol_filter
from ..evaluators import TraderEvaluator
from .abstract_strategy import AbstractStrategy
from ..markets import CryptoMarket
class TrendFollowing(AbstractStrategy):
"""
Follow a quote's trend by taking a buy/sell decision based on the 2nd
derivati... | 31.794872 | 77 | 0.591935 |
66dc6ee923cc072487dc6e236c5f01981ead183c | 1,473 | py | Python | tasker.py | Avishek-Paul/SlackAssistant | 4cb41fe62526dc26381c6ca6bc420b1104a8da2f | [
"MIT"
] | null | null | null | tasker.py | Avishek-Paul/SlackAssistant | 4cb41fe62526dc26381c6ca6bc420b1104a8da2f | [
"MIT"
] | null | null | null | tasker.py | Avishek-Paul/SlackAssistant | 4cb41fe62526dc26381c6ca6bc420b1104a8da2f | [
"MIT"
] | null | null | null |
import importlib
import glob
import config
import logging
import logging.config
from celery import Celery
logger = logging.getLogger(__name__)
logging.config.fileConfig('logging_config.ini')
app = Celery('slack_assistant', broker=config.broker)
# def loadPlugins(sef):
files = [f.replace('/','.')[:-3] for f in glob.... | 30.6875 | 129 | 0.647658 |
caabcecf0a5251a3b7cea58013d39374a8c8f666 | 10,909 | py | Python | saticl/tasks/__init__.py | edornd/multimodal-icl | f79bfa73665db471c12ee9cb57bbee1bcabb0467 | [
"MIT"
] | 6 | 2021-12-08T05:58:18.000Z | 2021-12-29T09:55:32.000Z | saticl/tasks/__init__.py | edornd/multimodal-icl | f79bfa73665db471c12ee9cb57bbee1bcabb0467 | [
"MIT"
] | null | null | null | saticl/tasks/__init__.py | edornd/multimodal-icl | f79bfa73665db471c12ee9cb57bbee1bcabb0467 | [
"MIT"
] | null | null | null | import logging
import random
from collections import defaultdict
from pathlib import Path
from typing import Iterable, List
import numpy as np
from ordered_set import OrderedSet
from saticl.datasets.base import DatasetBase
from saticl.logging.console import DistributedLogger
from saticl.tasks.agrivision import ICL_AG... | 47.637555 | 119 | 0.660464 |
f30eac5930a77fdd519ff99155f37e05cf917441 | 486 | py | Python | src/djshop/apps/offers/forms/bundle_offers.py | diegojromerolopez/djshop | 3fe623532228006e96269bd0f21c7b7d380c3a1a | [
"MIT"
] | null | null | null | src/djshop/apps/offers/forms/bundle_offers.py | diegojromerolopez/djshop | 3fe623532228006e96269bd0f21c7b7d380c3a1a | [
"MIT"
] | 1 | 2017-05-08T17:05:00.000Z | 2018-04-04T11:55:30.000Z | src/djshop/apps/offers/forms/bundle_offers.py | diegojromerolopez/djshop | 3fe623532228006e96269bd0f21c7b7d380c3a1a | [
"MIT"
] | 2 | 2017-04-25T10:32:57.000Z | 2020-05-04T16:12:08.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from djshop.apps.offers.models import BundleOffer
from django import forms
# Bundle offer form
class BundleOfferForm(forms.ModelForm):
class Meta:
model = BundleOffer
fields = ["name", "description", "product", "bundle_product_units... | 25.578947 | 97 | 0.738683 |
126faae346a32f2c6d533c08d0a9fdb11f73862b | 25,198 | py | Python | sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/aio/_text_analytics_client_async.py | letmaik/azure-sdk-for-python | 4ed6294caef4699534c56c9d840f379bced1ab6f | [
"MIT"
] | null | null | null | sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/aio/_text_analytics_client_async.py | letmaik/azure-sdk-for-python | 4ed6294caef4699534c56c9d840f379bced1ab6f | [
"MIT"
] | null | null | null | sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/aio/_text_analytics_client_async.py | letmaik/azure-sdk-for-python | 4ed6294caef4699534c56c9d840f379bced1ab6f | [
"MIT"
] | null | null | null | # coding=utf-8
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
from typing import ( # pylint: disable=unused-import
Union,
Optional,
Any,
List,
Dict,
TYPE_CHECKING
)
from azure.core.tracing.d... | 52.715481 | 118 | 0.668863 |
b0fd1a4e359844c28297c4fb729f9ac90777de75 | 861 | py | Python | eco-server.py | leopedroso45/ClientServerPy | 7216838e445b3e90fefcfb740ad194a089c5115d | [
"MIT"
] | null | null | null | eco-server.py | leopedroso45/ClientServerPy | 7216838e445b3e90fefcfb740ad194a089c5115d | [
"MIT"
] | null | null | null | eco-server.py | leopedroso45/ClientServerPy | 7216838e445b3e90fefcfb740ad194a089c5115d | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from threading import Timer
from _thread import *
import threading
import time
import socket
HOST = '127.0.0.1' # Standard loopback interface address (localhost)
PORT = 65432 # Port to listen on (non-privileged ports are > 1023)
print_lock = threading.Lock()
def timeout():
print('S... | 22.657895 | 73 | 0.601626 |
e9c8330682cb9b43f65141d12547f02f50b9983d | 1,437 | py | Python | examples/braket_sampler_min_vertex.py | aws/amazon-braket-ocean-plugin-python | 41e9b115e2f547498b90ed62a0b0ef4f57dc6b6a | [
"Apache-2.0"
] | 10 | 2020-09-22T08:41:16.000Z | 2022-03-02T23:23:24.000Z | examples/braket_sampler_min_vertex.py | aws/amazon-braket-ocean-plugin-python | 41e9b115e2f547498b90ed62a0b0ef4f57dc6b6a | [
"Apache-2.0"
] | 38 | 2020-08-13T19:14:40.000Z | 2022-02-14T13:54:22.000Z | examples/braket_sampler_min_vertex.py | aws/amazon-braket-ocean-plugin-python | 41e9b115e2f547498b90ed62a0b0ef4f57dc6b6a | [
"Apache-2.0"
] | 5 | 2021-06-30T16:39:25.000Z | 2022-01-16T04:26:55.000Z | # Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompany... | 39.916667 | 97 | 0.783577 |
d559ec7107d9c6854dd5c871e72c9ad487961c3e | 387 | py | Python | basiclive/core/lims/migrations/0054_auto_20200519_1654.py | znarthur/basic-live | 79c194311de05af2e1bb21d1bc8c6c14dda356d0 | [
"BSD-3-Clause"
] | null | null | null | basiclive/core/lims/migrations/0054_auto_20200519_1654.py | znarthur/basic-live | 79c194311de05af2e1bb21d1bc8c6c14dda356d0 | [
"BSD-3-Clause"
] | 1 | 2020-12-03T15:27:09.000Z | 2020-12-03T15:27:09.000Z | basiclive/core/lims/migrations/0054_auto_20200519_1654.py | znarthur/basic-live | 79c194311de05af2e1bb21d1bc8c6c14dda356d0 | [
"BSD-3-Clause"
] | 1 | 2021-09-28T21:06:09.000Z | 2021-09-28T21:06:09.000Z | # Generated by Django 3.0.6 on 2020-05-19 22:54
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('lims', '0053_auto_20200519_1641'),
]
operations = [
migrations.AlterField(
model_name='beamline',
name='active',
... | 20.368421 | 52 | 0.599483 |
8c0a8b2ddba0f170d02aa64ef23a6fd73c37accb | 1,400 | py | Python | flask_management_blueprint/management/health_check.py | stone-payments/flask-management-blueprint | eafec0e1560726705990ac8a37c120006011047c | [
"Apache-2.0"
] | 3 | 2018-03-23T21:55:38.000Z | 2020-03-11T10:22:29.000Z | flask_management_blueprint/management/health_check.py | stone-payments/flask-management-blueprint | eafec0e1560726705990ac8a37c120006011047c | [
"Apache-2.0"
] | 8 | 2018-03-16T17:40:28.000Z | 2021-06-11T17:45:37.000Z | flask_management_blueprint/management/health_check.py | stone-payments/flask-management-blueprint | eafec0e1560726705990ac8a37c120006011047c | [
"Apache-2.0"
] | 4 | 2018-06-06T20:00:34.000Z | 2020-03-10T14:51:08.000Z | """Module to define classes to retrieve app health"""
import asyncio
import async_timeout
import aiohttp
async def fetch(session, url):
"""Method to fetch data from a url asynchronously
"""
async with async_timeout.timeout(30):
async with session.get(url) as response:
return await resp... | 25.454545 | 69 | 0.630714 |
d1de34205cc3ccc33b870a40d722cbba5fbfe0d2 | 705 | wsgi | Python | opm/opm.wsgi | Open-Prose-Metrics/open_prose_metrics_app-core | 9df65edfe9ee9af0a0731c3f2e21ea25bced250c | [
"MIT"
] | null | null | null | opm/opm.wsgi | Open-Prose-Metrics/open_prose_metrics_app-core | 9df65edfe9ee9af0a0731c3f2e21ea25bced250c | [
"MIT"
] | null | null | null | opm/opm.wsgi | Open-Prose-Metrics/open_prose_metrics_app-core | 9df65edfe9ee9af0a0731c3f2e21ea25bced250c | [
"MIT"
] | null | null | null | import sys, os
import logging
logging.basicConfig(stream=sys.stderr)
PROJECT_FOLDER = '/var/www/opm'
PROJECT_HOME = '/var/www/opm/app'
PYTHON_VERSION = 'python3.7'
activate_this = os.path.join(PROJECT_FOLDER, 'virtualenv', 'bin', 'activate_this.py')
exec(compile(open(activate_this, "rb").read(), activate_this, 'exec'),... | 41.470588 | 100 | 0.763121 |
6e7acbb617cd37119c395acea3981ebe4477b7c7 | 7,233 | py | Python | prototypes/python_prototype/multiplicativeFormulation.py | dariothornhill/adaptive-engine | 209e7a552f8675cdd18f6c1352ede68f6fbf9e36 | [
"Apache-2.0"
] | 31 | 2017-12-08T08:03:27.000Z | 2021-09-15T07:37:38.000Z | prototypes/python_prototype/multiplicativeFormulation.py | dariothornhill/adaptive-engine | 209e7a552f8675cdd18f6c1352ede68f6fbf9e36 | [
"Apache-2.0"
] | 12 | 2018-09-27T13:55:15.000Z | 2021-06-10T19:15:17.000Z | prototypes/python_prototype/multiplicativeFormulation.py | Dhiliban24/Adaptive-engine | 48f1077e4af619701e13af2d7a738bdedaec37d2 | [
"Apache-2.0"
] | 19 | 2018-10-26T07:12:20.000Z | 2022-02-10T12:51:27.000Z | ##Author: Ilia Rushkin, VPAL Research, Harvard University, Cambridge, MA, USA
import numpy as np
import pandas as pd
from fakeInitials import initialize_variables
from derivedData import calculate_derived_data
from empiricalEstimation import estimate
class MultiplicativeFormulation(object):
def __init__(self, **... | 36.165 | 190 | 0.56657 |
8235a5261305f298ea38ed3ebd94f7e4aa65a828 | 1,238 | py | Python | apps/leaflet_ts/leaflet_ts/lib/ldap.py | earthobservatory/displacement-ts-server | 185d9fab9af35c863de8a12d09d9f677f03ec6f9 | [
"Apache-2.0"
] | null | null | null | apps/leaflet_ts/leaflet_ts/lib/ldap.py | earthobservatory/displacement-ts-server | 185d9fab9af35c863de8a12d09d9f677f03ec6f9 | [
"Apache-2.0"
] | null | null | null | apps/leaflet_ts/leaflet_ts/lib/ldap.py | earthobservatory/displacement-ts-server | 185d9fab9af35c863de8a12d09d9f677f03ec6f9 | [
"Apache-2.0"
] | null | null | null | import ldap, traceback
from leaflet_ts import app
def ldap_user_verified(username, password):
"""Verify user via ldap."""
host = app.config['LDAP_HOST']
base_dn = app.config['LDAP_BASEDN']
groups = app.config['LDAP_GROUPS']
try:
l = ldap.Connection(
host,
dn='uid... | 29.47619 | 78 | 0.579968 |
5af1783a72898dd08522b140632ca6b71846c429 | 12,200 | py | Python | tests/unit/mdp/test_pressure.py | CubeSkyy/ILU-RL | 676d88587e1d8638487de1b5a3f8785a7375ad1a | [
"MIT"
] | null | null | null | tests/unit/mdp/test_pressure.py | CubeSkyy/ILU-RL | 676d88587e1d8638487de1b5a3f8785a7375ad1a | [
"MIT"
] | null | null | null | tests/unit/mdp/test_pressure.py | CubeSkyy/ILU-RL | 676d88587e1d8638487de1b5a3f8785a7375ad1a | [
"MIT"
] | 2 | 2021-03-13T15:38:05.000Z | 2021-05-08T22:25:36.000Z | import unittest
from ilurl.params import MDPParams
from ilurl.utils.properties import lazy_property
from tests.unit.mdp.test_mdp_base import (TestGridMDPSetUp,
INCOMING_247123161, OUTGOING_247123161,
INCOMING_247123464, OUTGOING_247123464,
... | 30.730479 | 97 | 0.565738 |
3cc7adf7a0a9cd51e1b8cca01b8280fc702d1186 | 257 | py | Python | osnim/0131/10952 A+B - 5.py | Kwak-JunYoung/154Algoritm-5weeks | fa18ae5f68a1ee722a30a05309214247f7fbfda4 | [
"MIT"
] | 3 | 2022-01-24T03:06:32.000Z | 2022-01-30T08:43:58.000Z | osnim/0131/10952 A+B - 5.py | Kwak-JunYoung/154Algoritm-5weeks | fa18ae5f68a1ee722a30a05309214247f7fbfda4 | [
"MIT"
] | null | null | null | osnim/0131/10952 A+B - 5.py | Kwak-JunYoung/154Algoritm-5weeks | fa18ae5f68a1ee722a30a05309214247f7fbfda4 | [
"MIT"
] | 2 | 2022-01-24T02:27:40.000Z | 2022-01-30T08:57:03.000Z | from sys import stdin
while True:
try:
A, B = map(int, stdin.readline().split())
# A, B = map(int, input().split())
if A == 0 and B == 0:
break
print(A + B)
except EOFError or ValueError:
break
| 18.357143 | 49 | 0.490272 |
31a5c3f6fe8b7c4faaa99bb94df84b54edb08a34 | 926 | py | Python | mmdet/models/detectors/__init__.py | hukefei/chongqing_contest | c38ae3e6f25230282c65cdd568de93f28e88c6d6 | [
"Apache-2.0"
] | 1 | 2021-04-12T13:29:54.000Z | 2021-04-12T13:29:54.000Z | mmdet/models/detectors/__init__.py | hukefei/chongqing_contest | c38ae3e6f25230282c65cdd568de93f28e88c6d6 | [
"Apache-2.0"
] | 1 | 2021-04-12T13:31:27.000Z | 2021-04-12T13:33:10.000Z | mmdet/models/detectors/__init__.py | hukefei/chongqing_contest | c38ae3e6f25230282c65cdd568de93f28e88c6d6 | [
"Apache-2.0"
] | 1 | 2021-04-21T10:14:15.000Z | 2021-04-21T10:14:15.000Z | from .base import BaseDetector
from .cascade_rcnn import CascadeRCNN
from .double_head_rcnn import DoubleHeadRCNN
from .fast_rcnn import FastRCNN
from .faster_rcnn import FasterRCNN
from .fcos import FCOS
from .grid_rcnn import GridRCNN
from .htc import HybridTaskCascade
from .mask_rcnn import MaskRCNN
from .mask_scori... | 37.04 | 77 | 0.808855 |
3b3762961e7607f5ead0466238fd30e52a66a36c | 14,996 | py | Python | app/main/views.py | ToonoW/flashy | 565f5348be8f7f7369346be06ed64e2c4f403a1d | [
"MIT"
] | null | null | null | app/main/views.py | ToonoW/flashy | 565f5348be8f7f7369346be06ed64e2c4f403a1d | [
"MIT"
] | null | null | null | app/main/views.py | ToonoW/flashy | 565f5348be8f7f7369346be06ed64e2c4f403a1d | [
"MIT"
] | null | null | null | from flask import render_template, redirect, url_for, abort, flash, request,\
current_app, make_response
from flask.ext.login import login_required, current_user
from flask.ext.sqlalchemy import get_debug_queries
from . import main
from .forms import EditProfileForm, EditProfileAdminForm, PostForm,\
CommentForm... | 36.845209 | 126 | 0.660976 |
7a3e13ff737d1ef7195ae3879573172b0736eddd | 2,896 | py | Python | Player.py | PubuduS/pygame | 7137942ea6f99745295c94a12802b738d41c0f00 | [
"MIT"
] | null | null | null | Player.py | PubuduS/pygame | 7137942ea6f99745295c94a12802b738d41c0f00 | [
"MIT"
] | null | null | null | Player.py | PubuduS/pygame | 7137942ea6f99745295c94a12802b738d41c0f00 | [
"MIT"
] | null | null | null | import pygame
from GameGenerics import *
class Player(GameGenerics):
## Constructor for Player class
# Initialize the class member variables.
def __init__(self):
super(Player, self).__init__()
## holds a spaceship image.
# space_invaders.png Icon made by Freepic from www.flatico... | 36.2 | 92 | 0.635014 |
a718c368754bec8f2fec75a0d06db98382aacf2b | 1,377 | py | Python | Tweeter.py | celif/Daily-Art-Twitter-Bot | 86bee44bed8ae7c958d3639c8b03bfa219392fae | [
"MIT"
] | null | null | null | Tweeter.py | celif/Daily-Art-Twitter-Bot | 86bee44bed8ae7c958d3639c8b03bfa219392fae | [
"MIT"
] | null | null | null | Tweeter.py | celif/Daily-Art-Twitter-Bot | 86bee44bed8ae7c958d3639c8b03bfa219392fae | [
"MIT"
] | null | null | null | #!/usr/bin/python
from ImportedLibs import *
from ArtFinder import *
class Tweeter(object):
def setAuth(self):
APP_KEY = 'Consumer Key'
APP_SECRET = 'Consumer Secret'
OAUTH_TOKEN = 'Access Token'
OAUTH_TOKEN_SECRET = 'Access Token Secret'
twitter = Twython(APP_KEY, APP_S... | 25.5 | 87 | 0.636166 |
d4cd4596ad7f6e0187f91e645753c131d68a9a4a | 845 | py | Python | python/orthogonal_test.py | davxy/numeric | 1e8b44a72e1d570433a5ba81ae0795a750ce5921 | [
"Unlicense"
] | 2 | 2020-05-03T17:02:44.000Z | 2022-02-21T04:09:34.000Z | python/orthogonal_test.py | davxy/numeric | 1e8b44a72e1d570433a5ba81ae0795a750ce5921 | [
"Unlicense"
] | null | null | null | python/orthogonal_test.py | davxy/numeric | 1e8b44a72e1d570433a5ba81ae0795a750ce5921 | [
"Unlicense"
] | null | null | null | # Orthogonal linear system solver tests
from math import sqrt
import numpy as np
from orthogonal import orthogonal
################################################################################
# 2x2 orthogonal matrix
A = np.matrix('1 1;'
'1 -1', float)
A = A*1.0/sqrt(2.0)
# Known terms vector
b = ... | 24.142857 | 80 | 0.498225 |
76bcc4e3ca6f4c2e442b34bdc9eefa2ddf712e68 | 5,313 | py | Python | Python/maximum-sum-of-3-non-overlapping-subarrays.py | RideGreg/LeetCode | b70818b1e6947bf29519a24f78816e022ebab59e | [
"MIT"
] | 1 | 2022-01-30T06:55:28.000Z | 2022-01-30T06:55:28.000Z | Python/maximum-sum-of-3-non-overlapping-subarrays.py | RideGreg/LeetCode | b70818b1e6947bf29519a24f78816e022ebab59e | [
"MIT"
] | null | null | null | Python/maximum-sum-of-3-non-overlapping-subarrays.py | RideGreg/LeetCode | b70818b1e6947bf29519a24f78816e022ebab59e | [
"MIT"
] | 1 | 2021-12-31T03:56:39.000Z | 2021-12-31T03:56:39.000Z | # Time: O(n)
# Space: O(n)
# 689
# In a given array nums of positive integers, find three non-overlapping subarrays with maximum sum.
#
# Each subarray will be of size k, and we want to maximize the sum of all 3*k entries.
#
# Return the result as a list of indices representing the starting position of each interval ... | 37.415493 | 121 | 0.501788 |
ba9739ccb22e5708458c453eeb366de77d0e4b4d | 30,759 | py | Python | humanfriendly/terminal/__init__.py | blaise-io/python-humanfriendly | 1abbe85eb281fca17ae1cb769d0a23acdd2e1bd8 | [
"MIT"
] | 249 | 2015-01-03T09:31:18.000Z | 2022-03-26T13:46:13.000Z | humanfriendly/terminal/__init__.py | blaise-io/python-humanfriendly | 1abbe85eb281fca17ae1cb769d0a23acdd2e1bd8 | [
"MIT"
] | 55 | 2015-06-24T18:48:10.000Z | 2022-03-21T12:14:14.000Z | virtual/lib/python3.6/site-packages/humanfriendly/terminal/__init__.py | Mercy-Njoroge/blog | 404336fb0fc8d172ddde8b744042cb3f37d89c65 | [
"MIT"
] | 47 | 2015-01-03T09:35:28.000Z | 2022-02-28T16:59:58.000Z | # Human friendly input/output in Python.
#
# Author: Peter Odding <peter@peterodding.com>
# Last Change: March 1, 2020
# URL: https://humanfriendly.readthedocs.io
"""
Interaction with interactive text terminals.
The :mod:`~humanfriendly.terminal` module makes it easy to interact with
interactive text terminals and fo... | 39.586873 | 114 | 0.67577 |
4b708817cfd9f33b5fe41cb0eeff1f80a606144a | 2,465 | py | Python | homeassistant/components/camera/blink.py | jamescurtin/home-assistant | 6a9968ccb9b0082f5629e50955549d432aba7d90 | [
"Apache-2.0"
] | 2 | 2020-02-20T18:47:55.000Z | 2021-11-09T11:33:28.000Z | homeassistant/components/camera/blink.py | moose51789/home-assistant | 63c9d59d5455850fd4b37c2475fe6f10effb5245 | [
"Apache-2.0"
] | 5 | 2022-03-01T06:31:03.000Z | 2022-03-31T07:20:45.000Z | homeassistant/components/camera/blink.py | moose51789/home-assistant | 63c9d59d5455850fd4b37c2475fe6f10effb5245 | [
"Apache-2.0"
] | 3 | 2018-08-27T10:08:30.000Z | 2020-07-04T10:07:03.000Z | """
Support for Blink system camera.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/camera.blink/
"""
import logging
from datetime import timedelta
import requests
from homeassistant.components.blink import DOMAIN
from homeassistant.components.camera i... | 30.060976 | 76 | 0.670994 |
056b1d08bcf300254d9bac28126c290ac0810afb | 1,695 | py | Python | ooobuild/lo/io/x_sequence_output_stream.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/lo/io/x_sequence_output_stream.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/lo/io/x_sequence_output_stream.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# 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... | 34.591837 | 143 | 0.729204 |
dd0eb45aa0be9ae144b2103b8c8b611c479fbea7 | 1,344 | py | Python | py/probe_info_service/app_engine/config.py | arccode/factory | a1b0fccd68987d8cd9c89710adc3c04b868347ec | [
"BSD-3-Clause"
] | 3 | 2022-01-06T16:52:52.000Z | 2022-03-07T11:30:47.000Z | py/probe_info_service/app_engine/config.py | arccode/factory | a1b0fccd68987d8cd9c89710adc3c04b868347ec | [
"BSD-3-Clause"
] | null | null | null | py/probe_info_service/app_engine/config.py | arccode/factory | a1b0fccd68987d8cd9c89710adc3c04b868347ec | [
"BSD-3-Clause"
] | 1 | 2021-10-24T01:47:22.000Z | 2021-10-24T01:47:22.000Z | # Copyright 2020 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import enum
import logging
import os
import yaml
from cros.factory.utils import file_utils
# TODO(yhong): Stop disabling unused-import check once the is... | 28.595745 | 74 | 0.74256 |
4b80dce6a68cfcef017fca876c3e7ac62b105172 | 35,162 | py | Python | plotter/full_node/full_node_store.py | Plotter-Network/plotter-blockchain | 13d10557496f37b9a001786ff837bdf34d8f1bcb | [
"Apache-2.0"
] | 1 | 2021-07-10T12:50:30.000Z | 2021-07-10T12:50:30.000Z | plotter/full_node/full_node_store.py | Plotter-Network/plotter-blockchain | 13d10557496f37b9a001786ff837bdf34d8f1bcb | [
"Apache-2.0"
] | null | null | null | plotter/full_node/full_node_store.py | Plotter-Network/plotter-blockchain | 13d10557496f37b9a001786ff837bdf34d8f1bcb | [
"Apache-2.0"
] | null | null | null | import asyncio
import dataclasses
import logging
import time
from typing import Dict, List, Optional, Set, Tuple
from plotter.consensus.block_record import BlockRecord
from plotter.consensus.blockchain_interface import BlockchainInterface
from plotter.consensus.constants import ConsensusConstants
from plotter.consensu... | 45.137356 | 120 | 0.621722 |
64d477127f680ebe36b11aac11dc6e49ca9c4850 | 2,138 | py | Python | {{cookiecutter.project_name}}/{{cookiecutter.app_name}}/config.py | Anyesh/cookiecutter-flask-all-in-one | 6ae0a423e8cab23c23756f1ef610643c85b71f32 | [
"MIT"
] | 35 | 2020-11-27T09:06:44.000Z | 2022-01-31T17:08:41.000Z | {{cookiecutter.project_name}}/{{cookiecutter.app_name}}/config.py | Anyesh/cookiecutter-flask-all-in-one | 6ae0a423e8cab23c23756f1ef610643c85b71f32 | [
"MIT"
] | 1 | 2021-05-15T17:34:47.000Z | 2021-06-04T20:12:59.000Z | {{cookiecutter.project_name}}/{{cookiecutter.app_name}}/config.py | Anyesh/cookiecutter-flask-all-in-one | 6ae0a423e8cab23c23756f1ef610643c85b71f32 | [
"MIT"
] | 2 | 2020-12-03T13:55:11.000Z | 2020-12-08T10:42:03.000Z | """Flask configuration variables."""
import os
from dotenv import load_dotenv
basedir = os.path.abspath(os.path.dirname(__file__))
load_dotenv(os.path.join(basedir, '.env'))
LOGGING_CONFIG = {
'version': 1,
'root': {
'level': 'NOTSET',
'handlers': ['default']
},
'formatters': {
... | 30.542857 | 81 | 0.634705 |
8be756cc3546345697cff459215a76af156082cd | 40,990 | py | Python | tests/test_text.py | rianmcguire/WeasyPrint | 7e400663236d16121e14cf3183ce53828d056092 | [
"BSD-3-Clause"
] | null | null | null | tests/test_text.py | rianmcguire/WeasyPrint | 7e400663236d16121e14cf3183ce53828d056092 | [
"BSD-3-Clause"
] | null | null | null | tests/test_text.py | rianmcguire/WeasyPrint | 7e400663236d16121e14cf3183ce53828d056092 | [
"BSD-3-Clause"
] | null | null | null | """
weasyprint.tests.test_text
--------------------------
Test the text layout.
"""
import pytest
from weasyprint.css.properties import INITIAL_VALUES
from weasyprint.text.line_break import split_first_line
from .testing_utils import MONO_FONTS, SANS_FONTS, assert_no_logs, render_pages
def make_text(t... | 30.959215 | 79 | 0.603293 |
8d0088cba9d02e30d0af3ca974b8990116143841 | 1,404 | py | Python | 19-dyn-attr-prop/oscon/explore2.py | matteoshen/example-code | b54c22a1b8cee3fc53d1473cb38ca46eb179b4c3 | [
"MIT"
] | 5,651 | 2015-01-06T21:58:46.000Z | 2022-03-31T13:39:07.000Z | 19-dyn-attr-prop/oscon/explore2.py | matteoshen/example-code | b54c22a1b8cee3fc53d1473cb38ca46eb179b4c3 | [
"MIT"
] | 42 | 2016-12-11T19:17:11.000Z | 2021-11-23T19:41:16.000Z | 19-dyn-attr-prop/oscon/explore2.py | matteoshen/example-code | b54c22a1b8cee3fc53d1473cb38ca46eb179b4c3 | [
"MIT"
] | 2,394 | 2015-01-18T10:57:38.000Z | 2022-03-31T11:41:12.000Z | """
explore2.py: Script to explore the OSCON schedule feed
>>> from osconfeed import load
>>> raw_feed = load()
>>> feed = FrozenJSON(raw_feed)
>>> len(feed.Schedule.speakers)
357
>>> sorted(feed.Schedule.keys())
['conferences', 'events', 'speakers', 'venues']
>>> feed.Schedule.speakers... | 25.527273 | 59 | 0.570513 |
2951691d7199bc3ac372a38c09522d8d04267b3a | 1,219 | py | Python | notebooks/initilization.py | mssalvador/NextProject | b9e223f8f1de803fd3865c3f2148a417f88556da | [
"Apache-2.0"
] | 1 | 2017-10-10T07:00:46.000Z | 2017-10-10T07:00:46.000Z | notebooks/initilization.py | mssalvador/NextProject | b9e223f8f1de803fd3865c3f2148a417f88556da | [
"Apache-2.0"
] | null | null | null | notebooks/initilization.py | mssalvador/NextProject | b9e223f8f1de803fd3865c3f2148a417f88556da | [
"Apache-2.0"
] | 2 | 2018-11-19T09:07:49.000Z | 2018-11-28T12:54:25.000Z | # Make sure that Python starts in Workflow-folder or else the modules will be screewed up!
import sys
import os
import getpass
import datetime
# Graphics importation and pandas
import seaborn as sb
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
sb.set(style='whitegrid')
# Something about addin... | 29.02381 | 90 | 0.770304 |
1f1b6728e330570d93c0f2f11a65791a018afe8f | 753 | py | Python | POO/arquivos-livro/07/Python3/DeputadoFederal.py | ell3a/estudos-python | 09808a462aa3e73ad433501acb11f62217548af8 | [
"MIT"
] | null | null | null | POO/arquivos-livro/07/Python3/DeputadoFederal.py | ell3a/estudos-python | 09808a462aa3e73ad433501acb11f62217548af8 | [
"MIT"
] | null | null | null | POO/arquivos-livro/07/Python3/DeputadoFederal.py | ell3a/estudos-python | 09808a462aa3e73ad433501acb11f62217548af8 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# coding: utf-8
"""Classe DeputadoFederal """
from Politico import Politico
class DeputadoFederal(Politico):
""" Classe Deputado Federal """
def __init__(self, nome, partido, estado):
""" Construtor da classe DeputadoFederal """
Politico.__init__(self)
self.set_nome... | 31.375 | 84 | 0.622842 |
e92468edf79bdfe38cfd10b452629a87fff851cc | 97,778 | py | Python | synchrophasor/frame.py | aleneus/pypmu | 66e6c495a91efb8a6018061ff7955a6654b1404d | [
"BSD-3-Clause"
] | 50 | 2016-03-30T18:48:34.000Z | 2022-03-11T01:41:37.000Z | synchrophasor/frame.py | aleneus/pypmu | 66e6c495a91efb8a6018061ff7955a6654b1404d | [
"BSD-3-Clause"
] | 32 | 2017-10-20T06:52:38.000Z | 2022-03-18T14:13:03.000Z | synchrophasor/frame.py | aleneus/pypmu | 66e6c495a91efb8a6018061ff7955a6654b1404d | [
"BSD-3-Clause"
] | 36 | 2016-05-17T19:43:14.000Z | 2022-03-17T18:37:22.000Z | """
# IEEE Std C37.118.2 - 2011 Frame Implementation #
This script provides implementation of IEEE Standard for Synchrophasor
Data Transfer for Power Systems.
**IEEE C37.118.2 standard** defines four types of frames:
* Data Frames.
* Configuration Frames (multiple versions).
* Command Frames.
* Header Frames.
"""
... | 36.662167 | 121 | 0.559983 |
a93aa38f88e7f4a3756cf0005fa3dc39e99d3f5d | 7,275 | py | Python | argo/workflows/client/models/v1alpha1_cluster_workflow_template.py | argentumcode/argo-client-python | 31c1519056379d3f046d4b522f37af87243fdbb4 | [
"Apache-2.0"
] | null | null | null | argo/workflows/client/models/v1alpha1_cluster_workflow_template.py | argentumcode/argo-client-python | 31c1519056379d3f046d4b522f37af87243fdbb4 | [
"Apache-2.0"
] | null | null | null | argo/workflows/client/models/v1alpha1_cluster_workflow_template.py | argentumcode/argo-client-python | 31c1519056379d3f046d4b522f37af87243fdbb4 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Argo Server API
You can get examples of requests and responses by using the CLI with `--gloglevel=9`, e.g. `argo list --gloglevel=9` # noqa: E501
The version of the OpenAPI document: v3.0.4
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
... | 35.487805 | 312 | 0.642062 |
2ce133e947758702b600cbe91ea61fce4f9aa2d4 | 2,169 | py | Python | tools/MetaMaptoStandoff.py | bepnye/brat | 28acfb2d3cce20bd4d4ff1a67690e271675841f2 | [
"CC-BY-3.0"
] | 20 | 2015-01-26T01:39:44.000Z | 2020-05-30T19:04:14.000Z | tools/MetaMaptoStandoff.py | bepnye/brat | 28acfb2d3cce20bd4d4ff1a67690e271675841f2 | [
"CC-BY-3.0"
] | 7 | 2015-04-11T12:57:42.000Z | 2016-04-08T13:43:44.000Z | tools/MetaMaptoStandoff.py | bepnye/brat | 28acfb2d3cce20bd4d4ff1a67690e271675841f2 | [
"CC-BY-3.0"
] | 13 | 2015-01-26T01:39:45.000Z | 2022-03-09T16:45:09.000Z | #!/usr/bin/env python
# Script to convert MetaMap "fielded" ("-N" argument) output into
# standoff with reference to the original text.
import sys
import re
import os
import codecs
# Regex for the "signature" of a metamap "fielded" output line
FIELDED_OUTPUT_RE = re.compile(r'^\d+\|')
class taggedEntity:
def __... | 30.125 | 89 | 0.60627 |
0c947e60037da287445dd61858383e88f6442963 | 20,370 | py | Python | create_db.py | deontologician/d-d-scripts | 08c673b56bede01d4a106a9512469218976bc18f | [
"MIT"
] | 1 | 2016-05-09T04:26:29.000Z | 2016-05-09T04:26:29.000Z | create_db.py | deontologician/d-d-scripts | 08c673b56bede01d4a106a9512469218976bc18f | [
"MIT"
] | null | null | null | create_db.py | deontologician/d-d-scripts | 08c673b56bede01d4a106a9512469218976bc18f | [
"MIT"
] | null | null | null | from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
import models as M
import logging
logging.getLogger('sqlalchemy.engine').setLevel(logging.INFO)
logging.basicConfig()
def setup_db(db_filename):
'''Creates and populates the sqlite database. Nothing will be done if it
exists and th... | 31.630435 | 79 | 0.469219 |
d579269c7047fc1b611c2042aeae36de75946013 | 12,034 | py | Python | back/datasetgenerator.py | camilodoa/ai-melts-ice | 80f06d7e4030fdcae25325ab6f291ea723edae56 | [
"MIT"
] | 2 | 2020-06-01T18:27:58.000Z | 2020-06-02T04:35:32.000Z | back/datasetgenerator.py | camilodoa/ai-melts-ice | 80f06d7e4030fdcae25325ab6f291ea723edae56 | [
"MIT"
] | 25 | 2020-03-24T18:25:39.000Z | 2022-01-19T16:54:20.000Z | back/datasetgenerator.py | camilodoa/ai-melts-ice | 80f06d7e4030fdcae25325ab6f291ea723edae56 | [
"MIT"
] | null | null | null | from geopy.geocoders import Nominatim
import pandas as pd
import numpy as np
import pickle
import time
import requests
import urllib.request as urllib
class Syracuse():
'''
Object used to query Syracuse deportation database
Website: https://trac.syr.edu/phptools/immigration/arrest/
'''
def __init_... | 35.922388 | 157 | 0.533572 |
21de040d794a4c015a327ae6ef79ba25fe13e094 | 7,007 | py | Python | openstack_dashboard/contrib/sahara/content/data_processing/clusters/tabs.py | timpricecatalyst/horizon | 8279ae0ed464e62e1c91e78341342160f8a07172 | [
"Apache-2.0"
] | 1 | 2021-01-20T00:14:15.000Z | 2021-01-20T00:14:15.000Z | openstack_dashboard/contrib/sahara/content/data_processing/clusters/tabs.py | timpricecatalyst/horizon | 8279ae0ed464e62e1c91e78341342160f8a07172 | [
"Apache-2.0"
] | 1 | 2019-10-27T15:57:25.000Z | 2019-10-27T15:57:25.000Z | openstack_dashboard/contrib/sahara/content/data_processing/clusters/tabs.py | timpricecatalyst/horizon | 8279ae0ed464e62e1c91e78341342160f8a07172 | [
"Apache-2.0"
] | 15 | 2017-01-12T10:40:00.000Z | 2019-04-19T08:28:05.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 under the... | 35.75 | 78 | 0.601256 |
63f567723eeb891b38109f2cd18a56390bc1815a | 516 | py | Python | python/151. Reverse Words in a String.py | DragonYong/Happy-Algorithm | 7ca585d5990f5c4587ab4e22178ecb88e5d57d91 | [
"Apache-2.0"
] | null | null | null | python/151. Reverse Words in a String.py | DragonYong/Happy-Algorithm | 7ca585d5990f5c4587ab4e22178ecb88e5d57d91 | [
"Apache-2.0"
] | 1 | 2020-08-31T09:32:56.000Z | 2020-08-31T09:32:56.000Z | python/151. Reverse Words in a String.py | DragonYong/Happy-Algorithm | 7ca585d5990f5c4587ab4e22178ecb88e5d57d91 | [
"Apache-2.0"
] | null | null | null | class Solution:
def reverseWords(self, s: str) -> str:
if not s or s = "":
return None
s = s.strip()
temp = s.split(" ")
for i in temp:
print("${}$".format(i))
stack = [i for i in temp if i != ""]
return " ".join(stack[::-1])
if __name__ ==... | 23.454545 | 62 | 0.52907 |
873ad9d7ac2070f9a11b0486adca37d29ee8b0fb | 884 | py | Python | setup.py | skrushinsky/openspy | e6c3aed4e77a4c7d068b900e6a9e3b0c57318471 | [
"MIT"
] | 2 | 2021-07-03T18:15:22.000Z | 2021-07-03T20:25:19.000Z | setup.py | skrushinsky/openspy | e6c3aed4e77a4c7d068b900e6a9e3b0c57318471 | [
"MIT"
] | null | null | null | setup.py | skrushinsky/openspy | e6c3aed4e77a4c7d068b900e6a9e3b0c57318471 | [
"MIT"
] | 1 | 2018-02-16T11:44:38.000Z | 2018-02-16T11:44:38.000Z | from setuptools import setup, find_packages
import sys, os
version = '0.1'
setup(name='openspy',
version=version,
description="Search planes in given range",
long_description="""\
Query [OpenSky](https://opensky-network.org/apidoc/index.html) service
and outputs crafts in a given range (450km from P... | 28.516129 | 95 | 0.623303 |
33f42490db6411c1eedd6b9e99cfa48741e51322 | 1,536 | py | Python | common/sendRequests.py | sinnosong/ApiAutoTest | a8f98507e996f9ae2e88cb275527cab44aa3a7d4 | [
"MIT"
] | 5 | 2020-08-04T04:31:30.000Z | 2021-07-14T01:31:39.000Z | common/sendRequests.py | sinnosong/ApiAutoTest | a8f98507e996f9ae2e88cb275527cab44aa3a7d4 | [
"MIT"
] | null | null | null | common/sendRequests.py | sinnosong/ApiAutoTest | a8f98507e996f9ae2e88cb275527cab44aa3a7d4 | [
"MIT"
] | 1 | 2020-08-04T07:01:11.000Z | 2020-08-04T07:01:11.000Z | import os,sys,json
import configparser
from config import setting
sys.path.append(os.path.dirname(os.path.dirname(__file__)))
class SendRequests():
"""发送请求数据"""
def sendRequests(self,session,apiData):
# 读取config中的测试host,port
con = configparser.ConfigParser()
con.read(settin... | 35.72093 | 99 | 0.458984 |
39e7e8d5d1e601dbd65a4b1c8d775171e3d137ce | 2,268 | py | Python | 03-opencv-lab/example08_classify_shapes.py | iproduct/course-robotics-npmg | 0feb2ded46007ba87b8128f1f2e039036ef274bd | [
"Apache-2.0"
] | null | null | null | 03-opencv-lab/example08_classify_shapes.py | iproduct/course-robotics-npmg | 0feb2ded46007ba87b8128f1f2e039036ef274bd | [
"Apache-2.0"
] | null | null | null | 03-opencv-lab/example08_classify_shapes.py | iproduct/course-robotics-npmg | 0feb2ded46007ba87b8128f1f2e039036ef274bd | [
"Apache-2.0"
] | 1 | 2021-03-17T09:08:02.000Z | 2021-03-17T09:08:02.000Z | import cv2
import numpy as np
import example06_imgstacking as stacking
def empty(arg):
pass
def classify_figure(contour, w, h):
num_vertices = len(contour)
ratio = w / float(h)
if num_vertices < 3:
return "unrecognized"
elif num_vertices == 3:
return "Triangle"
elif num_vertice... | 34.892308 | 114 | 0.582011 |
f5087825ee567645c2d88251ea0f39e6007de37c | 32,486 | py | Python | pycln/utils/scan.py | vantage-ola/pycln | 492fd68898827b5bbee0d971e2eab5249bfae272 | [
"MIT"
] | 1 | 2021-07-08T04:57:03.000Z | 2021-07-08T04:57:03.000Z | pycln/utils/scan.py | vantage-ola/pycln | 492fd68898827b5bbee0d971e2eab5249bfae272 | [
"MIT"
] | null | null | null | pycln/utils/scan.py | vantage-ola/pycln | 492fd68898827b5bbee0d971e2eab5249bfae272 | [
"MIT"
] | null | null | null | """Pycln source code AST analysis utility."""
import ast
import os
import sys
from dataclasses import dataclass
from enum import Enum, unique
from functools import wraps
from pathlib import Path
from typing import Any, Callable, List, Optional, Set, Tuple, TypeVar, Union, cast
from . import _nodes, iou, pathu
from ._e... | 36.015521 | 88 | 0.566367 |
2aa9fbba0ad35824355e4404c8911cac5257b303 | 39,970 | py | Python | catboost/python-package/ut/medium/canondata/test.test_export_to_python_with_cat_features_CPU-40_/model.py | karina-usmanova/catboost | 7eff3b7e2e9e8793ab27ea21b2d39a9238f1ba02 | [
"Apache-2.0"
] | 1 | 2019-07-08T09:14:39.000Z | 2019-07-08T09:14:39.000Z | catboost/python-package/ut/medium/canondata/test.test_export_to_python_with_cat_features_CPU-40_/model.py | karina-usmanova/catboost | 7eff3b7e2e9e8793ab27ea21b2d39a9238f1ba02 | [
"Apache-2.0"
] | null | null | null | catboost/python-package/ut/medium/canondata/test.test_export_to_python_with_cat_features_CPU-40_/model.py | karina-usmanova/catboost | 7eff3b7e2e9e8793ab27ea21b2d39a9238f1ba02 | [
"Apache-2.0"
] | null | null | null | ### Types to hold CTR's data
class catboost_model_ctr(object):
def __init__(self, base_hash, base_ctr_type, target_border_idx, prior_num, prior_denom, shift, scale):
self.base_hash = base_hash
self.base_ctr_type = base_ctr_type
self.target_border_idx = target_border_idx
self.prior_n... | 70.743363 | 868 | 0.649687 |
8f6ba7dfcd7821d2b2e41fa9923925ad77d9d4b3 | 25,624 | py | Python | matdeeplearn/process/process.py | usccolumbia/deeperGATGNN | 24ee53b23d1559040b7aab971768434753b582ff | [
"MIT"
] | 19 | 2021-09-29T20:32:50.000Z | 2022-02-22T11:32:18.000Z | matdeeplearn/process/process.py | usccolumbia/deeperGATGNN | 24ee53b23d1559040b7aab971768434753b582ff | [
"MIT"
] | 1 | 2021-11-23T07:37:50.000Z | 2021-11-23T07:37:50.000Z | matdeeplearn/process/process.py | usccolumbia/deeperGATGNN | 24ee53b23d1559040b7aab971768434753b582ff | [
"MIT"
] | 2 | 2021-09-30T10:18:37.000Z | 2022-01-30T01:08:05.000Z | import os
import sys
import time
import csv
import json
import warnings
import numpy as np
import ase
import glob
from ase import io
from scipy.stats import rankdata
from scipy import interpolate
##torch imports
import torch
import torch.nn.functional as F
from torch_geometric.data import DataLoader, Dataset, Data, In... | 35.539528 | 94 | 0.586169 |
3163143cc4b5bc0a36011b5a3944f83ff4870417 | 10,496 | py | Python | dpmModule/jobs/windbreaker.py | OniOniOn-/maplestory_dpm_calc | fbe824f01ab8e8210b174dd9db8295da80c267cd | [
"MIT"
] | 1 | 2020-09-24T06:20:00.000Z | 2020-09-24T06:20:00.000Z | dpmModule/jobs/windbreaker.py | OniOniOn-/maplestory_dpm_calc | fbe824f01ab8e8210b174dd9db8295da80c267cd | [
"MIT"
] | null | null | null | dpmModule/jobs/windbreaker.py | OniOniOn-/maplestory_dpm_calc | fbe824f01ab8e8210b174dd9db8295da80c267cd | [
"MIT"
] | 2 | 2020-09-24T06:20:02.000Z | 2021-08-01T01:34:15.000Z | from ..kernel import core
from ..character import characterKernel as ck
from ..status.ability import Ability_tool
from ..execution.rules import RuleSet, ConcurrentRunRule, ComplexConditionRule
from . import globalSkill
from .jobbranch import bowmen
from .jobclass import cygnus
from math import ceil
from typing import A... | 32.395062 | 87 | 0.517245 |
611ccb0d1a3724ce9f9ff7bedbe377df297bbd37 | 7,063 | py | Python | jd_china-joy_card.py | honglt1/jdd | 9fd49a6b09af8e243367067d7c7cd2ae6d418466 | [
"MIT"
] | 1 | 2022-02-09T16:25:04.000Z | 2022-02-09T16:25:04.000Z | jd_china-joy_card.py | honglt1/jdd | 9fd49a6b09af8e243367067d7c7cd2ae6d418466 | [
"MIT"
] | null | null | null | jd_china-joy_card.py | honglt1/jdd | 9fd49a6b09af8e243367067d7c7cd2ae6d418466 | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
"""
cron: 10 10 * * *
new Env('萌虎摇摇乐卡片信息');
"""
import requests
import json
import time
import os
import re
import sys
import random
import string
import urllib
#以下部分参考Curtin的脚本:https://github.com/curtinlv/JD-Script
def randomuserAgent():
global uuid,addressid,iosVer,iosV,clientVersion,i... | 45.275641 | 285 | 0.561943 |
ab2b81789f63e420787c7b05a3737a3532e0b0fa | 4,768 | py | Python | docs/conf.py | lei-liu1/OCTIS | 1e8e6be5040b38cf3c458ece4327886dee8568ef | [
"MIT"
] | 340 | 2021-02-23T14:44:52.000Z | 2022-03-28T03:38:55.000Z | docs/conf.py | mpalenciaolivar/OCTIS | 1e8e6be5040b38cf3c458ece4327886dee8568ef | [
"MIT"
] | 50 | 2021-04-19T17:23:10.000Z | 2022-03-16T10:01:49.000Z | docs/conf.py | mpalenciaolivar/OCTIS | 1e8e6be5040b38cf3c458ece4327886dee8568ef | [
"MIT"
] | 30 | 2021-04-19T15:42:53.000Z | 2022-03-21T12:08:47.000Z | #!/usr/bin/env python
#
# octis documentation build configuration file, created by
# sphinx-quickstart on Fri Jun 9 13:47:02 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All c... | 29.251534 | 77 | 0.683305 |
3839c68febbeafc10edec062bbc095de6eb23da7 | 123 | py | Python | apps/User/tests/__init__.py | Eduardo-RFarias/DjangoReactBackend | b8183ea4b24be5c0aa557ffbc79fc23e0777b8ad | [
"MIT"
] | null | null | null | apps/User/tests/__init__.py | Eduardo-RFarias/DjangoReactBackend | b8183ea4b24be5c0aa557ffbc79fc23e0777b8ad | [
"MIT"
] | null | null | null | apps/User/tests/__init__.py | Eduardo-RFarias/DjangoReactBackend | b8183ea4b24be5c0aa557ffbc79fc23e0777b8ad | [
"MIT"
] | null | null | null | from .BaseAuthenticatedTest import BaseAuthenticatedTest
from .UserTests import UserTests
from .AuthTests import AuthTests
| 30.75 | 56 | 0.878049 |
0fc60b6e16f9bc6695c3a6e21d55ad7897a5a5c7 | 5,551 | py | Python | tkkuih.py | mypapit/tkkuih | c9f2cab5b5aa2386523e415eca8ef4163a12f8b2 | [
"BSD-2-Clause"
] | 1 | 2020-06-04T07:47:58.000Z | 2020-06-04T07:47:58.000Z | tkkuih.py | mypapit/tkkuih | c9f2cab5b5aa2386523e415eca8ef4163a12f8b2 | [
"BSD-2-Clause"
] | null | null | null | tkkuih.py | mypapit/tkkuih | c9f2cab5b5aa2386523e415eca8ef4163a12f8b2 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon Mar 30 10:42:50 2020
Copyright (c) 2020, Mohammad Hafiz bin Ismail.
@author: Mohammad Hafiz bin Ismail (mypapit@gmail.com)
@Purpose: Desktop GUI demonstration for tensorflow
Trained using Tensorflow 1.14 with MobileNet 192
##See function "addOpenFile()" and "detectGate" ... | 25.231818 | 157 | 0.690686 |
612b450e47b7e347e161eabd61491b6fb718b35e | 69 | py | Python | aws_rds_policies/aws_rds_instance_auto_minor_version_upgrade_enabled.py | designing-penguin/panther-analysis | 26034cea4504f43227f8d3789225f6ca7b35dfe0 | [
"Apache-2.0"
] | null | null | null | aws_rds_policies/aws_rds_instance_auto_minor_version_upgrade_enabled.py | designing-penguin/panther-analysis | 26034cea4504f43227f8d3789225f6ca7b35dfe0 | [
"Apache-2.0"
] | null | null | null | aws_rds_policies/aws_rds_instance_auto_minor_version_upgrade_enabled.py | designing-penguin/panther-analysis | 26034cea4504f43227f8d3789225f6ca7b35dfe0 | [
"Apache-2.0"
] | null | null | null | def policy(resource):
return resource['AutoMinorVersionUpgrade']
| 23 | 46 | 0.782609 |
feff04908747f2444dfa1a96a122fd667824b163 | 1,007 | py | Python | src/utils/all_utils.py | CodinjaoftheWorld/DVC_DL_Tensorflow | a01522b69c03f4b2d9f3c8ccc3a1098bfaabfd5c | [
"Apache-2.0"
] | null | null | null | src/utils/all_utils.py | CodinjaoftheWorld/DVC_DL_Tensorflow | a01522b69c03f4b2d9f3c8ccc3a1098bfaabfd5c | [
"Apache-2.0"
] | null | null | null | src/utils/all_utils.py | CodinjaoftheWorld/DVC_DL_Tensorflow | a01522b69c03f4b2d9f3c8ccc3a1098bfaabfd5c | [
"Apache-2.0"
] | null | null | null | import yaml
import os
import csv
import json
import logging
import time
def read_yaml(path_to_yaml: str) -> dict:
with open(path_to_yaml) as yaml_file:
content = yaml.safe_load(yaml_file)
logging.info(f"yaml file: {path_to_yaml} loaded successfully.")
return content
def create_directory(dirs: list... | 29.617647 | 83 | 0.685204 |
55f195990a1d1ee0551bc31bcf31f41ef69b03b5 | 2,477 | py | Python | src/dataProcessing/extractRelationalSkipgrams.py | yuzhimanhua/PENNER | 9421b230b4ce7018c32a0c085e3beb886c348bba | [
"Apache-2.0"
] | 11 | 2019-04-24T02:17:36.000Z | 2022-01-11T09:23:02.000Z | src/dataProcessing/extractRelationalSkipgrams.py | yuzhimanhua/PENNER | 9421b230b4ce7018c32a0c085e3beb886c348bba | [
"Apache-2.0"
] | null | null | null | src/dataProcessing/extractRelationalSkipgrams.py | yuzhimanhua/PENNER | 9421b230b4ce7018c32a0c085e3beb886c348bba | [
"Apache-2.0"
] | 3 | 2020-07-18T14:29:52.000Z | 2022-02-09T02:19:28.000Z | import sys
import json
from collections import defaultdict
def getRelationalSkipgrams(tokens, start1, end1, start2, end2, window=5):
# with assumption, there is no overlap between entity mentions
# if the number of tokens between two entity mentions is less than the window size
# we extract the relational skipgram ... | 39.951613 | 176 | 0.69237 |
ebcc69747c5d1fba784195fdf55e14394d192968 | 10,175 | py | Python | Demo/pdist/cvslib.py | cemeyer/tauthon | 2c3328c5272cffa2a544542217181c5828afa7ed | [
"PSF-2.0"
] | 2,293 | 2015-01-02T12:46:10.000Z | 2022-03-29T09:45:43.000Z | python/src/Demo/pdist/cvslib.py | weiqiangzheng/sl4a | d3c17dca978cbeee545e12ea240a9dbf2a6999e9 | [
"Apache-2.0"
] | 315 | 2015-05-31T11:55:46.000Z | 2022-01-12T08:36:37.000Z | python/src/Demo/pdist/cvslib.py | weiqiangzheng/sl4a | d3c17dca978cbeee545e12ea240a9dbf2a6999e9 | [
"Apache-2.0"
] | 1,033 | 2015-01-04T07:48:40.000Z | 2022-03-24T09:34:37.000Z | """Utilities for CVS administration."""
import string
import os
import time
import md5
import fnmatch
if not hasattr(time, 'timezone'):
time.timezone = 0
class File:
"""Represent a file's status.
Instance variables:
file -- the filename (no slashes), None if uninitialized
lseen -- true if the ... | 27.876712 | 74 | 0.542506 |
e0230f9c40697623fbe2858d97b4e39a783a0210 | 3,106 | py | Python | main/forms.py | adityatelange/django-ebook-audiobook-website | c07647df78b1807d585b3f14678e7726ba89f5c7 | [
"MIT"
] | 2 | 2019-09-10T09:42:23.000Z | 2019-11-28T08:56:09.000Z | main/forms.py | adityatelange/django-ebook-audiobook-website | c07647df78b1807d585b3f14678e7726ba89f5c7 | [
"MIT"
] | null | null | null | main/forms.py | adityatelange/django-ebook-audiobook-website | c07647df78b1807d585b3f14678e7726ba89f5c7 | [
"MIT"
] | null | null | null | import logging
from django import forms
from django.contrib.auth import authenticate
from django.contrib.auth.forms import (UserCreationForm as DjangoUserCreationForm)
from django.contrib.auth.forms import UsernameField
from django.core.mail import send_mail
from django.forms import inlineformset_factory
from . impor... | 34.511111 | 103 | 0.658081 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.