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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
069f2df5fd11d359a16791fa25f850a8150ff903 | 1,394 | py | Python | src/manage.py | MelvinYin/Defined_Proteins | 75da20be82a47d85d27176db29580ab87d52b670 | [
"BSD-3-Clause"
] | 2 | 2021-01-05T02:55:57.000Z | 2021-04-16T15:49:08.000Z | src/manage.py | MelvinYin/Defined_Proteins | 75da20be82a47d85d27176db29580ab87d52b670 | [
"BSD-3-Clause"
] | null | null | null | src/manage.py | MelvinYin/Defined_Proteins | 75da20be82a47d85d27176db29580ab87d52b670 | [
"BSD-3-Clause"
] | 1 | 2021-01-05T08:12:38.000Z | 2021-01-05T08:12:38.000Z | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
from config import paths
def main(*args, **kwargs):
paths.initialise(os.path.join(os.path.dirname(os.path.realpath(__file__)), "__main__"))
assert os.path.isfile(paths.SEARCH_EXEC), paths.SEARCH_EXEC
# ... | 35.74359 | 91 | 0.683644 |
6ad093ece279fae4e396df89e6b940c68ddf0642 | 14,249 | py | Python | tensorflow_probability/python/sts/dynamic_regression.py | SiegeLordEx/probability | 1a12ee773199bec0ad6d49333e268f98e4b731be | [
"Apache-2.0"
] | 1 | 2021-08-23T17:17:52.000Z | 2021-08-23T17:17:52.000Z | tensorflow_probability/python/sts/dynamic_regression.py | SiegeLordEx/probability | 1a12ee773199bec0ad6d49333e268f98e4b731be | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/sts/dynamic_regression.py | SiegeLordEx/probability | 1a12ee773199bec0ad6d49333e268f98e4b731be | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The TensorFlow Probability Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 40.945402 | 89 | 0.701312 |
7ad747de729f09460990896765f7421acaed8f22 | 23,813 | py | Python | abs_templates_ec/laygo/tech.py | aalto-ele/BAG2_TEMPLATES_EC | f04c4367234eb2261397b58fac11a79bdf5bee04 | [
"BSD-3-Clause"
] | null | null | null | abs_templates_ec/laygo/tech.py | aalto-ele/BAG2_TEMPLATES_EC | f04c4367234eb2261397b58fac11a79bdf5bee04 | [
"BSD-3-Clause"
] | 1 | 2021-03-11T12:07:32.000Z | 2021-03-15T07:42:03.000Z | abs_templates_ec/laygo/tech.py | aalto-ele/BAG2_TEMPLATES_EC | f04c4367234eb2261397b58fac11a79bdf5bee04 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""This module defines abstract analog mosfet template classes.
"""
from typing import Dict, Any, Tuple, List, TYPE_CHECKING
from bag.layout.util import BBox
from bag.layout.template import TemplateBase
from bag.layout.routing import WireArray
import abc
from ..analog_mos.core import MOSTec... | 38.284566 | 113 | 0.56003 |
63cc1f2b8c5a1407ab0f09d67528271867f53190 | 1,915 | py | Python | utils/process_log.py | AnastaciaVolkova/SFND_2D_Feature_Tracking | 9e7c343eeb78950c69e8067c9e6d37843805c8b5 | [
"MIT"
] | null | null | null | utils/process_log.py | AnastaciaVolkova/SFND_2D_Feature_Tracking | 9e7c343eeb78950c69e8067c9e6d37843805c8b5 | [
"MIT"
] | null | null | null | utils/process_log.py | AnastaciaVolkova/SFND_2D_Feature_Tracking | 9e7c343eeb78950c69e8067c9e6d37843805c8b5 | [
"MIT"
] | null | null | null | import pickle
import pandas as pd
import numpy as np
def key_points_info(data):
data_x = dict()
detectors = list()
for record in data:
if record[1] is not None:
det, des = record[0].split("_")
if det not in detectors:
for metric, column in record[1]["detecto... | 29.921875 | 87 | 0.601044 |
eaad4856eb0883dea9d5d2a29769337d6b9c9f12 | 7,325 | py | Python | tests/integration/suite/test_node.py | fizzyduck/rancher | d8099d85f22a6e46fd93f8fc406df8cf91ccb12f | [
"Apache-2.0"
] | 1 | 2019-10-10T06:50:35.000Z | 2019-10-10T06:50:35.000Z | tests/integration/suite/test_node.py | fizzyduck/rancher | d8099d85f22a6e46fd93f8fc406df8cf91ccb12f | [
"Apache-2.0"
] | null | null | null | tests/integration/suite/test_node.py | fizzyduck/rancher | d8099d85f22a6e46fd93f8fc406df8cf91ccb12f | [
"Apache-2.0"
] | null | null | null | import base64
import hashlib
import os
import tempfile
import pytest
from rancher import ApiError
from .common import auth_check
from .conftest import wait_for
import time
def test_node_fields(admin_mc):
cclient = admin_mc.client
fields = {
'annotations': 'cru',
'labels': 'cru',
'nodeT... | 30.648536 | 81 | 0.640137 |
8da703c93ef18d2c6d5f0c19883a87eb208d0a24 | 15,920 | py | Python | vee/database.py | immersionroom/vee | 2c6f781dc96e9028f2446777b906ca37dc2f4299 | [
"BSD-3-Clause"
] | 6 | 2017-11-05T02:44:10.000Z | 2021-07-14T19:10:56.000Z | vee/database.py | immersionroom/vee | 2c6f781dc96e9028f2446777b906ca37dc2f4299 | [
"BSD-3-Clause"
] | null | null | null | vee/database.py | immersionroom/vee | 2c6f781dc96e9028f2446777b906ca37dc2f4299 | [
"BSD-3-Clause"
] | 1 | 2017-01-31T23:10:09.000Z | 2017-01-31T23:10:09.000Z | import datetime
import os
import sqlite3
import shutil
import re
import six
from vee.utils import makedirs
from vee import log
_migrations = []
@_migrations.append
def _create_initial_tables(con):
con.execute('''CREATE TABLE repositories (
id INTEGER PRIMARY KEY,
created_at TIMESTAMP NOT NUL... | 28.377897 | 125 | 0.58191 |
404bad75969548a67643665b744d9c3a386e3a2f | 1,451 | py | Python | analysis/mixed/plot_cloud_all_storm.py | coryschwartz/nebula-crawler | 34ebe1109a5117949b4f285891a065adcc0bae08 | [
"Apache-2.0"
] | 66 | 2021-07-05T21:55:27.000Z | 2022-03-20T20:44:38.000Z | analysis/mixed/plot_cloud_all_storm.py | coryschwartz/nebula-crawler | 34ebe1109a5117949b4f285891a065adcc0bae08 | [
"Apache-2.0"
] | 8 | 2021-07-18T09:00:12.000Z | 2022-03-15T17:44:11.000Z | analysis/mixed/plot_cloud_all_storm.py | coryschwartz/nebula-crawler | 34ebe1109a5117949b4f285891a065adcc0bae08 | [
"Apache-2.0"
] | 6 | 2021-07-11T12:25:05.000Z | 2022-01-04T21:14:50.000Z | import psycopg2
import toml
import matplotlib.pyplot as plt
from lib import node_time, node_classification, node_agent, node_cloud
# Helper function to trim agent version
def trim_agent(agent):
if agent.startswith("/"):
version = agent[1:]
if agent.startswith("go-ipfs"):
return "go-ipfs"
e... | 25.45614 | 110 | 0.660924 |
e369556799923a5bb8759c482c0e7c915b90e690 | 4,757 | py | Python | ACME/model/model.py | mauriziokovacic/ACME | 2615b66dd4addfd5c03d9d91a24c7da414294308 | [
"MIT"
] | 3 | 2019-10-23T23:10:55.000Z | 2021-09-01T07:30:14.000Z | ACME/model/model.py | mauriziokovacic/ACME-Python | 2615b66dd4addfd5c03d9d91a24c7da414294308 | [
"MIT"
] | null | null | null | ACME/model/model.py | mauriziokovacic/ACME-Python | 2615b66dd4addfd5c03d9d91a24c7da414294308 | [
"MIT"
] | 1 | 2020-07-11T11:35:43.000Z | 2020-07-11T11:35:43.000Z | import warnings
import torch
from ..fileio.fileparts import *
from .freeze import *
from .unfreeze import *
class Model(torch.nn.Module):
"""
A class representing a generic model architecture
Attributes
----------
name : str
the name of the model
device : str or to... | 25.713514 | 116 | 0.559596 |
9f395608eaed2d63e107c7cb5f81fa82744ffd89 | 32,733 | py | Python | DetVisGUI_test.py | carranza96/DetVisGUI | 84554abf938e2b22380f2cbb14afe11a76b4b1af | [
"MIT"
] | 127 | 2020-05-20T06:14:13.000Z | 2022-03-31T08:13:06.000Z | DetVisGUI_test.py | carranza96/DetVisGUI | 84554abf938e2b22380f2cbb14afe11a76b4b1af | [
"MIT"
] | 12 | 2020-10-12T17:36:51.000Z | 2022-03-31T07:50:23.000Z | DetVisGUI_test.py | carranza96/DetVisGUI | 84554abf938e2b22380f2cbb14afe11a76b4b1af | [
"MIT"
] | 18 | 2020-07-29T08:23:12.000Z | 2022-02-26T02:40:11.000Z | # __author__ = 'ChienHung Chen in Academia Sinica IIS'
import argparse
import itertools
import json
import os
import pickle
import xml.etree.ElementTree as ET
from tkinter import (END, Button, Checkbutton, E, Entry, IntVar, Label,
Listbox, Menu, N, S, Scrollbar, StringVar, Tk, W, ttk)
import cv2
... | 35.852136 | 84 | 0.506584 |
b110ff9ffe5fad9ca568ee61d99837d5ceee0c08 | 2,884 | py | Python | perplexity.py | Artemis-ii/LDA | 496e43f875ef35084cfb8539ee8bfe4e4fe68fb7 | [
"Apache-2.0"
] | null | null | null | perplexity.py | Artemis-ii/LDA | 496e43f875ef35084cfb8539ee8bfe4e4fe68fb7 | [
"Apache-2.0"
] | null | null | null | perplexity.py | Artemis-ii/LDA | 496e43f875ef35084cfb8539ee8bfe4e4fe68fb7 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu Nov 1 16:46:55 2018
@author: 月神少女
"""
import math
import matplotlib.pyplot as plt
def dictionary_found(wordlist): #对模型训练出来的词转换成一个词为KEY,概率为值的字典。
word_dictionary1={}
for i in range(len(wordlist)):
if i%2==0:
if word_dictionary1.__con... | 31.692308 | 109 | 0.643551 |
f101f2a323003e61bc00bd65305f7602125aa280 | 4,574 | py | Python | benchmark/startQiskit_Class1687.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_Class1687.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_Class1687.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=5
# total number=59
import cirq
import qiskit
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2,floor, sqrt, pi
import numpy as np
import networkx as ... | 32.439716 | 80 | 0.612593 |
f66f592a57dadacb3d195ad26bab6c81d331895c | 15,752 | py | Python | zoo/policies/cross-rl-agent/cross_rl_agent/train/run_train.py | MCZhi/SMARTS | 3ef5650b04ac6fb7145cf4e23d5534d73e0929fc | [
"MIT"
] | 2 | 2021-12-13T12:41:54.000Z | 2021-12-16T03:10:24.000Z | zoo/policies/cross-rl-agent/cross_rl_agent/train/run_train.py | MCZhi/SMARTS | 3ef5650b04ac6fb7145cf4e23d5534d73e0929fc | [
"MIT"
] | null | null | null | zoo/policies/cross-rl-agent/cross_rl_agent/train/run_train.py | MCZhi/SMARTS | 3ef5650b04ac6fb7145cf4e23d5534d73e0929fc | [
"MIT"
] | null | null | null | # Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved.
#
# 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 us... | 41.343832 | 118 | 0.562913 |
6f5397f4f180d682238e4f61981a809b3ef2aabd | 2,596 | py | Python | tartiflette/scalar/builtins/string.py | matt-koevort/tartiflette | 5777866b133d846ce4f8aa03f735fa81832896cd | [
"MIT"
] | 530 | 2019-06-04T11:45:36.000Z | 2022-03-31T09:29:56.000Z | tartiflette/scalar/builtins/string.py | matt-koevort/tartiflette | 5777866b133d846ce4f8aa03f735fa81832896cd | [
"MIT"
] | 242 | 2019-06-04T11:53:08.000Z | 2022-03-28T07:06:27.000Z | tartiflette/scalar/builtins/string.py | matt-koevort/tartiflette | 5777866b133d846ce4f8aa03f735fa81832896cd | [
"MIT"
] | 36 | 2019-06-21T06:40:27.000Z | 2021-11-04T13:11:16.000Z | from typing import Any, Dict, Optional, Union
from tartiflette import Scalar
from tartiflette.constants import UNDEFINED_VALUE
from tartiflette.language.ast import StringValueNode
class ScalarString:
"""
Built-in scalar which handle string values.
"""
def coerce_output(self, value: Any) -> str:
... | 32.049383 | 191 | 0.614407 |
8d55b2b7fa1c08a07eb1275c93af59256d27d79c | 151 | py | Python | config.py | siprikorea/aguri-bot | 98c81ee865f7814be0574c69dedaae0373da7249 | [
"Apache-2.0"
] | null | null | null | config.py | siprikorea/aguri-bot | 98c81ee865f7814be0574c69dedaae0373da7249 | [
"Apache-2.0"
] | null | null | null | config.py | siprikorea/aguri-bot | 98c81ee865f7814be0574c69dedaae0373da7249 | [
"Apache-2.0"
] | null | null | null | class config(object):
bot_token = '190337691:AAEmrH-pVz_wImCfYpnFDRA4G12Jhx7X1Jk'
base_url = 'https://api.telegram.org/bot' + bot_token + '/'
| 30.2 | 63 | 0.715232 |
72f28c924cd6ef0ce99f261039db52a2bdade042 | 22,034 | py | Python | nmt/model_helper.py | whiskyboy/CVAE_GNMT | 12d01df4b36cb5c44eb719c79cae71d782e1aacd | [
"Apache-2.0"
] | null | null | null | nmt/model_helper.py | whiskyboy/CVAE_GNMT | 12d01df4b36cb5c44eb719c79cae71d782e1aacd | [
"Apache-2.0"
] | null | null | null | nmt/model_helper.py | whiskyboy/CVAE_GNMT | 12d01df4b36cb5c44eb719c79cae71d782e1aacd | [
"Apache-2.0"
] | null | null | null | """Utility functions for building models."""
from __future__ import print_function
import collections
import six
import os
import time
import numpy as np
import tensorflow as tf
from tensorflow.python.ops import lookup_ops
from .utils import iterator_utils
from .utils import misc_utils as utils
from .utils import v... | 36.003268 | 80 | 0.6824 |
5f28b4d5282c2563c296dfecbcbe72224ee8fce1 | 400 | py | Python | src/network_manager_dispatcher_app/sound_thread.py | meads/dns-leak-test-py | 2771c56c486ab549519d886e691993a6b090f27c | [
"MIT"
] | 1 | 2022-02-19T09:09:52.000Z | 2022-02-19T09:09:52.000Z | src/network_manager_dispatcher_app/sound_thread.py | meads/network-manager-dispatcher-app | 2771c56c486ab549519d886e691993a6b090f27c | [
"MIT"
] | null | null | null | src/network_manager_dispatcher_app/sound_thread.py | meads/network-manager-dispatcher-app | 2771c56c486ab549519d886e691993a6b090f27c | [
"MIT"
] | null | null | null | import threading
from queue import Queue
from .sox_player import ISoXPlayer
class SoundThread(threading.Thread):
def __init__(self, q: Queue, play: ISoXPlayer):
threading.Thread.__init__(self)
self.q = q
self.play = play
def run(self):
while True:
if self.q.empty():... | 23.529412 | 51 | 0.5875 |
ec211937be56a3d8aa96b4904a7e8fce678d5840 | 6,952 | py | Python | test/functional/rpc_getblockstats.py | WFLSCoin/wflscoin | 794eb115845c3e7d6b75cf40031568bf5329ee25 | [
"MIT"
] | null | null | null | test/functional/rpc_getblockstats.py | WFLSCoin/wflscoin | 794eb115845c3e7d6b75cf40031568bf5329ee25 | [
"MIT"
] | null | null | null | test/functional/rpc_getblockstats.py | WFLSCoin/wflscoin | 794eb115845c3e7d6b75cf40031568bf5329ee25 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2017-2019 The Wflscoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test getblockstats rpc call
#
from test_framework.blocktools import COINBASE_MATURITY
from test_fra... | 41.380952 | 121 | 0.627014 |
b46b87e5c35cb0ed602cd3a787ce287c9838c13f | 627 | py | Python | api/app/utils.py | pedroporras/intro-deployment-ml | ff2768be17bc6ca3b3ab5ae5380c3b7516f9396d | [
"MIT"
] | null | null | null | api/app/utils.py | pedroporras/intro-deployment-ml | ff2768be17bc6ca3b3ab5ae5380c3b7516f9396d | [
"MIT"
] | null | null | null | api/app/utils.py | pedroporras/intro-deployment-ml | ff2768be17bc6ca3b3ab5ae5380c3b7516f9396d | [
"MIT"
] | null | null | null | from multiprocessing import Pipe
from joblib import load
from sklearn.pipeline import Pipeline
from pydantic import BaseModel
from pandas import DataFrame
import os
from io import BytesIO
def get_model() -> Pipeline:
model_path = os.environ.get('MODEL_PATH', 'model/model.pkl')
with open(model_path, 'rb') as mo... | 31.35 | 87 | 0.751196 |
688f1bc7810191f836e6233b3209444bb9181847 | 4,401 | py | Python | tests/test_cookiecutter_python_library.py | ghassanmas/edx-cookiecutters | b186021f7322d9c493f1875fff797ebae33157b0 | [
"Apache-2.0"
] | 2 | 2022-02-21T15:21:40.000Z | 2022-03-07T14:09:05.000Z | tests/test_cookiecutter_python_library.py | ghassanmas/edx-cookiecutters | b186021f7322d9c493f1875fff797ebae33157b0 | [
"Apache-2.0"
] | 8 | 2021-12-27T02:19:03.000Z | 2022-03-15T19:05:52.000Z | tests/test_cookiecutter_python_library.py | ghassanmas/edx-cookiecutters | b186021f7322d9c493f1875fff797ebae33157b0 | [
"Apache-2.0"
] | 1 | 2022-03-02T16:48:26.000Z | 2022-03-02T16:48:26.000Z | """
Tests of the project generation output.
"""
import logging
import logging.config
import os
import re
from contextlib import contextmanager
from pathlib import Path
import pytest
import sh
from test_utils.bake import bake_in_temp_dir
from test_utils.venv import run_in_virtualenv
LOGGING_CONFIG = {
'version':... | 30.992958 | 117 | 0.676437 |
0fcb3d3f23b1a2edefc6c91960598753390bf298 | 1,426 | py | Python | dai15shou/code15-1_fushimi.py | naoshige314/workshop01 | 5c7be08f99eb164b7901628de26cecfd04fa926f | [
"MIT"
] | null | null | null | dai15shou/code15-1_fushimi.py | naoshige314/workshop01 | 5c7be08f99eb164b7901628de26cecfd04fa926f | [
"MIT"
] | null | null | null | dai15shou/code15-1_fushimi.py | naoshige314/workshop01 | 5c7be08f99eb164b7901628de26cecfd04fa926f | [
"MIT"
] | 2 | 2021-06-10T11:53:02.000Z | 2021-06-20T15:43:39.000Z | #Union-Findの実装
class UnionFind:
def __init__(self,n):
self.par=[-1]*n
self.siz=[1]*n
#根を求める
def root(self,x):
if self.par[x] == -1:
return x
else:
#経路圧縮
self.par[x]=self.root(self.par[x])
return self.par[x]
#グループ判定... | 18.519481 | 46 | 0.514727 |
ca515f76e04d3277ba2a8619290ccd2130b3a2ff | 44,054 | py | Python | listings/listing11-2.py | eivl/MissionPython | dc4e06f2eaac9d53f5091ae6f921e39db986d101 | [
"Apache-2.0"
] | 4 | 2018-09-07T15:35:24.000Z | 2019-03-27T09:48:12.000Z | listings/listing11-2.py | eivl/MissionPython | dc4e06f2eaac9d53f5091ae6f921e39db986d101 | [
"Apache-2.0"
] | 371 | 2020-03-04T21:51:56.000Z | 2022-03-31T20:59:11.000Z | listings/listing11-2.py | eivl/MissionPython | dc4e06f2eaac9d53f5091ae6f921e39db986d101 | [
"Apache-2.0"
] | 3 | 2019-06-18T19:57:17.000Z | 2020-11-06T03:55:08.000Z | # Escape - A Python Adventure
# by Sean McManus / www.sean.co.uk
# Art by Rafael Pimenta
# Typed in by PUT YOUR NAME HERE
import time, random, math
###############
## VARIABLES ##
###############
WIDTH = 800 #window size
HEIGHT = 800
#PLAYER variables
PLAYER_NAME = "Sean" # change this to your name!
FRIEND1_NAME =... | 39.36908 | 79 | 0.60301 |
06546f7c6d7996749ef1fee9de4291fc3480bfd1 | 3,962 | py | Python | alipay/aop/api/request/AlipayInsDataAutoScoreQueryRequest.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/request/AlipayInsDataAutoScoreQueryRequest.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/request/AlipayInsDataAutoScoreQueryRequest.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.AlipayInsDataAutoScoreQueryModel import AlipayInsDataAutoScoreQueryModel
class AlipayInsDataAutoScoreQueryRequest(object):
def ... | 27.324138 | 148 | 0.643614 |
c5650e3bf56ed1b2670b4e803792f0c3c4bb4db2 | 7,289 | py | Python | 4_flask_restful/practice/JihyunLee/answer.py | geronimo03/WebStudio2019 | c7a9b59098c2ce97bddfd7727963c3b0f48bdbba | [
"MIT"
] | 14 | 2019-03-06T10:32:40.000Z | 2021-11-18T01:44:28.000Z | 4_flask_restful/practice/JihyunLee/answer.py | geronimo03/WebStudio2019 | c7a9b59098c2ce97bddfd7727963c3b0f48bdbba | [
"MIT"
] | 35 | 2019-03-13T07:04:02.000Z | 2019-10-08T06:26:45.000Z | 4_flask_restful/practice/JihyunLee/answer.py | geronimo03/WebStudio2019 | c7a9b59098c2ce97bddfd7727963c3b0f48bdbba | [
"MIT"
] | 22 | 2019-03-11T11:00:24.000Z | 2019-09-14T06:53:30.000Z | from flask import Flask, request
from flask_restful import Api, Resource
import json
import os
app = Flask(__name__)
api = Api(app)
class UserList(Resource):
filename = 'users.json'
def get_users(self):
users = []
if os.path.exists(self.filename):
with open(self.filename, 'r') as ... | 30.885593 | 110 | 0.511593 |
f1cf3054931c7a5b84468d280367ca11e237c244 | 844 | py | Python | src/utils/data_mgmt.py | Rohanbagulwar/DVC-NLP-Simple-usecase | 9968439be55c64566250d01f19414401825884dc | [
"MIT"
] | null | null | null | src/utils/data_mgmt.py | Rohanbagulwar/DVC-NLP-Simple-usecase | 9968439be55c64566250d01f19414401825884dc | [
"MIT"
] | null | null | null | src/utils/data_mgmt.py | Rohanbagulwar/DVC-NLP-Simple-usecase | 9968439be55c64566250d01f19414401825884dc | [
"MIT"
] | null | null | null | import logging
# from tqdm import tqdm
import random
import xml.etree.ElementTree as ET
import re
def process_posts(fd_in, fd_out_train, fd_out_test, target_tag, split):
line_num = 1
for line in (fd_in):
try:
fd_out = fd_out_train if random.random() > split else fd_out_test
att... | 33.76 | 77 | 0.554502 |
19311c998f39cd18458d7b364013a383e6b3d94c | 5,137 | py | Python | imagededup/handlers/search/retrieval.py | Incopro/imagededup | 6ad3325512fce6b44fd62c628ff4a62ebdc5c7f2 | [
"Apache-2.0"
] | 2 | 2019-12-06T08:48:32.000Z | 2019-12-30T21:29:14.000Z | imagededup/handlers/search/retrieval.py | Incopro/imagededup | 6ad3325512fce6b44fd62c628ff4a62ebdc5c7f2 | [
"Apache-2.0"
] | 8 | 2020-09-25T22:25:25.000Z | 2022-02-10T02:04:10.000Z | imagededup/handlers/search/retrieval.py | Incopro/imagededup | 6ad3325512fce6b44fd62c628ff4a62ebdc5c7f2 | [
"Apache-2.0"
] | null | null | null | from typing import Callable, Dict, Union, Tuple
import numpy as np
from sklearn.metrics.pairwise import cosine_similarity
from imagededup.handlers.search.bktree import BKTree
from imagededup.handlers.search.brute_force import BruteForce
from imagededup.utils.general_utils import parallelise
def cosine_similarity_ch... | 38.335821 | 112 | 0.638894 |
c20a745252df39c1c793868fea8d50485dea7c3f | 151 | py | Python | data types and variables exerscise/Triples of Latin Letters.py | nrgxtra/fundamentals | d9f35eb040c0e1009aad2f7305c035fda207a147 | [
"MIT"
] | null | null | null | data types and variables exerscise/Triples of Latin Letters.py | nrgxtra/fundamentals | d9f35eb040c0e1009aad2f7305c035fda207a147 | [
"MIT"
] | null | null | null | data types and variables exerscise/Triples of Latin Letters.py | nrgxtra/fundamentals | d9f35eb040c0e1009aad2f7305c035fda207a147 | [
"MIT"
] | null | null | null |
n = int(input())
for i in range(n):
for j in range(n):
for h in range(n):
print(f'{chr(97+i)}{chr(97+j)}{chr(97+h)}')
| 18.875 | 56 | 0.456954 |
35616cb99d42189ffb1d878629f3eb605e2c649d | 9,244 | py | Python | nova/tests/unit/virt/vmwareapi/test_network_util.py | viveknandavanam/nova | 556377b6915936467436c9d5bb33bc0e22244e1e | [
"Apache-2.0"
] | 1 | 2019-07-29T10:30:24.000Z | 2019-07-29T10:30:24.000Z | nova/tests/unit/virt/vmwareapi/test_network_util.py | viveknandavanam/nova | 556377b6915936467436c9d5bb33bc0e22244e1e | [
"Apache-2.0"
] | 11 | 2017-06-19T01:28:55.000Z | 2017-06-23T02:01:47.000Z | nova/tests/unit/virt/vmwareapi/test_network_util.py | viveknandavanam/nova | 556377b6915936467436c9d5bb33bc0e22244e1e | [
"Apache-2.0"
] | 7 | 2015-01-20T10:30:08.000Z | 2020-02-05T10:29:05.000Z | # Copyright (c) 2014 VMware, Inc.
#
# 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 requir... | 39.169492 | 78 | 0.583081 |
578bb162ee296a673f6b3c06d996f97d33b8af81 | 680 | py | Python | poky/scripts/lib/build_perf/html.py | buildlinux/unityos | dcbe232d0589013d77a62c33959d6a69f9bfbc5e | [
"Apache-2.0"
] | 53 | 2018-02-28T08:51:32.000Z | 2022-02-28T06:49:23.000Z | scripts/lib/build_perf/html.py | nareshgbhat/luv-yocto | 48976c54238dda0791e274927371265d259c0e5a | [
"MIT"
] | 27 | 2018-01-25T00:26:53.000Z | 2020-08-09T05:20:04.000Z | scripts/lib/build_perf/html.py | nareshgbhat/luv-yocto | 48976c54238dda0791e274927371265d259c0e5a | [
"MIT"
] | 51 | 2018-02-21T04:46:08.000Z | 2022-03-02T04:20:41.000Z | #
# Copyright (c) 2017, Intel Corporation.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU General Public License,
# version 2, as published by the Free Software Foundation.
#
# This program is distributed in the hope it will be useful, but WITHOUT... | 34 | 75 | 0.769118 |
e5ab6c6697bd5669e2ab509f1546d4224a4444d6 | 4,732 | py | Python | osf_tests/management_commands/test_backfill_egap_metadata.py | gaybro8777/osf.io | 30408511510a40bc393565817b343ef5fd76ab14 | [
"Apache-2.0"
] | 628 | 2015-01-15T04:33:22.000Z | 2022-03-30T06:40:10.000Z | osf_tests/management_commands/test_backfill_egap_metadata.py | gaybro8777/osf.io | 30408511510a40bc393565817b343ef5fd76ab14 | [
"Apache-2.0"
] | 4,712 | 2015-01-02T01:41:53.000Z | 2022-03-30T14:18:40.000Z | osf_tests/management_commands/test_backfill_egap_metadata.py | Johnetordoff/osf.io | de10bf249c46cede04c78f7e6f7e352c69e6e6b5 | [
"Apache-2.0"
] | 371 | 2015-01-12T16:14:08.000Z | 2022-03-31T18:58:29.000Z | import pytest
from osf.management.commands.backfill_egap_provider_metadata import backfill_egap_metadata
from osf.management.commands.update_registration_schemas import update_registration_schemas
from osf.models import RegistrationSchema
from osf_tests.factories import RegistrationFactory, RegistrationProviderFactory... | 41.876106 | 111 | 0.744505 |
f321fbc395c4358da192e1bbd761ff86399d3ac9 | 543 | py | Python | manage.py | seLain/MissAchieve | e65ecf46d3c35b79151d526d0b0abce7b55a6652 | [
"MIT"
] | null | null | null | manage.py | seLain/MissAchieve | e65ecf46d3c35b79151d526d0b0abce7b55a6652 | [
"MIT"
] | 7 | 2018-03-29T05:38:46.000Z | 2021-06-10T20:09:49.000Z | manage.py | seLain/MissAchieve | e65ecf46d3c35b79151d526d0b0abce7b55a6652 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "MissAchieve.settings")
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. ... | 33.9375 | 75 | 0.688766 |
15415a1901079c94d72442a3953863ab8d537c35 | 880 | py | Python | config.py | lyori6/microblog_app | 335135cebe90e647639a6fc6c659ca26923cc1e3 | [
"MIT"
] | null | null | null | config.py | lyori6/microblog_app | 335135cebe90e647639a6fc6c659ca26923cc1e3 | [
"MIT"
] | 1 | 2019-09-13T16:12:45.000Z | 2019-09-13T16:12:45.000Z | config.py | hoquem/microblog | b0421a0157ac73cbb4f467838010eb20f888086c | [
"MIT"
] | null | null | null | import os
from dotenv import load_dotenv
basedir = os.path.abspath(os.path.dirname(__file__))
load_dotenv(os.path.join(basedir, '.env'))
class Config(object):
SECRET_KEY = os.environ.get('SECRET_KEY') or 'you-will-never-guess'
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL') or \
'sqlite:///'... | 38.26087 | 71 | 0.710227 |
a1e2c99b92ea5a5af22263327dd30e46cfd54d6f | 69,232 | py | Python | pylogix/eip.py | zursch/pylogix | 1d7889454b7db1d00dce7028cb81eae60ebda787 | [
"Apache-2.0"
] | null | null | null | pylogix/eip.py | zursch/pylogix | 1d7889454b7db1d00dce7028cb81eae60ebda787 | [
"Apache-2.0"
] | null | null | null | pylogix/eip.py | zursch/pylogix | 1d7889454b7db1d00dce7028cb81eae60ebda787 | [
"Apache-2.0"
] | null | null | null | '''
Originally created by Burt Peterson
Updated and maintained by Dustin Roeder (dmroeder@gmail.com)
Copyright 2019 Dustin Roeder
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 Lic... | 35.521806 | 115 | 0.503004 |
26aa17d4ad757d16d85af83a63d06e383faf6c20 | 739 | py | Python | pyefun/systemProcessingBase.py | liguoqing-byte/pyefun | 773b89944aae5beb060d75f21cf1553bb359660a | [
"Apache-2.0"
] | null | null | null | pyefun/systemProcessingBase.py | liguoqing-byte/pyefun | 773b89944aae5beb060d75f21cf1553bb359660a | [
"Apache-2.0"
] | null | null | null | pyefun/systemProcessingBase.py | liguoqing-byte/pyefun | 773b89944aae5beb060d75f21cf1553bb359660a | [
"Apache-2.0"
] | null | null | null | """
.. Hint::
系统处理
.. literalinclude:: ../../../pyefun/systemProcessingBase_test.py
:language: python
:caption: 代码示例
:linenos:
"""
import time
import os
import platform
def 系统_是否为window系统():
return platform.system().lower() == 'windows'
def 系统_是否为linux系统():
return platform.system().low... | 10.408451 | 64 | 0.608931 |
a384df9531cad8ac8918981c727f5a2182ad016c | 1,097 | py | Python | invirtualenv_plugins/rpm_scripts/pre_uninstall.py | BenLloydPearson/invirtualenv | 5103eece3a998499fa260413ef7e57baa57555c4 | [
"BSD-3-Clause"
] | null | null | null | invirtualenv_plugins/rpm_scripts/pre_uninstall.py | BenLloydPearson/invirtualenv | 5103eece3a998499fa260413ef7e57baa57555c4 | [
"BSD-3-Clause"
] | null | null | null | invirtualenv_plugins/rpm_scripts/pre_uninstall.py | BenLloydPearson/invirtualenv | 5103eece3a998499fa260413ef7e57baa57555c4 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
from __future__ import print_function
import logging
import os
import shutil
import sys
from invirtualenv.deploy import unlink_deployed_bin_files
from invirtualenv.config import get_configuration_dict
if __name__ == "__main__":
# /usr/share/<packagename_version>/package_scripts
this_scr... | 35.387097 | 72 | 0.740201 |
6f38befcc863f9f0504dac65b12395f691150084 | 25,154 | py | Python | app/navigation.py | cds-snc/notification-admin | d4056798bf889ad29893667bbb67ead2f8e466e4 | [
"MIT"
] | 16 | 2019-11-05T21:35:49.000Z | 2022-01-12T15:00:32.000Z | app/navigation.py | cds-snc/notification-admin | d4056798bf889ad29893667bbb67ead2f8e466e4 | [
"MIT"
] | 509 | 2019-07-11T22:03:19.000Z | 2022-03-30T15:19:26.000Z | app/navigation.py | cds-snc/notification-admin | d4056798bf889ad29893667bbb67ead2f8e466e4 | [
"MIT"
] | 8 | 2020-02-21T20:19:29.000Z | 2022-03-31T14:17:02.000Z | from itertools import chain
from flask import request
class Navigation:
mapping: dict = {}
exclude: set = set()
selected_attribute = "class=selected"
def __init__(self):
self.mapping = {
navigation: {"main.{}".format(endpoint) for endpoint in endpoints} for navigation, endpoints ... | 30.526699 | 128 | 0.57637 |
f385e56e9ef6a4355d833a7d21dfc036ff777f6b | 1,092 | py | Python | tsengine/util/operations.py | ccccxjin/TsEngine | 5f8deed436eb9756be40f78a7bf52be9e910b501 | [
"MIT"
] | 1 | 2020-07-10T09:11:38.000Z | 2020-07-10T09:11:38.000Z | tsengine/util/operations.py | ccccxjin/tsengine | 5f8deed436eb9756be40f78a7bf52be9e910b501 | [
"MIT"
] | null | null | null | tsengine/util/operations.py | ccccxjin/tsengine | 5f8deed436eb9756be40f78a7bf52be9e910b501 | [
"MIT"
] | null | null | null | from ._collections import _escape_mapper_args
class F:
__slots__ = 'name'
def __init__(self, name):
self.name = name
def __lt__(self, other):
other = _escape_mapper_args(other)
return '%s < %s' % (self.name, other)
def __le__(self, other):
other = _escape_mapper_args... | 22.75 | 51 | 0.572344 |
3305a83dae6e4396b85627393c3d99118eeff877 | 34,682 | py | Python | electrumx/server/block_processor.py | commerceblock/cb-electrum-server | c1d5aaf32790e4679bec8b640cdbbc15bc6a9b27 | [
"MIT"
] | 1 | 2019-06-19T23:36:28.000Z | 2019-06-19T23:36:28.000Z | electrumx/server/block_processor.py | commerceblock/cb-electrum-server | c1d5aaf32790e4679bec8b640cdbbc15bc6a9b27 | [
"MIT"
] | 5 | 2018-11-16T14:06:30.000Z | 2019-08-30T14:05:08.000Z | electrumx/server/block_processor.py | commerceblock/cb-electrum-server | c1d5aaf32790e4679bec8b640cdbbc15bc6a9b27 | [
"MIT"
] | null | null | null | # Copyright (c) 2016-2017, Neil Booth
# Copyright (c) 2017, the ElectrumX authors
#
# All rights reserved.
#
# See the file "LICENCE" for information about the copyright
# and warranty status of this software.
'''Block prefetcher and chain processor.'''
import array
import asyncio
from struct import pack, unpack
imp... | 39.056306 | 87 | 0.587394 |
50b70938957dfc575f78127156d86c336d176e5f | 562 | py | Python | src/icolos/utils/enums/flow_control_enums.py | jharrymoore/Icolos | c60cc00c34208ab7011d41d52a74651763673e7a | [
"Apache-2.0"
] | null | null | null | src/icolos/utils/enums/flow_control_enums.py | jharrymoore/Icolos | c60cc00c34208ab7011d41d52a74651763673e7a | [
"Apache-2.0"
] | null | null | null | src/icolos/utils/enums/flow_control_enums.py | jharrymoore/Icolos | c60cc00c34208ab7011d41d52a74651763673e7a | [
"Apache-2.0"
] | null | null | null | from icolos.core.workflow_steps.prediction.active_learning import StepActiveLearning
from icolos.utils.enums.step_enums import StepBaseEnum
from icolos.core.flow_control.iterator import StepIterator
_SBE = StepBaseEnum
class FlowControlInitializationEnum:
# These steps are responsible for initializing other step... | 35.125 | 89 | 0.800712 |
e48aa6f051f6f9bbefe6b37382433e4be1f23131 | 7,265 | py | Python | userbot/modules/globalban.py | qmuensa/QB-USERBOT | 5a6c098e387755256801b60c1c57f1a404edc671 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 1 | 2022-02-03T15:00:26.000Z | 2022-02-03T15:00:26.000Z | userbot/modules/globalban.py | qmuensa/QB-USERBOT | 5a6c098e387755256801b60c1c57f1a404edc671 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/globalban.py | qmuensa/QB-USERBOT | 5a6c098e387755256801b60c1c57f1a404edc671 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 1 | 2022-02-21T16:07:35.000Z | 2022-02-21T16:07:35.000Z | # Copyright (C) 2020 Catuserbot <https://github.com/sandy1709/catuserbot>
# Ported by @mrismanaziz
# FROM Man-Userbot <https://github.com/mrismanaziz/Man-Userbot>
# t.me/SharingUserbot
import asyncio
from datetime import datetime
from io import BytesIO
from telethon import events
from telethon.errors import BadReques... | 34.43128 | 158 | 0.577151 |
af53796fce82c63c53d91ac174159281d20f6d2a | 620 | py | Python | Aulas/Mundo 3/091.py | JoaoEmanuell/Meus-Estudos-Python | f6f6eeb6016919e594613785ffe7136d74241ada | [
"MIT"
] | 2 | 2021-07-29T18:58:02.000Z | 2021-10-29T21:11:22.000Z | Aulas/Mundo 3/091.py | JoaoEmanuell/Meus-Estudos-Python | f6f6eeb6016919e594613785ffe7136d74241ada | [
"MIT"
] | null | null | null | Aulas/Mundo 3/091.py | JoaoEmanuell/Meus-Estudos-Python | f6f6eeb6016919e594613785ffe7136d74241ada | [
"MIT"
] | null | null | null | from random import randint
from operator import itemgetter
jogo = {'jogador1': randint(1, 6),
'jogador2': randint(1, 6),
'jogador3': randint(1, 6),
'jogador4': randint(1, 6)}
print('Valores sorteados')
rank = []
for k, v in jogo.items():
print(f'{k} tirou {v} no dado')
print('=' * ... | 41.333333 | 215 | 0.646774 |
2732c1e924031c3533ec180c59d1ba8aba3c1fa4 | 2,980 | py | Python | src/secondaires/navigation/equipage/volontes/virer_tribord.py | stormi/tsunami | bdc853229834b52b2ee8ed54a3161a1a3133d926 | [
"BSD-3-Clause"
] | null | null | null | src/secondaires/navigation/equipage/volontes/virer_tribord.py | stormi/tsunami | bdc853229834b52b2ee8ed54a3161a1a3133d926 | [
"BSD-3-Clause"
] | null | null | null | src/secondaires/navigation/equipage/volontes/virer_tribord.py | stormi/tsunami | bdc853229834b52b2ee8ed54a3161a1a3133d926 | [
"BSD-3-Clause"
] | null | null | null | # -*-coding:Utf-8 -*
# Copyright (c) 2013 LE GOFF Vincent
# 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 source code must retain the above copyright notice, this
# lis... | 41.971831 | 79 | 0.72349 |
c2fc460528777bc979b0eb11d01deb297cf8daac | 800 | py | Python | ros/src/twist_controller/pid.py | mrhm2000/CarND-Capstone | 804182ecfc329d9a593555eff795da1f7cf628e2 | [
"MIT"
] | null | null | null | ros/src/twist_controller/pid.py | mrhm2000/CarND-Capstone | 804182ecfc329d9a593555eff795da1f7cf628e2 | [
"MIT"
] | 2 | 2018-06-25T16:28:45.000Z | 2018-07-01T14:07:40.000Z | ros/src/twist_controller/pid.py | mrhm2000/CarND-Capstone | 804182ecfc329d9a593555eff795da1f7cf628e2 | [
"MIT"
] | 8 | 2018-06-10T17:18:03.000Z | 2018-07-19T18:28:07.000Z |
MIN_NUM = float('-inf')
MAX_NUM = float('inf')
class PID(object):
def __init__(self, kp, ki, kd, min=MIN_NUM, max=MAX_NUM):
self.kp = kp
self.ki = ki
self.kd = kd
self.min = min
self.max = max
self.integral = self.last_error = 0.
def reset(self):
self... | 23.529412 | 76 | 0.55625 |
4a46d3a6597e11d7e43ec9f801e82f47f8d06b99 | 9,018 | py | Python | salt/modules/match.py | fictivekin/salt | f4b6f815d47ab8c790028e8ddad64ee0f8bb3f00 | [
"Apache-2.0"
] | null | null | null | salt/modules/match.py | fictivekin/salt | f4b6f815d47ab8c790028e8ddad64ee0f8bb3f00 | [
"Apache-2.0"
] | null | null | null | salt/modules/match.py | fictivekin/salt | f4b6f815d47ab8c790028e8ddad64ee0f8bb3f00 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
The match module allows for match routines to be run and determine target specs
'''
from __future__ import absolute_import
# Import python libs
import inspect
import logging
import sys
# Import salt libs
import salt.minion
import salt.utils
from salt.defaults import DEFAULT_TARGET_DELIM
fr... | 25.260504 | 93 | 0.626081 |
e5adbee718a71e09e83dc6cb75e0ad77f2e474c7 | 7,529 | py | Python | pymultifracs/cumulants.py | MerlinDumeur/pymultifracs | 9767ee4c34a3a39a7609f40afd6265151ba4e550 | [
"MIT"
] | 9 | 2019-03-29T05:28:42.000Z | 2019-12-29T12:41:15.000Z | pymultifracs/cumulants.py | MerlinDumeur/pymultifracs | 9767ee4c34a3a39a7609f40afd6265151ba4e550 | [
"MIT"
] | 4 | 2021-01-20T14:58:03.000Z | 2021-03-01T11:52:09.000Z | pymultifracs/cumulants.py | MerlinDumeur/pymultifracs | 9767ee4c34a3a39a7609f40afd6265151ba4e550 | [
"MIT"
] | 6 | 2021-02-08T15:23:39.000Z | 2022-03-28T13:30:46.000Z | """
Authors: Omar D. Domingues <omar.darwiche-domingues@inria.fr>
Merlin Dumeur <merlin@dumeur.net>
"""
from dataclasses import dataclass, field, InitVar
import numpy as np
import matplotlib.pyplot as plt
from scipy.special import binom as binomial_coefficient
from .utils import linear_regression, fast_powe... | 32.175214 | 78 | 0.53699 |
a957f445ff1d9c3e270c79b09e653c697dac97c9 | 146 | py | Python | lista_convidados.py | WestenPy/Curso_em_video | 9f6a9775d27e1b86d54b381aba5da69b2ae21b27 | [
"MIT"
] | null | null | null | lista_convidados.py | WestenPy/Curso_em_video | 9f6a9775d27e1b86d54b381aba5da69b2ae21b27 | [
"MIT"
] | null | null | null | lista_convidados.py | WestenPy/Curso_em_video | 9f6a9775d27e1b86d54b381aba5da69b2ae21b27 | [
"MIT"
] | null | null | null | lista = [1, 2, 3, 4, 5]
lista.append(6)
print(lista)
print()
a = lista.pop(0)
b = lista.pop(3)
print(lista)
print(a, b)
del lista[1]
print(lista)
| 13.272727 | 23 | 0.636986 |
6424e394df45ee3ca29991691ccc559c1fb06ed3 | 14,821 | py | Python | isic/utils/dataset.py | bomcon123456/isic | bf86f6a057c96c85a089587e2e1076bf5d586d3f | [
"Apache-2.0"
] | null | null | null | isic/utils/dataset.py | bomcon123456/isic | bf86f6a057c96c85a089587e2e1076bf5d586d3f | [
"Apache-2.0"
] | 2 | 2021-09-28T05:33:52.000Z | 2022-02-26T09:50:37.000Z | isic/utils/dataset.py | bomcon123456/isic | bf86f6a057c96c85a089587e2e1076bf5d586d3f | [
"Apache-2.0"
] | null | null | null | # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/utils_dataset.ipynb (unless otherwise specified).
__all__ = ['SkinLabels', 'from_label_idx_to_key', 'preprocess_df', 'split_df_to_cat_num_df', 'undersampling_df',
'oversampling_df', 'oversampling_not_flat_df', 'hybridsampling_df', 'gen_new_dts', 'get_class_wei... | 34.30787 | 133 | 0.611362 |
b07d73c57532e63ecee6c7b10c3a74eea72c46da | 872 | py | Python | src/learning/NaiveBayes.py | alexandrabenamar/Who-Wins | 23df54f98286e67aab39e92ac746bccf6916c231 | [
"MIT"
] | 3 | 2018-04-10T21:52:57.000Z | 2018-08-22T15:41:58.000Z | src/learning/NaiveBayes.py | alexandrabenamar/Who-Wins | 23df54f98286e67aab39e92ac746bccf6916c231 | [
"MIT"
] | null | null | null | src/learning/NaiveBayes.py | alexandrabenamar/Who-Wins | 23df54f98286e67aab39e92ac746bccf6916c231 | [
"MIT"
] | 1 | 2020-05-18T15:46:23.000Z | 2020-05-18T15:46:23.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from pyspark.mllib.classification import NaiveBayes
from functions_MLlib import spark_context, training_set, test_set, write_result, brexit_labeled_data, mode_predict
if __name__ == "__main__" :
sc = spark_context()
numFeatures = 10000
print(... | 27.25 | 114 | 0.658257 |
08ec6d6ad7cd41ddb71590624af6d18098ce3bbe | 49,161 | py | Python | integration_tests/ci_analyzer/test_analyzer_aggregation_queries.py | nordic-institute/X-Road-Metrics | 249d859466bf6065257cf8b3c27d0e9db4ab2378 | [
"MIT"
] | 2 | 2021-06-30T11:12:31.000Z | 2021-09-24T08:50:03.000Z | integration_tests/ci_analyzer/test_analyzer_aggregation_queries.py | nordic-institute/X-Road-Metrics | 249d859466bf6065257cf8b3c27d0e9db4ab2378 | [
"MIT"
] | null | null | null | integration_tests/ci_analyzer/test_analyzer_aggregation_queries.py | nordic-institute/X-Road-Metrics | 249d859466bf6065257cf8b3c27d0e9db4ab2378 | [
"MIT"
] | 2 | 2021-07-02T12:31:37.000Z | 2021-11-09T08:44:09.000Z | import unittest
from unittest.mock import Mock
from integration_tests.helpers import cl_db_handler
from integration_tests.ci_analyzer.ci_analyzer_settings import Settings
from analysis_module.opmon_analyzer.AnalyzerDatabaseManager import AnalyzerDatabaseManager
from datetime import datetime
import time
class TestA... | 43.737544 | 140 | 0.623462 |
ef1790e1d254d801ba8736f136a67699b8eca72d | 4,533 | py | Python | apis/bilibili/video.py | LXG-Shadow/BilibiliGetFavorite | a3912eb983be5f420c3729d705eefbf06d240309 | [
"Apache-2.0"
] | 60 | 2018-08-27T07:10:58.000Z | 2021-07-14T11:13:53.000Z | apis/bilibili/video.py | LXG-Shadow/BilibiliGetFavorite | a3912eb983be5f420c3729d705eefbf06d240309 | [
"Apache-2.0"
] | 6 | 2019-09-09T02:50:23.000Z | 2021-06-08T21:46:16.000Z | apis/bilibili/video.py | LXG-Shadow/BilibiliGetFavorite | a3912eb983be5f420c3729d705eefbf06d240309 | [
"Apache-2.0"
] | 17 | 2019-01-20T08:46:01.000Z | 2021-06-30T10:44:01.000Z | from apis import CommonRequestWrapper
from config import Config
class QUALITY:
P4k = (120, "FLV", "超清 4K", True)
P1080F60 = (116, "FLV", "高清 1080P60", True)
P1080PLUS = (112, "FLV", "高清 1080P+", True)
P1080 = (80, "FLV", "高清 1080P", True)
P720F60 = (74, "FLV", "高清 720P", True)
P720 = (64, "FLV... | 28.15528 | 110 | 0.566953 |
f40355cfb7ec8c3b4e34be4e3611baa03daeb4a4 | 304 | py | Python | tests/test_invoice_line_item.py | Files-com/files-sdk-python | 84cedc9be099cd9e4db6249ef7a9d60595487090 | [
"MIT"
] | 14 | 2020-08-05T15:48:06.000Z | 2021-08-18T13:13:39.000Z | tests/test_invoice_line_item.py | Files-com/files-sdk-python | 84cedc9be099cd9e4db6249ef7a9d60595487090 | [
"MIT"
] | 4 | 2020-10-30T14:49:25.000Z | 2021-09-29T17:11:53.000Z | tests/test_invoice_line_item.py | Files-com/files-sdk-python | 84cedc9be099cd9e4db6249ef7a9d60595487090 | [
"MIT"
] | null | null | null | import unittest
import inspect
import files_sdk
from tests.base import TestBase
from files_sdk.models import InvoiceLineItem
from files_sdk import invoice_line_item
class InvoiceLineItemTest(TestBase):
pass
# Instance Methods
# Static Methods
if __name__ == '__main__':
unittest.main() | 21.714286 | 44 | 0.786184 |
52c895bee1aa9a9cbf371e66a93b0a5bced7f980 | 1,590 | py | Python | client/back/server_connection.py | joaorura/HangmanGameOnline-HGC | 9d32ba7bd5f95cd1d899afe3eb0f327faff36596 | [
"MIT"
] | null | null | null | client/back/server_connection.py | joaorura/HangmanGameOnline-HGC | 9d32ba7bd5f95cd1d899afe3eb0f327faff36596 | [
"MIT"
] | null | null | null | client/back/server_connection.py | joaorura/HangmanGameOnline-HGC | 9d32ba7bd5f95cd1d899afe3eb0f327faff36596 | [
"MIT"
] | null | null | null | from socket import socket
from multiprocessing import Queue
from utils.utils import check_type
from .process_all import ProcessAll
from .process_receive import ProcessReceive
from .process_send import ProcessSend
class ServerConnection:
def __init__(self, ip, port):
self.address = (ip, port)
self.... | 30 | 88 | 0.627044 |
2391a4e8b73a7b6fd7af117cc9422ee579d79321 | 3,775 | py | Python | homeassistant/components/sensor/zwave.py | hemantsangwan/home-assistant | 28b397030d2f66bb084f80d8a237d0a2c11bac79 | [
"MIT"
] | 2 | 2021-05-25T01:08:57.000Z | 2022-01-09T21:02:46.000Z | homeassistant/components/sensor/zwave.py | hemantsangwan/home-assistant | 28b397030d2f66bb084f80d8a237d0a2c11bac79 | [
"MIT"
] | null | null | null | homeassistant/components/sensor/zwave.py | hemantsangwan/home-assistant | 28b397030d2f66bb084f80d8a237d0a2c11bac79 | [
"MIT"
] | 1 | 2022-02-04T10:11:57.000Z | 2022-02-04T10:11:57.000Z | """
homeassistant.components.sensor.zwave
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Interfaces with Z-Wave sensors.
"""
# pylint: disable=import-error
from openzwave.network import ZWaveNetwork
from pydispatch import dispatcher
import homeassistant.components.zwave as zwave
from homeassistant.helpers.device import Device... | 27.757353 | 78 | 0.639205 |
834181020b98b5a79dd72dd438c316cbb19abd09 | 5,102 | py | Python | T2API/migrations/0001_initial.py | hackhb18-T2/api | c42be466492d07d6451ff3145985cd8cc0927257 | [
"Apache-2.0"
] | null | null | null | T2API/migrations/0001_initial.py | hackhb18-T2/api | c42be466492d07d6451ff3145985cd8cc0927257 | [
"Apache-2.0"
] | null | null | null | T2API/migrations/0001_initial.py | hackhb18-T2/api | c42be466492d07d6451ff3145985cd8cc0927257 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 2.0.2 on 2018-02-17 03:15
import django.contrib.auth.models
import django.contrib.auth.validators
import django.utils.timezone
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth... | 54.860215 | 164 | 0.525284 |
cb40d0155a934c13d9d4deddd580429b19dba719 | 2,171 | py | Python | young/apps/users/migrations/0007_auto_20190104_1205.py | Aooyh/Young | 223671c05085f79a9f12513ccc16abbb4ca801d4 | [
"MIT"
] | 1 | 2019-04-20T07:54:21.000Z | 2019-04-20T07:54:21.000Z | young/apps/users/migrations/0007_auto_20190104_1205.py | Aooyh/Young | 223671c05085f79a9f12513ccc16abbb4ca801d4 | [
"MIT"
] | null | null | null | young/apps/users/migrations/0007_auto_20190104_1205.py | Aooyh/Young | 223671c05085f79a9f12513ccc16abbb4ca801d4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.11 on 2019-01-04 12:05
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
... | 36.79661 | 166 | 0.620912 |
c23f8f47befa30db6d6758c8d6c0e1243c037b84 | 19,914 | py | Python | homeassistant/components/netatmo/climate.py | pszafer/core | ab6fb5cb7705a7f2e3a4f310b5d42047c3372bd2 | [
"Apache-2.0"
] | 3 | 2019-07-06T08:00:22.000Z | 2021-11-12T23:01:59.000Z | homeassistant/components/netatmo/climate.py | pszafer/core | ab6fb5cb7705a7f2e3a4f310b5d42047c3372bd2 | [
"Apache-2.0"
] | 44 | 2020-08-03T07:31:07.000Z | 2022-03-31T06:02:04.000Z | homeassistant/components/netatmo/climate.py | titilambert/home-assistant | a2651845f379992231fd7b9c8458828036296ee0 | [
"Apache-2.0"
] | 2 | 2017-09-03T16:06:02.000Z | 2021-01-12T15:07:52.000Z | """Support for Netatmo Smart thermostats."""
import logging
from typing import List, Optional
import voluptuous as vol
from homeassistant.components.climate import ClimateEntity
from homeassistant.components.climate.const import (
CURRENT_HVAC_HEAT,
CURRENT_HVAC_IDLE,
DEFAULT_MIN_TEMP,
HVAC_MODE_AUTO,... | 34.099315 | 88 | 0.615547 |
99acede90e68c6a9be099056d7bbdaa7b7a6328b | 5,377 | py | Python | samcli/local/common/runtime_template.py | darthzyklus/aws-sam-cli | 9c5546801e4c46a79ffc2d1f1d1e5005d0451bf0 | [
"BSD-2-Clause",
"Apache-2.0"
] | 859 | 2020-08-25T03:53:17.000Z | 2022-03-31T12:33:07.000Z | samcli/local/common/runtime_template.py | darthzyklus/aws-sam-cli | 9c5546801e4c46a79ffc2d1f1d1e5005d0451bf0 | [
"BSD-2-Clause",
"Apache-2.0"
] | 1,369 | 2020-08-25T10:57:03.000Z | 2022-03-31T23:00:25.000Z | samcli/local/common/runtime_template.py | darthzyklus/aws-sam-cli | 9c5546801e4c46a79ffc2d1f1d1e5005d0451bf0 | [
"BSD-2-Clause",
"Apache-2.0"
] | 275 | 2020-08-25T19:33:50.000Z | 2022-03-26T08:32:52.000Z | """
All-in-one metadata about runtimes
"""
import itertools
import os
import pathlib
from typing import Set
_init_path = str(pathlib.Path(os.path.dirname(__file__)).parent.parent)
_templates = os.path.join(_init_path, "lib", "init", "templates")
_lambda_images_templates = os.path.join(_init_path, "lib", "init", "imag... | 31.080925 | 113 | 0.598103 |
4c42d650b64e321e3fd971fbd810c8c8bdb75819 | 382 | py | Python | Binary Number with Alternating Bits (693)/693.py | WeaverDyl/LeetCode-Solutions | 5b37e26390bcda69ffcb1142cc03e193f74735e6 | [
"MIT"
] | null | null | null | Binary Number with Alternating Bits (693)/693.py | WeaverDyl/LeetCode-Solutions | 5b37e26390bcda69ffcb1142cc03e193f74735e6 | [
"MIT"
] | null | null | null | Binary Number with Alternating Bits (693)/693.py | WeaverDyl/LeetCode-Solutions | 5b37e26390bcda69ffcb1142cc03e193f74735e6 | [
"MIT"
] | null | null | null | # Runtime: 20 ms
# Beats 100% of Python submissions
class Solution(object):
def hasAlternatingBits(self, n):
"""
:type n: int
:rtype: bool
"""
while n != 0:
prev_bit = n & 1
n = n >> 1
curr_bit = n & 1
if prev_bit == curr_bit:
... | 21.222222 | 36 | 0.442408 |
a7085f7cd78ca29a2b4e8567acab231c470f34cb | 80 | py | Python | ocradmin/projects/tasks.py | mikesname/ocropodium | a3e379cca38dc1999349bf4e9b5608e81dc54b10 | [
"Apache-2.0"
] | 1 | 2018-04-18T20:39:02.000Z | 2018-04-18T20:39:02.000Z | ocradmin/projects/tasks.py | mikesname/ocropodium | a3e379cca38dc1999349bf4e9b5608e81dc54b10 | [
"Apache-2.0"
] | null | null | null | ocradmin/projects/tasks.py | mikesname/ocropodium | a3e379cca38dc1999349bf4e9b5608e81dc54b10 | [
"Apache-2.0"
] | null | null | null | """
Celery functions to be processed in a non-blocking distributed manner.
"""
| 16 | 70 | 0.7375 |
42daa578772ffe2930eb1ea191563bdef9b6ed0b | 516 | py | Python | advance_py/04 Collections/defaultdict_start.py | joejoeyjoseph/playground | fa739d51635823b866fafd1e712760074cfc175c | [
"MIT"
] | null | null | null | advance_py/04 Collections/defaultdict_start.py | joejoeyjoseph/playground | fa739d51635823b866fafd1e712760074cfc175c | [
"MIT"
] | null | null | null | advance_py/04 Collections/defaultdict_start.py | joejoeyjoseph/playground | fa739d51635823b866fafd1e712760074cfc175c | [
"MIT"
] | null | null | null | # Demonstrate the usage of defaultdict objects
def main():
# define a list of items that we want to count
fruits = ['apple', 'pear', 'orange', 'banana',
'apple', 'grape', 'banana', 'banana']
# use a dictionary to count each element
fruitCounter = {}
# Count the elements in the list... | 22.434783 | 51 | 0.587209 |
c7217f0c821779672fd2e857185c15af50449bad | 12,005 | py | Python | bert/run_bert.py | qianyingw/bioner | 8f62f1871497b16e0e7bd7c083f758a01657cbcc | [
"MIT"
] | 1 | 2021-08-23T14:24:33.000Z | 2021-08-23T14:24:33.000Z | bert/run_bert.py | qianyingw/pre-pico | 8f62f1871497b16e0e7bd7c083f758a01657cbcc | [
"MIT"
] | null | null | null | bert/run_bert.py | qianyingw/pre-pico | 8f62f1871497b16e0e7bd7c083f758a01657cbcc | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 28 17:02:50 2020
@author: qwang
"""
import os
os.chdir("/home/qwang/pre-pico/bert")
# import sys
# sys.path[0] = sys.path[0][:-5]
import random
import json
import torch
from torch.utils.data import DataLoader
from transformers import BertTokeniz... | 43.813869 | 142 | 0.68005 |
ad969a195cb9898c5febea88a0c73a7f0a3094fa | 6,694 | py | Python | databuilder/extractor/dashboard/tableau/tableau_external_table_extractor.py | keyko-io/nevermined-amundsen-databuilder | e48f803320e5ce16168c9ed01adee3ea4f7d51cf | [
"Apache-2.0"
] | null | null | null | databuilder/extractor/dashboard/tableau/tableau_external_table_extractor.py | keyko-io/nevermined-amundsen-databuilder | e48f803320e5ce16168c9ed01adee3ea4f7d51cf | [
"Apache-2.0"
] | null | null | null | databuilder/extractor/dashboard/tableau/tableau_external_table_extractor.py | keyko-io/nevermined-amundsen-databuilder | e48f803320e5ce16168c9ed01adee3ea4f7d51cf | [
"Apache-2.0"
] | null | null | null | import logging
from typing import Any, Dict, Iterator
from pyhocon import ConfigFactory, ConfigTree
import databuilder.extractor.dashboard.tableau.tableau_dashboard_constants as const
from databuilder import Scoped
from databuilder.extractor.base_extractor import Extractor
from databuilder.extractor.dashboard.tableau... | 47.140845 | 117 | 0.699731 |
c5df30f2fb164861ba55826e16e6b7e25a6324fb | 3,723 | py | Python | modelchimp/views/api/experiment_custom_object.py | akarsh3007/modelchimp | 1b4a53547d6835867df0d4ca7be83ea6c805c8ce | [
"BSD-2-Clause"
] | null | null | null | modelchimp/views/api/experiment_custom_object.py | akarsh3007/modelchimp | 1b4a53547d6835867df0d4ca7be83ea6c805c8ce | [
"BSD-2-Clause"
] | null | null | null | modelchimp/views/api/experiment_custom_object.py | akarsh3007/modelchimp | 1b4a53547d6835867df0d4ca7be83ea6c805c8ce | [
"BSD-2-Clause"
] | null | null | null | import re
from django.http import HttpResponse
from rest_framework import status
from rest_framework import generics, mixins, views
from rest_framework.response import Response
from modelchimp.serializers.experiment_custom_object import ExperimentCustomObjectSerializer
from modelchimp.models.experiment_custom_object... | 37.606061 | 105 | 0.681708 |
6e84941d9b1ac1dfd237fb0f091c1e0e1d0c27d6 | 16,916 | py | Python | src/dcos_e2e/_vendor/dcos_launch/platforms/arm.py | Fabs/dcos-e2e | 8836dfa5b83f9d61e92b8b4bd8b058404a3bdc20 | [
"Apache-2.0"
] | null | null | null | src/dcos_e2e/_vendor/dcos_launch/platforms/arm.py | Fabs/dcos-e2e | 8836dfa5b83f9d61e92b8b4bd8b058404a3bdc20 | [
"Apache-2.0"
] | null | null | null | src/dcos_e2e/_vendor/dcos_launch/platforms/arm.py | Fabs/dcos-e2e | 8836dfa5b83f9d61e92b8b4bd8b058404a3bdc20 | [
"Apache-2.0"
] | null | null | null | """ This module is intended to allow deploying of arbitrary Azure Resource
Manager (ARM) templates and describe the provided DC/OS cluster. For more
information on how to configure and interpret these templates, see:
https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-authoring-templates
"""
i... | 45.718919 | 115 | 0.676578 |
7f59884addfe7603506144ca1c3ca7ae9ce3d373 | 625 | py | Python | cookie_decrypter.py | 6un9-h0-Dan/PoshC2 | dd39e62421ed5efd1e895e66b8ad59f034bf6a4c | [
"BSD-3-Clause"
] | 1,504 | 2016-07-12T04:14:00.000Z | 2022-03-31T02:59:30.000Z | cookie_decrypter.py | 6un9-h0-Dan/PoshC2 | dd39e62421ed5efd1e895e66b8ad59f034bf6a4c | [
"BSD-3-Clause"
] | 139 | 2016-10-13T10:41:18.000Z | 2022-03-31T13:22:47.000Z | cookie_decrypter.py | 6un9-h0-Dan/PoshC2 | dd39e62421ed5efd1e895e66b8ad59f034bf6a4c | [
"BSD-3-Clause"
] | 377 | 2016-07-12T03:10:03.000Z | 2022-03-31T10:04:13.000Z | #!/usr/bin/env python3
from poshc2.Colours import Colours
from poshc2.server.Core import decrypt
from poshc2.server.database.DB import get_keys, database_connect
import sys, re
file = open(sys.argv[1], "r")
database_connect()
result = get_keys()
if result:
for line in file:
if re.search("SessionID", lin... | 28.409091 | 85 | 0.5792 |
ea04ad1a61f11b3cc74e5469b8a6197b5ad36a85 | 12,009 | py | Python | tests/test_expectations.py | codelover-without-talent/GPflow | 1af7b1ca7da6687974150a1440d821a106b2159d | [
"Apache-2.0"
] | 1 | 2018-10-20T03:02:50.000Z | 2018-10-20T03:02:50.000Z | tests/test_expectations.py | codelover-without-talent/GPflow | 1af7b1ca7da6687974150a1440d821a106b2159d | [
"Apache-2.0"
] | null | null | null | tests/test_expectations.py | codelover-without-talent/GPflow | 1af7b1ca7da6687974150a1440d821a106b2159d | [
"Apache-2.0"
] | 1 | 2019-01-12T23:35:26.000Z | 2019-01-12T23:35:26.000Z | # Copyright 2018 the GPflow 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... | 34.808696 | 94 | 0.691148 |
4dd1b8d9b9023b06396fda1b851e8d28b6b5d1b9 | 327 | py | Python | Python/HRL/01-Intro to Python/01_variables.py | Errrneist/Exia | d9040386089d64c67b466db99c64f786cdf625e8 | [
"Apache-2.0"
] | null | null | null | Python/HRL/01-Intro to Python/01_variables.py | Errrneist/Exia | d9040386089d64c67b466db99c64f786cdf625e8 | [
"Apache-2.0"
] | null | null | null | Python/HRL/01-Intro to Python/01_variables.py | Errrneist/Exia | d9040386089d64c67b466db99c64f786cdf625e8 | [
"Apache-2.0"
] | null | null | null | # Hongjun Wu
# 20180208
# Python test files. This file test on variable and basic calculations.
price = 8.5
weight = 7.5
money = weight * price
# 卧槽toString原来是这么写的啊
print('You need to pay this amount: ' + money.__str__())
print('Now I will give you five bucks backs.')
money -= 5
print('Now just pay: ' + money.__st... | 19.235294 | 71 | 0.700306 |
1811ab4eaae14f37e35d3b7d9342db1dd0f3339b | 3,381 | py | Python | skipp/filters/tests/tests/test_laplace.py | IntelPython/scikit-ipp | df3c595296ab2009f95b1cfe412f6bf0680d4be3 | [
"BSD-3-Clause"
] | 6 | 2021-08-24T06:49:12.000Z | 2022-03-22T11:12:06.000Z | skipp/filters/tests/tests/test_laplace.py | IntelPython/scikit-ipp | df3c595296ab2009f95b1cfe412f6bf0680d4be3 | [
"BSD-3-Clause"
] | 4 | 2020-11-17T14:54:25.000Z | 2021-03-18T08:58:15.000Z | skipp/filters/tests/tests/test_laplace.py | IntelPython/scikit-ipp | df3c595296ab2009f95b1cfe412f6bf0680d4be3 | [
"BSD-3-Clause"
] | 2 | 2020-08-25T12:09:55.000Z | 2022-03-19T12:06:18.000Z | # ******************************************************************************
# Copyright (c) 2020, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code mus... | 49 | 81 | 0.578527 |
27c4b5a2b254dbb84348676dbaa9908cce764ab4 | 22,871 | py | Python | mkt/webapps/indexers.py | ngokevin/zamboni | a33dcd489175d8e7ba1c02ee4dabb6cfdc405e69 | [
"BSD-3-Clause"
] | null | null | null | mkt/webapps/indexers.py | ngokevin/zamboni | a33dcd489175d8e7ba1c02ee4dabb6cfdc405e69 | [
"BSD-3-Clause"
] | null | null | null | mkt/webapps/indexers.py | ngokevin/zamboni | a33dcd489175d8e7ba1c02ee4dabb6cfdc405e69 | [
"BSD-3-Clause"
] | null | null | null | import sys
from operator import attrgetter
from django.conf import settings
from django.core.urlresolvers import reverse
from django.db.models import Min
from elasticsearch_dsl import F, filter as es_filter, query
import commonware.log
import amo
import mkt
from mkt.constants import APP_FEATURES
from mkt.constants.... | 41.432971 | 79 | 0.50505 |
8d150c6bcf0e26f6f91eec2f63a144fb86ae6759 | 2,503 | py | Python | includes/cisco.py | b1scuit-thi3f/jimiPlugin-remote | 915621e325df6424832a9052d47af3ee0f6b095a | [
"Apache-2.0"
] | null | null | null | includes/cisco.py | b1scuit-thi3f/jimiPlugin-remote | 915621e325df6424832a9052d47af3ee0f6b095a | [
"Apache-2.0"
] | null | null | null | includes/cisco.py | b1scuit-thi3f/jimiPlugin-remote | 915621e325df6424832a9052d47af3ee0f6b095a | [
"Apache-2.0"
] | null | null | null | import time
import re
import logging
from netmiko import ConnectHandler
from plugins.remote.includes import remote
class cisco(remote.remote):
def __init__(self, host, deviceHostname, username="Admin", password='', enablePassword="", port=22, timeout=5):
self.host = host
self.deviceHostname = dev... | 39.109375 | 196 | 0.613264 |
07b238fba3c3d48e0514e0643187d25b907bc648 | 4,360 | py | Python | app/utils.py | kindweb223/React-Django-M3U8 | ee3edfabcf4e4423e96591df7cf42f8d89813292 | [
"Apache-2.0"
] | 1 | 2020-12-28T07:54:05.000Z | 2020-12-28T07:54:05.000Z | app/utils.py | kindweb223/React-Django-M3U8 | ee3edfabcf4e4423e96591df7cf42f8d89813292 | [
"Apache-2.0"
] | 11 | 2020-06-05T17:35:01.000Z | 2022-02-26T07:00:16.000Z | app/utils.py | kindweb223/React-Django-M3U8 | ee3edfabcf4e4423e96591df7cf42f8d89813292 | [
"Apache-2.0"
] | 1 | 2021-11-02T11:35:45.000Z | 2021-11-02T11:35:45.000Z | import json
import logging
import re
import requests
from django.conf import settings
logger = logging.getLogger(__name__)
class M3U8ChannelFactory(object):
group = None
duration = None
title = None
path = None
extra_data = {}
def init_channel(self, extinf_string):
logger.info('In... | 28.874172 | 101 | 0.586468 |
d0d0e5620db0317ecc637195eadc729744f5e9ed | 5,405 | py | Python | warehouse/admin/views/banners.py | fairhopeweb/warehouse | 7d8ef742e8fe6b401190c28ce56761848041c89f | [
"Apache-2.0"
] | 3,103 | 2015-01-30T00:24:10.000Z | 2022-03-31T23:21:39.000Z | warehouse/admin/views/banners.py | fairhopeweb/warehouse | 7d8ef742e8fe6b401190c28ce56761848041c89f | [
"Apache-2.0"
] | 6,709 | 2015-01-05T01:23:20.000Z | 2022-03-31T14:49:46.000Z | warehouse/admin/views/banners.py | fairhopeweb/warehouse | 7d8ef742e8fe6b401190c28ce56761848041c89f | [
"Apache-2.0"
] | 959 | 2015-01-12T22:22:40.000Z | 2022-03-31T22:21:51.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 Li... | 29.535519 | 88 | 0.679371 |
451f5c4d89346835c58d37cd42eadd492e17d300 | 893 | py | Python | src/main.py | andresmesad09/challenge-python-01 | 188e26f938eddebc16d68d6730ad79f2c9f93a7e | [
"MIT"
] | null | null | null | src/main.py | andresmesad09/challenge-python-01 | 188e26f938eddebc16d68d6730ad79f2c9f93a7e | [
"MIT"
] | null | null | null | src/main.py | andresmesad09/challenge-python-01 | 188e26f938eddebc16d68d6730ad79f2c9f93a7e | [
"MIT"
] | 1 | 2020-07-21T04:02:47.000Z | 2020-07-21T04:02:47.000Z | # Resolve the problem!!
PALINDROMES = [
'Acaso hubo buhos aca',
'A la catalana banal atacala',
'Amar da drama',
]
NOT_PALINDROMES = [
'Hola como estas',
'Platzi'
'Oscar',
]
def is_palindrome(palindrome):
# Start coding here
word_lower = palindrome.lower()
word_strip = word_lower.... | 19 | 59 | 0.606943 |
f9ecdf663a769032384e347af9237ced758594dd | 10,600 | py | Python | openstack/tests/functional/cloud/test_identity.py | NeCTAR-RC/openstacksdk | 60a24f6c4717a1f9a0e545c9a07e68afaedc5a27 | [
"Apache-2.0"
] | 99 | 2018-03-28T15:41:45.000Z | 2022-01-23T17:22:13.000Z | openstack/tests/functional/cloud/test_identity.py | NeCTAR-RC/openstacksdk | 60a24f6c4717a1f9a0e545c9a07e68afaedc5a27 | [
"Apache-2.0"
] | 5 | 2018-05-25T16:54:23.000Z | 2021-11-21T02:27:16.000Z | openstack/tests/functional/cloud/test_identity.py | NeCTAR-RC/openstacksdk | 60a24f6c4717a1f9a0e545c9a07e68afaedc5a27 | [
"Apache-2.0"
] | 104 | 2018-04-06T14:33:54.000Z | 2022-03-01T01:58:09.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 t... | 42.231076 | 79 | 0.62717 |
baf73fab3c2dd1c31c1286ebc8b991979a6b0535 | 382 | py | Python | src/Cheese/testError.py | KubaBoi/CheeseFramework | ffe35449f43efa957bd5b30b28f61d3bf165699c | [
"MIT"
] | 2 | 2022-03-10T15:37:12.000Z | 2022-03-12T01:17:05.000Z | src/Cheese/testError.py | KubaBoi/CheeseFramework | ffe35449f43efa957bd5b30b28f61d3bf165699c | [
"MIT"
] | null | null | null | src/Cheese/testError.py | KubaBoi/CheeseFramework | ffe35449f43efa957bd5b30b28f61d3bf165699c | [
"MIT"
] | null | null | null | #cheese
class TestError(Exception):
def __init__(self, value, template, comment):
self.value = value
self.template = template
self.comment = comment
class MockError(Exception):
def __init__(self, repositoryName, methodName, argName):
self.repositoryName = repositoryName
... | 25.466667 | 60 | 0.67801 |
538ab6da279f3078b867649572d493ea6e4cd4a0 | 1,434 | py | Python | bikesharing/migrations/0047_vehicle_type_reservation_20210906_1403.py | iteratec/cykel | 10e238395b4ca2ecc9c18272305af6c27da6c640 | [
"MIT"
] | null | null | null | bikesharing/migrations/0047_vehicle_type_reservation_20210906_1403.py | iteratec/cykel | 10e238395b4ca2ecc9c18272305af6c27da6c640 | [
"MIT"
] | null | null | null | bikesharing/migrations/0047_vehicle_type_reservation_20210906_1403.py | iteratec/cykel | 10e238395b4ca2ecc9c18272305af6c27da6c640 | [
"MIT"
] | 1 | 2020-11-30T09:50:19.000Z | 2020-11-30T09:50:19.000Z | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("bikesharing", "0046_rent_remove_position_20201204_2059"),
]
operations = [
migrations.AddField(
model_name="vehicletype",
name="allow_spontaneous_rent",
... | 26.555556 | 67 | 0.511158 |
78c021a9af559006ce42e991dc55f3b0e177fa9d | 3,064 | py | Python | pcraster/pcraster-4.2.0/pcraster-4.2.0/source/pcraster_block_python/usecase.py | quanpands/wflow | b454a55e4a63556eaac3fbabd97f8a0b80901e5a | [
"MIT"
] | null | null | null | pcraster/pcraster-4.2.0/pcraster-4.2.0/source/pcraster_block_python/usecase.py | quanpands/wflow | b454a55e4a63556eaac3fbabd97f8a0b80901e5a | [
"MIT"
] | null | null | null | pcraster/pcraster-4.2.0/pcraster-4.2.0/source/pcraster_block_python/usecase.py | quanpands/wflow | b454a55e4a63556eaac3fbabd97f8a0b80901e5a | [
"MIT"
] | null | null | null | #!/usr/bin/env python2.4
from pcraster import *
from PCRasterBlock import *
nrRows = 3
nrCols = 2
cellSize = 1
west = 0.0
north = 0.0
# Use pcrasterpy for all rasters.
raster = Raster(nrRows, nrCols, cellSize, west, north)
baseElevation = REAL4RasterData(raster, 0.0)
block = createBlock(baseElevation)
originalThic... | 30.039216 | 75 | 0.725849 |
300989971702e21924f3f86b1494a6a6796bbc98 | 790 | py | Python | bot/tests/conftest.py | sh4rpy/volodya | 5165584281ddfeabe5b1e637690a6adade291524 | [
"BSD-3-Clause"
] | null | null | null | bot/tests/conftest.py | sh4rpy/volodya | 5165584281ddfeabe5b1e637690a6adade291524 | [
"BSD-3-Clause"
] | null | null | null | bot/tests/conftest.py | sh4rpy/volodya | 5165584281ddfeabe5b1e637690a6adade291524 | [
"BSD-3-Clause"
] | null | null | null | import os
import pytest
from django.conf import settings
from dotenv import load_dotenv
from users.models import TelegramUser
load_dotenv()
@pytest.fixture(scope='session')
def django_db_setup():
settings.DATABASES['default'] = {
'ENGINE': 'django.db.backends.postgresql',
'NAME': os.getenv('DB... | 23.939394 | 74 | 0.693671 |
6cea097d6f247ff42da78bf9b6e670027776a98d | 2,482 | py | Python | contrib/pyi_runtimehook.py | stashpayio/electrum-stash | a04e1fde408196e547cf80f8ce9d9391133bd865 | [
"MIT"
] | null | null | null | contrib/pyi_runtimehook.py | stashpayio/electrum-stash | a04e1fde408196e547cf80f8ce9d9391133bd865 | [
"MIT"
] | null | null | null | contrib/pyi_runtimehook.py | stashpayio/electrum-stash | a04e1fde408196e547cf80f8ce9d9391133bd865 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""PyInstaller runtime hook"""
import imp
import sys
import pkgutil
_old_find_module = imp.find_module
def _new_find_module(name, *args, **kwargs):
if name in ['lib', 'gui', 'plugins']:
return (None, name, ('', '', 5))
else:
return _old_find_module(name, *args, **kwargs... | 27.88764 | 78 | 0.637389 |
b8c3b81e718bb43af75247dc3fc71dab2334ae80 | 502 | py | Python | strings.py | ghanshyam30/python_with_mosh | f1defd8785fdec494ae9d657406cddd94771bcd6 | [
"MIT"
] | null | null | null | strings.py | ghanshyam30/python_with_mosh | f1defd8785fdec494ae9d657406cddd94771bcd6 | [
"MIT"
] | null | null | null | strings.py | ghanshyam30/python_with_mosh | f1defd8785fdec494ae9d657406cddd94771bcd6 | [
"MIT"
] | null | null | null | # STRINGS
# We can define strings using single (‘ ‘) or double (“ “) quotes.
course_title = "PYTHON FOR BEGINNERS"
# Accessing individual characters or slices
print("Expected O/P:H \nActual O/P:",course_title[3])
print("Expected O/P:S \nActual O/P:",course_title[-1])
# Slicing
print("Expected O/P:YTH \nActual O/P:",... | 38.615385 | 67 | 0.711155 |
83a3c1b76f64fffb124c60a267ee6d47ad1aa433 | 4,278 | py | Python | tests/pytests/unit/modules/test_pdbedit.py | tomdoherty/salt | f87d5d7abbf9777773c4d91fdafecb8b1a728e76 | [
"Apache-2.0"
] | 9,425 | 2015-01-01T05:59:24.000Z | 2022-03-31T20:44:05.000Z | tests/pytests/unit/modules/test_pdbedit.py | tomdoherty/salt | f87d5d7abbf9777773c4d91fdafecb8b1a728e76 | [
"Apache-2.0"
] | 33,507 | 2015-01-01T00:19:56.000Z | 2022-03-31T23:48:20.000Z | tests/pytests/unit/modules/test_pdbedit.py | tomdoherty/salt | f87d5d7abbf9777773c4d91fdafecb8b1a728e76 | [
"Apache-2.0"
] | 5,810 | 2015-01-01T19:11:45.000Z | 2022-03-31T02:37:20.000Z | from textwrap import dedent
import pytest
import salt.modules.pdbedit as pdbedit
from tests.support.mock import MagicMock, patch
@pytest.fixture(autouse=True)
def setup_loader(request):
setup_loader_modules = {pdbedit: {}}
with pytest.helpers.loader_mock(request, setup_loader_modules) as loader_mock:
... | 31 | 85 | 0.531089 |
6ec8fdaff3be970ba79864a32925ed78b62c270f | 33,638 | py | Python | pymux/layout.py | timgates42/pymux | 3f66e62b9de4b2251c7f9afad6c516dc5a30ec67 | [
"BSD-3-Clause"
] | 1,280 | 2015-04-27T03:59:31.000Z | 2018-10-25T02:35:00.000Z | pymux/layout.py | timgates42/pymux | 3f66e62b9de4b2251c7f9afad6c516dc5a30ec67 | [
"BSD-3-Clause"
] | 71 | 2015-05-19T14:37:53.000Z | 2018-09-10T09:37:26.000Z | pymux/layout.py | timgates42/pymux | 3f66e62b9de4b2251c7f9afad6c516dc5a30ec67 | [
"BSD-3-Clause"
] | 80 | 2016-01-03T18:06:55.000Z | 2018-08-27T00:57:13.000Z | # encoding: utf-8
"""
The layout engine. This builds the prompt_toolkit layout.
"""
from __future__ import unicode_literals
from prompt_toolkit.application.current import get_app
from prompt_toolkit.filters import Condition, has_focus
from prompt_toolkit.formatted_text import FormattedText, HTML
from prompt_toolkit.la... | 35.633475 | 150 | 0.579969 |
7cfd4c2dae80b92585f726933df87d32bcaeba19 | 292 | py | Python | output/models/nist_data/atomic/g_year_month/schema_instance/nistschema_sv_iv_atomic_g_year_month_max_inclusive_2_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 1 | 2021-08-14T17:59:21.000Z | 2021-08-14T17:59:21.000Z | output/models/nist_data/atomic/g_year_month/schema_instance/nistschema_sv_iv_atomic_g_year_month_max_inclusive_2_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 4 | 2020-02-12T21:30:44.000Z | 2020-04-15T20:06:46.000Z | output/models/nist_data/atomic/g_year_month/schema_instance/nistschema_sv_iv_atomic_g_year_month_max_inclusive_2_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | null | null | null | from output.models.nist_data.atomic.g_year_month.schema_instance.nistschema_sv_iv_atomic_g_year_month_max_inclusive_2_xsd.nistschema_sv_iv_atomic_g_year_month_max_inclusive_2 import NistschemaSvIvAtomicGYearMonthMaxInclusive2
__all__ = [
"NistschemaSvIvAtomicGYearMonthMaxInclusive2",
]
| 48.666667 | 225 | 0.907534 |
d61d032636d74646bfadfaf8bd4b180cb4f990f0 | 1,898 | py | Python | nuvem-parallel/nuvem/lookup.py | isabella232/nuvem | b92a21dc6d902845810a67711e25a3f6fa9fb9f3 | [
"Apache-2.0"
] | 4 | 2016-03-11T21:13:57.000Z | 2021-11-10T13:38:53.000Z | nuvem-parallel/nuvem/lookup.py | apache/nuvem | b92a21dc6d902845810a67711e25a3f6fa9fb9f3 | [
"Apache-2.0"
] | 1 | 2021-11-04T13:04:16.000Z | 2021-11-04T13:04:16.000Z | nuvem-parallel/nuvem/lookup.py | isabella232/nuvem | b92a21dc6d902845810a67711e25a3f6fa9fb9f3 | [
"Apache-2.0"
] | 9 | 2015-12-05T21:09:42.000Z | 2021-11-10T13:35:50.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... | 33.892857 | 94 | 0.612223 |
bdbac9caac2368234fa6f9c4434329f6a00d0316 | 10,610 | py | Python | configs/models/lenet.py | jamesoneill12/LayerFusion | 99cba1030ed8c012a453bc7715830fc99fb980dc | [
"Apache-2.0"
] | null | null | null | configs/models/lenet.py | jamesoneill12/LayerFusion | 99cba1030ed8c012a453bc7715830fc99fb980dc | [
"Apache-2.0"
] | null | null | null | configs/models/lenet.py | jamesoneill12/LayerFusion | 99cba1030ed8c012a453bc7715830fc99fb980dc | [
"Apache-2.0"
] | null | null | null | import argparse
import os, sys
import shutil
import time
import math
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.optim as optim
import torch.utils.data
import torch.utils.data.distributed
import torchvision.transforms as transforms
import torchvision.datasets as datasets
import torchvision... | 39.007353 | 119 | 0.637795 |
864322c2a8a04a0ba3d9f7c9146cb233ef0a9d15 | 1,531 | py | Python | tests/core/test_bitops.py | greysonDEV/SHA-256 | 512de78a7261728316f79de5be2ca8b6eddebbb6 | [
"MIT"
] | null | null | null | tests/core/test_bitops.py | greysonDEV/SHA-256 | 512de78a7261728316f79de5be2ca8b6eddebbb6 | [
"MIT"
] | null | null | null | tests/core/test_bitops.py | greysonDEV/SHA-256 | 512de78a7261728316f79de5be2ca8b6eddebbb6 | [
"MIT"
] | null | null | null | from sha256.core.bitops import binary, prepad, add, twos
def test_binary():
result = binary(0)
expected = [0]
assert result == expected
result = binary(10)
expected = [1,0,1,0]
assert result == expected
result = binary(528193)
expected = [1,0,0,0,0,0,0,0,1,1,1,1,0,1,0,0,0,0,0,1]
... | 30.62 | 84 | 0.547355 |
6961e1d83e9a66f473c0cac181bc4b1b38859c11 | 1,865 | py | Python | python/desc/twinkles/analyseICat.py | LSSTDESC/Twinkles | 86d6caebde7f965b76ded80df0a1b66254f2a866 | [
"MIT"
] | 6 | 2017-02-10T00:38:09.000Z | 2018-12-13T17:12:08.000Z | python/desc/twinkles/analyseICat.py | LSSTDESC/Twinkles | 86d6caebde7f965b76ded80df0a1b66254f2a866 | [
"MIT"
] | 101 | 2016-11-29T15:31:00.000Z | 2019-08-23T19:14:19.000Z | python/desc/twinkles/analyseICat.py | LSSTDESC/Twinkles | 86d6caebde7f965b76ded80df0a1b66254f2a866 | [
"MIT"
] | 4 | 2017-01-05T20:28:40.000Z | 2018-12-13T17:12:09.000Z | from __future__ import absolute_import, division, print_function
import pandas as pd
import numpy as np
def readPhoSimInstanceCatalog(fname,
names=['obj', 'SourceID', 'RA', 'DEC', 'MAG_NORM',\
'SED_NAME', 'REDSHIFT', 'GAMMA1',\
... | 30.080645 | 114 | 0.589812 |
08662e3756cccdb6402a64b83a1e68427c059d1f | 32,469 | py | Python | xpsi/PostProcessing/_spectrum.py | DevarshiChoudhury/xpsi | 200b82b4ef4a4e7342fc30dd03c5821cff0031c2 | [
"MIT"
] | 14 | 2019-09-26T12:08:06.000Z | 2021-05-11T15:26:10.000Z | xpsi/PostProcessing/_spectrum.py | DevarshiChoudhury/xpsi | 200b82b4ef4a4e7342fc30dd03c5821cff0031c2 | [
"MIT"
] | 13 | 2020-01-10T11:03:28.000Z | 2021-10-04T14:44:01.000Z | xpsi/PostProcessing/_spectrum.py | DevarshiChoudhury/xpsi | 200b82b4ef4a4e7342fc30dd03c5821cff0031c2 | [
"MIT"
] | 9 | 2020-03-04T13:28:05.000Z | 2021-09-28T09:00:50.000Z | from __future__ import division
from ._global_imports import *
try:
import fgivenx
except ImportError:
_warning('Cannot import fgivenx for conditional posterior contours.')
fgivenx = None
from ..tools.phase_integrator import phase_integrator
from ..tools.energy_interpolator import energy_interpolator
fro... | 38.470379 | 91 | 0.560134 |
2fb843391c823c0c9cf63109e755bf17c567e242 | 3,222 | py | Python | pacK/modul2.py | Nika1411/Laba17 | 408fd297495e199d8489617ebdf6fe10d7c04fc2 | [
"MIT"
] | null | null | null | pacK/modul2.py | Nika1411/Laba17 | 408fd297495e199d8489617ebdf6fe10d7c04fc2 | [
"MIT"
] | null | null | null | pacK/modul2.py | Nika1411/Laba17 | 408fd297495e199d8489617ebdf6fe10d7c04fc2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Вариант 14
# Создать класс Payment (зарплата). В классе должны быть представлены поля: фамилия-
# имя-отчество, оклад, год поступления на работу, процент надбавки, подоходный налог,
# количество отработанных дней в месяце, количество рабочих дней в месяце, начисленная и... | 35.8 | 120 | 0.667908 |
5bbeead3df22125db183e582d4b92a991181da8b | 35 | py | Python | vkbottle/dispatch/return_manager/__init__.py | homus32/vkbottle | 8247665ef74835abe0c2c5e5981826540d0ecdb5 | [
"MIT"
] | 698 | 2019-08-09T17:32:52.000Z | 2021-07-22T08:30:32.000Z | vkbottle/dispatch/return_manager/__init__.py | homus32/vkbottle | 8247665ef74835abe0c2c5e5981826540d0ecdb5 | [
"MIT"
] | 216 | 2019-08-18T19:22:50.000Z | 2021-07-30T12:15:17.000Z | vkbottle/dispatch/return_manager/__init__.py | homus32/vkbottle | 8247665ef74835abe0c2c5e5981826540d0ecdb5 | [
"MIT"
] | 268 | 2019-08-10T14:52:04.000Z | 2021-07-28T07:06:42.000Z | from .abc import BaseReturnManager
| 17.5 | 34 | 0.857143 |
d010d090643176a7143a847e73080106627a44af | 1,720 | py | Python | setup.py | parrondo/test | f2c88ad12e3715f002aecf54a06dc518aa9171e0 | [
"MIT"
] | null | null | null | setup.py | parrondo/test | f2c88ad12e3715f002aecf54a06dc518aa9171e0 | [
"MIT"
] | null | null | null | setup.py | parrondo/test | f2c88ad12e3715f002aecf54a06dc518aa9171e0 | [
"MIT"
] | null | null | null | import os
import re
from setuptools import setup, find_packages
regexp = re.compile(r'.*__version__ = [\'\"](.*?)[\'\"]', re.S)
base_package = 'test'
base_path = os.path.dirname(__file__)
init_file = os.path.join(base_path, 'src', 'test', '__init__.py')
with open(init_file, 'r') as f:
module_content = f.read()
... | 28.196721 | 65 | 0.589535 |
0ef7598dfc450c658627b0f48e6d6050d763d93e | 2,719 | py | Python | ch05_CNN/00_lenet.py | insaneyilin/d2l_pytorch_notes | aa607b3ff0f5e47659dc4cdbdb4d13bff630a4e4 | [
"Apache-2.0"
] | null | null | null | ch05_CNN/00_lenet.py | insaneyilin/d2l_pytorch_notes | aa607b3ff0f5e47659dc4cdbdb4d13bff630a4e4 | [
"Apache-2.0"
] | null | null | null | ch05_CNN/00_lenet.py | insaneyilin/d2l_pytorch_notes | aa607b3ff0f5e47659dc4cdbdb4d13bff630a4e4 | [
"Apache-2.0"
] | null | null | null | import os
import time
import torch
from torch import nn, optim
import sys
sys.path.append("..") # to find d2lzh_pytorch
import d2lzh_pytorch as d2l
# check device
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
print(torch.__version__)
print(device)
cl... | 33.158537 | 108 | 0.604266 |
74c87c03b633954b6407919ec06a67ec3ace61e2 | 450 | py | Python | src/data-structures/heaps/test_minHeap.py | Sunhick/csci-2270 | 2a65cf088010b2d508833700da05ed607a84d24c | [
"MIT"
] | 1 | 2017-05-04T05:01:13.000Z | 2017-05-04T05:01:13.000Z | src/data-structures/heaps/test_minHeap.py | Sunhick/csci-2270 | 2a65cf088010b2d508833700da05ed607a84d24c | [
"MIT"
] | null | null | null | src/data-structures/heaps/test_minHeap.py | Sunhick/csci-2270 | 2a65cf088010b2d508833700da05ed607a84d24c | [
"MIT"
] | null | null | null | #!/usr/bin/python3
"""
minHeaps
Pythonic implementation of Heaps
"""
__author__ = "Sunil"
__email__ = "suba5417@colorado.edu"
import unittest
from minHeap import MinHeap
class test_MinHeap(unittest.TestCase):
"""
Test heap create, delete, insert
"""
heap = None
def __init__(self):
se... | 13.636364 | 38 | 0.626667 |
493f544865cd9bfe74771a0df347ed3eb1bcf2d2 | 932 | py | Python | text/detector/utils/python_nms.py | kernelforce/invoice | 58c4e24484b3e47ed8aaf227964b372eac475227 | [
"MIT"
] | 1,017 | 2019-08-02T04:18:35.000Z | 2022-03-29T08:18:03.000Z | text/detector/utils/python_nms.py | guanshuicheng/- | 21ea131ed8680dbb1740c45d690d6ed0e3eb4798 | [
"MIT"
] | 47 | 2019-08-08T08:36:48.000Z | 2022-03-08T07:00:29.000Z | text/detector/utils/python_nms.py | guanshuicheng/- | 21ea131ed8680dbb1740c45d690d6ed0e3eb4798 | [
"MIT"
] | 300 | 2019-08-03T03:06:30.000Z | 2022-03-31T02:20:11.000Z | import numpy as np
def nms(boxes, threshold, method='Union'):
if boxes.size==0:
return np.empty((0,3))
x1 = boxes[:,0]
y1 = boxes[:,1]
x2 = boxes[:,2]
y2 = boxes[:,3]
s = boxes[:,4]
area = (x2-x1+1) * (y2-y1+1)
I = np.argsort(s)
pick = np.zeros_like(s, dtype=np.int16)
cou... | 28.242424 | 54 | 0.483906 |
c8f6a3771f8427ef7281eb590e15c5795998de56 | 514 | py | Python | chapter5/rgb_hsv_grayscale.py | vizcacha/practicalcv | 6bd8170bbb7325585811938fd35069f5e1b5605e | [
"MIT"
] | null | null | null | chapter5/rgb_hsv_grayscale.py | vizcacha/practicalcv | 6bd8170bbb7325585811938fd35069f5e1b5605e | [
"MIT"
] | null | null | null | chapter5/rgb_hsv_grayscale.py | vizcacha/practicalcv | 6bd8170bbb7325585811938fd35069f5e1b5605e | [
"MIT"
] | null | null | null | from SimpleCV import Image, Display
import time
displayObject = Display()
img = Image('starry_night.png')
print 'Initial: %s' % (img.getPixel(25, 25),)
img.save(displayObject)
time.sleep(3)
hsv = img.toHSV()
print 'HSV: %s' % (hsv.getPixel(25, 25),)
hsv.save(displayObject)
time.sleep(3)
rgb = hsv.toRGB()
pri... | 13.891892 | 48 | 0.678988 |
de4ec424d0e27b4cdaef58efb807d12a1530b565 | 2,033 | py | Python | venv/Lib/site-packages/pyrogram/raw/types/input_report_reason_geo_irrelevant.py | iamgeorgiy/heroku-userbot | 5a92417d16f8ead949d88cb38da213fc2da5d3a4 | [
"Apache-2.0"
] | null | null | null | venv/Lib/site-packages/pyrogram/raw/types/input_report_reason_geo_irrelevant.py | iamgeorgiy/heroku-userbot | 5a92417d16f8ead949d88cb38da213fc2da5d3a4 | [
"Apache-2.0"
] | null | null | null | venv/Lib/site-packages/pyrogram/raw/types/input_report_reason_geo_irrelevant.py | iamgeorgiy/heroku-userbot | 5a92417d16f8ead949d88cb38da213fc2da5d3a4 | [
"Apache-2.0"
] | null | null | null | # Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2020 Dan <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free... | 31.765625 | 103 | 0.640433 |
a8511c4934ca02239845af28e1db32dcb2c9f2e0 | 3,388 | py | Python | scripts/gha/install_prereqs_desktop.py | oliwilkinsonio/firebase-cpp-sdk | 1a2790030e92f77ad2aaa87000a1222d12dcabfc | [
"Apache-2.0"
] | 193 | 2019-03-18T16:30:43.000Z | 2022-03-30T17:39:32.000Z | scripts/gha/install_prereqs_desktop.py | oliwilkinsonio/firebase-cpp-sdk | 1a2790030e92f77ad2aaa87000a1222d12dcabfc | [
"Apache-2.0"
] | 647 | 2019-03-18T20:50:41.000Z | 2022-03-31T18:32:33.000Z | scripts/gha/install_prereqs_desktop.py | oliwilkinsonio/firebase-cpp-sdk | 1a2790030e92f77ad2aaa87000a1222d12dcabfc | [
"Apache-2.0"
] | 86 | 2019-04-21T09:40:38.000Z | 2022-03-26T20:48:37.000Z | #!/usr/bin/env python
# Copyright 2020 Google
#
# 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 agr... | 37.230769 | 95 | 0.691854 |
683c226df95cfdc762243d09f84ed53114ccc011 | 946 | py | Python | myutils.py | hiszm/credit_card_scan | c2ebde77b5e878c57e514c5c2fed72444271ad6c | [
"Xnet",
"X11"
] | null | null | null | myutils.py | hiszm/credit_card_scan | c2ebde77b5e878c57e514c5c2fed72444271ad6c | [
"Xnet",
"X11"
] | null | null | null | myutils.py | hiszm/credit_card_scan | c2ebde77b5e878c57e514c5c2fed72444271ad6c | [
"Xnet",
"X11"
] | null | null | null | import cv2
def sort_contours(cnts, method="left-to-right"):
reverse = False
i = 0
if method == "right-to-left" or method == "bottom-to-top":
reverse = True
if method == "top-to-bottom" or method == "bottom-to-top":
i = 1
# 用一个最小的矩形,把找到的形状包起来x,y,h,w
# 执行一个排序操作,得到是排序完整
boundingBoxes... | 30.516129 | 80 | 0.585624 |
a85d162629ba65d91d742e16a7a29b7a6544640d | 867 | py | Python | pyone/server.py | andromedia/addon-pyone | cf72fc27ac2267169c6c9ecf48ca3739249a51fe | [
"Apache-2.0"
] | null | null | null | pyone/server.py | andromedia/addon-pyone | cf72fc27ac2267169c6c9ecf48ca3739249a51fe | [
"Apache-2.0"
] | null | null | null | pyone/server.py | andromedia/addon-pyone | cf72fc27ac2267169c6c9ecf48ca3739249a51fe | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 www.privaz.io Valletech AB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 34.68 | 92 | 0.756632 |
3573f06c6b6a0d836950f5f5b719a700e5b4f319 | 5,890 | py | Python | Contents/Libraries/Shared/js2py/legecy_translators/translator.py | fossabot/Sub-Zero.bundle | fb2210f2fd9003b68f78f4c878f4428ec4aa0d4f | [
"MIT"
] | 1,553 | 2015-11-09T02:17:06.000Z | 2022-03-31T20:24:52.000Z | Contents/Libraries/Shared/js2py/legecy_translators/translator.py | saiterlz/Sub-Zero.bundle | 1a0bb9c3e4be84be35d46672907783363fe5a87b | [
"MIT"
] | 691 | 2015-11-05T21:32:26.000Z | 2022-03-17T10:52:45.000Z | Contents/Libraries/Shared/js2py/legecy_translators/translator.py | saiterlz/Sub-Zero.bundle | 1a0bb9c3e4be84be35d46672907783363fe5a87b | [
"MIT"
] | 162 | 2015-11-06T19:38:55.000Z | 2022-03-16T02:42:41.000Z | from flow import translate_flow
from constants import remove_constants, recover_constants
from objects import remove_objects, remove_arrays, translate_object, translate_array, set_func_translator
from functions import remove_functions, reset_inline_count
from jsparser import inject_before_lval, indent, dbg
TOP_GLOBAL ... | 38.75 | 105 | 0.662479 |
2d65ffc2d0625f7f84bf4e16e749bccacf5a1d50 | 1,613 | py | Python | umap/settings/__init__.py | sosm/umap | 7893ff1c7d943b7fb71b74dbd8a3b47b7b104ca3 | [
"WTFPL"
] | 1 | 2020-12-13T20:56:53.000Z | 2020-12-13T20:56:53.000Z | umap/settings/__init__.py | sosm/umap | 7893ff1c7d943b7fb71b74dbd8a3b47b7b104ca3 | [
"WTFPL"
] | 1 | 2020-07-11T08:38:44.000Z | 2020-07-11T08:38:44.000Z | umap/settings/__init__.py | sosm/umap | 7893ff1c7d943b7fb71b74dbd8a3b47b7b104ca3 | [
"WTFPL"
] | 3 | 2019-06-27T06:46:05.000Z | 2019-12-12T09:46:12.000Z | import imp
import os
import sys
from django.utils.termcolors import colorize
from .base import * # NOQA, default values
# Allow to override setting from any file, may be out of the PYTHONPATH,
# to make it easier for non python people.
path = os.environ.get('UMAP_SETTINGS')
if not path:
# Retrocompat
path =... | 33.604167 | 72 | 0.584005 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.