hexsha stringlengths 40 40 | size int64 1 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 239 | max_stars_repo_name stringlengths 5 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 239 | max_issues_repo_name stringlengths 5 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | 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 239 | max_forks_repo_name stringlengths 5 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 1 1.03M | avg_line_length float64 1 958k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4a0e87849519fc6c4bb8fc7c0be2f724d3b23139 | 601 | py | Python | test/lex_state_norule.py | pyarnold/ply | 98bb0e095d72c8aed9de01c15b65fa096c745ce3 | [
"Unlicense"
] | 1 | 2020-12-18T01:07:42.000Z | 2020-12-18T01:07:42.000Z | test/lex_state_norule.py | pyarnold/ply | 98bb0e095d72c8aed9de01c15b65fa096c745ce3 | [
"Unlicense"
] | null | null | null | test/lex_state_norule.py | pyarnold/ply | 98bb0e095d72c8aed9de01c15b65fa096c745ce3 | [
"Unlicense"
] | null | null | null | # lex_state_norule.py
#
# Declaration of a state for which no rules are defined
import sys
if ".." not in sys.path:
sys.path.insert(0, "..")
import ply.lex as lex
tokens = [
"PLUS",
"MINUS",
"NUMBER",
]
states = (('comment', 'exclusive'),
('example', 'exclusive'))
t_PLUS = r'\+'
t_MINUS =... | 13.659091 | 55 | 0.577371 |
4a0e880cebc522a7c347b6febf0631298ea36e5b | 2,290 | py | Python | 2019/Day3.py | dueyfinster/adventofcode | b05c271b0bb7aa6cea8d1039061a96d1a642cb7b | [
"MIT"
] | null | null | null | 2019/Day3.py | dueyfinster/adventofcode | b05c271b0bb7aa6cea8d1039061a96d1a642cb7b | [
"MIT"
] | null | null | null | 2019/Day3.py | dueyfinster/adventofcode | b05c271b0bb7aa6cea8d1039061a96d1a642cb7b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from ngu import read_file
import re
def manhattan_dist(pos):
return abs(pos[0]) + abs(pos[1])
def convert_to_coords(positions, last_pos, pos_to_calculate, distance, crossings, distances):
movement = int(re.sub("R|L|U|D", "", pos_to_calculate))
x, y = last_pos
for _ in range(0,... | 28.625 | 93 | 0.646288 |
4a0e887c11bff05cc63fa41b81253f35cd3d4db2 | 845 | py | Python | mockapi/test/urls.py | AKSharma01/mock_form | e21ac891fd0f31be37329351ca1f500b512f6251 | [
"Apache-2.0"
] | null | null | null | mockapi/test/urls.py | AKSharma01/mock_form | e21ac891fd0f31be37329351ca1f500b512f6251 | [
"Apache-2.0"
] | null | null | null | mockapi/test/urls.py | AKSharma01/mock_form | e21ac891fd0f31be37329351ca1f500b512f6251 | [
"Apache-2.0"
] | null | null | null | from flask import Flask, request, render_template, url_for
from views import *
app = Flask(__name__)
app.secret_key = "mockapi.dev"
urls = [
('/', ['GET'], Start.as_view('view')),
('/login', ['GET','POST'], Log.as_view('log_alllist')), #- Login into mockapi
('/logout', ['GET'], Logout.as_view('logout')),... | 52.8125 | 108 | 0.618935 |
4a0e88ba8dead435285dfd37b907e6397d3138b8 | 183 | py | Python | implementations/week3/money_change.py | MichelML/edx_algos_micromaster | b3e8f3030b2c6c071405d5f6d27d502b4ec177c0 | [
"MIT"
] | null | null | null | implementations/week3/money_change.py | MichelML/edx_algos_micromaster | b3e8f3030b2c6c071405d5f6d27d502b4ec177c0 | [
"MIT"
] | null | null | null | implementations/week3/money_change.py | MichelML/edx_algos_micromaster | b3e8f3030b2c6c071405d5f6d27d502b4ec177c0 | [
"MIT"
] | null | null | null | # Uses python3
import sys
def get_change(m):
fives = m % 10
return m // 10 + fives // 5 + fives % 5
if __name__ == '__main__':
m = int(input())
print(get_change(m)) | 18.3 | 44 | 0.579235 |
4a0e88da58c6223a8616883986829b83d18b704e | 466 | py | Python | setup.py | omadson/triggercmd-cli | 52392024cc5f3f00f66207b460ba7296c838964e | [
"MIT"
] | 8 | 2021-09-18T11:33:41.000Z | 2021-10-07T15:39:19.000Z | setup.py | omadson/triggercmd-cli | 52392024cc5f3f00f66207b460ba7296c838964e | [
"MIT"
] | 5 | 2021-09-22T13:27:59.000Z | 2021-10-14T14:24:43.000Z | setup.py | omadson/triggercmd-cli | 52392024cc5f3f00f66207b460ba7296c838964e | [
"MIT"
] | 3 | 2021-09-22T01:46:28.000Z | 2021-10-13T22:47:11.000Z | # -*- coding: utf-8 -*-
from setuptools import setup
setup(
name="triggercmd_cli",
version="0.1.0",
url="https://github.com/GussSoares/triggercmd-cli",
license="MIT License",
author="Gustavo Soares",
author_email="gustavo.soares.cdc@gmail.com",
keywords="triggercmd alexa echo-dot cli archli... | 29.125 | 71 | 0.693133 |
4a0e88db3c70c2762c7a660320dc245a136753ee | 6,653 | py | Python | model/densenet169/model119_val1.py | wan-h/JD-AI-Fashion-Challenge | 817f693672f418745e3a4c89a0417a3165b08130 | [
"MIT"
] | 3 | 2018-05-06T15:15:21.000Z | 2018-05-13T12:31:42.000Z | model/densenet169/model119_val1.py | wan-h/JD-AI-Fashion-Challenge | 817f693672f418745e3a4c89a0417a3165b08130 | [
"MIT"
] | null | null | null | model/densenet169/model119_val1.py | wan-h/JD-AI-Fashion-Challenge | 817f693672f418745e3a4c89a0417a3165b08130 | [
"MIT"
] | null | null | null | """
以model 4为基础,新增real crop
"""
import math
import os
import queue
import time
import keras
from keras.layers import Dense, BatchNormalization, Activation
import config
from util import data_loader
from util import keras_util
from util.keras_util import KerasModelConfig
model_config = KerasModelConfi... | 46.852113 | 121 | 0.533444 |
4a0e89cb3339f6b036a20c39f85fd70b71fe0fa3 | 1,880 | py | Python | ProgrammingProject2/tasks/task4b.py | samuelmmorse/MGSsecurity | 425621afca366244cdcdc5b991538a618d45fd12 | [
"Apache-2.0"
] | null | null | null | ProgrammingProject2/tasks/task4b.py | samuelmmorse/MGSsecurity | 425621afca366244cdcdc5b991538a618d45fd12 | [
"Apache-2.0"
] | null | null | null | ProgrammingProject2/tasks/task4b.py | samuelmmorse/MGSsecurity | 425621afca366244cdcdc5b991538a618d45fd12 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
import sys
shellcode= (
"\xeb\x29\x5b\x31\xc0\x88\x43\x09\x88\x43\x0c\x88\x43\x47\x89\x5b"
"\x48\x8d\x4b\x0a\x89\x4b\x4c\x8d\x4b\x0d\x89\x4b\x50\x89\x43\x54"
"\x8d\x4b\x48\x31\xd2\x31\xc0\xb0\x0b\xcd\x80\xe8\xd2\xff\xff\xff"
"/bin/bash*"
"-c*"
# You can modify the following command st... | 37.6 | 74 | 0.612234 |
4a0e8b034a0f6ac8cce9ab1dd9999ff83d81e3cf | 8,576 | py | Python | src/pymor/vectorarrays/block.py | lbalicki/pymor | 8de5f16499b95a48c6332449677540383548dc3e | [
"Unlicense"
] | null | null | null | src/pymor/vectorarrays/block.py | lbalicki/pymor | 8de5f16499b95a48c6332449677540383548dc3e | [
"Unlicense"
] | null | null | null | src/pymor/vectorarrays/block.py | lbalicki/pymor | 8de5f16499b95a48c6332449677540383548dc3e | [
"Unlicense"
] | 1 | 2021-03-03T15:18:24.000Z | 2021-03-03T15:18:24.000Z | # This file is part of the pyMOR project (http://www.pymor.org).
# Copyright 2013-2019 pyMOR developers and contributors. All rights reserved.
# License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
from functools import reduce
from numbers import Number
import numpy as np
from pymor.core.interf... | 36.965517 | 116 | 0.642024 |
4a0e8b07fe4418fb909aa16142e980e3c9484174 | 326 | py | Python | settings.dist.py | uguratar/pyzico | b779d590b99392df60db7c5e2df832708df9b6a2 | [
"MIT"
] | 6 | 2015-05-03T10:48:54.000Z | 2018-03-06T12:36:02.000Z | settings.dist.py | uguratar/pyzico | b779d590b99392df60db7c5e2df832708df9b6a2 | [
"MIT"
] | 1 | 2021-06-01T22:06:45.000Z | 2021-06-01T22:06:45.000Z | settings.dist.py | uguratar/pyzico | b779d590b99392df60db7c5e2df832708df9b6a2 | [
"MIT"
] | null | null | null | url = "https://iyziconnect.com/post/v1/"
delete_card_url = "https://iyziconnect.com/delete-card/v1/"
register_card_url = "https://iyziconnect.com/register-card/v1/"
bin_check_url = "https://api.iyzico.com/bin-check"
installment_url = "https://iyziconnect.com/installment/v1/"
api_id = ""
api_secret = ""
mode = "test" #... | 36.222222 | 63 | 0.726994 |
4a0e8b7da03b385c235bea5dd25866ac313be6eb | 5,476 | py | Python | at_tmp/model/FUNC/RQMT_OPT.py | zuoleilei3253/zuoleilei | e188b15a0aa4a9fde00dba15e8300e4b87973e2d | [
"Apache-2.0"
] | null | null | null | at_tmp/model/FUNC/RQMT_OPT.py | zuoleilei3253/zuoleilei | e188b15a0aa4a9fde00dba15e8300e4b87973e2d | [
"Apache-2.0"
] | null | null | null | at_tmp/model/FUNC/RQMT_OPT.py | zuoleilei3253/zuoleilei | e188b15a0aa4a9fde00dba15e8300e4b87973e2d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2018/7/16 17:11
# @Author : bxf
# @File : RQMT_OPT.py
# @Software: PyCharm
from model.util.TMP_PAGINATOR import *
from model.util.PUB_RESP import *
from model.util.newID import *
class RQMT_OPT:
def get_lists(self, data,token):
... | 43.808 | 179 | 0.570489 |
4a0e8b875254803e78ddfd75c2193811476d9d21 | 4,477 | py | Python | agpy/mpfit/oldtests/mpfit_vs_scipy.py | keflavich/agpy | fb3a42d9909b7cd1ba74247530bcc8742f5aaeb1 | [
"MIT"
] | 16 | 2015-05-08T11:14:26.000Z | 2021-11-19T19:05:16.000Z | agpy/mpfit/oldtests/mpfit_vs_scipy.py | keflavich/agpy | fb3a42d9909b7cd1ba74247530bcc8742f5aaeb1 | [
"MIT"
] | 3 | 2016-05-12T16:27:14.000Z | 2020-12-27T01:14:24.000Z | agpy/mpfit/oldtests/mpfit_vs_scipy.py | keflavich/agpy | fb3a42d9909b7cd1ba74247530bcc8742f5aaeb1 | [
"MIT"
] | 19 | 2015-03-30T22:34:14.000Z | 2020-11-25T23:29:53.000Z | """
Compare speed and fit quality for a few cases using mpfit and scipy.optimize.leastsq
"""
from agpy.mpfit import mpfit
from agpy.timer import print_timing
from scipy.optimize import leastsq
import scipy.optimize
import numpy as np
import timeit
def gaussian(x,A,dx,w, return_components=False):
"""
Returns a... | 31.528169 | 118 | 0.649542 |
4a0e8e3bebbf9b23526aabc95ae7bbcd0dbde3a0 | 6,359 | py | Python | calculations.py | BenTimor/Sidur | 2deb619b683043447d25abb6e0421a7cc5869b88 | [
"MIT"
] | 1 | 2020-12-07T05:43:17.000Z | 2020-12-07T05:43:17.000Z | calculations.py | BenTimor/Sidur | 2deb619b683043447d25abb6e0421a7cc5869b88 | [
"MIT"
] | null | null | null | calculations.py | BenTimor/Sidur | 2deb619b683043447d25abb6e0421a7cc5869b88 | [
"MIT"
] | null | null | null | from typing import List
from .schedule import *
from random import shuffle
from . import config
def embedding(schedule: Schedule, employees: List[Employee]):
"""
Embedding all of the employees into the schedule
:param schedule: The schedule
:param employees: The employees
"""
# Embedding the pr... | 39.993711 | 165 | 0.590344 |
4a0e8eda57315939710ecdb13175ce70149df7b0 | 7,365 | py | Python | tests/ozpcenter_api/test_api_custom_field.py | emosher/ozp-backend | d31d00bb8a28a8d0c999813f616b398f41516244 | [
"Apache-2.0"
] | 1 | 2018-10-05T17:03:01.000Z | 2018-10-05T17:03:01.000Z | tests/ozpcenter_api/test_api_custom_field.py | emosher/ozp-backend | d31d00bb8a28a8d0c999813f616b398f41516244 | [
"Apache-2.0"
] | 1 | 2017-01-06T19:20:32.000Z | 2017-01-06T19:20:32.000Z | tests/ozpcenter_api/test_api_custom_field.py | emosher/ozp-backend | d31d00bb8a28a8d0c999813f616b398f41516244 | [
"Apache-2.0"
] | 7 | 2016-12-16T15:42:05.000Z | 2020-09-05T01:11:27.000Z | import pytest
from django.test import override_settings
from rest_framework import status
from ozpcenter.models import CustomField
from tests.cases import APITestCase, ModelAssertionsMixin
from tests.ozpcenter_api import fixtures
from ozpcenter.api.custom_field.model_access import get_custom_field_by_id
@pytest.mark.i... | 37.385787 | 102 | 0.712559 |
4a0e8ef005ac34abcab87222f7c3cefc22b75de1 | 19,794 | py | Python | python/paddle/fluid/contrib/slim/graph/graph_wrapper.py | Sand3r-/Paddle | 1217a521554d63caa1381b8716910d0268dfc22d | [
"Apache-2.0"
] | 2 | 2017-05-15T06:52:18.000Z | 2017-06-13T11:55:11.000Z | python/paddle/fluid/contrib/slim/graph/graph_wrapper.py | MaJun-cn/Paddle | 0ec3a42e9740a5f5066053bb49a923d538eba24a | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/contrib/slim/graph/graph_wrapper.py | MaJun-cn/Paddle | 0ec3a42e9740a5f5066053bb49a923d538eba24a | [
"Apache-2.0"
] | 4 | 2020-07-27T13:24:03.000Z | 2020-08-06T08:20:32.000Z | # Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 33.893836 | 123 | 0.566535 |
4a0e9050abe9ad6bb92a44d0cb025ee7289a679e | 1,042 | py | Python | cobang/logging.py | php1301/CoBang | b1c7f1fb72233c58dca5b10084939a528c4cb61c | [
"Apache-2.0"
] | 1 | 2020-05-29T10:14:41.000Z | 2020-05-29T10:14:41.000Z | cobang/logging.py | php1301/CoBang | b1c7f1fb72233c58dca5b10084939a528c4cb61c | [
"Apache-2.0"
] | null | null | null | cobang/logging.py | php1301/CoBang | b1c7f1fb72233c58dca5b10084939a528c4cb61c | [
"Apache-2.0"
] | null | null | null |
import gi
import logbook
from logbook.handlers import Handler, StringFormatterHandlerMixin
gi.require_version('GLib', '2.0')
from gi.repository import GLib
from .consts import SHORT_NAME
LOGBOOK_LEVEL_TO_GLIB = {
logbook.DEBUG: GLib.LogLevelFlags.LEVEL_DEBUG,
logbook.INFO: GLib.LogLevelFlags.LEVEL_INFO,
... | 28.162162 | 102 | 0.742802 |
4a0e91274f286a29dfd4ab19a5fe02704bc41a19 | 5,226 | py | Python | test_image.py | tian961214/RFB_ESRGAN-PyTorch | 0104e8e9b172065e94ac07bf65d9bb9a1898425e | [
"Apache-2.0"
] | 1 | 2021-05-27T06:41:43.000Z | 2021-05-27T06:41:43.000Z | test_image.py | tian961214/RFB_ESRGAN-PyTorch | 0104e8e9b172065e94ac07bf65d9bb9a1898425e | [
"Apache-2.0"
] | null | null | null | test_image.py | tian961214/RFB_ESRGAN-PyTorch | 0104e8e9b172065e94ac07bf65d9bb9a1898425e | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Dakewe Biotech Corporation. All Rights Reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | 37.597122 | 138 | 0.628396 |
4a0e916f8c42b9aa380c98113c51696165544c4a | 9,990 | py | Python | AO3/series.py | gf0507033/ao3_api | 675efd41c66812265bb6cfe4bfc6dde8c1db5bd2 | [
"MIT"
] | null | null | null | AO3/series.py | gf0507033/ao3_api | 675efd41c66812265bb6cfe4bfc6dde8c1db5bd2 | [
"MIT"
] | null | null | null | AO3/series.py | gf0507033/ao3_api | 675efd41c66812265bb6cfe4bfc6dde8c1db5bd2 | [
"MIT"
] | null | null | null | from datetime import date
from cached_property import cached_property
from bs4 import BeautifulSoup
from . import threadable, utils
from .requester import requester
from .users import User
from .works import Work
class Series:
def __init__(self, seriesid, session=None, load=True):
"""Creates a new serie... | 34.93007 | 117 | 0.536537 |
4a0e917a04c793844b63ee797ce514f689386ae6 | 2,572 | py | Python | KD_Lib/KD/vision/attention/attention.py | PiaCuk/KD_Lib | 153299d484e4c6b33793749709dbb0f33419f190 | [
"MIT"
] | 360 | 2020-05-11T08:18:20.000Z | 2022-03-31T01:48:43.000Z | KD_Lib/KD/vision/attention/attention.py | PiaCuk/KD_Lib | 153299d484e4c6b33793749709dbb0f33419f190 | [
"MIT"
] | 91 | 2020-05-11T08:14:56.000Z | 2022-03-30T05:29:03.000Z | KD_Lib/KD/vision/attention/attention.py | PiaCuk/KD_Lib | 153299d484e4c6b33793749709dbb0f33419f190 | [
"MIT"
] | 39 | 2020-05-11T08:06:47.000Z | 2022-03-29T05:11:18.000Z | import torch.nn.functional as F
from KD_Lib.KD.common import BaseClass
from .loss_metric import ATLoss
class Attention(BaseClass):
"""
Implementation of attention-based Knowledge distillation from the paper "Paying More
Attention To The Attention - Improving the Performance of CNNs via Attention Transfer... | 35.232877 | 90 | 0.650855 |
4a0e922a7e7c541445b87ed9862fe3ab7a8d2b97 | 4,067 | py | Python | Algorithm.Python/FutureOptionBuySellCallIntradayRegressionAlgorithm.py | szymanskilukasz/Lean | fe2ac131af2d0614494e5c970a57d4b7c89d5f88 | [
"Apache-2.0"
] | 3 | 2021-02-18T08:06:35.000Z | 2021-02-23T17:12:47.000Z | Algorithm.Python/FutureOptionBuySellCallIntradayRegressionAlgorithm.py | szymanskilukasz/Lean | fe2ac131af2d0614494e5c970a57d4b7c89d5f88 | [
"Apache-2.0"
] | 1 | 2021-02-22T21:03:27.000Z | 2021-02-23T19:01:04.000Z | Algorithm.Python/FutureOptionBuySellCallIntradayRegressionAlgorithm.py | szymanskilukasz/Lean | fe2ac131af2d0614494e5c970a57d4b7c89d5f88 | [
"Apache-2.0"
] | 1 | 2021-03-12T05:22:15.000Z | 2021-03-12T05:22:15.000Z | # QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
#
# 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 Licen... | 44.206522 | 297 | 0.703221 |
4a0e9362beed4d61daebdf89b0fe1d4a6388d312 | 625 | py | Python | hc/accounts/migrations/0009_auto_20180702_0510.py | andela/hc-wits-kla | ce14d6841c31b525ed8aec42b283ebe5db7cc3f8 | [
"BSD-3-Clause"
] | null | null | null | hc/accounts/migrations/0009_auto_20180702_0510.py | andela/hc-wits-kla | ce14d6841c31b525ed8aec42b283ebe5db7cc3f8 | [
"BSD-3-Clause"
] | 33 | 2018-06-21T06:05:39.000Z | 2021-12-13T19:47:43.000Z | hc/accounts/migrations/0009_auto_20180702_0510.py | andela/hc-wits-kla | ce14d6841c31b525ed8aec42b283ebe5db7cc3f8 | [
"BSD-3-Clause"
] | 2 | 2018-07-12T18:18:09.000Z | 2021-12-22T11:21:19.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2018-07-02 05:10
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0026_auto_20160415_1824'),
('accounts', '0008_auto_20180630_1451'),
]
... | 24.038462 | 68 | 0.5968 |
4a0e93c30d799b1ef207d5cddfd8796f4cb62ee8 | 3,805 | py | Python | python/GafferUI/NodeUI.py | cwmartin/gaffer | 1f8a0f75522105c9d5efefac6d55cb61c1038909 | [
"BSD-3-Clause"
] | null | null | null | python/GafferUI/NodeUI.py | cwmartin/gaffer | 1f8a0f75522105c9d5efefac6d55cb61c1038909 | [
"BSD-3-Clause"
] | null | null | null | python/GafferUI/NodeUI.py | cwmartin/gaffer | 1f8a0f75522105c9d5efefac6d55cb61c1038909 | [
"BSD-3-Clause"
] | null | null | null | ##########################################################################
#
# Copyright (c) 2011-2012, John Haddon. All rights reserved.
# Copyright (c) 2011-2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted prov... | 34.279279 | 82 | 0.705388 |
4a0e942b39392b31e2e99d0b97c0b65ea97a60a2 | 8,214 | py | Python | test/test_scheduler.py | skybrush-io/flockwave-async | 242055f551966dde9b035ff87ed10ed52f6cdf26 | [
"MIT"
] | null | null | null | test/test_scheduler.py | skybrush-io/flockwave-async | 242055f551966dde9b035ff87ed10ed52f6cdf26 | [
"MIT"
] | null | null | null | test/test_scheduler.py | skybrush-io/flockwave-async | 242055f551966dde9b035ff87ed10ed52f6cdf26 | [
"MIT"
] | null | null | null | from pytest import deprecated_call, raises
from time import time
from trio import sleep
from typing import Optional
from flockwave.concurrency.scheduler import JobCancelled, LateSubmissionError, Scheduler
class Task:
def __init__(self, result: int = 0, *, error: Optional[str] = None):
self._result = resu... | 28.620209 | 88 | 0.704407 |
4a0e942e203d7f01921c7653bdde96c6978035bd | 323 | py | Python | src/boot.py | overdone/climate_control | 932db9a7d22322042c5fb8b2a8afebea4e197c2c | [
"MIT"
] | null | null | null | src/boot.py | overdone/climate_control | 932db9a7d22322042c5fb8b2a8afebea4e197c2c | [
"MIT"
] | null | null | null | src/boot.py | overdone/climate_control | 932db9a7d22322042c5fb8b2a8afebea4e197c2c | [
"MIT"
] | null | null | null | import network
import gc
import settings
gc.collect()
def do_wifi_connect():
sta_if = network.WLAN(network.STA_IF)
if not sta_if.isconnected():
sta_if.active(True)
sta_if.connect(settings.WIFI_SID, settings.WIFI_PASS)
while not sta_if.isconnected():
pass
do_wifi_connect... | 17 | 61 | 0.681115 |
4a0e95186e815e34d814047ed69c171c3f52252b | 2,750 | py | Python | camviz/objects/object.py | TRI-ML/camviz | ba1d8b92dff2ae01616c999739eca3e507434f4f | [
"MIT"
] | 30 | 2021-12-13T21:26:22.000Z | 2022-03-15T16:11:59.000Z | camviz/objects/object.py | TRI-ML/camviz | ba1d8b92dff2ae01616c999739eca3e507434f4f | [
"MIT"
] | 4 | 2021-12-14T15:23:51.000Z | 2022-02-17T07:51:59.000Z | camviz/objects/object.py | TRI-ML/camviz | ba1d8b92dff2ae01616c999739eca3e507434f4f | [
"MIT"
] | 1 | 2021-12-23T07:38:30.000Z | 2021-12-23T07:38:30.000Z | # Copyright 2021 Toyota Research Institute. All rights reserved.
from OpenGL.GL import *
from camviz.objects.pose import Pose
class Object:
"""
Base object draw class
Parameters
----------
scale : float
Scale used when drawing the object
pose : np.array
Object pose
"""
... | 24.553571 | 77 | 0.566182 |
4a0e952aa1a65f16885e00e613c8c65ae3d69087 | 828 | py | Python | ASLServerDjango/mysite/polls/migrations/0021_news.py | Plusers/ASLServerDjango | da03aa6ec53e1f72d320e94ecabba1569c5e9a75 | [
"MIT"
] | 1 | 2019-10-11T20:14:18.000Z | 2019-10-11T20:14:18.000Z | ASLServerDjango/mysite/polls/migrations/0021_news.py | Plusers/ASLServerDjango | da03aa6ec53e1f72d320e94ecabba1569c5e9a75 | [
"MIT"
] | null | null | null | ASLServerDjango/mysite/polls/migrations/0021_news.py | Plusers/ASLServerDjango | da03aa6ec53e1f72d320e94ecabba1569c5e9a75 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.9 on 2019-03-26 20:03
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('polls', '0020_auto_20190326_2002'),
]
operations = [
migrations.CreateModel... | 33.12 | 114 | 0.619565 |
4a0e956c96bf4e207e82f09a26612b707aa60355 | 1,573 | py | Python | fitshelper/utils.py | philrosenfield/fitshelper | 492e5b533fbe4069efbf0849fa6cf71fee76abcd | [
"MIT"
] | null | null | null | fitshelper/utils.py | philrosenfield/fitshelper | 492e5b533fbe4069efbf0849fa6cf71fee76abcd | [
"MIT"
] | null | null | null | fitshelper/utils.py | philrosenfield/fitshelper | 492e5b533fbe4069efbf0849fa6cf71fee76abcd | [
"MIT"
] | null | null | null | """Common Utilities"""
def replace_all(text, dic):
"""perfrom text.replace(key, value) for all keys and values in dic"""
for old, new in dic.items():
text = text.replace(old, new)
return text
def center_from_simbad(target):
"""Query Simbad for the coordinates of a target."""
from astroque... | 28.6 | 77 | 0.557533 |
4a0e96904a2add41f4e0306c9d32af89a677aea9 | 1,193 | py | Python | tests/test_it.py | ljocha/anncolvar | 44daeba1d21b6b7225e8ba6d097245a97f6c8a43 | [
"MIT"
] | 8 | 2018-07-17T09:50:13.000Z | 2021-12-25T07:20:00.000Z | tests/test_it.py | ljocha/anncolvar | 44daeba1d21b6b7225e8ba6d097245a97f6c8a43 | [
"MIT"
] | 6 | 2018-11-27T12:44:28.000Z | 2021-10-10T19:22:59.000Z | tests/test_it.py | ljocha/anncolvar | 44daeba1d21b6b7225e8ba6d097245a97f6c8a43 | [
"MIT"
] | 7 | 2018-11-15T01:08:33.000Z | 2021-12-10T15:53:19.000Z | import pytest
import mdtraj as md
import numpy as np
import keras as krs
import argparse as arg
import datetime as dt
import sys
import os
import anncolvar
def test_it():
myinfilename = os.path.join(os.path.dirname(__file__), 'traj_fit.xtc')
myintopname = os.path.join(os.path.dirname(__file__), 'reference.pdb')
... | 38.483871 | 118 | 0.551551 |
4a0e96fb4395cc528d2c790b1d05dfd13086d041 | 561 | py | Python | bin/sam2pairs.py | PavriLab/hicer-nf | ec726f48511aaa4797743103fa24b4db5a7aeefa | [
"MIT"
] | null | null | null | bin/sam2pairs.py | PavriLab/hicer-nf | ec726f48511aaa4797743103fa24b4db5a7aeefa | [
"MIT"
] | 2 | 2021-01-14T13:01:17.000Z | 2021-09-27T13:43:58.000Z | bin/sam2pairs.py | PavriLab/hicer-nf | ec726f48511aaa4797743103fa24b4db5a7aeefa | [
"MIT"
] | 1 | 2021-01-20T17:07:22.000Z | 2021-01-20T17:07:22.000Z | #!/usr/bin/env python
import argparse as ap
import pysam as ps
import logging
logging.basicConfig(format='%(asctime)s - %(message)s', level=logging.INFO)
parser = ap.ArgumentParser()
parser.add_argument('pairedSam',
help = 'paired SAM file')
args = parser.parse_args()
with ps.AlignmentFile(args.p... | 28.05 | 75 | 0.607843 |
4a0e97b414fec292cca9421462383c229d53a947 | 5,403 | py | Python | antlir/compiler/requires_provides.py | facebookincubator/fs_image | 3515a24bb0e93176a5584bdc8839464fa28390d7 | [
"MIT"
] | 9 | 2019-12-02T20:17:35.000Z | 2020-06-13T16:34:25.000Z | antlir/compiler/requires_provides.py | facebookincubator/fs_image | 3515a24bb0e93176a5584bdc8839464fa28390d7 | [
"MIT"
] | 19 | 2019-11-22T23:30:04.000Z | 2020-07-16T18:05:48.000Z | antlir/compiler/requires_provides.py | facebookincubator/fs_image | 3515a24bb0e93176a5584bdc8839464fa28390d7 | [
"MIT"
] | 4 | 2019-12-04T19:03:28.000Z | 2020-06-13T16:34:29.000Z | #!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
'''
Images are composed of a bunch of Items. These are declared by the user
in an order-independent fashion, but they... | 30.353933 | 78 | 0.719785 |
4a0e97d47e68a0679bcdf8ee166f3b80139634a3 | 7,361 | py | Python | python_examples/examples/databases/readme_beanie_example.py | BurnySc2/tools | f2b0f4450fb30cff61d390b222f561c26fd2324b | [
"MIT"
] | null | null | null | python_examples/examples/databases/readme_beanie_example.py | BurnySc2/tools | f2b0f4450fb30cff61d390b222f561c26fd2324b | [
"MIT"
] | 10 | 2021-12-22T19:48:26.000Z | 2022-03-31T13:22:47.000Z | python_examples/examples/databases/readme_beanie_example.py | BurnySc2/tools | f2b0f4450fb30cff61d390b222f561c26fd2324b | [
"MIT"
] | null | null | null | """
https://github.com/roman-right/beanie/
https://roman-right.github.io/beanie/
MongoDB GUI Interface: Robo 3T
"""
import asyncio
import sys
from typing import ForwardRef, List
import motor
from beanie import Document, init_beanie
from beanie.odm.operators.update.general import Set
from loguru import logger
from pyda... | 34.237209 | 156 | 0.685641 |
4a0e981d3f4334808d6e47286af28f91d922800d | 11,220 | py | Python | couchbase_core/analytics.py | dfresh613/couchbase-python-client | c77af56490ed4c6d364fcf8fc1a374570de0239b | [
"Apache-2.0"
] | 1 | 2021-04-22T14:46:06.000Z | 2021-04-22T14:46:06.000Z | couchbase_core/analytics.py | dfresh613/couchbase-python-client | c77af56490ed4c6d364fcf8fc1a374570de0239b | [
"Apache-2.0"
] | 3 | 2021-04-19T14:57:20.000Z | 2021-05-14T12:29:50.000Z | couchbase_core/analytics.py | dfresh613/couchbase-python-client | c77af56490ed4c6d364fcf8fc1a374570de0239b | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2017, Couchbase, 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 required by applicable l... | 38.689655 | 118 | 0.61934 |
4a0e9833c0214f86eddba984c7f219d3e67cddeb | 5,169 | py | Python | widgets/Ticker.py | iubica/wx-portfolio | 12101986db72bcaffd9b744d514d6f9f651ad5a1 | [
"MIT"
] | 3 | 2018-03-19T07:57:10.000Z | 2021-07-05T08:55:14.000Z | widgets/Ticker.py | iubica/wx-portfolio | 12101986db72bcaffd9b744d514d6f9f651ad5a1 | [
"MIT"
] | 6 | 2020-03-24T15:40:18.000Z | 2021-12-13T19:46:09.000Z | widgets/Ticker.py | iubica/wx-portfolio | 12101986db72bcaffd9b744d514d6f9f651ad5a1 | [
"MIT"
] | 4 | 2018-03-29T21:59:55.000Z | 2019-12-16T14:56:38.000Z | #!/usr/bin/env python
import wx
from wx.lib.ticker import Ticker
import wx.lib.colourselect as csel #for easy color selection
#----------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self,... | 34.925676 | 88 | 0.609015 |
4a0e9a61c773c9d67f7e32efbe6d8e7fecec1e0e | 6,846 | py | Python | src/nmap_scripts.py | secdec/ADAPT | f9bd149b321830588df47e06b8b8e1db07ea9d7a | [
"Apache-2.0"
] | 183 | 2018-09-18T20:44:31.000Z | 2021-11-09T11:20:14.000Z | src/nmap_scripts.py | secdec/ADAPT | f9bd149b321830588df47e06b8b8e1db07ea9d7a | [
"Apache-2.0"
] | 11 | 2019-01-30T17:21:38.000Z | 2021-01-17T23:33:47.000Z | src/nmap_scripts.py | secdec/ADAPT | f9bd149b321830588df47e06b8b8e1db07ea9d7a | [
"Apache-2.0"
] | 49 | 2018-09-21T21:18:43.000Z | 2022-03-10T12:47:04.000Z | #
# Automated Dynamic Application Penetration Testing (ADAPT)
#
# Copyright (C) 2018 Applied Visions - http://securedecisions.com
#
# Written by Siege Technologies - http://www.siegetechnologies.com/
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... | 47.213793 | 118 | 0.693982 |
4a0e9b291df7fa79b69f078f0de0c1d9ef76e8cd | 3,178 | py | Python | Data-Preprocessing/code.py | Pannu22/ga-learner-dsmp-repo | b36777df3a91e48e5bf8e484f42ddbed98754728 | [
"MIT"
] | null | null | null | Data-Preprocessing/code.py | Pannu22/ga-learner-dsmp-repo | b36777df3a91e48e5bf8e484f42ddbed98754728 | [
"MIT"
] | null | null | null | Data-Preprocessing/code.py | Pannu22/ga-learner-dsmp-repo | b36777df3a91e48e5bf8e484f42ddbed98754728 | [
"MIT"
] | null | null | null | # --------------
#Importing header files
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
#Code starts here
data = pd.read_csv(path)
#Plotting Histogram
data['Rating'].hist()
data = data[data['Rating']<=5]
data['Rating'].hist()
#Code ends here
# --------------
# code starts here
# Finding ... | 23.716418 | 90 | 0.684078 |
4a0e9b79e9b5b4ca5f82826061f422ac6807068f | 40,666 | py | Python | scripts/mgear/rigbits/facial_rigger/lips_rigger.py | stormstudios/rigbits | 37ce738952a3cd31ba8a18b8989f5ea491d03bf0 | [
"MIT"
] | 1 | 2020-08-11T01:17:19.000Z | 2020-08-11T01:17:19.000Z | scripts/mgear/rigbits/facial_rigger/lips_rigger.py | stormstudios/rigbits | 37ce738952a3cd31ba8a18b8989f5ea491d03bf0 | [
"MIT"
] | null | null | null | scripts/mgear/rigbits/facial_rigger/lips_rigger.py | stormstudios/rigbits | 37ce738952a3cd31ba8a18b8989f5ea491d03bf0 | [
"MIT"
] | null | null | null | """Rigbits lips rigger tool"""
import json
from functools import partial
import mgear.core.pyqt as gqt
import pymel.core as pm
from maya.app.general.mayaMixin import MayaQWidgetDockableMixin
from mgear.vendor.Qt import QtCore, QtWidgets
from pymel.core import datatypes
from mgear import rigbits
from mgear.core impor... | 37.934701 | 79 | 0.533394 |
4a0e9b9b2c7af5893ba59ed51d26348f82c9d88c | 2,786 | py | Python | main.py | Yar59/NPC_Generator | f49aa2d04e36c3a36377a9b62b0e9449b5aa9f23 | [
"MIT"
] | null | null | null | main.py | Yar59/NPC_Generator | f49aa2d04e36c3a36377a9b62b0e9449b5aa9f23 | [
"MIT"
] | null | null | null | main.py | Yar59/NPC_Generator | f49aa2d04e36c3a36377a9b62b0e9449b5aa9f23 | [
"MIT"
] | null | null | null | from faker import Faker
from file_operations import render_template
import random
NUMBER_OF_CARDS = 10
fake = Faker("ru_RU")
SKILLS = ["Стремительный прыжок",
"Электрический выстрел",
"Ледяной удар",
"Стремительный удар",
"Кислотный взгляд",
"Тайный побег",
... | 33.97561 | 71 | 0.416009 |
4a0e9ca537e55a269872ae3c75cdac62b45c71ca | 5,377 | py | Python | soap/shell/utils.py | gitter-badger/soap | 4f5eb7848e4dc516a6ff972db5c8c46ec9037c47 | [
"MIT"
] | 22 | 2016-02-08T16:57:30.000Z | 2021-03-12T20:32:06.000Z | soap/shell/utils.py | gitter-badger/soap | 4f5eb7848e4dc516a6ff972db5c8c46ec9037c47 | [
"MIT"
] | 1 | 2018-07-11T21:21:27.000Z | 2018-07-17T19:53:19.000Z | soap/shell/utils.py | gitter-badger/soap | 4f5eb7848e4dc516a6ff972db5c8c46ec9037c47 | [
"MIT"
] | 6 | 2016-02-01T13:30:56.000Z | 2018-11-28T04:35:27.000Z | import csv
import os
import random
import time
from soap import logger
from soap.analysis import frontier as analysis_frontier, Plot
from soap.context import context
from soap.expression import is_expression
from soap.parser import parse as _parse
from soap.program.generator import generate_function
from soap.semantic... | 31.080925 | 77 | 0.612237 |
4a0e9e8734fac4f422655e522f6ca590f0cefb0c | 151 | py | Python | StickyDJ-Bot/src/clients/config.py | JCab09/StickyDJ-Bot | feaf2229a6729be6ad022f9105da19192e3a91d3 | [
"WTFPL"
] | null | null | null | StickyDJ-Bot/src/clients/config.py | JCab09/StickyDJ-Bot | feaf2229a6729be6ad022f9105da19192e3a91d3 | [
"WTFPL"
] | null | null | null | StickyDJ-Bot/src/clients/config.py | JCab09/StickyDJ-Bot | feaf2229a6729be6ad022f9105da19192e3a91d3 | [
"WTFPL"
] | null | null | null | #!/usr/bin/env python3
"""Base-Client configloader
So far Obsolete due to configmaker-module
in ../src/util/configmaker.py
Author: Jason Cabezuela
""" | 21.571429 | 41 | 0.761589 |
4a0e9f22058f068a9bd0c1f19c9af26c9b689452 | 345 | py | Python | cryptopals/set1/1.py | diofeher/ctf-writeups | b82eaae064fe5339c69892dd084e0f1915ca8bb5 | [
"MIT"
] | 8 | 2018-12-30T06:49:29.000Z | 2021-06-30T22:37:54.000Z | cryptopals/set1/1.py | diofeher/ctf-writeups | b82eaae064fe5339c69892dd084e0f1915ca8bb5 | [
"MIT"
] | null | null | null | cryptopals/set1/1.py | diofeher/ctf-writeups | b82eaae064fe5339c69892dd084e0f1915ca8bb5 | [
"MIT"
] | 2 | 2020-03-10T11:04:54.000Z | 2020-10-13T12:34:16.000Z | import base64
def hex_to_b64(text):
hx = text.decode('hex')
return base64.b64encode(hx)
st = '49276d206b696c6c696e6720796f757220627261696e206c696b65206120706f69736f6e6f7573206d757368726f6f6d'
# I'm killing your brain like a poisonous mushroom
assert hex_to_b64(st) == 'SSdtIGtpbGxpbmcgeW91ciBicmFpbiBsaWtlIGEgc... | 34.5 | 103 | 0.831884 |
4a0e9f46414a8d463bcdffa28f734a17d3413cbe | 207 | py | Python | regtests/bench/recursive_fib.py | secureosv/pythia | 459f9e2bc0bb2da57e9fa8326697d9ef3386883a | [
"BSD-3-Clause"
] | 17 | 2015-12-13T23:11:31.000Z | 2020-07-19T00:40:18.000Z | regtests/bench/recursive_fib.py | secureosv/pythia | 459f9e2bc0bb2da57e9fa8326697d9ef3386883a | [
"BSD-3-Clause"
] | 8 | 2016-02-22T19:42:56.000Z | 2016-07-13T10:58:04.000Z | regtests/bench/recursive_fib.py | secureosv/pythia | 459f9e2bc0bb2da57e9fa8326697d9ef3386883a | [
"BSD-3-Clause"
] | 3 | 2016-04-11T20:34:31.000Z | 2021-03-12T10:33:02.000Z | '''
Fibonacci Sequence
'''
from time import clock
def F(n):
if n == 0: return 0
elif n == 1: return 1
else: return F(n-1)+F(n-2)
def main():
start = clock()
a = F( 32 )
print(clock()-start)
main() | 11.5 | 27 | 0.584541 |
4a0e9f94844fff257b98f6c35f270e0df0fc5e8b | 19,188 | py | Python | tf/fabric.py | gitter-badger/text-fabric | ac614e490d0779a6ad89dbf30b697cd6e736bd57 | [
"MIT"
] | null | null | null | tf/fabric.py | gitter-badger/text-fabric | ac614e490d0779a6ad89dbf30b697cd6e736bd57 | [
"MIT"
] | null | null | null | tf/fabric.py | gitter-badger/text-fabric | ac614e490d0779a6ad89dbf30b697cd6e736bd57 | [
"MIT"
] | 1 | 2020-01-22T13:13:30.000Z | 2020-01-22T13:13:30.000Z | import os
import collections
from .parameters import VERSION, NAME, APIREF, LOCATIONS
from .core.data import Data, WARP, WARP2_DEFAULT, MEM_MSG
from .core.helpers import (
itemize, setDir, expandDir, collectFormats, cleanName, check32, console, makeExamples
)
from .core.timestamp import Timestamp
from .core.prepare... | 32.522034 | 98 | 0.58547 |
4a0e9fe301533dab87d6a69aca096e0f0f61a66e | 1,003 | py | Python | Live/sprites/__base.py | Pawel095/PJ_Pygame_Prezentacja | f6ace78c2df504a262eac6b1ae46d458939dd0c0 | [
"MIT"
] | null | null | null | Live/sprites/__base.py | Pawel095/PJ_Pygame_Prezentacja | f6ace78c2df504a262eac6b1ae46d458939dd0c0 | [
"MIT"
] | null | null | null | Live/sprites/__base.py | Pawel095/PJ_Pygame_Prezentacja | f6ace78c2df504a262eac6b1ae46d458939dd0c0 | [
"MIT"
] | null | null | null | import pygame
import global_vars as g
class Base:
def __init__(self):
self.speed=300
self.position=(100,100)
self.velocity=(0,0)
self.acceleration=(0,0)
self.alive = True
def __linear_update(self,deltaT):
px,py = self.position
vx,vy = self.velocity
... | 28.657143 | 86 | 0.582253 |
4a0ea0107d37e256afa235e24a6b4de37b3498d7 | 1,362 | py | Python | dssvue/mplqt.py | gyanz/dssvue | c2d6e48f2c83319f70116dbda0346ae53adb9297 | [
"MIT"
] | 9 | 2019-09-21T20:03:59.000Z | 2022-01-03T16:19:47.000Z | dssvue/mplqt.py | gyanz/dssvue | c2d6e48f2c83319f70116dbda0346ae53adb9297 | [
"MIT"
] | 1 | 2019-11-01T20:06:21.000Z | 2019-11-08T15:12:20.000Z | dssvue/mplqt.py | gyanz/dssvue | c2d6e48f2c83319f70116dbda0346ae53adb9297 | [
"MIT"
] | null | null | null | from PyQt5 import uic
from PyQt5 import QtGui
from PyQt5.QtGui import (QColor,QIcon,QTextCursor)
from PyQt5 import QtWidgets
from PyQt5.QtWidgets import (QApplication,QMainWindow,QDialog,QCheckBox,QComboBox,
QWidgetAction,QLabel,QFileDialog,
QAbstractItemView,Q... | 34.923077 | 88 | 0.688693 |
4a0ea064f1120ce0bb26d9778eeddd520e752266 | 39,721 | py | Python | beetsplug/replaygain.py | arcresu/beets | 3161e2722670884884adcdaddd25591e3bef3dc4 | [
"MIT"
] | null | null | null | beetsplug/replaygain.py | arcresu/beets | 3161e2722670884884adcdaddd25591e3bef3dc4 | [
"MIT"
] | null | null | null | beetsplug/replaygain.py | arcresu/beets | 3161e2722670884884adcdaddd25591e3bef3dc4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, Fabrice Laporte, Yevgeny Bezman, and Adrian Sampson.
#
# 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 restrict... | 37.191948 | 79 | 0.596058 |
4a0ea08874afc508076444aea5864c451383890e | 3,103 | py | Python | runner.py | dinheironamesa/Faturas_Energia | 3a9c65a65991b9bdf5754675a8ac87ab1bdf0846 | [
"Apache-2.0"
] | null | null | null | runner.py | dinheironamesa/Faturas_Energia | 3a9c65a65991b9bdf5754675a8ac87ab1bdf0846 | [
"Apache-2.0"
] | null | null | null | runner.py | dinheironamesa/Faturas_Energia | 3a9c65a65991b9bdf5754675a8ac87ab1bdf0846 | [
"Apache-2.0"
] | null | null | null |
from os import listdir
from xlsxwriter import Workbook
from scrapper import scrape
if __name__ == '__main__':
workbook = Workbook('fatura.xlsx')
worksheet = workbook.add_worksheet()
# Headers
worksheet.write('A1', 'produto1')
worksheet.write('B1', 'unidade')
worksheet.write('C1', 'grandezas_... | 29.273585 | 58 | 0.467612 |
4a0ea0c4afcdbb01f83d9ddb254b19882dcd2f98 | 969 | py | Python | week2/task8.py | sdanil-ops/stepik-beegeek-python | 02302ab85d581962a82cbce766b7b284d4c5491e | [
"MIT"
] | null | null | null | week2/task8.py | sdanil-ops/stepik-beegeek-python | 02302ab85d581962a82cbce766b7b284d4c5491e | [
"MIT"
] | null | null | null | week2/task8.py | sdanil-ops/stepik-beegeek-python | 02302ab85d581962a82cbce766b7b284d4c5491e | [
"MIT"
] | 1 | 2021-08-18T00:58:27.000Z | 2021-08-18T00:58:27.000Z | # -----------------------------------------------------------
# Copyright (c) 2021. Danil Smirnov
# The program is fed three lines, each on a separate line.
# The program should print the entered lines in reverse order,
# each on a separate line. Uses code from previous task.
# Just paste it.
# ---... | 27.685714 | 73 | 0.544892 |
4a0ea1a52d8454db9ac2e9016f5b06c6e6f96a80 | 7,060 | py | Python | SEPHIRA/FastAPI/resources/auth.py | dman926/Flask-API | 49e052159a3915ec25305141ecdd6cdeb1d7a25c | [
"MIT"
] | 4 | 2021-04-23T16:51:57.000Z | 2021-06-06T20:28:08.000Z | SEPHIRA/FastAPI/resources/auth.py | dman926/Flask-API | 49e052159a3915ec25305141ecdd6cdeb1d7a25c | [
"MIT"
] | null | null | null | SEPHIRA/FastAPI/resources/auth.py | dman926/Flask-API | 49e052159a3915ec25305141ecdd6cdeb1d7a25c | [
"MIT"
] | 3 | 2021-03-21T22:29:05.000Z | 2021-06-06T20:30:18.000Z | from fastapi import APIRouter, Request
from fastapi.security.oauth2 import OAuth2PasswordRequestForm
from config import APISettings
from fastapi import Depends
from pydantic import BaseModel, EmailStr
from typing import Optional
from mongoengine.errors import NotUniqueError, DoesNotExist
from modules.JWT import Token... | 28.699187 | 105 | 0.754674 |
4a0ea1dc6b04995e282b5a8430c52c4efcc2aefc | 639 | py | Python | torchtext/datasets/__init__.py | kortemaki/text | ea64e1d28c794ed6ffc0a5c66651c33e2f57f01f | [
"BSD-3-Clause"
] | 1 | 2018-04-04T08:31:40.000Z | 2018-04-04T08:31:40.000Z | torchtext/datasets/__init__.py | kortemaki/text | ea64e1d28c794ed6ffc0a5c66651c33e2f57f01f | [
"BSD-3-Clause"
] | null | null | null | torchtext/datasets/__init__.py | kortemaki/text | ea64e1d28c794ed6ffc0a5c66651c33e2f57f01f | [
"BSD-3-Clause"
] | null | null | null | from .language_modeling import LanguageModelingDataset, WikiText2, PennTreebank # NOQA
from .snli import SNLI
from .sst import SST
from .translation import TranslationDataset, Multi30k, IWSLT, WMT14 # NOQA
from .sequence_tagging import SequenceTaggingDataset, UDPOS # NOQA
from .trec import TREC
from .imdb import IMDB... | 27.782609 | 87 | 0.613459 |
4a0ea21336559daddaebbf35f06f4c5f4879864b | 16,133 | py | Python | cern_access/indico_cern_access/util.py | plourenco/indico-plugins-cern | 5be71a552825afdd93a3bc7e7141335b8559c41a | [
"MIT"
] | null | null | null | cern_access/indico_cern_access/util.py | plourenco/indico-plugins-cern | 5be71a552825afdd93a3bc7e7141335b8559c41a | [
"MIT"
] | null | null | null | cern_access/indico_cern_access/util.py | plourenco/indico-plugins-cern | 5be71a552825afdd93a3bc7e7141335b8559c41a | [
"MIT"
] | null | null | null | # This file is part of the CERN Indico plugins.
# Copyright (C) 2014 - 2020 CERN
#
# The CERN Indico plugins are free software; you can redistribute
# them and/or modify them under the terms of the MIT License; see
# the LICENSE file for more details.
from __future__ import unicode_literals
import hashlib
import hmac... | 43.136364 | 117 | 0.743197 |
4a0ea372492266f6577b137f695ba49099186bd7 | 30 | py | Python | app/utils/exceptions/__init__.py | InNickF/django-template | a8a9e1e5cd8cf63543cc78ef4fbd6bce060a448b | [
"MIT"
] | 3 | 2020-09-20T11:21:01.000Z | 2021-01-31T18:55:54.000Z | app/utils/exceptions/__init__.py | InNickF/django-template | a8a9e1e5cd8cf63543cc78ef4fbd6bce060a448b | [
"MIT"
] | 2 | 2020-09-21T09:53:32.000Z | 2021-06-10T19:40:41.000Z | app/utils/exceptions/__init__.py | InNickF/django-template | a8a9e1e5cd8cf63543cc78ef4fbd6bce060a448b | [
"MIT"
] | 2 | 2021-01-17T20:59:23.000Z | 2021-01-31T18:55:58.000Z | """Custom app's exceptions"""
| 15 | 29 | 0.666667 |
4a0ea3bec05e713f8fd78035f6abd451d2e35a8f | 3,501 | py | Python | thingsboard-gateway/thingsboard_gateway/tb_utility/tb_loader.py | drexelwireless/thingsboard-gateway | c4af30c3874c4e507c14566e332d2b4628e506e8 | [
"Apache-2.0"
] | 1 | 2022-02-10T10:03:43.000Z | 2022-02-10T10:03:43.000Z | thingsboard-gateway/thingsboard_gateway/tb_utility/tb_loader.py | drexelwireless/thingsboard-gateway | c4af30c3874c4e507c14566e332d2b4628e506e8 | [
"Apache-2.0"
] | null | null | null | thingsboard-gateway/thingsboard_gateway/tb_utility/tb_loader.py | drexelwireless/thingsboard-gateway | c4af30c3874c4e507c14566e332d2b4628e506e8 | [
"Apache-2.0"
] | null | null | null | # Copyright 2022. ThingsBoard
#
# 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 ... | 46.68 | 124 | 0.628963 |
4a0ea4076d5fd65f186079405d2073af10e69a68 | 339 | py | Python | cart/migrations/0020_remove_comment_status.py | Mambodiev/ecom_website | ced03d61a99a7d657f7cb0106dbb9cf1ab15e367 | [
"MIT"
] | null | null | null | cart/migrations/0020_remove_comment_status.py | Mambodiev/ecom_website | ced03d61a99a7d657f7cb0106dbb9cf1ab15e367 | [
"MIT"
] | 1 | 2022-03-30T21:19:09.000Z | 2022-03-30T21:19:09.000Z | cart/migrations/0020_remove_comment_status.py | Mambodiev/ecom_website | ced03d61a99a7d657f7cb0106dbb9cf1ab15e367 | [
"MIT"
] | null | null | null | # Generated by Django 3.2 on 2021-07-26 07:01
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('cart', '0019_rename_approuved_comment_approved'),
]
operations = [
migrations.RemoveField(
model_name='comment',
name='status'... | 18.833333 | 59 | 0.60767 |
4a0ea4196a23089abb2fab789f31cdc11d2a8325 | 82 | py | Python | Modules/triangle_03/03_triangle.py | MihailMarkovski/Python-Advanced-2020 | 8edea78cbe5588a409ba9bc3767861250f58c1a6 | [
"MIT"
] | 4 | 2020-09-19T13:53:19.000Z | 2020-11-01T18:34:53.000Z | Modules/triangle_03/03_triangle.py | MNikov/Python-Advanced-September-2020 | 1d65039de7f094d908411afffa8aee9689ab4220 | [
"MIT"
] | null | null | null | Modules/triangle_03/03_triangle.py | MNikov/Python-Advanced-September-2020 | 1d65039de7f094d908411afffa8aee9689ab4220 | [
"MIT"
] | null | null | null | from Modules.triangle_03 import triangle_fn as tf
tf.draw_triangle(int(input()))
| 20.5 | 49 | 0.804878 |
4a0ea43038bad194749cdbbc66cf37f6f351c475 | 1,695 | py | Python | fs/osfs/xattrs.py | rimrim/pyfs | ce9f3c76468a0779a0517ea7d7c191caf1bffd25 | [
"BSD-3-Clause"
] | 1 | 2021-07-15T22:45:17.000Z | 2021-07-15T22:45:17.000Z | fs/osfs/xattrs.py | rimrim/pyfs | ce9f3c76468a0779a0517ea7d7c191caf1bffd25 | [
"BSD-3-Clause"
] | null | null | null | fs/osfs/xattrs.py | rimrim/pyfs | ce9f3c76468a0779a0517ea7d7c191caf1bffd25 | [
"BSD-3-Clause"
] | null | null | null | """
fs.osfs.xattrs
==============
Extended-attribute support for OSFS
"""
import os
import sys
import errno
from fs.errors import *
from fs.path import *
from fs.base import FS
try:
import xattr
except ImportError:
xattr = None
if xattr is not None:
class OSFSXAttrMixin(object):
"""Mixin pr... | 22.905405 | 79 | 0.6 |
4a0ea4fc9d827e023dbbddfe368ba8c39c22351d | 3,940 | py | Python | beginner_source/examples_autograd/polynomial_custom_function.py | d2weber/tutorials | c08519b873566369d19a616c491ce2a9d4d5dde1 | [
"BSD-3-Clause"
] | null | null | null | beginner_source/examples_autograd/polynomial_custom_function.py | d2weber/tutorials | c08519b873566369d19a616c491ce2a9d4d5dde1 | [
"BSD-3-Clause"
] | null | null | null | beginner_source/examples_autograd/polynomial_custom_function.py | d2weber/tutorials | c08519b873566369d19a616c491ce2a9d4d5dde1 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
r"""
PyTorch: Defining New autograd Functions
----------------------------------------
A third order polynomial, trained to predict :math:`y=\sin(x)` from :math:`-\pi`
to :math:`\pi` by minimizing squared Euclidean distance. Instead of writing the
polynomial as :math:`y=a+bx+cx^2+dx^3`, we writ... | 37.52381 | 84 | 0.671827 |
4a0ea5f5208730e0111b51f6d86f5056cfa0f96e | 38,787 | py | Python | pandas/tests/groupby/aggregate/test_aggregate.py | gabriellm1/pandas | 020040b3b92516b445ddd8daba3b9818340e82d4 | [
"BSD-3-Clause"
] | 1 | 2020-08-18T16:49:16.000Z | 2020-08-18T16:49:16.000Z | pandas/tests/groupby/aggregate/test_aggregate.py | gabriellm1/pandas | 020040b3b92516b445ddd8daba3b9818340e82d4 | [
"BSD-3-Clause"
] | null | null | null | pandas/tests/groupby/aggregate/test_aggregate.py | gabriellm1/pandas | 020040b3b92516b445ddd8daba3b9818340e82d4 | [
"BSD-3-Clause"
] | 2 | 2021-07-17T19:28:31.000Z | 2021-11-28T17:14:58.000Z | """
test .agg behavior / note that .apply is tested generally in test_groupby.py
"""
import functools
from functools import partial
import numpy as np
import pytest
from pandas.errors import PerformanceWarning
from pandas.core.dtypes.common import is_integer_dtype
import pandas as pd
from pandas import DataFrame, I... | 33.122972 | 87 | 0.547529 |
4a0ea66000c8da72f003d6d7059e3781c2201689 | 1,482 | py | Python | setup.py | xiong-jie-y/onapy | 50b588d014dc24cd4876c784c8e69fba4eaf547e | [
"MIT"
] | 6 | 2021-03-23T14:44:33.000Z | 2021-03-24T05:37:20.000Z | setup.py | xiong-jie-y/onapy | 50b588d014dc24cd4876c784c8e69fba4eaf547e | [
"MIT"
] | null | null | null | setup.py | xiong-jie-y/onapy | 50b588d014dc24cd4876c784c8e69fba4eaf547e | [
"MIT"
] | null | null | null | import os
import setuptools
import glob
__version__ = '0.0.1dev2'
def _parse_requirements(path):
with open(path) as f:
return [
line.rstrip()
for line in f
if not (line.isspace() or line.startswith('#'))
]
from setuptools.command.install import install
from sub... | 29.058824 | 81 | 0.67004 |
4a0ea75de21da682e4c54c6dee33d31901145647 | 10,012 | py | Python | homeassistant/components/mqtt/sensor.py | basicpail/core | 5cc54618c5af3f75c08314bf2375cc7ac40d2b7e | [
"Apache-2.0"
] | null | null | null | homeassistant/components/mqtt/sensor.py | basicpail/core | 5cc54618c5af3f75c08314bf2375cc7ac40d2b7e | [
"Apache-2.0"
] | 21 | 2021-11-23T06:27:34.000Z | 2022-03-31T06:24:13.000Z | homeassistant/components/mqtt/sensor.py | basicpail/core | 5cc54618c5af3f75c08314bf2375cc7ac40d2b7e | [
"Apache-2.0"
] | null | null | null | """Support for MQTT sensors."""
from __future__ import annotations
from datetime import timedelta
import functools
import logging
import voluptuous as vol
from homeassistant.components import sensor
from homeassistant.components.sensor import (
DEVICE_CLASSES_SCHEMA,
STATE_CLASSES_SCHEMA,
SensorEntity,
)... | 34.170648 | 140 | 0.651119 |
4a0ea88087ba775d9f75b6776c9d204eb07f5298 | 16,816 | py | Python | src/ezdxf/addons/iterdxf.py | jkjt/ezdxf | 2acc5611b81476ea16b98063b9f55446a9182b81 | [
"MIT"
] | 515 | 2017-01-25T05:46:52.000Z | 2022-03-29T09:52:27.000Z | src/ezdxf/addons/iterdxf.py | jkjt/ezdxf | 2acc5611b81476ea16b98063b9f55446a9182b81 | [
"MIT"
] | 417 | 2017-01-25T10:01:17.000Z | 2022-03-29T09:22:04.000Z | src/ezdxf/addons/iterdxf.py | jkjt/ezdxf | 2acc5611b81476ea16b98063b9f55446a9182b81 | [
"MIT"
] | 149 | 2017-02-01T15:52:02.000Z | 2022-03-17T10:33:38.000Z | # Copyright (c) 2020-2021, Manfred Moitzi
# License: MIT License
from typing import (
Iterable,
Iterator,
cast,
BinaryIO,
Tuple,
Dict,
Optional,
List,
Set,
Union,
Any,
)
from io import StringIO
from pathlib import Path
from ezdxf.lldxf.const import DXFStructureError
from ezdx... | 35.106472 | 89 | 0.596991 |
4a0ea897851d786d50a88ae4ee826b7010129e9e | 3,011 | py | Python | server/migrations/0078_auto_20180723_0936.py | lfaraone/sal | d0dff90cebcbc87f18c2c6957264f21566d52000 | [
"Apache-2.0"
] | 1 | 2019-11-01T20:54:47.000Z | 2019-11-01T20:54:47.000Z | server/migrations/0078_auto_20180723_0936.py | grahamgilbert/sal | d247ec1ea8855e65e5855b0dd63eae93b40f86ca | [
"Apache-2.0"
] | null | null | null | server/migrations/0078_auto_20180723_0936.py | grahamgilbert/sal | d247ec1ea8855e65e5855b0dd63eae93b40f86ca | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2018-07-23 16:36
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('server', '0077_friendlynamecache'),
]
operations = [
migrations.AlterField(
... | 31.364583 | 74 | 0.562936 |
4a0ea911014c9ce3b689a6797efbb3b2dc8ede0c | 6,434 | py | Python | sdk/python/pulumi_kubernetes/scheduling/v1/outputs.py | sunbing81/pulumi-kubernetes | 8de6b379b00e2ab95b24bc176de8b329c670d7cd | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_kubernetes/scheduling/v1/outputs.py | sunbing81/pulumi-kubernetes | 8de6b379b00e2ab95b24bc176de8b329c670d7cd | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_kubernetes/scheduling/v1/outputs.py | sunbing81/pulumi-kubernetes | 8de6b379b00e2ab95b24bc176de8b329c670d7cd | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by pulumigen. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from ... import met... | 56.938053 | 425 | 0.708579 |
4a0ea9d9d5fe51b46df18ee9dab28f7cbf13f952 | 1,791 | py | Python | tests/conftest.py | firstof9/ha-openei | ac01f6756b846591049d629249d11a0d1edfb867 | [
"MIT"
] | 7 | 2021-09-08T14:46:11.000Z | 2021-11-14T18:14:09.000Z | tests/conftest.py | firstof9/ha-openei | ac01f6756b846591049d629249d11a0d1edfb867 | [
"MIT"
] | 44 | 2021-09-03T22:09:21.000Z | 2021-12-15T17:21:25.000Z | tests/conftest.py | firstof9/ha-openei | ac01f6756b846591049d629249d11a0d1edfb867 | [
"MIT"
] | 1 | 2021-09-04T13:15:51.000Z | 2021-09-04T13:15:51.000Z | """Test configurations."""
from unittest.mock import patch
import pytest
pytest_plugins = "pytest_homeassistant_custom_component"
@pytest.fixture(autouse=True)
def auto_enable_custom_integrations(enable_custom_integrations):
yield
@pytest.fixture(name="mock_api")
def mock_api():
"""Mock the library calls... | 31.421053 | 86 | 0.663875 |
4a0eab4e9b90c2dad613e8f934993478c7ef0615 | 80 | py | Python | scotty/version.py | huandy/python-scotty | b8d1925db881adaf06ce3c532ab3a61835dce6a8 | [
"Apache-2.0"
] | 2 | 2015-10-19T14:56:00.000Z | 2016-08-19T13:42:50.000Z | scotty/version.py | huandy/python-scotty | b8d1925db881adaf06ce3c532ab3a61835dce6a8 | [
"Apache-2.0"
] | 3 | 2016-03-02T09:18:47.000Z | 2021-03-25T21:39:00.000Z | scotty/version.py | huandy/python-scotty | b8d1925db881adaf06ce3c532ab3a61835dce6a8 | [
"Apache-2.0"
] | 5 | 2015-11-29T04:28:37.000Z | 2017-07-18T08:51:59.000Z | __version_info__ = (0, 1, 7)
__version__ = '.'.join(map(str, __version_info__))
| 26.666667 | 50 | 0.7 |
4a0eac88f6a70ad48033a76571c9c1d79d021428 | 2,075 | py | Python | calculateAnnotationsEventLog_pretsa.py | jkoessle/PRETSA | 93435f1ab37a87a96487496c9facae51971bcfd1 | [
"MIT"
] | null | null | null | calculateAnnotationsEventLog_pretsa.py | jkoessle/PRETSA | 93435f1ab37a87a96487496c9facae51971bcfd1 | [
"MIT"
] | null | null | null | calculateAnnotationsEventLog_pretsa.py | jkoessle/PRETSA | 93435f1ab37a87a96487496c9facae51971bcfd1 | [
"MIT"
] | null | null | null | import sys
import pandas as pd
import csv
import os
import numpy as np
class excel_semicolon(csv.excel):
delimiter = ';'
dictPath = sys.argv[1]
writeFilePath = dictPath + "pretsa_statistics_annotations.csv"
with open(writeFilePath, 'w+') as writeFile:
caseIDColName = "Case ID"
datasets = ["... | 46.111111 | 112 | 0.470843 |
4a0eaccda3694abdb3af0309f302d9ba07b676fb | 741 | py | Python | flexget/plugins/generic/log_start.py | sillygreen89/Flexget | 60f24ab0dda7b94c87ba43451921c50c3cef391f | [
"MIT"
] | 1 | 2018-05-02T21:14:50.000Z | 2018-05-02T21:14:50.000Z | flexget/plugins/generic/log_start.py | sillygreen89/Flexget | 60f24ab0dda7b94c87ba43451921c50c3cef391f | [
"MIT"
] | null | null | null | flexget/plugins/generic/log_start.py | sillygreen89/Flexget | 60f24ab0dda7b94c87ba43451921c50c3cef391f | [
"MIT"
] | null | null | null | from __future__ import unicode_literals, division, absolute_import
from builtins import * # pylint: disable=unused-import, redefined-builtin
import logging
import os
from argparse import SUPPRESS
from flexget import options
from flexget.event import event
log = logging.getLogger('log_start')
@event('manager.start... | 25.551724 | 88 | 0.74224 |
4a0ead224f0868d84bfae8f883f9a5e18b8a6ebd | 22,072 | py | Python | main_good.py | ginsongsong/TecoGAN | 9f3b4b76d5098ce07c2594eac8979c6536c50ea9 | [
"Apache-2.0"
] | null | null | null | main_good.py | ginsongsong/TecoGAN | 9f3b4b76d5098ce07c2594eac8979c6536c50ea9 | [
"Apache-2.0"
] | null | null | null | main_good.py | ginsongsong/TecoGAN | 9f3b4b76d5098ce07c2594eac8979c6536c50ea9 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import os, math, time, collections, numpy as np
''' TF_CPP_MIN_LOG_LEVEL
0 = all messages are logged (default behavior)
1 = INFO messages are not printed
2 = INFO and WARNING messages are not printed
3 = INFO, WARNING, and ERROR messages are not printed
Disable Logs for now '''
os.environ['TF_CPP_MIN... | 48.940133 | 120 | 0.653181 |
4a0ead8d2f771422a5baabc7ea892499687bc7c0 | 5,461 | py | Python | tests/routes/test_ingress.py | LinuxForHealth/connect | 0bb2edc2923633c68b3247006abe98001605adbd | [
"Apache-2.0"
] | 33 | 2020-06-16T11:47:03.000Z | 2022-03-24T02:41:00.000Z | tests/routes/test_ingress.py | LinuxForHealth/connect | 0bb2edc2923633c68b3247006abe98001605adbd | [
"Apache-2.0"
] | 470 | 2020-06-12T01:18:43.000Z | 2022-02-20T23:08:00.000Z | tests/routes/test_ingress.py | LinuxForHealth/connect | 0bb2edc2923633c68b3247006abe98001605adbd | [
"Apache-2.0"
] | 30 | 2020-06-12T19:36:09.000Z | 2022-01-31T15:25:35.000Z | import pytest
from connect.clients import kafka, nats
from connect.config import get_settings
from connect.workflows.core import CoreWorkflow
from unittest.mock import AsyncMock
@pytest.mark.parametrize(
"fixture_name,data_format",
[
("x12_fixture", "X12-005010"),
("fhir_fixture", "FHIR-R4"),
... | 40.154412 | 103 | 0.718733 |
4a0eadbff7ed2b42375232f7313b96c8b3e1ddde | 546 | py | Python | Symbols/reverse_triangle.py | Ashokkommi0001/patterns | daa1a1d8f3bc6e021e02a0e34458e2c178fc71d2 | [
"MIT"
] | 2 | 2021-03-17T12:08:22.000Z | 2021-03-17T12:11:10.000Z | Symbols/reverse_triangle.py | Ashokkommi0001/patterns | daa1a1d8f3bc6e021e02a0e34458e2c178fc71d2 | [
"MIT"
] | null | null | null | Symbols/reverse_triangle.py | Ashokkommi0001/patterns | daa1a1d8f3bc6e021e02a0e34458e2c178fc71d2 | [
"MIT"
] | 1 | 2021-03-17T11:49:39.000Z | 2021-03-17T11:49:39.000Z | def for_reverse_triangle():
for row in range(6):
for col in range(11):
if (row==0) or (row-col==0 or row+col==10):
print("*",end=" ")
else:
print(end=" ")
print()
def while_reverse_triangle():
row=0
while row<6:
co... | 24.818182 | 56 | 0.388278 |
4a0eae39d62adf3f8072c861b6dc9447f4cdf880 | 2,634 | py | Python | src/ape/types/abstract.py | miohtama/ape | 622deb25076d33de0edb3a23449ccdc04c3288cd | [
"Apache-2.0"
] | 210 | 2021-04-29T05:42:42.000Z | 2022-03-31T15:50:17.000Z | src/ape/types/abstract.py | miohtama/ape | 622deb25076d33de0edb3a23449ccdc04c3288cd | [
"Apache-2.0"
] | 370 | 2021-04-29T01:54:32.000Z | 2022-03-31T19:19:29.000Z | src/ape/types/abstract.py | miohtama/ape | 622deb25076d33de0edb3a23449ccdc04c3288cd | [
"Apache-2.0"
] | 25 | 2021-04-29T05:08:50.000Z | 2022-03-11T20:43:56.000Z | import json
from copy import deepcopy
from pathlib import Path
from typing import Any, Dict, Optional, Set, Union
import dataclassy as dc
def update_params(params, param_name, param_type):
if param_name in params and params[param_name]:
params[param_name] = param_type.from_dict(params[param_name])
def ... | 30.627907 | 86 | 0.647684 |
4a0eaecdfc4c1d8218441b30616099ae43d2439c | 8,150 | py | Python | labelme/labelme/widgets/label_dialog.py | acejo2208/Drone_Segmentation | 0f2abebc4e6e209bb6f02d8ab642134a6431f526 | [
"Apache-2.0"
] | 2 | 2021-07-21T09:19:15.000Z | 2021-07-22T00:29:43.000Z | labelme/labelme/widgets/label_dialog.py | acejo2208/Drone_Segmentation | 0f2abebc4e6e209bb6f02d8ab642134a6431f526 | [
"Apache-2.0"
] | null | null | null | labelme/labelme/widgets/label_dialog.py | acejo2208/Drone_Segmentation | 0f2abebc4e6e209bb6f02d8ab642134a6431f526 | [
"Apache-2.0"
] | 1 | 2021-07-21T09:19:26.000Z | 2021-07-21T09:19:26.000Z | import re
from qtpy import QT_VERSION
from qtpy import QtCore
from qtpy import QtGui
from qtpy import QtWidgets
from labelme.logger import logger
import labelme.utils
QT5 = QT_VERSION[0] == "5"
# TODO(unknown):
# - Calculate optimal position so as not to go out of screen area.
class LabelQLineEdit(QtWidgets.QLi... | 34.100418 | 78 | 0.600245 |
4a0eaf8eb3fd7655dd1335902f6d81f9e5885f7d | 656 | py | Python | src/jose/tests/test_utils.py | hdknr/jose | d872407e9f3b3a0262e6bb1cdb599b5c4c1d9ee4 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | src/jose/tests/test_utils.py | hdknr/jose | d872407e9f3b3a0262e6bb1cdb599b5c4c1d9ee4 | [
"BSD-2-Clause-FreeBSD"
] | 1 | 2015-01-23T09:37:17.000Z | 2015-01-23T09:37:17.000Z | src/jose/tests/test_utils.py | hdknr/jose | d872407e9f3b3a0262e6bb1cdb599b5c4c1d9ee4 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | # -*- coding: utf-8 -*-
import unittest
from jose.utils import base64
class TestBase64(unittest.TestCase):
def test_base64(self):
'''
nose2 jose.tests.test_utils.TestBase64.test_base64
'''
self.assertEquals('QWxpY2U', base64.base64url_encode('Alice'))
self.assertEquals('Qm... | 26.24 | 70 | 0.644817 |
4a0eb0275eee12c2ffa3cb47273e2b69f1958b76 | 1,213 | py | Python | swaggerpy3_test/loader_test.py | darrensessions/swaggerpy3 | 6c41533652c314ca58d420414e62c18f112fc11e | [
"BSD-3-Clause"
] | 1 | 2020-06-24T22:44:43.000Z | 2020-06-24T22:44:43.000Z | swaggerpy3_test/loader_test.py | darrensessions/swaggerpy3 | 6c41533652c314ca58d420414e62c18f112fc11e | [
"BSD-3-Clause"
] | null | null | null | swaggerpy3_test/loader_test.py | darrensessions/swaggerpy3 | 6c41533652c314ca58d420414e62c18f112fc11e | [
"BSD-3-Clause"
] | 2 | 2020-03-28T21:09:32.000Z | 2021-08-06T08:00:47.000Z | #!/usr/bin/env python
#
# Copyright (c) 2013, Digium, Inc.
#
import unittest
import swaggerpy
from swaggerpy import swagger_model
class TestProcessor(swagger_model.SwaggerProcessor):
def process_resource_listing(self, resources, context):
resources['processed'] = True
class LoaderTest(unittest.TestCa... | 28.209302 | 72 | 0.635614 |
4a0eb0710160cc33152a75a9500bba4600f72537 | 2,802 | py | Python | apps/questions/views.py | ressapanda/fishka-backend | c1eb58566dce01c7a011f0093893cd16b6d50875 | [
"MIT"
] | null | null | null | apps/questions/views.py | ressapanda/fishka-backend | c1eb58566dce01c7a011f0093893cd16b6d50875 | [
"MIT"
] | null | null | null | apps/questions/views.py | ressapanda/fishka-backend | c1eb58566dce01c7a011f0093893cd16b6d50875 | [
"MIT"
] | null | null | null | from django_filters.rest_framework import DjangoFilterBackend
from rest_framework import mixins, status
from rest_framework.decorators import action
from rest_framework.filters import OrderingFilter, SearchFilter
from rest_framework.request import Request
from rest_framework.response import Response
from rest_framework... | 36.38961 | 115 | 0.712348 |
4a0eb17619396e3ecb35b16796d8b3fe736eadb7 | 362 | py | Python | strings/tests/test_string_to_integer_ii.py | ahcode0919/python-ds-algorithms | 0d617b78c50b6c18da40d9fa101438749bfc82e1 | [
"MIT"
] | null | null | null | strings/tests/test_string_to_integer_ii.py | ahcode0919/python-ds-algorithms | 0d617b78c50b6c18da40d9fa101438749bfc82e1 | [
"MIT"
] | null | null | null | strings/tests/test_string_to_integer_ii.py | ahcode0919/python-ds-algorithms | 0d617b78c50b6c18da40d9fa101438749bfc82e1 | [
"MIT"
] | 3 | 2020-10-07T20:24:45.000Z | 2020-12-16T04:53:19.000Z | from strings.string_to_integer_ii import string_to_integer_ii
def test_string_to_integer_ii():
assert string_to_integer_ii("34") == 34
assert string_to_integer_ii("100") == 100
assert string_to_integer_ii("-12") == -12
assert string_to_integer_ii("6") == 6
assert string_to_integer_ii("0") == 0
... | 32.909091 | 61 | 0.726519 |
4a0eb177915819a04f65f5e3e8d84984c6379c9d | 11,204 | py | Python | mayan/apps/appearance/models.py | ercusz/Mayan-EDMS | 46accc39f3f252c43b8d9d2b19478ae7f13bd11d | [
"Apache-2.0"
] | null | null | null | mayan/apps/appearance/models.py | ercusz/Mayan-EDMS | 46accc39f3f252c43b8d9d2b19478ae7f13bd11d | [
"Apache-2.0"
] | null | null | null | mayan/apps/appearance/models.py | ercusz/Mayan-EDMS | 46accc39f3f252c43b8d9d2b19478ae7f13bd11d | [
"Apache-2.0"
] | null | null | null | import bleach
import logging
from django.conf import settings
from django.db import models
from django.urls import reverse
from django.utils.encoding import force_text
from django.utils.translation import ugettext_lazy as _
from mayan.apps.converter.models import Asset
from mayan.apps.databases.model_mixins import Extr... | 41.962547 | 114 | 0.661549 |
4a0eb27033f6b9c491bccd17821f9215e6e87539 | 32,771 | py | Python | datasets/census_bureau_acs/pipelines/place_2019_5yr/place_2019_5yr_dag.py | gkodukula/public-datasets-pipelines | 4f4c87edae252059062ba479b80559e7675a885f | [
"Apache-2.0"
] | null | null | null | datasets/census_bureau_acs/pipelines/place_2019_5yr/place_2019_5yr_dag.py | gkodukula/public-datasets-pipelines | 4f4c87edae252059062ba479b80559e7675a885f | [
"Apache-2.0"
] | null | null | null | datasets/census_bureau_acs/pipelines/place_2019_5yr/place_2019_5yr_dag.py | gkodukula/public-datasets-pipelines | 4f4c87edae252059062ba479b80559e7675a885f | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 61.832075 | 5,932 | 0.565225 |
4a0eb32f300b289b937194fa2307dcd6cf0f1a64 | 15,129 | py | Python | bentoml/_internal/frameworks/onnx.py | nice03/BentoML | 003bf54884c65785bf234aa23f3ff2025cd74121 | [
"Apache-2.0"
] | null | null | null | bentoml/_internal/frameworks/onnx.py | nice03/BentoML | 003bf54884c65785bf234aa23f3ff2025cd74121 | [
"Apache-2.0"
] | null | null | null | bentoml/_internal/frameworks/onnx.py | nice03/BentoML | 003bf54884c65785bf234aa23f3ff2025cd74121 | [
"Apache-2.0"
] | null | null | null | import shutil
import typing as t
import logging
from typing import TYPE_CHECKING
from simple_di import inject
from simple_di import Provide
from bentoml import Tag
from bentoml import Runner
from bentoml.exceptions import BentoMLException
from bentoml.exceptions import MissingDependencyException
from ..types import ... | 35.348131 | 124 | 0.635468 |
4a0eb3ba254d832be2daee09e391303a5acfc4ac | 4,073 | py | Python | ptype/data.py | ai2es/ptype-physical | 8b0cce55eb54b7c9e588206935cb42e81adc6e20 | [
"CC0-1.0"
] | null | null | null | ptype/data.py | ai2es/ptype-physical | 8b0cce55eb54b7c9e588206935cb42e81adc6e20 | [
"CC0-1.0"
] | null | null | null | ptype/data.py | ai2es/ptype-physical | 8b0cce55eb54b7c9e588206935cb42e81adc6e20 | [
"CC0-1.0"
] | null | null | null | import os
import random
import numpy as np
import pandas as pd
from tqdm import tqdm
from sklearn.preprocessing import StandardScaler, MinMaxScaler,\
OneHotEncoder, LabelEncoder
def load_ptype_data(data_path, source, train_start='20130101', train_end='20181108',
v... | 47.360465 | 128 | 0.656764 |
4a0eb43295e4b66b6a9ee8233f1633e4b578f9cb | 1,059 | py | Python | src/transaction.py | rajatgupta310198/BlockChain | 03884c0e95e6504431da1e935dde28bc99c9f0c3 | [
"MIT"
] | 2 | 2021-03-15T12:38:18.000Z | 2021-06-16T17:44:42.000Z | src/transaction.py | rajatgupta310198/BlockChain | 03884c0e95e6504431da1e935dde28bc99c9f0c3 | [
"MIT"
] | null | null | null | src/transaction.py | rajatgupta310198/BlockChain | 03884c0e95e6504431da1e935dde28bc99c9f0c3 | [
"MIT"
] | 1 | 2018-09-28T19:08:58.000Z | 2018-09-28T19:08:58.000Z | """
Transaction Class
List of Transaction objects will be added to one Block.
Author: Rajat Gupta
Email: rajat15101@iiitnr.edu.in
Time & Date: 11:28 hrs, Sat, 3rd March 2018
"""
from datetime import datetime
class Transaction(object):
''''
Transcation class will encompases single transaction in network b... | 21.18 | 103 | 0.650614 |
4a0eb445dcd04e887a1482f6782f43e2336704e1 | 11,705 | py | Python | chess/chessboard.py | Asher-W/Chess | f5c03232596fbb0e3cdcbcf00701aaa985ddf8a6 | [
"MIT"
] | null | null | null | chess/chessboard.py | Asher-W/Chess | f5c03232596fbb0e3cdcbcf00701aaa985ddf8a6 | [
"MIT"
] | null | null | null | chess/chessboard.py | Asher-W/Chess | f5c03232596fbb0e3cdcbcf00701aaa985ddf8a6 | [
"MIT"
] | 1 | 2021-08-01T01:24:47.000Z | 2021-08-01T01:24:47.000Z | import tkinter as tk
from PIL import Image, ImageTk
import chesspieces as cp
#font details
font, text_margin = ("Veranda", 20), 5
primary_color = "tan"
secondary_color = "SpringGreen4"
class ChessBoard(tk.Canvas):
def __init__(self, root, pattern = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR"):
self.siz... | 40.085616 | 156 | 0.491756 |
4a0eb623c105211327ae6c8a18838b2b9fb0ca0b | 3,950 | py | Python | unicef.py | timofonic-otherdevstuff/dap-scrapers | 7b98ec546e5dcf56b82236f36db04c68743cc5ae | [
"Unlicense"
] | 3 | 2015-03-30T08:53:41.000Z | 2017-05-05T13:37:08.000Z | unicef.py | timofonic-otherdevstuff/dap-scrapers | 7b98ec546e5dcf56b82236f36db04c68743cc5ae | [
"Unlicense"
] | 2 | 2016-03-31T17:26:37.000Z | 2016-03-31T17:28:15.000Z | unicef.py | OCHA-DAP/dap-scrapers | 3beb34acfe5bf5f2fd7d2a15857264a1e65bcf08 | [
"Unlicense"
] | 2 | 2016-03-31T17:02:03.000Z | 2018-03-12T14:13:27.000Z | import logging
import dl
import messytables
import xypath
import re
import orm
import requests
import lxml.html
"""Value: dsID, region, indID, period, value, source, is_number
DataSet: dsID, last_updated, last_scraped, name
Indicator: indID, name, units
"""
log = logging.getLogger("unicef")
log.addHandler(lo... | 32.113821 | 105 | 0.575443 |
4a0eb676ac88a24aad4083abd15fffa61a4cbe13 | 7,108 | py | Python | max31865.py | obiben/silvia-pi | d41a9222dda068403e66f1f1a9ef3ef1aabae75b | [
"MIT"
] | 2 | 2018-02-22T13:34:34.000Z | 2021-02-02T21:28:30.000Z | max31865.py | obiben/silvia-pi | d41a9222dda068403e66f1f1a9ef3ef1aabae75b | [
"MIT"
] | 2 | 2019-05-16T00:10:17.000Z | 2020-10-05T17:27:17.000Z | max31865.py | obiben/silvia-pi | d41a9222dda068403e66f1f1a9ef3ef1aabae75b | [
"MIT"
] | 2 | 2019-07-09T19:19:24.000Z | 2021-06-20T13:04:25.000Z | #!/usr/bin/python
#The MIT License (MIT)
#
#Copyright (c) 2015 Stephen P. Smith
#
#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... | 31.874439 | 86 | 0.677124 |
4a0eb6a3fb27045cd9bd9845892dbe62323443f4 | 349 | py | Python | spark_dependencies/python_lib/nose2/exceptions.py | usc-isi-i2/WEDC | cf48355d8a5c6616fb34be9932520875e218d2c4 | [
"Apache-2.0"
] | null | null | null | spark_dependencies/python_lib/nose2/exceptions.py | usc-isi-i2/WEDC | cf48355d8a5c6616fb34be9932520875e218d2c4 | [
"Apache-2.0"
] | null | null | null | spark_dependencies/python_lib/nose2/exceptions.py | usc-isi-i2/WEDC | cf48355d8a5c6616fb34be9932520875e218d2c4 | [
"Apache-2.0"
] | null | null | null | # This module contains some code copied from unittest2/ and other code
# developed in reference to unittest2.
# unittest2 is Copyright (c) 2001-2010 Python Software Foundation; All
# Rights Reserved. See: http://docs.python.org/license.html
__unittest = True
class TestNotFoundError(Exception):
"""Raised when a n... | 31.727273 | 70 | 0.765043 |
4a0eb7746a05dd11f90420db3ea0731624e6011c | 897 | py | Python | tests/unit/mock_ami.py | nchizhov/python-ami | d1953f4129452cbc015d7cb3d1e2f360dcaee45c | [
"BSD-3-Clause"
] | 95 | 2015-10-10T05:12:50.000Z | 2022-02-28T15:20:48.000Z | tests/unit/mock_ami.py | nchizhov/python-ami | d1953f4129452cbc015d7cb3d1e2f360dcaee45c | [
"BSD-3-Clause"
] | 40 | 2016-04-12T16:49:07.000Z | 2022-02-09T01:00:17.000Z | tests/unit/mock_ami.py | nchizhov/python-ami | d1953f4129452cbc015d7cb3d1e2f360dcaee45c | [
"BSD-3-Clause"
] | 63 | 2016-04-12T15:29:09.000Z | 2022-02-24T12:19:50.000Z | import socket
import threading
from rx import Observable
class AMIMock(object):
thread = None
def __init__(self):
self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
def start(self):
self.socket.bind((socket.gethostname(), 0,))
self.thread = threading.Thread(target=s... | 23 | 71 | 0.571906 |
4a0eb9235b83ad1387a1fd981f09a9fd2013a3a5 | 7,152 | py | Python | keras_gym/caching/test_experience_replay.py | KristianHolsheimer/keras-gym | 0296ddcc8685e1ce732c3173caaa0fd25af9ef58 | [
"MIT"
] | 16 | 2019-07-01T10:56:26.000Z | 2021-01-31T18:56:56.000Z | keras_gym/caching/test_experience_replay.py | KristianHolsheimer/keras-gym | 0296ddcc8685e1ce732c3173caaa0fd25af9ef58 | [
"MIT"
] | 10 | 2019-03-10T21:56:10.000Z | 2020-09-06T21:49:55.000Z | keras_gym/caching/test_experience_replay.py | KristianHolsheimer/keras-gym | 0296ddcc8685e1ce732c3173caaa0fd25af9ef58 | [
"MIT"
] | 5 | 2019-08-02T22:11:19.000Z | 2020-04-19T20:18:38.000Z | import gym
import numpy as np
from .experience_replay import ExperienceReplayBuffer
class MockEnv:
action_space = gym.spaces.Discrete(7)
def __init__(self, num_frames):
self.num_frames = num_frames
class TestExperienceReplayBuffer:
N = 7
S = np.expand_dims(np.arange(N), axis=1)
A = S[:... | 41.34104 | 79 | 0.434424 |
4a0eb98c3b045c51a23ea5f312d0adb7398ad66b | 1,138 | py | Python | gcloud/storage/connection.py | grapefruit623/gcloud-python | 83d130e2cfb0bf867d7ba165ff157d31d52f1b35 | [
"Apache-2.0"
] | null | null | null | gcloud/storage/connection.py | grapefruit623/gcloud-python | 83d130e2cfb0bf867d7ba165ff157d31d52f1b35 | [
"Apache-2.0"
] | null | null | null | gcloud/storage/connection.py | grapefruit623/gcloud-python | 83d130e2cfb0bf867d7ba165ff157d31d52f1b35 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 Google 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 required by applicable law or a... | 36.709677 | 74 | 0.738137 |
4a0eba4fec6079e53666851d4808dfb4a22d7e37 | 356 | py | Python | snippets/gradient_mask.py | iubica/wx-portfolio | 12101986db72bcaffd9b744d514d6f9f651ad5a1 | [
"MIT"
] | 3 | 2018-03-19T07:57:10.000Z | 2021-07-05T08:55:14.000Z | snippets/gradient_mask.py | iubica/wx-portfolio | 12101986db72bcaffd9b744d514d6f9f651ad5a1 | [
"MIT"
] | 6 | 2020-03-24T15:40:18.000Z | 2021-12-13T19:46:09.000Z | snippets/gradient_mask.py | iubica/wx-portfolio | 12101986db72bcaffd9b744d514d6f9f651ad5a1 | [
"MIT"
] | 4 | 2018-03-29T21:59:55.000Z | 2019-12-16T14:56:38.000Z | snippet_normalize (cr, width, height)
pattern = cairo.LinearGradient (0, 0, 1, 1)
pattern.add_color_stop_rgb (0, 0, 0.3, 0.8)
pattern.add_color_stop_rgb (1, 0, 0.8, 0.3)
mask = cairo.RadialGradient (0.5, 0.5, 0.25, 0.5, 0.5, 0.5)
mask.add_color_stop_rgba (0, 0, 0, 0, 1)
mask.add_color_stop_rgba (0.5, 0, 0, 0, 0)
cr.... | 27.384615 | 59 | 0.685393 |
4a0ebb6362d3a2b2cfebb68051abaedd0c6874d0 | 8,148 | py | Python | backend/main.py | gopherkhan/playhvz | 77a399c4d5da33f33681cb927b3f476d27a7d538 | [
"Apache-2.0"
] | null | null | null | backend/main.py | gopherkhan/playhvz | 77a399c4d5da33f33681cb927b3f476d27a7d538 | [
"Apache-2.0"
] | null | null | null | backend/main.py | gopherkhan/playhvz | 77a399c4d5da33f33681cb927b3f476d27a7d538 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 29.846154 | 75 | 0.732327 |
4a0ebbf38ee0a828334e6f1f38957e30ea21888b | 2,414 | py | Python | Sent.py | Jaehoon-Cha-Data/Natural-Language-Process | 7f032a87a354f45352516e986b621f50db2207f8 | [
"MIT"
] | null | null | null | Sent.py | Jaehoon-Cha-Data/Natural-Language-Process | 7f032a87a354f45352516e986b621f50db2207f8 | [
"MIT"
] | null | null | null | Sent.py | Jaehoon-Cha-Data/Natural-Language-Process | 7f032a87a354f45352516e986b621f50db2207f8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu Oct 10 11:09:46 2019
@author: jaehooncha
@email: chajaehoon79@gmail.com
"""
import numpy as np
class Sent(object):
def __init__(self, dataDir, seq_len):
self.dataDir = dataDir
self.seq_len = seq_len
self.timetxt = []
with open(... | 31.763158 | 121 | 0.53894 |
4a0ebbf769d1ffe367311a1c4e4ff4e13c50f661 | 1,838 | py | Python | Sprites.py | iamabeljoshua/Space-Shooter | dcd0da3f2094c3db339a243e8c728cb2f27dda11 | [
"MIT"
] | 2 | 2016-10-06T10:48:24.000Z | 2016-10-11T16:08:00.000Z | Sprites.py | ferguson-abel/Space-Shooter | dcd0da3f2094c3db339a243e8c728cb2f27dda11 | [
"MIT"
] | 1 | 2021-03-12T18:15:45.000Z | 2021-04-01T17:55:41.000Z | Sprites.py | iamabeljoshua/Space-Shooter | dcd0da3f2094c3db339a243e8c728cb2f27dda11 | [
"MIT"
] | null | null | null | #Author: Joshua Abel
#year: 2014
#twitter: @ferguson_abel
import pygame
class Sprite():
"""A SIMPLE SPRITE CLASSES WITH SOME UTILITY FUNCTIONS """
""" SETUP THE CONSTANTS USED IN THE MOVE FUNCTION """
LEFT = "left"
RIGHT = "right"
UP = "up"
DOWN = "down"
def __init__(sel... | 31.152542 | 104 | 0.567465 |
4a0ebd109511c888f5f913357e449e507c80b039 | 9,431 | py | Python | index.py | jDan735/covid-19_bot | a359e1b611031dab6070dea9dee68092a02ca7d8 | [
"MIT"
] | null | null | null | index.py | jDan735/covid-19_bot | a359e1b611031dab6070dea9dee68092a02ca7d8 | [
"MIT"
] | null | null | null | index.py | jDan735/covid-19_bot | a359e1b611031dab6070dea9dee68092a02ca7d8 | [
"MIT"
] | null | null | null | import telebot
import COVID19Py
import json
import sys
import time
sys.path.insert(0, "./lib/")
from lib import *
import covid19
with open("./botdata/countries.json", "r", encoding="utf-8") as datafile:
data = json.loads(datafile.read())
with open("./botdata/token.txt") as token:
bot = telebot.... | 45.781553 | 118 | 0.638426 |
4a0ebd1ff2ef5443736439ddbeacea3de41d1e0e | 4,798 | py | Python | ros/src/twist_controller/dbw_node.py | alextreib/CarND-Capstone | 3ac2f9e42b8d047cdce9b41c1e1456c3a25f6eba | [
"MIT"
] | null | null | null | ros/src/twist_controller/dbw_node.py | alextreib/CarND-Capstone | 3ac2f9e42b8d047cdce9b41c1e1456c3a25f6eba | [
"MIT"
] | null | null | null | ros/src/twist_controller/dbw_node.py | alextreib/CarND-Capstone | 3ac2f9e42b8d047cdce9b41c1e1456c3a25f6eba | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import rospy
from std_msgs.msg import Bool
from dbw_mkz_msgs.msg import ThrottleCmd, SteeringCmd, BrakeCmd, SteeringReport
from geometry_msgs.msg import TwistStamped
import math
from twist_controller import Controller
'''
You can build this node only after you have built (or partially built) th... | 40.661017 | 173 | 0.682159 |
4a0ebd92ad292ef5a2507c77d68b9117b3f1e4f6 | 15,134 | py | Python | MCPGM.py | buivn/paperImplementation | 52371926d1f6cc8fcfcdf302596ce3bdae4beac6 | [
"BSD-2-Clause"
] | null | null | null | MCPGM.py | buivn/paperImplementation | 52371926d1f6cc8fcfcdf302596ce3bdae4beac6 | [
"BSD-2-Clause"
] | null | null | null | MCPGM.py | buivn/paperImplementation | 52371926d1f6cc8fcfcdf302596ce3bdae4beac6 | [
"BSD-2-Clause"
] | null | null | null | import sys
import random
from tkinter import *
import time
import math, queue
from Init_map import *
import threading
import numpy as np
import array
map_dimension = 10
numberofaction = 4
spacedimension = 2
theta_leng = map_dimension*spacedimension*numberofaction
theta = np.zeros(theta_leng)
#phi_BF = np.one(80)
d... | 34.085586 | 112 | 0.570636 |
4a0ebdb31a6b5bc75ed6afec3058c821dbb713c1 | 1,756 | py | Python | gw_bot/helpers/Test_Helper.py | atykhonov/GW-Bot | fb1d8584f229efe703f05aa0e44fa0924b90ca1d | [
"Apache-2.0"
] | null | null | null | gw_bot/helpers/Test_Helper.py | atykhonov/GW-Bot | fb1d8584f229efe703f05aa0e44fa0924b90ca1d | [
"Apache-2.0"
] | null | null | null | gw_bot/helpers/Test_Helper.py | atykhonov/GW-Bot | fb1d8584f229efe703f05aa0e44fa0924b90ca1d | [
"Apache-2.0"
] | null | null | null | import base64
from unittest import TestCase
from pbx_gs_python_utils.utils.Dev import Dev
from gw_bot.setup.OSS_Setup import OSS_Setup
class Test_Helper(TestCase):
def setUp(self) -> OSS_Setup:
return self.oss_setup()
def oss_setup(self,profile_name = None, account_id=None, region=None) -> OSS_Se... | 35.836735 | 120 | 0.632688 |
4a0ebdbccdc379110607d08feb0208ba8c359faa | 7,129 | py | Python | flask/testsuite/templating.py | Khan/flask | e78e2a1641e5b7ad538d93154ee59445f4d4eaf7 | [
"BSD-3-Clause"
] | 5 | 2015-01-18T01:47:56.000Z | 2016-01-30T14:58:58.000Z | flask/testsuite/templating.py | Khan/flask | e78e2a1641e5b7ad538d93154ee59445f4d4eaf7 | [
"BSD-3-Clause"
] | 6 | 2018-06-21T19:45:01.000Z | 2018-06-21T19:45:02.000Z | flask/testsuite/templating.py | Khan/flask | e78e2a1641e5b7ad538d93154ee59445f4d4eaf7 | [
"BSD-3-Clause"
] | 6 | 2018-07-14T04:58:02.000Z | 2018-08-06T18:02:27.000Z | # -*- coding: utf-8 -*-
"""
flask.testsuite.templating
~~~~~~~~~~~~~~~~~~~~~~~~~~
Template functionality
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from __future__ import with_statement
import flask
import unittest
from flask.testsuite import FlaskTe... | 34.946078 | 78 | 0.580025 |
4a0ebe3f4750565be9f1fd05a93536bbf178192e | 18,030 | py | Python | src/pose_estimator/model_hrnet.py | Liang813/GaitGraph | df8cfd8d1e7a91a738190ba68bc52a67207188e5 | [
"MIT"
] | 57 | 2021-01-14T12:45:04.000Z | 2022-03-22T08:57:26.000Z | src/pose_estimator/model_hrnet.py | KennChow/GaitGraph | 749aa32ce079f0afaa39b15a90c8f1664f864436 | [
"MIT"
] | 18 | 2021-02-07T07:37:08.000Z | 2022-03-22T11:17:11.000Z | src/pose_estimator/model_hrnet.py | KennChow/GaitGraph | 749aa32ce079f0afaa39b15a90c8f1664f864436 | [
"MIT"
] | 18 | 2021-03-13T11:15:04.000Z | 2022-03-28T05:10:34.000Z | # ------------------------------------------------------------------------------
# Copyright (c) Microsoft
# Licensed under the MIT License.
# Written by Bin Xiao (Bin.Xiao@microsoft.com)
# ------------------------------------------------------------------------------
import os
import logging
import torch
import torc... | 36.204819 | 93 | 0.523849 |
4a0ebf32a498f4199f6c07c86166b766b7542b2c | 3,911 | py | Python | wiki.py | nzbr/wikigame | e05d10b97ca3e1d56757056d10c74c0ade6a39be | [
"0BSD"
] | 3 | 2020-01-20T19:03:06.000Z | 2020-06-10T02:42:29.000Z | wiki.py | nzbr/wikigame | e05d10b97ca3e1d56757056d10c74c0ade6a39be | [
"0BSD"
] | null | null | null | wiki.py | nzbr/wikigame | e05d10b97ca3e1d56757056d10c74c0ade6a39be | [
"0BSD"
] | null | null | null | #!/usr/bin/python3
from bs4 import BeautifulSoup
from multiprocessing import Pool
from sys import stdout
from urllib.parse import urljoin, quote
from urllib.request import urlopen
import argparse
import os
import traceback
parser = argparse.ArgumentParser()
parser.add_argument('cc', help='Country code for your Wikipe... | 26.248322 | 258 | 0.610841 |
4a0ebf840a213672ae1a3485f8163b6f082749f4 | 6,511 | py | Python | libs/shape.py | llockhar/Medical-Image-Annotator | 272df20be309f8b08ef6b56f91351df63857183f | [
"MIT"
] | 3 | 2020-07-21T02:45:57.000Z | 2021-02-27T10:49:13.000Z | libs/shape.py | llockhar/Medical-Image-Annotator | 272df20be309f8b08ef6b56f91351df63857183f | [
"MIT"
] | 1 | 2020-08-26T18:04:00.000Z | 2020-08-27T14:10:37.000Z | libs/shape.py | llockhar/Medical-Image-Annotator | 272df20be309f8b08ef6b56f91351df63857183f | [
"MIT"
] | 1 | 2022-01-31T04:43:57.000Z | 2022-01-31T04:43:57.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
try:
from PyQt5.QtGui import *
from PyQt5.QtCore import *
except ImportError:
from PyQt4.QtGui import *
from PyQt4.QtCore import *
from libs.utils import distance
import sys
DEFAULT_LINE_COLOR = QColor(0, 255, 0, 128)
DEFAULT_FILL_COLOR = QColor(255, 0, 0, 1... | 31.454106 | 87 | 0.590232 |
4a0ebf9e9875618da5760a6dd168d15b73e3fccc | 173 | py | Python | MathStudy.py | ReubenU/HelpfulGameAlgorithms | ae7760ee82e45d575e7b0d81f537530949d12c7e | [
"MIT"
] | null | null | null | MathStudy.py | ReubenU/HelpfulGameAlgorithms | ae7760ee82e45d575e7b0d81f537530949d12c7e | [
"MIT"
] | null | null | null | MathStudy.py | ReubenU/HelpfulGameAlgorithms | ae7760ee82e45d575e7b0d81f537530949d12c7e | [
"MIT"
] | null | null | null | # Author: Reuben Unicruz
# Date: 4/9/2019
import math
# Sigmoid logistical function
def sigmoid(x):
return 1 / (1 + math.exp(-x))
print(sigmoid(1))
| 14.416667 | 34 | 0.601156 |
4a0ebfdedd00041c78110ce20f6b8ef9c1f29528 | 23,277 | py | Python | venv/Lib/site-packages/git/test/test_refs.py | dhina016/OnCV | 2429ba7bc8589e92b2c273af6e8763487e1e05a8 | [
"Unlicense",
"MIT"
] | 1 | 2020-08-13T12:21:56.000Z | 2020-08-13T12:21:56.000Z | venv/Lib/site-packages/git/test/test_refs.py | dhina016/OnCV | 2429ba7bc8589e92b2c273af6e8763487e1e05a8 | [
"Unlicense",
"MIT"
] | 5 | 2021-03-19T11:01:43.000Z | 2022-02-10T12:02:58.000Z | venv/Lib/site-packages/git/test/test_refs.py | dhina016/OnCV | 2429ba7bc8589e92b2c273af6e8763487e1e05a8 | [
"Unlicense",
"MIT"
] | 1 | 2020-11-01T04:03:38.000Z | 2020-11-01T04:03:38.000Z | # test_refs.py
# Copyright (C) 2008, 2009 Michael Trier (mtrier@gmail.com) and contributors
#
# This module is part of GitPython and is released under
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
from itertools import chain
from git import (
Reference,
Head,
TagReference,
Remo... | 40.908612 | 111 | 0.63479 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.