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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e11d5329a3f8d1b9c8259746d3b9e45f2b0afeb5 | 490 | py | Python | pandaharvester/harvestercredmanager/base_cred_manager.py | tsulaiav/harvester | ca3f78348019dd616738f2da7d50e81700a8e6b9 | [
"Apache-2.0"
] | 7 | 2019-08-30T07:35:48.000Z | 2022-02-13T14:46:53.000Z | pandaharvester/harvestercredmanager/base_cred_manager.py | tsulaiav/harvester | ca3f78348019dd616738f2da7d50e81700a8e6b9 | [
"Apache-2.0"
] | 29 | 2019-09-20T14:04:37.000Z | 2021-09-13T12:53:05.000Z | pandaharvester/harvestercredmanager/base_cred_manager.py | tsulaiav/harvester | ca3f78348019dd616738f2da7d50e81700a8e6b9 | [
"Apache-2.0"
] | 15 | 2019-07-30T11:48:29.000Z | 2022-03-29T21:49:05.000Z | from pandaharvester.harvestercore.plugin_base import PluginBase
# base credential manager
class BaseCredManager(PluginBase):
# constructor
def __init__(self, **kwarg):
PluginBase.__init__(self, **kwarg)
# check credential lifetime for monitoring/alerting purposes
def check_credential_lifetim... | 22.272727 | 64 | 0.7 |
93735a218f7961025e3482f40c7f8cb2bd4f0288 | 54,985 | py | Python | models/networks.py | CaptainEven/MyEnlightenGAN | 8e7cfb01d77afa26ddc98e362ed4616f0cd3f23a | [
"BSD-3-Clause"
] | 1 | 2022-02-28T08:26:16.000Z | 2022-02-28T08:26:16.000Z | models/networks.py | CaptainEven/MyEnlightenGAN | 8e7cfb01d77afa26ddc98e362ed4616f0cd3f23a | [
"BSD-3-Clause"
] | null | null | null | models/networks.py | CaptainEven/MyEnlightenGAN | 8e7cfb01d77afa26ddc98e362ed4616f0cd3f23a | [
"BSD-3-Clause"
] | null | null | null | import functools
import os
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from torch.nn import init
# from torch.utils.serialization import load_lua
from lib.nn import SynchronizedBatchNorm2d as SynBN2d
######################################... | 37.868457 | 129 | 0.561844 |
aa12c46c419eea2875449a679ef874d191718bc2 | 568 | py | Python | GUI/gui_sample_003.py | lcarlin/guppe | a0ee7b85e8687e8fb8243fbb509119a94bc6460f | [
"Apache-2.0"
] | 1 | 2021-12-18T15:29:24.000Z | 2021-12-18T15:29:24.000Z | GUI/gui_sample_003.py | lcarlin/guppe | a0ee7b85e8687e8fb8243fbb509119a94bc6460f | [
"Apache-2.0"
] | null | null | null | GUI/gui_sample_003.py | lcarlin/guppe | a0ee7b85e8687e8fb8243fbb509119a94bc6460f | [
"Apache-2.0"
] | 3 | 2021-08-23T22:45:20.000Z | 2022-02-17T13:17:09.000Z | from tkinter import *
class Application:
def __init__(self, master=None):
self.widget1 = Frame(master)
self.widget1.pack()
self.msg = Label(self.widget1, text="Primeiro widget")
self.msg["font"] = ("Verdana", "10", "italic", "bold")
self.msg.pack ()
self.sair = Button... | 31.555556 | 62 | 0.577465 |
73d6574d0215d2f26f4cb87c3460c0a4d2c84793 | 1,065 | py | Python | main.py | D28112003/freesms | bea573a68db282e93a2323d3d00f7ffc2c91eab5 | [
"MIT"
] | 3 | 2020-12-07T20:38:51.000Z | 2020-12-07T20:59:39.000Z | main.py | D28112003/freesms | bea573a68db282e93a2323d3d00f7ffc2c91eab5 | [
"MIT"
] | null | null | null | main.py | D28112003/freesms | bea573a68db282e93a2323d3d00f7ffc2c91eab5 | [
"MIT"
] | null | null | null | import os,time,sys,shutil
class Main:
def __init__(self):
self.detekos()
def menu(self):
print("""
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; S P A M S M S ;
;---------------------------;
; Author : Dhani ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
NOTE: This tool's only work for Indon... | 19.722222 | 74 | 0.53615 |
b50b1b2c1ef12620695ef09785e9f35ad5034bfe | 1,903 | py | Python | tests/gameman_test.py | stratts/savman | 16ba9a527c6448ba7570cce7b7430ef55561e660 | [
"MIT"
] | null | null | null | tests/gameman_test.py | stratts/savman | 16ba9a527c6448ba7570cce7b7430ef55561e660 | [
"MIT"
] | null | null | null | tests/gameman_test.py | stratts/savman | 16ba9a527c6448ba7570cce7b7430ef55561e660 | [
"MIT"
] | null | null | null | import pytest
from savman import gameman
@pytest.fixture
def gamedir(tmpdir):
groot = tmpdir.mkdir('Games')
gdir = groot.mkdir('MyGame')
f1 = gdir.join('test1.txt')
f2 = gdir.join('test2.txt')
f3 = gdir.join('test3.png')
f1.write('test1'); f2.write('test2'); f3.write('test3')
return gdir
@... | 26.068493 | 64 | 0.606411 |
e04e9b60c275f0a43829cac60b8941c0baa8a34d | 6,186 | py | Python | rasa/core/train.py | isaac-philip/rasa | 923db75e03921921a6f1f3489a2c5574138ee685 | [
"Apache-2.0"
] | 1 | 2020-06-15T02:06:41.000Z | 2020-06-15T02:06:41.000Z | rasa/core/train.py | isaac-philip/rasa | 923db75e03921921a6f1f3489a2c5574138ee685 | [
"Apache-2.0"
] | 49 | 2020-06-23T11:26:22.000Z | 2022-02-01T13:22:24.000Z | rasa/core/train.py | isaac-philip/rasa | 923db75e03921921a6f1f3489a2c5574138ee685 | [
"Apache-2.0"
] | 1 | 2020-07-01T12:07:55.000Z | 2020-07-01T12:07:55.000Z | import argparse
import asyncio
import logging
import os
import tempfile
import typing
from typing import Dict, Optional, Text, Union, List
import rasa.utils.io
from rasa.constants import NUMBER_OF_TRAINING_STORIES_FILE, PERCENTAGE_KEY
from rasa.core.domain import Domain
from rasa.importers.importer import TrainingData... | 32.557895 | 88 | 0.640155 |
f1193420cf2b163275957c20875fd7f0faa17b0c | 2,908 | py | Python | src/m2_robot_code.py | lcopland18/99-CapstoneProject-201930 | 34b68b0010d649a9bf503b1da6d9c53a36aad4b7 | [
"MIT"
] | null | null | null | src/m2_robot_code.py | lcopland18/99-CapstoneProject-201930 | 34b68b0010d649a9bf503b1da6d9c53a36aad4b7 | [
"MIT"
] | null | null | null | src/m2_robot_code.py | lcopland18/99-CapstoneProject-201930 | 34b68b0010d649a9bf503b1da6d9c53a36aad4b7 | [
"MIT"
] | null | null | null | """
Capstone Project. Code to run on the EV3 robot (NOT on a laptop).
Author: Your professors (for the framework)
and Lauren Copland.
Spring term, 2018-2019.
"""
# DONE 1: Put your name in the above.
import math
import mqtt_remote_method_calls as mqtt
import rosebot
import m2_robot_code as m2
import m3_rob... | 35.901235 | 83 | 0.665062 |
222e6cb844a66643fa06ceaa24e41e4613bcbca5 | 1,990 | py | Python | projects/api/predictions.py | ndarvishev/projects | 6a9855c5f8af8fad2799ef7a203e126b834c5056 | [
"Apache-2.0"
] | 1 | 2021-06-26T19:13:49.000Z | 2021-06-26T19:13:49.000Z | projects/api/predictions.py | ndarvishev/projects | 6a9855c5f8af8fad2799ef7a203e126b834c5056 | [
"Apache-2.0"
] | null | null | null | projects/api/predictions.py | ndarvishev/projects | 6a9855c5f8af8fad2799ef7a203e126b834c5056 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""Predictions API Router."""
from json.decoder import JSONDecodeError
from typing import Optional
from fastapi import APIRouter, Depends, File, Request, UploadFile
from sqlalchemy.orm import Session
from projects.controllers import DeploymentController, PredictionController, \
ProjectCont... | 33.166667 | 89 | 0.650754 |
867c3f4b854a478bb47bb4ed854501f327dc62e9 | 453 | py | Python | datastrucutre/array/peak_element.py | abhishektyagi2912/python-dsa | 8f51f15a091ee76e00fb34abc232c23cb68440cb | [
"MIT"
] | 1 | 2021-05-02T05:43:34.000Z | 2021-05-02T05:43:34.000Z | datastrucutre/array/peak_element.py | abhishektyagi2912/python-dsa | 8f51f15a091ee76e00fb34abc232c23cb68440cb | [
"MIT"
] | null | null | null | datastrucutre/array/peak_element.py | abhishektyagi2912/python-dsa | 8f51f15a091ee76e00fb34abc232c23cb68440cb | [
"MIT"
] | null | null | null | def peak(arr, low, high):
n = len(arr)
while low <= high:
mid = low + (high - low) / 2
mid = int(mid)
if (mid == 0 or arr[mid-1] <= arr[mid]) and (mid == n-1 or arr[mid+1] <= arr[mid]):
return(arr[mid])
elif mid > 0 and arr[mid-1] > arr[mid]:
... | 23.842105 | 92 | 0.415011 |
531e211209f6f22d0d03e9f316ed6071bccf6749 | 418 | py | Python | labinfo11/venv/Scripts/pip3-script.py | MatiwsxD/ayed-2019-1 | a5fdbe3a055405150122cf3875cdb0c6afd9eff0 | [
"MIT"
] | null | null | null | labinfo11/venv/Scripts/pip3-script.py | MatiwsxD/ayed-2019-1 | a5fdbe3a055405150122cf3875cdb0c6afd9eff0 | [
"MIT"
] | null | null | null | labinfo11/venv/Scripts/pip3-script.py | MatiwsxD/ayed-2019-1 | a5fdbe3a055405150122cf3875cdb0c6afd9eff0 | [
"MIT"
] | null | null | null | #!C:\Users\MatiwsxD\PycharmProjects\labinfo11\venv\Scripts\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'pip==10.0.1','console_scripts','pip3'
__requires__ = 'pip==10.0.1'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.... | 32.153846 | 69 | 0.674641 |
82f1d32ed1067cf1f19d85e53ebe487485f2ac3a | 384 | py | Python | src/assignments/assignment10/customer.py | acc-cosc-1336/cosc-1336-spring-2018-zachdiamond000 | 1bcb2b6f75d9b8dd38a77f075f82f541e774411c | [
"MIT"
] | null | null | null | src/assignments/assignment10/customer.py | acc-cosc-1336/cosc-1336-spring-2018-zachdiamond000 | 1bcb2b6f75d9b8dd38a77f075f82f541e774411c | [
"MIT"
] | null | null | null | src/assignments/assignment10/customer.py | acc-cosc-1336/cosc-1336-spring-2018-zachdiamond000 | 1bcb2b6f75d9b8dd38a77f075f82f541e774411c | [
"MIT"
] | null | null | null | '''
Create a customer class
Add a constructor with parameters first, last, and phone_number
Create public attributes for first, last, and phone_number
STUDENT MUST ALSO MODIFY INVOICE CLASS TO USE THIS CLASS
SEE INVOICE file FOR INSTRUCTIONS
'''
class Customer:
def __init__(self,first, last,p_number):
se... | 24 | 63 | 0.708333 |
45d642cf079908964e73e5c1e92413f25461c423 | 3,120 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/tools/visualization/plot_summary.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 4 | 2020-11-13T02:35:56.000Z | 2021-03-29T20:15:54.000Z | Co-Simulation/Sumo/sumo-1.7.0/tools/visualization/plot_summary.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 9 | 2020-12-09T02:12:39.000Z | 2021-02-18T00:15:28.000Z | Co-Simulation/Sumo/sumo-1.7.0/tools/visualization/plot_summary.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 1 | 2020-11-20T19:31:26.000Z | 2020-11-20T19:31:26.000Z | #!/usr/bin/env python
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
# Copyright (C) 2013-2020 German Aerospace Center (DLR) and others.
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# https://www.ec... | 35.862069 | 87 | 0.675321 |
e0a6d9ca7cd2a0f50cd902ea6c9ccc49e67f926c | 65,867 | py | Python | cryptocurrency_bot/main_bot.py | Hukyl/cryptocurrency_bot | 5fd97056f1c88aea406571d1183e3ce1b7a50474 | [
"MIT"
] | 1 | 2021-06-02T06:13:56.000Z | 2021-06-02T06:13:56.000Z | cryptocurrency_bot/main_bot.py | Hukyl/cryptocurrency_bot | 5fd97056f1c88aea406571d1183e3ce1b7a50474 | [
"MIT"
] | null | null | null | cryptocurrency_bot/main_bot.py | Hukyl/cryptocurrency_bot | 5fd97056f1c88aea406571d1183e3ce1b7a50474 | [
"MIT"
] | null | null | null | from concurrent import futures
import copy
import datetime
import threading
import time
import telebot
from telebot.types import LabeledPrice
import schedule
from configs import settings
from models.parsers import CurrencyExchanger
from models.user import User, Prediction, Session
from models import exce... | 35.719631 | 80 | 0.518924 |
1c89baba592db30451f7f61b82d96fd736b64e86 | 9,317 | py | Python | python/dask_cudf/dask_cudf/sorting.py | NVnavkumar/cudf | ef6a3907d0fc9223fe3f0e61b73a0ea9f5c7281f | [
"Apache-2.0"
] | 239 | 2018-10-10T09:55:22.000Z | 2018-10-28T20:47:23.000Z | python/dask_cudf/dask_cudf/sorting.py | NVnavkumar/cudf | ef6a3907d0fc9223fe3f0e61b73a0ea9f5c7281f | [
"Apache-2.0"
] | 25 | 2018-10-10T14:46:32.000Z | 2018-10-28T22:16:14.000Z | python/dask_cudf/dask_cudf/sorting.py | NVnavkumar/cudf | ef6a3907d0fc9223fe3f0e61b73a0ea9f5c7281f | [
"Apache-2.0"
] | 19 | 2018-10-10T12:42:51.000Z | 2018-10-26T16:33:22.000Z | # Copyright (c) 2020-2022, NVIDIA CORPORATION.
from collections.abc import Iterator
import cupy
import numpy as np
import tlz as toolz
from dask.base import tokenize
from dask.dataframe import methods
from dask.dataframe.core import DataFrame, Index, Series
from dask.dataframe.shuffle import rearrange_by_column
from... | 31.056667 | 79 | 0.634002 |
d7c2f376d2c67da32f38a4ad2cff6ec70f864d02 | 457 | py | Python | src/ToolChainSCDG/procedures/windows/custom_package/GetTickCount.py | AnonymousSEMA/SEMA-ToolChain | 05d6a7e43e10d4b1f6c5dfb70fbabeab3d4daf82 | [
"BSD-2-Clause"
] | null | null | null | src/ToolChainSCDG/procedures/windows/custom_package/GetTickCount.py | AnonymousSEMA/SEMA-ToolChain | 05d6a7e43e10d4b1f6c5dfb70fbabeab3d4daf82 | [
"BSD-2-Clause"
] | null | null | null | src/ToolChainSCDG/procedures/windows/custom_package/GetTickCount.py | AnonymousSEMA/SEMA-ToolChain | 05d6a7e43e10d4b1f6c5dfb70fbabeab3d4daf82 | [
"BSD-2-Clause"
] | null | null | null | import logging
import time as timer
import angr
lw = logging.getLogger("CustomSimProcedureWindows")
class GetTickCount(angr.SimProcedure):
def run(self):
if angr.options.USE_SYSTEM_TIMES in self.state.options:
return int(timer.perf_counter() * 1000) + 12345
else:
val = sel... | 26.882353 | 69 | 0.641138 |
b75603ef2e99139a984024f1dbf54e58384c333d | 2,736 | py | Python | tensor2tensor/envs/time_step.py | SamuelmsWong/tensor2tensor | 7172ad8dc5f1d8f8c0e21cbb831ae2657387a2af | [
"Apache-2.0"
] | 3 | 2021-01-19T20:21:15.000Z | 2021-01-19T21:36:37.000Z | tensor2tensor/envs/time_step.py | SamuelmsWong/tensor2tensor | 7172ad8dc5f1d8f8c0e21cbb831ae2657387a2af | [
"Apache-2.0"
] | null | null | null | tensor2tensor/envs/time_step.py | SamuelmsWong/tensor2tensor | 7172ad8dc5f1d8f8c0e21cbb831ae2657387a2af | [
"Apache-2.0"
] | 1 | 2020-06-19T17:36:10.000Z | 2020-06-19T17:36:10.000Z | # coding=utf-8
# Copyright 2020 The Tensor2Tensor 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... | 35.532468 | 80 | 0.685307 |
c30846895d84b5ba7497e41bb9be62cc946070a4 | 1,151 | py | Python | ansible-tests/validations/library/overcloudrc.py | rthallisey/clapper | 7f6aeae9320c2c8b46c8f56d2a6191ecc6991e5b | [
"Apache-2.0"
] | 13 | 2015-10-19T02:02:23.000Z | 2019-01-03T09:07:08.000Z | ansible-tests/validations/library/overcloudrc.py | rthallisey/clapper | 7f6aeae9320c2c8b46c8f56d2a6191ecc6991e5b | [
"Apache-2.0"
] | 42 | 2015-09-04T18:02:17.000Z | 2016-12-20T14:47:09.000Z | ansible-tests/validations/library/overcloudrc.py | rthallisey/clapper | 7f6aeae9320c2c8b46c8f56d2a6191ecc6991e5b | [
"Apache-2.0"
] | 22 | 2015-07-27T16:37:59.000Z | 2019-04-09T02:04:10.000Z | #!/usr/bin/env python
from ansible.module_utils.basic import *
import os.path
import subprocess
def main():
module = AnsibleModule(argument_spec=dict(
path=dict(required=True, type='str'),
))
overcloudrc_path = module.params.get('path')
if not os.path.isfile(overcloudrc_path):
modu... | 28.073171 | 76 | 0.622068 |
747e183b5d4bc7d1c5d10d4e84f7398fd8aca8b9 | 5,779 | py | Python | src/toil/cwl/utils.py | w-gao/toil | 10fea969578f3438b47cfa3b26e2d73394f02e54 | [
"Apache-2.0"
] | null | null | null | src/toil/cwl/utils.py | w-gao/toil | 10fea969578f3438b47cfa3b26e2d73394f02e54 | [
"Apache-2.0"
] | null | null | null | src/toil/cwl/utils.py | w-gao/toil | 10fea969578f3438b47cfa3b26e2d73394f02e54 | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2015-2021 Regents of the University of California
#
# 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 app... | 35.89441 | 103 | 0.662225 |
19500153b863fb610c02de6000eced2a762b2294 | 514 | py | Python | food_ke/scripts/extract_spans.py | IBPA/FoodAtlas | 0a431f0a391adaa8984b380f3f6f7189f27b9311 | [
"Apache-2.0"
] | 1 | 2022-02-07T10:04:35.000Z | 2022-02-07T10:04:35.000Z | food_ke/scripts/extract_spans.py | IBPA/FoodAtlas | 0a431f0a391adaa8984b380f3f6f7189f27b9311 | [
"Apache-2.0"
] | null | null | null | food_ke/scripts/extract_spans.py | IBPA/FoodAtlas | 0a431f0a391adaa8984b380f3f6f7189f27b9311 | [
"Apache-2.0"
] | null | null | null | from dagster import composite_solid, pipeline, solid
from food_ke.scripts.modes import dev, prod
from food_ke.scripts.ner import (
chunk_articles,
get_articles,
get_spans_from_chunks,
)
@composite_solid(required_resource_defs={"ner_training_io_manager"})
def get_ner_training_data_composite_solid():
a... | 25.7 | 68 | 0.801556 |
198e59dfb16faa617db9927bed981bd111ff115c | 735 | py | Python | orderprocessing/orders/models/order.py | iomegak12/intel-training-usecase-1 | 0d1ab6f6076f46f7fbb290ceb41d6b851da1af3a | [
"MIT"
] | null | null | null | orderprocessing/orders/models/order.py | iomegak12/intel-training-usecase-1 | 0d1ab6f6076f46f7fbb290ceb41d6b851da1af3a | [
"MIT"
] | null | null | null | orderprocessing/orders/models/order.py | iomegak12/intel-training-usecase-1 | 0d1ab6f6076f46f7fbb290ceb41d6b851da1af3a | [
"MIT"
] | null | null | null | class Order:
def __init__(self, orderId: int, orderDate, customerId: int, productId: int, unitsOrdered: int, remarks):
self.orderId = orderId
self.orderDate = orderDate
self.customerId = customerId
self.productId = productId
self.unitsOrdered = unitsOrdered
self.remar... | 43.235294 | 109 | 0.444898 |
18ca5cf3e8776d3b1a3fd8ea0290c9826199544d | 32,786 | py | Python | netbox/dcim/models/device_components.py | v0tti/netbox | a9a20bf7195ba41b353b7d9b2989b643fea78ffd | [
"Apache-2.0"
] | null | null | null | netbox/dcim/models/device_components.py | v0tti/netbox | a9a20bf7195ba41b353b7d9b2989b643fea78ffd | [
"Apache-2.0"
] | null | null | null | netbox/dcim/models/device_components.py | v0tti/netbox | a9a20bf7195ba41b353b7d9b2989b643fea78ffd | [
"Apache-2.0"
] | null | null | null | import logging
from django.contrib.contenttypes.fields import GenericRelation
from django.core.exceptions import ObjectDoesNotExist, ValidationError
from django.core.validators import MaxValueValidator, MinValueValidator
from django.db import models
from django.db.models import Sum
from django.urls import reverse
from... | 31.862002 | 120 | 0.60718 |
a0bcf1a98bec279eff34eb1cd30da2b38ae7be3c | 1,259 | py | Python | V/tool.py | lllllaurel/jujiaodata | 96bbd9386ba0746a0cccd0f1976098115f74ffb3 | [
"MIT"
] | null | null | null | V/tool.py | lllllaurel/jujiaodata | 96bbd9386ba0746a0cccd0f1976098115f74ffb3 | [
"MIT"
] | null | null | null | V/tool.py | lllllaurel/jujiaodata | 96bbd9386ba0746a0cccd0f1976098115f74ffb3 | [
"MIT"
] | null | null | null | """
@author: laurel
@file: admin.py.py
@time: 2019/05/15
@description: tools
"""
from django.shortcuts import render, render_to_response
from django.http import JsonResponse,HttpResponse, HttpResponseRedirect
from syapp.models import YsArticle, Ips, Logs
from django import forms
from syapp.models import UserMain
from ... | 29.27907 | 122 | 0.713264 |
6a93c1412d419f3bb810c2747bbef9124116c50f | 2,397 | py | Python | server/swagger_server/models/notification_list.py | kakwa/certascale | 0df8da0f518506500117152fd0e28ee3286949af | [
"MIT"
] | null | null | null | server/swagger_server/models/notification_list.py | kakwa/certascale | 0df8da0f518506500117152fd0e28ee3286949af | [
"MIT"
] | null | null | null | server/swagger_server/models/notification_list.py | kakwa/certascale | 0df8da0f518506500117152fd0e28ee3286949af | [
"MIT"
] | 2 | 2020-11-04T03:07:00.000Z | 2020-11-05T08:14:33.000Z | # coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from swagger_server.models.base_model_ import Model
from swagger_server.models.notification import Notification # noqa: F401,E501
from swagger_server import util
cla... | 26.054348 | 87 | 0.618273 |
5657d8b2917ccfae3102c8c80af5d467d2efe519 | 4,351 | py | Python | conveyor.py | AndrBRus/Auto-manufacture-simulation | 0bffcc2109804da8be3d71d67e2881ec52030707 | [
"MIT"
] | null | null | null | conveyor.py | AndrBRus/Auto-manufacture-simulation | 0bffcc2109804da8be3d71d67e2881ec52030707 | [
"MIT"
] | null | null | null | conveyor.py | AndrBRus/Auto-manufacture-simulation | 0bffcc2109804da8be3d71d67e2881ec52030707 | [
"MIT"
] | null | null | null | # This module contains info about conveyor and actions on it.
# This class describes the conveyor,
# also all the functions that it can perform.
class conveyor(object):
# class constructor
def __init__(self):
self.work_status = True # status of conveyor work: True if conveyor is moving else Fal... | 50.011494 | 131 | 0.627672 |
1b64f7cd93bfef8169b729cb08b9e83b7aa851a7 | 13,649 | py | Python | sdk/python/pulumi_aws/ec2/local_gateway_route_table_vpc_association.py | aamir-locus/pulumi-aws | 3e234b050129bde35d8e072a88bd608562f02142 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/ec2/local_gateway_route_table_vpc_association.py | aamir-locus/pulumi-aws | 3e234b050129bde35d8e072a88bd608562f02142 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/ec2/local_gateway_route_table_vpc_association.py | aamir-locus/pulumi-aws | 3e234b050129bde35d8e072a88bd608562f02142 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** 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, overload
from .. import... | 44.604575 | 226 | 0.676313 |
1eadc641a192e5d5bb27a43c02953191594fe457 | 742 | py | Python | portfolio/home/migrations/0001_initial.py | queenieroseongcal98/website-design-gtms | 40ca21be4ad2fed1c1580562aa25e7238b0e2faf | [
"MIT"
] | null | null | null | portfolio/home/migrations/0001_initial.py | queenieroseongcal98/website-design-gtms | 40ca21be4ad2fed1c1580562aa25e7238b0e2faf | [
"MIT"
] | null | null | null | portfolio/home/migrations/0001_initial.py | queenieroseongcal98/website-design-gtms | 40ca21be4ad2fed1c1580562aa25e7238b0e2faf | [
"MIT"
] | null | null | null | # Generated by Django 3.1.5 on 2021-02-05 09:42
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Contact',
fields=[
('id', models.AutoField(... | 28.538462 | 114 | 0.563342 |
788b5d6d5cf705ad4e1cc47bf110b306d6e3cf9f | 1,425 | py | Python | move_base_goal_receiv.py | parkhyeonseung/ddarawa | 9148b7fd1f61ac48aa632143ef00dce58f52978c | [
"Apache-2.0"
] | 1 | 2022-01-13T03:26:26.000Z | 2022-01-13T03:26:26.000Z | move_base_goal_receiv.py | parkhyeonseung/ddarawa | 9148b7fd1f61ac48aa632143ef00dce58f52978c | [
"Apache-2.0"
] | null | null | null | move_base_goal_receiv.py | parkhyeonseung/ddarawa | 9148b7fd1f61ac48aa632143ef00dce58f52978c | [
"Apache-2.0"
] | null | null | null | import rospy
import actionlib
from move_base_msgs.msg import MoveBaseAction, MoveBaseGoal
import socket
import pickle ,time
def movebase_client():
receiver = socket.socket(family=socket.AF_INET, type=socket.SOCK_DGRAM)
receiver.bind((master_ip,7778))
client = actionlib.SimpleActionClient('move_base',Mov... | 27.403846 | 75 | 0.678596 |
0209b4af6278f957eb3b5fc8d6902d58007a6ca6 | 3,461 | py | Python | plums/plot/engine/utils.py | alexandreMayerowitz/playground-plums | a6be79e4c30c7abcbade5581f052a4e8035a2057 | [
"MIT"
] | null | null | null | plums/plot/engine/utils.py | alexandreMayerowitz/playground-plums | a6be79e4c30c7abcbade5581f052a4e8035a2057 | [
"MIT"
] | null | null | null | plums/plot/engine/utils.py | alexandreMayerowitz/playground-plums | a6be79e4c30c7abcbade5581f052a4e8035a2057 | [
"MIT"
] | 2 | 2021-02-03T12:37:53.000Z | 2022-03-09T03:48:12.000Z | import PIL.ImageFont
import numpy as np
from plums.commons import Path
def get_text_color(background_color):
"""Select the appropriate text color (black or white) based on the luminance of the background color.
Arguments:
background_color (tuple): The record color (RGB or RGBA format).
Returns:... | 37.215054 | 115 | 0.656747 |
5f9e930332db429d1f43fad19d56985259e610c2 | 2,352 | py | Python | main/model/post.py | daspots/dasapp | 15b113f86842fb8dcef71780a8bda23618427ab3 | [
"MIT"
] | null | null | null | main/model/post.py | daspots/dasapp | 15b113f86842fb8dcef71780a8bda23618427ab3 | [
"MIT"
] | null | null | null | main/model/post.py | daspots/dasapp | 15b113f86842fb8dcef71780a8bda23618427ab3 | [
"MIT"
] | null | null | null | from google.appengine.ext import ndb
import model
from api import fields
import flask
import util
class Post(model.Base):
user_key = ndb.KeyProperty(kind=model.User, required=True)
title = ndb.StringProperty(required=True)
content = ndb.StringProperty(default='')
image_ids_string = ndb.StringProperty(default='... | 30.545455 | 97 | 0.713861 |
3cd9b2415637404fd56d373edd7170be4022f19e | 1,379 | py | Python | setup.py | neurobin/phantomjspy | 45ecd242a200e55a6efb0b5596ef81950766b5c9 | [
"BSD-3-Clause"
] | 10 | 2019-12-21T21:34:30.000Z | 2021-11-27T01:23:58.000Z | setup.py | neurobin/phantomjspy | 45ecd242a200e55a6efb0b5596ef81950766b5c9 | [
"BSD-3-Clause"
] | 4 | 2020-03-31T17:29:31.000Z | 2021-05-28T05:18:28.000Z | setup.py | neurobin/phantomjspy | 45ecd242a200e55a6efb0b5596ef81950766b5c9 | [
"BSD-3-Clause"
] | 4 | 2019-12-21T21:42:25.000Z | 2021-05-27T19:44:57.000Z | # -*- coding: utf-8 -*-
import os
import sys
from codecs import open
from setuptools import setup
sys.path[0:0] = ['phantomjs']
from version import __version__
def get_readme(filename):
content = ""
try:
with open(os.path.join(os.path.dirname(__file__), filename), 'r', encoding='utf-8') as readme:
... | 31.340909 | 102 | 0.649746 |
4c6e9ddbc79a972e7dc7e01844b44aaf8cc45918 | 846 | py | Python | scripts/old/show_calib_points.py | strawlab/flyvr | 335892cae740e53e82e07b526e1ba53fbd34b0ce | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 3 | 2015-01-29T14:09:25.000Z | 2016-04-24T04:25:49.000Z | scripts/old/show_calib_points.py | strawlab/flyvr | 335892cae740e53e82e07b526e1ba53fbd34b0ce | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | scripts/old/show_calib_points.py | strawlab/flyvr | 335892cae740e53e82e07b526e1ba53fbd34b0ce | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | import os.path
import pickle
import sys
import json
import roslib;
roslib.load_manifest('freemovr_engine')
roslib.load_manifest('std_msgs')
import rospy
from std_msgs.msg import UInt32, String
if __name__ == "__main__":
rospy.init_node('showcalibpoints', anonymous=True)
pub_pts = rospy.Publisher('/multicams... | 26.4375 | 86 | 0.710402 |
d49e5621a2e119e5f52b80b4c9791e0bf19cbb31 | 4,150 | py | Python | paypal/response.py | mcordes/paypal-python | 86512481b5cd3700e13a601f193bb574b9338a43 | [
"Apache-2.0"
] | 1 | 2016-01-20T14:12:31.000Z | 2016-01-20T14:12:31.000Z | paypal/response.py | mcordes/paypal-python | 86512481b5cd3700e13a601f193bb574b9338a43 | [
"Apache-2.0"
] | null | null | null | paypal/response.py | mcordes/paypal-python | 86512481b5cd3700e13a601f193bb574b9338a43 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
"""
PayPalResponse parsing and processing.
"""
import logging
from pprint import pformat
from paypal.compat import is_py3, is_py25
if is_py3:
#noinspection PyUnresolvedReferences
import urllib.parse
#noinspection PyUnresolvedReferences
parse_qs = urllib.parse.parse_qs
elif is_py25:
... | 35.775862 | 78 | 0.629398 |
bc9b38aa93978a9c5a2ff6d24ac4f1e6be8b4faa | 1,888 | py | Python | third_party_package/RDKit_2015_03_1/rdkit/ML/Descriptors/UnitTestParser.py | Ivy286/cluster_basedfps | 7fc216537f570436f008ea567c137d03ba2b6d81 | [
"WTFPL"
] | 9 | 2019-04-23T01:46:12.000Z | 2021-08-16T07:07:12.000Z | third_party_package/RDKit_2015_03_1/rdkit/ML/Descriptors/UnitTestParser.py | Ivy286/cluster_basedfps | 7fc216537f570436f008ea567c137d03ba2b6d81 | [
"WTFPL"
] | null | null | null | third_party_package/RDKit_2015_03_1/rdkit/ML/Descriptors/UnitTestParser.py | Ivy286/cluster_basedfps | 7fc216537f570436f008ea567c137d03ba2b6d81 | [
"WTFPL"
] | 5 | 2016-09-21T03:47:48.000Z | 2019-07-30T22:17:35.000Z | #
# Copyright (C) 2001 greg Landrum
#
""" unit testing code for compound descriptors
"""
from __future__ import print_function
import unittest
import Parser
from rdkit.six.moves import xrange
class TestCase(unittest.TestCase):
def setUp(self):
print('\n%s: '%self.shortDescription(),end='')
self.piec... | 35.622642 | 101 | 0.64036 |
636b9f2d74ec64a3e0ae3ba3877d873a2e5e3f8d | 2,885 | py | Python | pyexlatex/logic/output/api/exc_handler/main.py | whoopnip/py-ex-latex | 66f5fadc35a0bfdce5f1ccb3c80dce8885b061b6 | [
"MIT"
] | 4 | 2020-06-08T07:17:12.000Z | 2021-11-04T21:39:52.000Z | pyexlatex/logic/output/api/exc_handler/main.py | nickderobertis/py-ex-latex | 66f5fadc35a0bfdce5f1ccb3c80dce8885b061b6 | [
"MIT"
] | 24 | 2020-02-17T17:20:44.000Z | 2021-12-20T00:10:19.000Z | pyexlatex/logic/output/api/exc_handler/main.py | nickderobertis/py-ex-latex | 66f5fadc35a0bfdce5f1ccb3c80dce8885b061b6 | [
"MIT"
] | null | null | null | from typing import List, Optional, Dict, Any
import warnings
from pyexlatex.logic.output.api.formats import OutputFormats
from pyexlatex.logic.output.errors.exc import (
LatexException
)
from pyexlatex.logic.output.api.exc_handler.prepend.main import handle_prepend_exceptions
from pyexlatex.logic.output.api.exc_ha... | 41.811594 | 111 | 0.683189 |
274dec8482448a2650a538a25659ee7a3881eb99 | 411 | py | Python | File.numpy-titanic-corrupt-data.py | eltechno/python_course | f74abac7df3f9f41864afd06479389260c29ea3a | [
"MIT"
] | 4 | 2019-05-04T00:33:25.000Z | 2021-05-29T20:37:59.000Z | File.numpy-titanic-corrupt-data.py | eltechno/python_course | f74abac7df3f9f41864afd06479389260c29ea3a | [
"MIT"
] | null | null | null | File.numpy-titanic-corrupt-data.py | eltechno/python_course | f74abac7df3f9f41864afd06479389260c29ea3a | [
"MIT"
] | 3 | 2020-05-05T13:14:28.000Z | 2022-02-03T16:18:37.000Z | # Import matplotlib.pyplot as plt
import pandas as pd
import matplotlib.pyplot as plt
# Assign filename: file
file = 'titanic_corrupt.txt'
# Import file: data
data = pd.read_csv(file, sep="\t", comment='#', na_values="Nothing")
# Print the head of the DataFrame
print(data.head())
# Plot 'Age' variable in a histogra... | 22.833333 | 68 | 0.717762 |
dcd4c38d996e579e04eccd1aabd63b16bee7b5c4 | 5,621 | py | Python | mars/tensor/linalg/qr.py | HarshCasper/mars | 4c12c968414d666c7a10f497bc22de90376b1932 | [
"Apache-2.0"
] | 2 | 2019-03-29T04:11:10.000Z | 2020-07-08T10:19:54.000Z | mars/tensor/linalg/qr.py | HarshCasper/mars | 4c12c968414d666c7a10f497bc22de90376b1932 | [
"Apache-2.0"
] | null | null | null | mars/tensor/linalg/qr.py | HarshCasper/mars | 4c12c968414d666c7a10f497bc22de90376b1932 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 1999-2020 Alibaba Group Holding Ltd.
#
# 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-... | 33.260355 | 94 | 0.579968 |
86499a5a2d95d2448ec08232fe59d054d7c5b9c9 | 3,334 | py | Python | auth0/v3/management/client_grants.py | akmjenkins/auth0-python | 511b016ac9853c7f4ee66769be7ad315c5585735 | [
"MIT"
] | 340 | 2015-06-05T12:32:26.000Z | 2022-03-30T18:41:30.000Z | auth0/v3/management/client_grants.py | akmjenkins/auth0-python | 511b016ac9853c7f4ee66769be7ad315c5585735 | [
"MIT"
] | 179 | 2015-05-26T00:35:07.000Z | 2022-03-18T17:16:37.000Z | auth0/v3/management/client_grants.py | akmjenkins/auth0-python | 511b016ac9853c7f4ee66769be7ad315c5585735 | [
"MIT"
] | 151 | 2015-01-27T11:49:01.000Z | 2022-03-03T14:26:09.000Z | from .rest import RestClient
class ClientGrants(object):
"""Auth0 client grants endpoints
Args:
domain (str): Your Auth0 domain, e.g: 'username.auth0.com'
token (str): Management API v2 Token
telemetry (bool, optional): Enable or disable Telemetry
(defaults to True)
... | 32.686275 | 104 | 0.609178 |
3d70a678d3dcc59d925ad0c7d6c15a01f05a3442 | 13,709 | py | Python | nova/objects/virtual_interface.py | gmannos/nova-rbac-policy-new-defaults | 7c61b4bd19b97011d7581866c0262065e52d7865 | [
"Apache-2.0"
] | null | null | null | nova/objects/virtual_interface.py | gmannos/nova-rbac-policy-new-defaults | 7c61b4bd19b97011d7581866c0262065e52d7865 | [
"Apache-2.0"
] | 1 | 2021-03-31T19:29:01.000Z | 2021-03-31T19:29:01.000Z | nova/objects/virtual_interface.py | gmannos/nova-rbac-policy-new-defaults | 7c61b4bd19b97011d7581866c0262065e52d7865 | [
"Apache-2.0"
] | 1 | 2020-07-22T22:14:40.000Z | 2020-07-22T22:14:40.000Z | # Copyright (C) 2014, Red Hat, 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... | 42.052147 | 81 | 0.598366 |
53140d26a1a0fe8bdc8745cfc8633379c01e96c9 | 7,768 | py | Python | discord/ext/commands/parameters.py | Alpha62579/discord.py | 366c65465a4c3d8b9d3b0b93ef8f07974fbd7a8d | [
"MIT"
] | null | null | null | discord/ext/commands/parameters.py | Alpha62579/discord.py | 366c65465a4c3d8b9d3b0b93ef8f07974fbd7a8d | [
"MIT"
] | null | null | null | discord/ext/commands/parameters.py | Alpha62579/discord.py | 366c65465a4c3d8b9d3b0b93ef8f07974fbd7a8d | [
"MIT"
] | null | null | null | """
The MIT License (MIT)
Copyright (c) 2015-present Rapptz
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merg... | 28.664207 | 127 | 0.663491 |
0ee3ef2c0a6bfb19a3e07da1f1aa521987b595ee | 1,857 | py | Python | sdk/dashboard/azure-mgmt-dashboard/azure/mgmt/dashboard/models/__init__.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-01-24T08:54:57.000Z | 2022-01-24T08:54:57.000Z | sdk/dashboard/azure-mgmt-dashboard/azure/mgmt/dashboard/models/__init__.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/dashboard/azure-mgmt-dashboard/azure/mgmt/dashboard/models/__init__.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 30.95 | 94 | 0.712439 |
91ba1b0ad11f14095e103a1cc7944658c9f8ea72 | 3,907 | py | Python | lagom/integrations/fast_api.py | meadsteve/lagom | 025993f42fa23547e333d81373523ced1baf4854 | [
"MIT"
] | 109 | 2019-06-02T13:40:38.000Z | 2022-03-08T18:35:17.000Z | lagom/integrations/fast_api.py | meadsteve/lagom | 025993f42fa23547e333d81373523ced1baf4854 | [
"MIT"
] | 152 | 2019-06-03T11:54:13.000Z | 2022-03-30T11:31:03.000Z | lagom/integrations/fast_api.py | meadsteve/lagom | 025993f42fa23547e333d81373523ced1baf4854 | [
"MIT"
] | 5 | 2020-02-05T09:44:12.000Z | 2022-01-31T08:41:38.000Z | """
FastAPI (https://fastapi.tiangolo.com/)
"""
from contextlib import contextmanager
from typing import TypeVar, Optional, Type, List, Iterator
from fastapi import Depends
from starlette.requests import Request
from ..context_based import ContextContainer
from ..definitions import PlainInstance
from ..interfaces im... | 36.514019 | 86 | 0.658818 |
e4ef43e7a61eac9dd2441e1637c4090adf27b0b0 | 529 | py | Python | tests/http_head/fake_slow_http_server.py | dantangfan/greenify | 794d12f718785607afaeb08f64d11604c8f33bdb | [
"BSD-3-Clause"
] | 5 | 2017-06-22T05:29:57.000Z | 2021-06-22T08:56:54.000Z | tests/http_head/fake_slow_http_server.py | dantangfan/greenify | 794d12f718785607afaeb08f64d11604c8f33bdb | [
"BSD-3-Clause"
] | null | null | null | tests/http_head/fake_slow_http_server.py | dantangfan/greenify | 794d12f718785607afaeb08f64d11604c8f33bdb | [
"BSD-3-Clause"
] | 1 | 2018-04-18T03:41:51.000Z | 2018-04-18T03:41:51.000Z | # coding: utf-8
import time
from SimpleHTTPServer import SimpleHTTPRequestHandler
import SocketServer
PORT = 0x2304
BLOCKING_SECONDS = 10 # seconds
class Server(SocketServer.TCPServer):
allow_reuse_address = True
class Handler(SimpleHTTPRequestHandler):
def do_HEAD(self):
time.sleep(BLOCKING_SEC... | 18.892857 | 53 | 0.714556 |
ef6036678a32909f8fb9a890f733d3c069c78932 | 653 | py | Python | python/oneflow/nn/graph/__init__.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | null | null | null | python/oneflow/nn/graph/__init__.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | null | null | null | python/oneflow/nn/graph/__init__.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2020 The OneFlow 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 applicable law or agr... | 36.277778 | 72 | 0.787136 |
8624d73e27b8ec71c0b7211d904f23f882295612 | 1,553 | py | Python | music_player/cmd.py | pontoniento/terplayer | 4d095db1d5e6943ab975acc07930066a3cc6589b | [
"MIT"
] | null | null | null | music_player/cmd.py | pontoniento/terplayer | 4d095db1d5e6943ab975acc07930066a3cc6589b | [
"MIT"
] | null | null | null | music_player/cmd.py | pontoniento/terplayer | 4d095db1d5e6943ab975acc07930066a3cc6589b | [
"MIT"
] | null | null | null | import sys
from pathlib import Path
from music_player.player import MusicController
class CmdApp:
BASIC_PROMPT: str = 'Music Player'
def __init__(self):
self.music_controller: MusicController = MusicController()
self.prompt: str = CmdApp.BASIC_PROMPT
def cmd_loop(self) -> None:
... | 28.759259 | 112 | 0.57566 |
fc45757b8664498a2e23a9794d77e7cba53e6ed5 | 571 | py | Python | pytest_docs/formatters/restuctured.py | liiight/pytest_docs | bdbd7b3e83f16582cadb66e54aea8070becf3e99 | [
"MIT"
] | 11 | 2018-11-06T14:36:58.000Z | 2022-02-02T13:56:19.000Z | pytest_docs/formatters/restuctured.py | liiight/pytest_docs | bdbd7b3e83f16582cadb66e54aea8070becf3e99 | [
"MIT"
] | 3 | 2018-11-06T10:09:38.000Z | 2020-11-11T07:10:08.000Z | pytest_docs/formatters/restuctured.py | liiight/pytest_docs | bdbd7b3e83f16582cadb66e54aea8070becf3e99 | [
"MIT"
] | 2 | 2019-04-05T12:48:08.000Z | 2020-11-05T07:21:10.000Z | from pytest_docs.formatter import Formatter
class RSTFormatter(Formatter):
name = "rst"
marker_prefix = "\n**Markers:**"
@staticmethod
def module_name_format(element):
return "\n{}\n{}".format(element, "*" * len(element))
@staticmethod
def class_name_format(element):
return "... | 24.826087 | 61 | 0.623468 |
c0ad1f2b3f61d4ce4e41ad80cb57a40219c270c6 | 1,040 | py | Python | training/urls.py | Atwinenickson/lendsuphumanresourcemanagement | b46df164d59a4e94300376d679e07bd9a60d6343 | [
"MIT",
"Unlicense"
] | 36 | 2019-11-26T11:46:32.000Z | 2022-02-17T13:18:18.000Z | training/urls.py | Atwinenickson/lendsuphumanresourcemanagement | b46df164d59a4e94300376d679e07bd9a60d6343 | [
"MIT",
"Unlicense"
] | 13 | 2020-02-14T09:30:16.000Z | 2022-03-12T00:58:09.000Z | training/urls.py | Atwinenickson/lendsuphumanresourcemanagement | b46df164d59a4e94300376d679e07bd9a60d6343 | [
"MIT",
"Unlicense"
] | 16 | 2019-06-14T12:11:29.000Z | 2022-02-14T15:16:07.000Z | from django.urls import path
from training import views
urlpatterns = [
path('user_training_page', views.user_training_page, name="user_training_page"),
path('schedule_training', views.schedule_training_page, name="schedule_training_page"),
path('edit_training_schedule/<int:training_schedule_id>/', views.... | 52 | 106 | 0.785577 |
214e528e2793af83b13472d08137576fa5aef6b5 | 1,033 | py | Python | ratings/migrations/0011_auto_20211023_1743.py | CommanderStorm/rallyetool-v2 | 721413d6df8afc9347dac7ee83deb3a0ad4c01bc | [
"MIT"
] | 1 | 2021-10-03T17:49:53.000Z | 2021-10-03T17:49:53.000Z | ratings/migrations/0011_auto_20211023_1743.py | FSTUM/rallyetool-v2 | 2f3e2b5cb8655abe023ed1215b7182430b75bb23 | [
"MIT"
] | 9 | 2021-11-23T10:13:43.000Z | 2022-03-01T15:04:15.000Z | ratings/migrations/0011_auto_20211023_1743.py | CommanderStorm/rallyetool-v2 | 721413d6df8afc9347dac7ee83deb3a0ad4c01bc | [
"MIT"
] | 1 | 2021-10-16T09:07:47.000Z | 2021-10-16T09:07:47.000Z | # Generated by Django 3.2.7 on 2021-10-23 15:43
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("ratings", "0010_auto_20211023_0238"),
]
operations = [
migrations.AlterField(
model_name="station",
name="latitude",... | 27.918919 | 102 | 0.54211 |
fc917ad203501288c5914a1f32fcac87439ac416 | 2,224 | py | Python | gwosc/catalog.py | rpfisher/gwosc | 76fa92d731c839adc17f6e80c7d27a847e47b874 | [
"MIT"
] | null | null | null | gwosc/catalog.py | rpfisher/gwosc | 76fa92d731c839adc17f6e80c7d27a847e47b874 | [
"MIT"
] | null | null | null | gwosc/catalog.py | rpfisher/gwosc | 76fa92d731c839adc17f6e80c7d27a847e47b874 | [
"MIT"
] | 4 | 2019-06-06T21:09:00.000Z | 2019-06-06T21:10:05.000Z | # -*- coding: utf-8 -*-
# Copyright Duncan Macleod 2019
#
# This file is part of GWOSC.
#
# GWOSC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any late... | 28.151899 | 79 | 0.646133 |
d8b00c5f2f9ec45c3f6765f3989f0b6167a9be32 | 10,111 | py | Python | tests/beastrun_tests.py | SimonGreenhill/BEASTling | b3da97240e632ac720f210cce4477fb29d49de84 | [
"BSD-2-Clause"
] | 12 | 2015-10-30T09:25:09.000Z | 2021-12-09T17:06:50.000Z | tests/beastrun_tests.py | SimonGreenhill/BEASTling | b3da97240e632ac720f210cce4477fb29d49de84 | [
"BSD-2-Clause"
] | 254 | 2015-11-03T10:37:05.000Z | 2021-07-23T19:57:35.000Z | tests/beastrun_tests.py | SimonGreenhill/BEASTling | b3da97240e632ac720f210cce4477fb29d49de84 | [
"BSD-2-Clause"
] | 9 | 2015-11-02T09:57:31.000Z | 2021-05-12T00:48:03.000Z | import os
import subprocess
from xml.etree import ElementTree as et
import shutil
import pathlib
import warnings
import pytest
import beastling.configuration
import beastling.beastxml
skip = [
("admin", "mk", "cldf_data_with_comma", "rate_var"),
# Beast interprets commas as separating alternative IDs (we
... | 49.807882 | 106 | 0.578973 |
e711744eec61923ce6d4de0ff7a2dd1da9fc2de9 | 5,954 | py | Python | dvc/command/run.py | zb0th/dvc | 5fdbc1882f73162419d5b84ed47a33e9e321f151 | [
"Apache-2.0"
] | 1 | 2020-07-25T08:23:32.000Z | 2020-07-25T08:23:32.000Z | dvc/command/run.py | aliseramirez/dvc | 92cc9f7e6f19f3b92f43e28131fe50c20b297214 | [
"Apache-2.0"
] | null | null | null | dvc/command/run.py | aliseramirez/dvc | 92cc9f7e6f19f3b92f43e28131fe50c20b297214 | [
"Apache-2.0"
] | null | null | null | from __future__ import unicode_literals
import argparse
import logging
from dvc.command.base import CmdBase, append_doc_link
from dvc.exceptions import DvcException
logger = logging.getLogger(__name__)
class CmdRun(CmdBase):
def run(self):
overwrite = self.args.yes or self.args.overwrite_dvcfile
... | 30.22335 | 79 | 0.562815 |
ac74f30ea8769f2fe0c5baa7ebf91a3d326b5975 | 268 | py | Python | hooks/pre-push.py | maltanar/dataset_loading | 75ba02f16735c78dfbd3e3962b484b9b57189dcd | [
"MIT"
] | 10 | 2018-03-08T11:15:17.000Z | 2021-09-12T12:35:26.000Z | hooks/pre-push.py | maltanar/dataset_loading | 75ba02f16735c78dfbd3e3962b484b9b57189dcd | [
"MIT"
] | null | null | null | hooks/pre-push.py | maltanar/dataset_loading | 75ba02f16735c78dfbd3e3962b484b9b57189dcd | [
"MIT"
] | 4 | 2018-07-06T15:54:35.000Z | 2021-03-04T08:10:07.000Z | #!/usr/bin/env python
import argparse
import pytest
def parse_args():
parser = argparse.ArgumentParser()
args = parser.parse_args()
return args
def main(args=None):
pytest.main()
if __name__ == '__main__':
args = parse_args()
main(args)
| 13.4 | 38 | 0.660448 |
d13934a14961c6fe39508a55a7b38b4ed77ba16c | 1,073 | py | Python | tests/test_median.py | vbrednikov/nginx-loganalyzer | 29221c5305b3e4443a60215be0764369cdcaab11 | [
"BSD-2-Clause"
] | null | null | null | tests/test_median.py | vbrednikov/nginx-loganalyzer | 29221c5305b3e4443a60215be0764369cdcaab11 | [
"BSD-2-Clause"
] | null | null | null | tests/test_median.py | vbrednikov/nginx-loganalyzer | 29221c5305b3e4443a60215be0764369cdcaab11 | [
"BSD-2-Clause"
] | null | null | null | import unittest
from decimal import Decimal
from nginx_loganalyzer import median
class TestMedian(unittest.TestCase):
def test_median_empty(self):
self.assertIsNone(median([]))
def test_median_1_element(self):
self.assertEqual(median([1]), 1)
def test_median_2_elements(self):
se... | 29 | 85 | 0.541473 |
f27be28dbe93fc551bbfe50247a88db5d4d2922e | 312 | py | Python | app/app/asgi.py | Diaga/knctU-Server | a3fb9ac00662fcdf6066ee838fa8c40bb8c208f3 | [
"MIT"
] | 1 | 2021-08-02T18:32:08.000Z | 2021-08-02T18:32:08.000Z | app/app/asgi.py | Diaga/knctU-Server | a3fb9ac00662fcdf6066ee838fa8c40bb8c208f3 | [
"MIT"
] | 5 | 2021-03-09T17:02:32.000Z | 2022-02-26T17:28:38.000Z | app/app/asgi.py | Diaga/knctU-Server | a3fb9ac00662fcdf6066ee838fa8c40bb8c208f3 | [
"MIT"
] | 1 | 2021-08-02T18:32:09.000Z | 2021-08-02T18:32:09.000Z | """
ASGI entrypoint. Configures Django and then runs the application
defined in the ASGI_APPLICATION setting.
"""
import os
import django
from channels.routing import get_default_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "app.settings")
django.setup()
application = get_default_application()
| 24 | 64 | 0.817308 |
7da629a6f353ffff0069d3472f4c2b616d412ca3 | 8,187 | py | Python | adafruit_pyportal/network.py | makermelissa/Adafruit_CircuitPython_PyPortal | d04c2a4d8dbb5ded2ab84459c4d5eab1c097ef1d | [
"Unlicense",
"MIT-0",
"MIT"
] | 49 | 2019-02-24T12:15:06.000Z | 2022-03-30T15:59:01.000Z | adafruit_pyportal/network.py | makermelissa/Adafruit_CircuitPython_PyPortal | d04c2a4d8dbb5ded2ab84459c4d5eab1c097ef1d | [
"Unlicense",
"MIT-0",
"MIT"
] | 74 | 2019-02-23T17:26:06.000Z | 2022-01-14T16:11:58.000Z | adafruit_pyportal/network.py | makermelissa/Adafruit_CircuitPython_PyPortal | d04c2a4d8dbb5ded2ab84459c4d5eab1c097ef1d | [
"Unlicense",
"MIT-0",
"MIT"
] | 63 | 2019-02-22T19:25:29.000Z | 2022-01-13T18:04:49.000Z | # SPDX-FileCopyrightText: 2020 Melissa LeBlanc-Williams, written for Adafruit Industries
#
# SPDX-License-Identifier: Unlicense
"""
`adafruit_pyportal.network`
================================================================================
CircuitPython driver for Adafruit PyPortal.
* Author(s): Limor Fried, Kevin J... | 38.07907 | 253 | 0.595212 |
19659d0f90e82fc943fa1f962817b4189ac83c3c | 596 | py | Python | app.py | LleeMcD/Mission-to-Mars | b27130208029e3ca13e66c11e8bdd74e79509a30 | [
"ADSL"
] | 1 | 2022-01-02T13:23:42.000Z | 2022-01-02T13:23:42.000Z | app.py | LleeMcD/Mission-to-Mars | b27130208029e3ca13e66c11e8bdd74e79509a30 | [
"ADSL"
] | null | null | null | app.py | LleeMcD/Mission-to-Mars | b27130208029e3ca13e66c11e8bdd74e79509a30 | [
"ADSL"
] | null | null | null | from flask import Flask, render_template, redirect, url_for
from flask_pymongo import PyMongo
import scraping
app = Flask(__name__)
# Use flask_pymongo to set up mongo connection
app.config["MONGO_URI"] = "mongodb://localhost:27017/mars_app"
mongo = PyMongo(app)
@app.route("/")
def index():
mars = mongo.db.mars.f... | 24.833333 | 62 | 0.714765 |
861e7297c13f03eecaf9d3ea4cd74288cc0a02e9 | 2,388 | py | Python | data/p4VQE/R1/benchmark/startQiskit_noisy66.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p4VQE/R1/benchmark/startQiskit_noisy66.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p4VQE/R1/benchmark/startQiskit_noisy66.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=3
# total number=10
import numpy as np
from qiskit import QuantumCircuit, execute, Aer, QuantumRegister, ClassicalRegister, transpile, BasicAer, IBMQ
import networkx as nx
from qiskit.visualization import plot_histogram
from typing import *
from pprint import pprint
from math import log2
from collectio... | 26.831461 | 118 | 0.631072 |
ad3705a7df059e60b3a873854622e54dfb7ae51a | 7,047 | py | Python | virtual/lib/python3.6/site-packages/astroid/exceptions.py | edithamadi/pitch_one | 40c8d1c67c77e483b29bd326721dde7f4a20120d | [
"Unlicense"
] | 3 | 2018-10-21T14:01:01.000Z | 2018-10-22T14:42:22.000Z | virtual/lib/python3.6/site-packages/astroid/exceptions.py | edithamadi/pitch_one | 40c8d1c67c77e483b29bd326721dde7f4a20120d | [
"Unlicense"
] | 12 | 2018-10-03T19:45:36.000Z | 2022-03-11T23:54:25.000Z | virtual/lib/python3.6/site-packages/astroid/exceptions.py | edithamadi/pitch_one | 40c8d1c67c77e483b29bd326721dde7f4a20120d | [
"Unlicense"
] | 3 | 2020-01-19T21:26:14.000Z | 2020-11-04T08:37:38.000Z | # Copyright (c) 2007, 2009-2010, 2013 LOGILAB S.A. (Paris, FRANCE) <contact@logilab.fr>
# Copyright (c) 2014 Google, Inc.
# Copyright (c) 2015-2018 Claudiu Popa <pcmanticore@gmail.com>
# Copyright (c) 2015-2016 Ceridwen <ceridwenv@gmail.com>
# Copyright (c) 2016 Derek Gustafson <degustaf@gmail.com>
# Copyright (c) 2018... | 32.325688 | 92 | 0.703278 |
da9c61c88b0b014e1d64705ccc9b212c0987d738 | 608 | py | Python | src/users/migrations/0021_alter_contact_user.py | Rey092/SwipeApp | 8451912aeb8b1a8fcd52bd9c58afb09b3e49768d | [
"MIT"
] | null | null | null | src/users/migrations/0021_alter_contact_user.py | Rey092/SwipeApp | 8451912aeb8b1a8fcd52bd9c58afb09b3e49768d | [
"MIT"
] | null | null | null | src/users/migrations/0021_alter_contact_user.py | Rey092/SwipeApp | 8451912aeb8b1a8fcd52bd9c58afb09b3e49768d | [
"MIT"
] | null | null | null | # Generated by Django 3.2.4 on 2021-08-15 07:48
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("users", "0020_alter_file_file"),
]
operations = [
migrations.AlterField(
... | 23.384615 | 60 | 0.575658 |
af26cd84a1a1e9cd8c6ecdd0a0e0ef801002872c | 5,184 | py | Python | src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/tests/test_vm_parameters.py | v-Ajnava/azure-cli | febec631d79bfca151e84267b5b409594bad598e | [
"MIT"
] | null | null | null | src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/tests/test_vm_parameters.py | v-Ajnava/azure-cli | febec631d79bfca151e84267b5b409594bad598e | [
"MIT"
] | 3 | 2021-03-26T00:48:20.000Z | 2022-03-29T22:05:39.000Z | src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/tests/test_vm_parameters.py | v-Ajnava/azure-cli | febec631d79bfca151e84267b5b409594bad598e | [
"MIT"
] | 1 | 2017-12-28T04:51:44.000Z | 2017-12-28T04:51:44.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 38.977444 | 217 | 0.599344 |
a5490da55fb9c37fea0b2e8d083f629a2db3f889 | 4,593 | py | Python | src/m3.py | 4n0Wd/05a-Debugging | dd5084987d638c16df81f4dd89e446a9edd0c06e | [
"MIT"
] | null | null | null | src/m3.py | 4n0Wd/05a-Debugging | dd5084987d638c16df81f4dd89e446a9edd0c06e | [
"MIT"
] | null | null | null | src/m3.py | 4n0Wd/05a-Debugging | dd5084987d638c16df81f4dd89e446a9edd0c06e | [
"MIT"
] | null | null | null | """
This module lets you practice DEBUGGING when LOGIC ERRORS occur.
That is, no run-time exception occurs, but the function simply
does not do the right thing.
Authors: David Mutchler, Dave Fisher, Valerie Galluzzi, Amanda Stouder,
their colleagues and Henry.
""" # DONE: 1. PUT YOUR NAME IN THE ABOVE LINE.... | 34.276119 | 72 | 0.521881 |
5d1cc2d544e08adacc9bdaac0cca6cb53e53bb65 | 27,146 | py | Python | kairon/utils.py | ash-pramila/chiron | ed207d52766fcce48ebc884ac97185b2901161d4 | [
"Apache-2.0"
] | null | null | null | kairon/utils.py | ash-pramila/chiron | ed207d52766fcce48ebc884ac97185b2901161d4 | [
"Apache-2.0"
] | 1 | 2021-01-29T22:20:59.000Z | 2021-01-29T22:20:59.000Z | kairon/utils.py | ash-pramila/chiron | ed207d52766fcce48ebc884ac97185b2901161d4 | [
"Apache-2.0"
] | null | null | null | import os
import re
import shutil
import string
import tempfile
from datetime import datetime, timedelta
from glob import glob, iglob
from html import escape
from pathlib import Path
from io import BytesIO
from secrets import choice
from smtplib import SMTP
from typing import Text, List, Dict
from rasa.utils.endpoints ... | 35.072351 | 138 | 0.605761 |
7b301c4007e743040747f7e65e13bce765dcfb92 | 3,022 | py | Python | parser/team08/Tytus_SQLPARSER_G8/Instrucciones/Expresiones/Logica.py | 18SebastianVC/tytus | 2b22f4339356b6cf46e3235a5219f68e5ba5573b | [
"MIT"
] | 1 | 2021-01-09T05:32:35.000Z | 2021-01-09T05:32:35.000Z | parser/team08/Tytus_SQLPARSER_G8/Instrucciones/Expresiones/Logica.py | XiomRB/tytus | 0873e4bdce5c110bee6ef2aa98240be6a93ae024 | [
"MIT"
] | null | null | null | parser/team08/Tytus_SQLPARSER_G8/Instrucciones/Expresiones/Logica.py | XiomRB/tytus | 0873e4bdce5c110bee6ef2aa98240be6a93ae024 | [
"MIT"
] | null | null | null | from Instrucciones.TablaSimbolos.Instruccion import Instruccion
from Instrucciones.TablaSimbolos.Tipo import Tipo_Dato, Tipo
from Instrucciones.Excepcion import Excepcion
class Logica(Instruccion):
def __init__(self, opIzq, opDer, operador, linea, columna):
Instruccion.__init__(self,Tipo(Tipo_Dato.BOOLEAN)... | 51.220339 | 137 | 0.599934 |
4cf74c557b39faf531999a2ea1bdbf93e992e00a | 7,882 | py | Python | raiden/utils/upgrades.py | marcosmartinez7/lumino | 2a5a74589aaf26172cee6ec23fde5f4fc1938a43 | [
"MIT"
] | 8 | 2019-06-12T14:50:06.000Z | 2022-02-15T16:20:07.000Z | raiden/utils/upgrades.py | marcosmartinez7/lumino | 2a5a74589aaf26172cee6ec23fde5f4fc1938a43 | [
"MIT"
] | 141 | 2019-06-18T13:04:08.000Z | 2021-11-23T22:00:32.000Z | raiden/utils/upgrades.py | marcosmartinez7/lumino | 2a5a74589aaf26172cee6ec23fde5f4fc1938a43 | [
"MIT"
] | 17 | 2019-05-21T18:09:05.000Z | 2020-10-29T13:01:01.000Z | import os
import sqlite3
from contextlib import closing
from glob import escape, glob
from pathlib import Path
import filelock
import structlog
from raiden.constants import RAIDEN_DB_VERSION
from raiden.storage.migrations.v16_to_v17 import upgrade_v16_to_v17
from raiden.storage.migrations.v17_to_v18 import upgrade_v1... | 36.155963 | 97 | 0.672164 |
03d18c85c23be1038ffa5e0acd7a787025ff8a46 | 4,619 | py | Python | testproj/snippets/serializers.py | Zeeshan138063/Documentaion-drf-yasg | 4ee4f4824e653259ae45c9a443c93a01d2e13df0 | [
"BSD-3-Clause"
] | null | null | null | testproj/snippets/serializers.py | Zeeshan138063/Documentaion-drf-yasg | 4ee4f4824e653259ae45c9a443c93a01d2e13df0 | [
"BSD-3-Clause"
] | null | null | null | testproj/snippets/serializers.py | Zeeshan138063/Documentaion-drf-yasg | 4ee4f4824e653259ae45c9a443c93a01d2e13df0 | [
"BSD-3-Clause"
] | null | null | null | from decimal import Decimal
from django.contrib.auth import get_user_model
from rest_framework import serializers
from rest_framework.compat import MaxLengthValidator, MinValueValidator
from snippets.models import LANGUAGE_CHOICES, STYLE_CHOICES, Snippet
class LanguageSerializer(serializers.Serializer):
name = ... | 44.84466 | 118 | 0.688894 |
159b2d7b1c5b2ba047f9b3e361eb6c5694dd34bd | 3,924 | py | Python | splatsync.py | robla/pinsplat | 1976c5f10ae669f243ff506b01fac62a59314baa | [
"MIT"
] | null | null | null | splatsync.py | robla/pinsplat | 1976c5f10ae669f243ff506b01fac62a59314baa | [
"MIT"
] | null | null | null | splatsync.py | robla/pinsplat | 1976c5f10ae669f243ff506b01fac62a59314baa | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import argparse
import configparser
import git
import os
import re
import shutil
import subprocess
import sys
import time
import urllib.request
from base10x60timestamp.b1060time import get_b1060_timestamp_from_epoch
def parse_arguments():
""" see http://docs.python.org/library/argparse ""... | 28.852941 | 82 | 0.675331 |
af08fa51f38d47b0371b702ec4851f6c1d496d71 | 5,721 | py | Python | plantcam.py | zmcki001/SpacePeppers | 5ef356a495772ead22cca5b46bbdc3f4119f630b | [
"MIT"
] | null | null | null | plantcam.py | zmcki001/SpacePeppers | 5ef356a495772ead22cca5b46bbdc3f4119f630b | [
"MIT"
] | null | null | null | plantcam.py | zmcki001/SpacePeppers | 5ef356a495772ead22cca5b46bbdc3f4119f630b | [
"MIT"
] | null | null | null | import os
import glob
import picamera
import ftplib
import sys
import bme280
import smbus2
from subprocess import call
from datetime import datetime
from time import sleep
from requests.exceptions import ConnectionError
# Our file path
filePath = "/home/pi/Desktop/spacepeppers2020/pics/"
picTotal = 1000000
picCount = ... | 31.960894 | 246 | 0.559692 |
2dbbce07d1e233b7a319092b636a5cef3de2576f | 13,894 | py | Python | rest_rpc/connection/runs.py | aimakerspace/synergos_rest | d7b45216e5d1854fe65213f06ae3f3bb6d99cab0 | [
"Apache-2.0"
] | null | null | null | rest_rpc/connection/runs.py | aimakerspace/synergos_rest | d7b45216e5d1854fe65213f06ae3f3bb6d99cab0 | [
"Apache-2.0"
] | null | null | null | rest_rpc/connection/runs.py | aimakerspace/synergos_rest | d7b45216e5d1854fe65213f06ae3f3bb6d99cab0 | [
"Apache-2.0"
] | 2 | 2022-01-21T01:06:01.000Z | 2022-01-26T01:11:06.000Z | #!/usr/bin/env python
####################
# Required Modules #
####################
# Generic/Built-in
import os
# Libs
import jsonschema
from flask import request
from flask_restx import Namespace, Resource, fields
# Custom
from rest_rpc import app
from rest_rpc.connection.core.utils import TopicalPayload
from re... | 35.085859 | 155 | 0.548798 |
865907c4a94122cd5b4972c346fdae37c8c3f3d7 | 966 | py | Python | src/executor/abstract_storage_executor.py | Ashwin1934/eva | 53c1172a0f8a7409cf0ef97efea957979a8290a0 | [
"Apache-2.0"
] | 34 | 2019-12-22T06:07:40.000Z | 2022-03-19T13:16:29.000Z | src/executor/abstract_storage_executor.py | Ashwin1934/eva | 53c1172a0f8a7409cf0ef97efea957979a8290a0 | [
"Apache-2.0"
] | 88 | 2020-01-29T19:25:19.000Z | 2022-03-25T05:20:52.000Z | src/executor/abstract_storage_executor.py | Ashwin1934/eva | 53c1172a0f8a7409cf0ef97efea957979a8290a0 | [
"Apache-2.0"
] | 33 | 2019-12-22T06:00:19.000Z | 2022-02-02T05:28:24.000Z | # coding=utf-8
# Copyright 2018-2020 EVA
#
# 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 ... | 33.310345 | 74 | 0.756729 |
7d4dd0318be19a700c470a0d1fb824cc190725d6 | 52,746 | py | Python | yaya/common/nt.py | Tony-Wang/YaYaNLP | d75780290926877e55759fb64e1440f809d653ed | [
"Apache-2.0"
] | 63 | 2016-01-14T17:25:25.000Z | 2022-01-07T04:33:48.000Z | yaya/common/nt.py | Tony-Wang/YaYaNLP | d75780290926877e55759fb64e1440f809d653ed | [
"Apache-2.0"
] | 1 | 2016-12-13T06:39:57.000Z | 2016-12-13T06:39:57.000Z | yaya/common/nt.py | Tony-Wang/YaYaNLP | d75780290926877e55759fb64e1440f809d653ed | [
"Apache-2.0"
] | 19 | 2015-12-05T12:31:49.000Z | 2021-07-02T17:43:50.000Z | # coding=utf-8
from __future__ import unicode_literals
from yaya.common.enum import Enum
__author__ = 'tony'
NT = Enum(
'A', # 上文 [参与]亚太经合组织的活动
'B', # 下文 中央电视台[报道]
'X', # 连接词 北京电视台[和]天津电视台
'C', # 特征词的一般性前缀 北京[电影]学院
'F', # 特征词的译名性前缀 美国[摩托罗拉]公司
'G', # 特征词的地名性前缀 交通银行[北京]分行
'H', # 特征... | 14.286566 | 39 | 0.439029 |
4fea8a472c077e52cfe80bb80684a1229bd92a2d | 842 | py | Python | scripts/script2_someprocessors.py | SMV818VMS/crispr_detection | abecc9289afe0802f641b3703b24838ea6e0c796 | [
"MIT"
] | 1 | 2017-11-27T04:53:38.000Z | 2017-11-27T04:53:38.000Z | scripts/script2_someprocessors.py | SMV818VMS/crispr_detection | abecc9289afe0802f641b3703b24838ea6e0c796 | [
"MIT"
] | null | null | null | scripts/script2_someprocessors.py | SMV818VMS/crispr_detection | abecc9289afe0802f641b3703b24838ea6e0c796 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import script1_functions as func
# # Process insertion files:
# func.insertion_processor("../ref_data/NC_000912transposoninsertions.gbk", "InsTh41", "../ref_data/insTh41_positions.txt")
# func.insertion_processor("../ref_data/NC_000912transposoninsertions.gbk", "InsTh7", "../ref_data/insTh7_po... | 40.095238 | 123 | 0.769596 |
7fbb8a83cbd6fb3589757f41bf455968c2866c36 | 3,221 | py | Python | tests/wallet/test_backup.py | grayfallstown/greendoge-blockchain | 31e325913374d694dc0859140d006a642e7f95ac | [
"Apache-2.0"
] | 44 | 2021-07-06T10:09:06.000Z | 2022-02-09T04:30:14.000Z | tests/wallet/test_backup.py | grayfallstown/greendoge-blockchain | 31e325913374d694dc0859140d006a642e7f95ac | [
"Apache-2.0"
] | 67 | 2021-07-06T11:57:18.000Z | 2022-02-02T16:14:15.000Z | tests/wallet/test_backup.py | grayfallstown/greendoge-blockchain | 31e325913374d694dc0859140d006a642e7f95ac | [
"Apache-2.0"
] | 16 | 2021-07-06T10:36:37.000Z | 2022-03-15T08:35:16.000Z | # import asyncio
# from pathlib import Path
# from secrets import token_bytes
#
# import pytest
#
# from greendoge.consensus.block_rewards import calculate_pool_reward, calculate_base_farmer_reward
# from greendoge.simulator.simulator_protocol import FarmNewBlockProtocol
# from greendoge.types.peer_info import PeerInfo... | 37.022989 | 116 | 0.686433 |
d9a6e728e26743eeecbb2e1be56a675e64b24c16 | 296 | py | Python | pydoge/connection_dbcursor.py | ezeportela/pydoge | 89ba8c4537cf22470caa51a698b9462f5522c079 | [
"MIT"
] | null | null | null | pydoge/connection_dbcursor.py | ezeportela/pydoge | 89ba8c4537cf22470caa51a698b9462f5522c079 | [
"MIT"
] | null | null | null | pydoge/connection_dbcursor.py | ezeportela/pydoge | 89ba8c4537cf22470caa51a698b9462f5522c079 | [
"MIT"
] | null | null | null | class ConnectionDbCursor:
def __init__(self, connection):
self.connection = connection
def __enter__(self):
self.cursor = self.connection.cursor()
return self.cursor
def __exit__(self, exception_type, exception_value, traceback):
self.cursor.close()
| 26.909091 | 67 | 0.682432 |
fb6ed0bc3f254ee331838ce04842961dcf87bb30 | 5,334 | py | Python | tensorflow/tensorboard/plugins/scalars/scalars_plugin_test.py | salonirk11/tensorflow | 7fda1bb1177c69fa7bf80d20d5c5e7aaa25816e7 | [
"Apache-2.0"
] | 4 | 2019-04-14T13:33:17.000Z | 2021-09-22T02:33:29.000Z | tensorflow/tensorboard/plugins/scalars/scalars_plugin_test.py | salonirk11/tensorflow | 7fda1bb1177c69fa7bf80d20d5c5e7aaa25816e7 | [
"Apache-2.0"
] | 1 | 2021-02-02T23:00:07.000Z | 2021-02-02T23:00:07.000Z | tensorflow/tensorboard/plugins/scalars/scalars_plugin_test.py | salonirk11/tensorflow | 7fda1bb1177c69fa7bf80d20d5c5e7aaa25816e7 | [
"Apache-2.0"
] | 2 | 2017-07-16T13:54:08.000Z | 2018-05-21T09:02:34.000Z | # -*- coding: utf-8 -*-
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Un... | 37.041667 | 80 | 0.72216 |
0f62b3dda2a070a46ffaabd9c112a5474ec63b17 | 105 | py | Python | traptransmitter/apps.py | FelixTheC/onlineOrderForm | 6f606fe7baa56e94d48278da8258b5eb33a3590d | [
"Apache-2.0"
] | null | null | null | traptransmitter/apps.py | FelixTheC/onlineOrderForm | 6f606fe7baa56e94d48278da8258b5eb33a3590d | [
"Apache-2.0"
] | null | null | null | traptransmitter/apps.py | FelixTheC/onlineOrderForm | 6f606fe7baa56e94d48278da8258b5eb33a3590d | [
"Apache-2.0"
] | 1 | 2021-04-01T16:52:35.000Z | 2021-04-01T16:52:35.000Z | from django.apps import AppConfig
class TraptransmitterConfig(AppConfig):
name = 'traptransmitter'
| 17.5 | 39 | 0.790476 |
ae66526a580dea263990f44c5a4b27ab276132f8 | 474 | py | Python | solutions/Longest Palindromic Substring/solution.py | nilax97/leetcode-solutions | d3c12f2b289662d199510e0431e177bbf3cda121 | [
"MIT"
] | 3 | 2021-06-06T22:03:15.000Z | 2021-06-08T08:49:04.000Z | solutions/Longest Palindromic Substring/solution.py | nilax97/leetcode-solutions | d3c12f2b289662d199510e0431e177bbf3cda121 | [
"MIT"
] | null | null | null | solutions/Longest Palindromic Substring/solution.py | nilax97/leetcode-solutions | d3c12f2b289662d199510e0431e177bbf3cda121 | [
"MIT"
] | null | null | null | class Solution:
def longestPalindrome(self, s: str) -> str:
res = ""
for i in range(len(s)):
tmp = self.helper(s, i, i)
if len(tmp) > len(res):
res = tmp
tmp = self.helper(s, i, i+1)
if len(tmp) > len(res):
res = tmp
... | 27.882353 | 53 | 0.413502 |
ed2ba7e53bc4df1991c713c0f8f6b1cd7688d90c | 3,023 | py | Python | trainer.py | blackredscarf/pytorch-DQN | 3b4abf540860e805e2b8a70cd09c818863c09233 | [
"Apache-2.0"
] | 21 | 2019-09-20T15:33:49.000Z | 2022-02-28T08:49:33.000Z | trainer.py | blackredscarf/pytorch-DQN | 3b4abf540860e805e2b8a70cd09c818863c09233 | [
"Apache-2.0"
] | 1 | 2020-09-17T19:37:53.000Z | 2020-09-17T19:37:53.000Z | trainer.py | blackredscarf/pytorch-DQN | 3b4abf540860e805e2b8a70cd09c818863c09233 | [
"Apache-2.0"
] | 14 | 2020-01-08T06:40:26.000Z | 2021-09-24T03:09:07.000Z | import math
import numpy as np
from config import Config
from core.logger import TensorBoardLogger
from core.util import get_output_folder
class Trainer:
def __init__(self, agent, env, config: Config):
self.agent = agent
self.env = env
self.config = config
# non-Linear epsilon dec... | 39.776316 | 147 | 0.596427 |
c068da1e468f92cd2876573cda3857085d21917b | 6,316 | py | Python | tests/test_ext_autodoc_autoattribute.py | SamB/sphinx | bf010790ace78ba4bc4231445e73bcecf97e4947 | [
"BSD-2-Clause"
] | null | null | null | tests/test_ext_autodoc_autoattribute.py | SamB/sphinx | bf010790ace78ba4bc4231445e73bcecf97e4947 | [
"BSD-2-Clause"
] | null | null | null | tests/test_ext_autodoc_autoattribute.py | SamB/sphinx | bf010790ace78ba4bc4231445e73bcecf97e4947 | [
"BSD-2-Clause"
] | null | null | null | """Test the autodoc extension.
This tests mainly the Documenters; the auto directives are tested in a test
source file translated by test_build.
"""
import sys
import pytest
from .test_ext_autodoc import do_autodoc
@pytest.mark.sphinx('html', testroot='ext-autodoc')
def test_autoattribute(app):
actual = do_au... | 28.071111 | 81 | 0.556681 |
801e5b6733cc781027b2dfeef1e202ba6a55e686 | 2,601 | py | Python | process.py | Jip-Hop/polargraph-optimizer | 5c7b201554c01148d90597867436c27e03b11a33 | [
"MIT"
] | null | null | null | process.py | Jip-Hop/polargraph-optimizer | 5c7b201554c01148d90597867436c27e03b11a33 | [
"MIT"
] | null | null | null | process.py | Jip-Hop/polargraph-optimizer | 5c7b201554c01148d90597867436c27e03b11a33 | [
"MIT"
] | null | null | null | #!/usr/bin/python
from __future__ import print_function
from lib import *
######################
instructions = []
setup_finished = False
import fileinput
for line in fileinput.input():
# Don't process the initial setup instructions,
# write to output file immediately
if not setup_finished:
pri... | 34.68 | 100 | 0.694733 |
ae9e166c6b43325b0bd19bd06b8c2fd2c67f08ed | 6,561 | py | Python | litex_boards/targets/lattice_ice40up5k_evn.py | AEW2015/litex-boards | e98ddd58d3dbe2229d04281d43cb0d13a06527ea | [
"BSD-2-Clause"
] | 177 | 2019-06-13T09:54:49.000Z | 2022-03-29T02:25:13.000Z | litex_boards/targets/lattice_ice40up5k_evn.py | zeldin/litex-boards | d52859d9ef5d8d210118c01ce89e29404ac8d7c6 | [
"BSD-2-Clause"
] | 347 | 2019-06-12T17:47:45.000Z | 2022-03-30T21:59:01.000Z | litex_boards/targets/lattice_ice40up5k_evn.py | zeldin/litex-boards | d52859d9ef5d8d210118c01ce89e29404ac8d7c6 | [
"BSD-2-Clause"
] | 202 | 2019-06-11T15:01:26.000Z | 2022-03-31T16:25:19.000Z | #!/usr/bin/env python3
#
# This file is part of LiteX-Boards.
#
# Copyright (c) 2019 Sean Cross <sean@xobs.io>
# Copyright (c) 2018 David Shah <dave@ds0.me>
# Copyright (c) 2020 Florent Kermarrec <florent@enjoy-digital.fr>
# SPDX-License-Identifier: BSD-2-Clause
import os
import sys
import argparse
target="lattice_i... | 38.368421 | 119 | 0.556165 |
a8d66a7e008d1abb9c5577c77fd84b4bbd0a8d50 | 1,448 | py | Python | sa/profiles/Qtech/BFC_PBIC_S/get_interface_status_ex.py | xUndero/noc | 9fb34627721149fcf7064860bd63887e38849131 | [
"BSD-3-Clause"
] | 1 | 2019-09-20T09:36:48.000Z | 2019-09-20T09:36:48.000Z | sa/profiles/Qtech/BFC_PBIC_S/get_interface_status_ex.py | ewwwcha/noc | aba08dc328296bb0e8e181c2ac9a766e1ec2a0bb | [
"BSD-3-Clause"
] | null | null | null | sa/profiles/Qtech/BFC_PBIC_S/get_interface_status_ex.py | ewwwcha/noc | aba08dc328296bb0e8e181c2ac9a766e1ec2a0bb | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# ---------------------------------------------------------------------
# Qtech.BFC_PBIC_S.get_interface_status_ex
# ---------------------------------------------------------------------
# Copyright (C) 2007-2019 The NOC Project
# See LICENSE for details
# ---------------------------------------... | 33.674419 | 93 | 0.483425 |
0f97e28ce440e2b41e9d598bb456861a246b4337 | 1,011 | py | Python | ambari-server/src/main/resources/stacks/VDH/2.4.1/hooks/before-ANY/scripts/hook.py | vsosrc/ambari | e3cc898672707bedf7597f2e16d684c8a00bba3b | [
"Apache-2.0"
] | 5 | 2018-06-03T05:19:40.000Z | 2021-04-16T17:10:49.000Z | ambari-server/src/main/resources/stacks/VDH/2.4.1/hooks/before-ANY/scripts/hook.py | vsosrc/ambari | e3cc898672707bedf7597f2e16d684c8a00bba3b | [
"Apache-2.0"
] | null | null | null | ambari-server/src/main/resources/stacks/VDH/2.4.1/hooks/before-ANY/scripts/hook.py | vsosrc/ambari | e3cc898672707bedf7597f2e16d684c8a00bba3b | [
"Apache-2.0"
] | 6 | 2019-05-07T13:24:39.000Z | 2021-02-15T14:12:37.000Z | """
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this ... | 29.735294 | 72 | 0.772502 |
2877f0861044919663885b76e012b15f026ef7a6 | 32,265 | py | Python | FashionMNISTFULL.py | avmoldovan/CNN-TE | 87fd7f97e4a7b16617b0404a34292dae03b55ece | [
"Apache-2.0"
] | 1 | 2022-03-15T06:22:35.000Z | 2022-03-15T06:22:35.000Z | FashionMNISTFULL.py | avmoldovan/CNN-TE | 87fd7f97e4a7b16617b0404a34292dae03b55ece | [
"Apache-2.0"
] | null | null | null | FashionMNISTFULL.py | avmoldovan/CNN-TE | 87fd7f97e4a7b16617b0404a34292dae03b55ece | [
"Apache-2.0"
] | null | null | null | from torchvision import transforms, datasets as ds
from torch.utils.data import DataLoader
import torchvision as tv
from torchvision.transforms import ToPILImage
import torch as t
import torch.nn as nn
from torch.autograd import Variable
from torch import optim
import torch.backends.cudnn as cudnn
# import matplotlib.p... | 42.905585 | 180 | 0.562219 |
65a8f108722358478e96dc1cffc9d04e8c9d619e | 1,141 | py | Python | mboot/decorator.py | nxdhf/pyMBoot | c0a609487ea752b4037e998053acb19e8ce50137 | [
"BSD-3-Clause"
] | null | null | null | mboot/decorator.py | nxdhf/pyMBoot | c0a609487ea752b4037e998053acb19e8ce50137 | [
"BSD-3-Clause"
] | null | null | null | mboot/decorator.py | nxdhf/pyMBoot | c0a609487ea752b4037e998053acb19e8ce50137 | [
"BSD-3-Clause"
] | null | null | null | import sys
import time
import logging
import traceback
import functools
def global_error_handler(func):
@functools.wraps(func)
def warpper():
try:
func()
except Exception as e:
root_logger = logging.getLogger()
err_msg = '\n' + traceback.format_exc() if root_... | 31.694444 | 122 | 0.568799 |
9beb18ccd57ae91d21623877ebd1eb6dbbd94b2c | 23,587 | py | Python | test/test_markdown_backslash_escapes_extra.py | scop/pymarkdown | 562ba8f7857d99ba09e86e42de5a37ec6d9b2c30 | [
"MIT"
] | 20 | 2021-01-14T17:39:09.000Z | 2022-03-14T08:35:22.000Z | test/test_markdown_backslash_escapes_extra.py | scop/pymarkdown | 562ba8f7857d99ba09e86e42de5a37ec6d9b2c30 | [
"MIT"
] | 304 | 2020-08-15T23:24:00.000Z | 2022-03-31T23:34:03.000Z | test/test_markdown_backslash_escapes_extra.py | scop/pymarkdown | 562ba8f7857d99ba09e86e42de5a37ec6d9b2c30 | [
"MIT"
] | 3 | 2021-08-11T10:26:26.000Z | 2021-11-02T20:41:27.000Z | """
https://github.github.com/gfm/#backslash-escapes
"""
import pytest
from .utils import act_and_assert
@pytest.mark.gfm
def test_backslash_escapes_extra_1():
"""
Test case backslash extra 1: backslash before the code span open
"""
# Arrange
source_markdown = """\\`code span`"""
expected_t... | 26.651977 | 113 | 0.559969 |
ea8b7605314d1398928a8404ceef2c503ed1d915 | 570 | py | Python | tests/utils/test_regex.py | tonysyu/qwikstart | d942c486a7d4362354e95a11e3797c42a982c891 | [
"BSD-3-Clause"
] | 1 | 2020-04-10T01:55:51.000Z | 2020-04-10T01:55:51.000Z | tests/utils/test_regex.py | tonysyu/qwikstart | d942c486a7d4362354e95a11e3797c42a982c891 | [
"BSD-3-Clause"
] | 112 | 2019-12-24T20:04:05.000Z | 2022-01-25T19:05:20.000Z | tests/utils/test_regex.py | tonysyu/qwikstart | d942c486a7d4362354e95a11e3797c42a982c891 | [
"BSD-3-Clause"
] | null | null | null | import re
from qwikstart.utils import regex
class TestCreateRegexFlags:
def test_empty_list(self) -> None:
assert regex.create_regex_flags([]) == re.RegexFlag(0)
def test_unknown_flag(self) -> None:
assert regex.create_regex_flags(["NOT-A-FLAG"]) == re.RegexFlag(0)
def test_single_flag(... | 30 | 80 | 0.680702 |
fb231c25a543ccd89a4cec13a29a46d76bb797a7 | 1,235 | py | Python | setup.py | djt5019/episode_renamer | 84d3dda24b54c70a489c2a6bcb9c7c2c2dadfba9 | [
"Unlicense"
] | null | null | null | setup.py | djt5019/episode_renamer | 84d3dda24b54c70a489c2a6bcb9c7c2c2dadfba9 | [
"Unlicense"
] | null | null | null | setup.py | djt5019/episode_renamer | 84d3dda24b54c70a489c2a6bcb9c7c2c2dadfba9 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
from setuptools import find_packages, setup
from eplist import __author__ as author
from eplist import __email__ as email
from eplist import __version__ as version
import sys
info = sys.version_info
if (info.major, info.minor) != (2, 7):
print "Requires Python 2.7"
exit... | 26.847826 | 63 | 0.607287 |
61c6064cb8829035b314973d733b072fa98b84ad | 231 | py | Python | helpers/numpy_repeat_1.py | futureseadev/hgwxx7 | 282b370afc7d9c277e6c1f5b31282f14f9236f7b | [
"MIT"
] | 6 | 2018-06-21T09:44:36.000Z | 2021-10-01T18:37:41.000Z | helpers/numpy_repeat_1.py | futureseadev/hgwxx7 | 282b370afc7d9c277e6c1f5b31282f14f9236f7b | [
"MIT"
] | 15 | 2020-01-28T22:56:15.000Z | 2022-03-11T23:55:52.000Z | helpers/numpy_repeat_1.py | praveentn/hgwxx7 | 282b370afc7d9c277e6c1f5b31282f14f9236f7b | [
"MIT"
] | 2 | 2018-06-25T16:40:20.000Z | 2021-10-01T18:37:42.000Z | # numpy repeat - use case 1
# creating a new pandas column from a list
# assuming you've a dataframe df
import numpy as np
my_list = ['A','B','C','D']
df['my_list'] = np.repeat(my_list, 5)
# repeats each item in my_list 5 times
| 21 | 42 | 0.683983 |
18f76373d16f40d982a07acbaf7260f7925b736c | 20,748 | py | Python | critiquebrainz/ws/review/views.py | AbhinavOhri/critiquebrainz | d1c1c175209ec78bcced1dbfd5bd64a46be2d1f4 | [
"Apache-2.0"
] | null | null | null | critiquebrainz/ws/review/views.py | AbhinavOhri/critiquebrainz | d1c1c175209ec78bcced1dbfd5bd64a46be2d1f4 | [
"Apache-2.0"
] | null | null | null | critiquebrainz/ws/review/views.py | AbhinavOhri/critiquebrainz | d1c1c175209ec78bcced1dbfd5bd64a46be2d1f4 | [
"Apache-2.0"
] | null | null | null | from brainzutils import cache
from flask import Blueprint, jsonify
import critiquebrainz.db.review as db_review
from critiquebrainz.db import (
vote as db_vote,
exceptions as db_exceptions,
spam_report as db_spam_report,
revision as db_revision,
users as db_users,
REVIEW_RATING_MIN,
REVIEW_... | 32.41875 | 120 | 0.616156 |
59b4f521b1c7923a231bdc8ecd7ee44c60036330 | 949 | py | Python | bot.py | AktanKasymaliev/insta_download | cf16ba55f8d47ed300b5fd543aaeac614b49276a | [
"MIT"
] | 1 | 2022-03-16T14:47:18.000Z | 2022-03-16T14:47:18.000Z | bot.py | AktanKasymaliev/insta_download | cf16ba55f8d47ed300b5fd543aaeac614b49276a | [
"MIT"
] | null | null | null | bot.py | AktanKasymaliev/insta_download | cf16ba55f8d47ed300b5fd543aaeac614b49276a | [
"MIT"
] | 4 | 2021-08-08T14:22:22.000Z | 2022-03-28T11:20:49.000Z | import telebot
from config import import_conf
from telebot import types
from parse_insta import main, delete_file
bot = telebot.TeleBot(import_conf("BOT", "token"))
@bot.message_handler(commands=['start'])
def send_welcome(message: types.Message):
chat_id = message.chat.id
bot.send_message(chat_id, "Hello, se... | 31.633333 | 75 | 0.687039 |
f220680fdbaebcac41a467a8e78051669d528cea | 405 | py | Python | qa/pull-tester/tests_config.py | newstartblockchain/- | e58851967dd58bcd228794ff4904fd3a6c3e8989 | [
"MIT"
] | null | null | null | qa/pull-tester/tests_config.py | newstartblockchain/- | e58851967dd58bcd228794ff4904fd3a6c3e8989 | [
"MIT"
] | null | null | null | qa/pull-tester/tests_config.py | newstartblockchain/- | e58851967dd58bcd228794ff4904fd3a6c3e8989 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
# Copyright (c) 2013-2014 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
BUILDDIR="/home/smilecoin/Desktop/sml2.0"
EXEEXT=""
# These will turn into comments if they were disable... | 25.3125 | 71 | 0.785185 |
d4010288139e89f92e7e1a1c715375c19d4b15d5 | 2,779 | py | Python | spira/yevon/gdsii/base.py | JCoetzee123/spira | dae08feba1578ecc8745b45109f4fb7bef374546 | [
"MIT"
] | null | null | null | spira/yevon/gdsii/base.py | JCoetzee123/spira | dae08feba1578ecc8745b45109f4fb7bef374546 | [
"MIT"
] | null | null | null | spira/yevon/gdsii/base.py | JCoetzee123/spira | dae08feba1578ecc8745b45109f4fb7bef374546 | [
"MIT"
] | null | null | null | from spira.core.transformable import Transformable
from spira.core.parameters.initializer import ParameterInitializer
from spira.core.parameters.initializer import MetaInitializer
from spira.core.parameters.descriptor import FunctionParameter
from spira.yevon.process.gdsii_layer import LayerParameter
from spira.core.pa... | 30.877778 | 110 | 0.652033 |
6bfc5be3b783b092806d7870e58a5d23175fd85f | 2,336 | py | Python | optuna/integration/keras.py | Jeyhooon/optuna | 0a5560cd0c8e83fe03f63ab431a513bf893f7d4d | [
"MIT"
] | 1 | 2019-05-28T07:29:49.000Z | 2019-05-28T07:29:49.000Z | optuna/integration/keras.py | nabenabe0928/optuna | aa505125de8515518fe19ba227edf7a1d3f8ebda | [
"MIT"
] | null | null | null | optuna/integration/keras.py | nabenabe0928/optuna | aa505125de8515518fe19ba227edf7a1d3f8ebda | [
"MIT"
] | 2 | 2020-03-03T00:40:28.000Z | 2021-01-28T11:54:32.000Z | from typing import Dict
from typing import Optional
import optuna
from optuna._deprecated import deprecated
with optuna._imports.try_import() as _imports:
from keras.callbacks import Callback
if not _imports.is_successful():
Callback = object # NOQA
@deprecated(
"2.1.0",
text="Recent Keras release... | 35.938462 | 91 | 0.657106 |
b5682525aa125baf1cadc1429f98cfe12ee6dcbd | 1,743 | py | Python | MuPythonLibrary/Uefi/Capsule/CatGenerator_test.py | matthewfcarlson/mu_pip_python_library | 659538b80fd5c060e053e14a828d9d41161682a1 | [
"BSD-2-Clause"
] | null | null | null | MuPythonLibrary/Uefi/Capsule/CatGenerator_test.py | matthewfcarlson/mu_pip_python_library | 659538b80fd5c060e053e14a828d9d41161682a1 | [
"BSD-2-Clause"
] | null | null | null | MuPythonLibrary/Uefi/Capsule/CatGenerator_test.py | matthewfcarlson/mu_pip_python_library | 659538b80fd5c060e053e14a828d9d41161682a1 | [
"BSD-2-Clause"
] | null | null | null | import os
import unittest
from MuPythonLibrary.Uefi.Capsule.CatGenerator import CatGenerator
# must run from build env or set PYTHONPATH env variable to point to the MuPythonLibrary folder
class CatGeneratorTest(unittest.TestCase):
def test_win10_OS(self):
o = CatGenerator("x64", "win10")
self.a... | 31.690909 | 95 | 0.644865 |
5253590c78323092de9de531e620ea85ba83f4ac | 271 | py | Python | Code/train.py | Elitedestroyer2/Waifu_recongizer | 3d28193b78374b954e29de70271fe9a97528613c | [
"MIT"
] | null | null | null | Code/train.py | Elitedestroyer2/Waifu_recongizer | 3d28193b78374b954e29de70271fe9a97528613c | [
"MIT"
] | null | null | null | Code/train.py | Elitedestroyer2/Waifu_recongizer | 3d28193b78374b954e29de70271fe9a97528613c | [
"MIT"
] | null | null | null | import tensorflow as tf
from tensorflow.keras import datasets, layers, models
import matplotlib.pyplot as plt
(train_images, train_labels), (test_images, test_labels) = datasets.cifar10.load_data()
print(train_images)
print(train_labels)
print(test_images) | 24.636364 | 88 | 0.782288 |
47471bf5dca6e5e15b2c531b34a263f4083063a8 | 435 | py | Python | S1/TP5/ex7.py | HerbeMalveillante/ecole | bebbc73cd678c58c9cd40389ea1cf229a0200308 | [
"MIT"
] | null | null | null | S1/TP5/ex7.py | HerbeMalveillante/ecole | bebbc73cd678c58c9cd40389ea1cf229a0200308 | [
"MIT"
] | null | null | null | S1/TP5/ex7.py | HerbeMalveillante/ecole | bebbc73cd678c58c9cd40389ea1cf229a0200308 | [
"MIT"
] | null | null | null | import random
def cree(n):
return [random.randint(0, 20) for i in range(n)]
def apparitions(x, lis):
return [indice for indice, item in enumerate(lis) if item == x]
entiers = int(input("Saisir le nombre d'entiers de la liste : "))
liste = cree(entiers)
print(f"Liste : {liste}")
entierRecherche = int(input... | 25.588235 | 80 | 0.698851 |
bbdd676802bbb0bf4ff7e70bbd4d43e2bf5a9dad | 4,332 | py | Python | test/test_arns.py | fishzle/policy_sentry | aa880c0ff87565132538e1d23ebf113d24c6b3b5 | [
"MIT"
] | 1 | 2019-10-22T00:50:47.000Z | 2019-10-22T00:50:47.000Z | test/test_arns.py | fishzle/policy_sentry | aa880c0ff87565132538e1d23ebf113d24c6b3b5 | [
"MIT"
] | null | null | null | test/test_arns.py | fishzle/policy_sentry | aa880c0ff87565132538e1d23ebf113d24c6b3b5 | [
"MIT"
] | null | null | null | import unittest
from pathlib import Path
from policy_sentry.shared.arns import does_arn_match
from policy_sentry.shared.database import connect_db
home = str(Path.home())
config_directory = '/.policy_sentry/'
database_file_name = 'aws.sqlite3'
database_path = home + config_directory + database_file_name
db_session = c... | 59.342466 | 161 | 0.751385 |
e16bef9f6db78f6969e3494091663af67f6315de | 2,947 | py | Python | test/pyaz/network/private_link_service/__init__.py | bigdatamoore/py-az-cli | 54383a4ee7cc77556f6183e74e992eec95b28e01 | [
"MIT"
] | null | null | null | test/pyaz/network/private_link_service/__init__.py | bigdatamoore/py-az-cli | 54383a4ee7cc77556f6183e74e992eec95b28e01 | [
"MIT"
] | 9 | 2021-09-24T16:37:24.000Z | 2021-12-24T00:39:19.000Z | test/pyaz/network/private_link_service/__init__.py | bigdatamoore/py-az-cli | 54383a4ee7cc77556f6183e74e992eec95b28e01 | [
"MIT"
] | null | null | null | import json, subprocess
from ... pyaz_utils import get_cli_name, get_params
def create(resource_group, name, subnet, lb_frontend_ip_configs, private_ip_address=None, private_ip_allocation_method=None, private_ip_address_version=None, vnet_name=None, public_ip_address=None, location=None, tags=None, lb_name=None, visi... | 39.824324 | 331 | 0.690193 |
79908e2a179c229b70d3fc3bd04c0b43f0ae708b | 12,568 | py | Python | tensorflow_probability/python/bijectors/soft_clip.py | jakee417/probability-1 | ae7117f37ac441bc7a888167ea23e5e620c5bcde | [
"Apache-2.0"
] | 1 | 2020-06-03T14:20:56.000Z | 2020-06-03T14:20:56.000Z | tensorflow_probability/python/bijectors/soft_clip.py | jakee417/probability-1 | ae7117f37ac441bc7a888167ea23e5e620c5bcde | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/bijectors/soft_clip.py | jakee417/probability-1 | ae7117f37ac441bc7a888167ea23e5e620c5bcde | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 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... | 37.855422 | 80 | 0.666852 |
a33bd85f098431ccb2ffe3207b35bdb5ec67ec23 | 4,808 | py | Python | napari/_qt/dialogs/qt_reader_dialog.py | gselzer/napari | 410459a45db30efdf84c2339db9ceff8ccc570c8 | [
"BSD-3-Clause"
] | null | null | null | napari/_qt/dialogs/qt_reader_dialog.py | gselzer/napari | 410459a45db30efdf84c2339db9ceff8ccc570c8 | [
"BSD-3-Clause"
] | null | null | null | napari/_qt/dialogs/qt_reader_dialog.py | gselzer/napari | 410459a45db30efdf84c2339db9ceff8ccc570c8 | [
"BSD-3-Clause"
] | null | null | null | import os
from typing import Any, Dict, Optional, Tuple
from qtpy.QtWidgets import (
QButtonGroup,
QCheckBox,
QDialog,
QDialogButtonBox,
QLabel,
QRadioButton,
QVBoxLayout,
QWidget,
)
class QtReaderDialog(QDialog):
"""Dialog for user to select a reader plugin for a given file exten... | 32.707483 | 88 | 0.649126 |
0e1a13f98a43955e0978a849e020046f83c11478 | 717 | py | Python | omaha_server/omaha/migrations/0019_auto_20150707_0822.py | makar21/omaha-server | b84cdf6e67d9106e7a86b447204de4f82397b019 | [
"Apache-2.0"
] | 8 | 2018-06-25T07:20:17.000Z | 2021-02-07T20:01:04.000Z | omaha_server/omaha/migrations/0019_auto_20150707_0822.py | makar21/omaha-server | b84cdf6e67d9106e7a86b447204de4f82397b019 | [
"Apache-2.0"
] | 8 | 2018-06-22T21:56:27.000Z | 2020-06-25T15:22:56.000Z | omaha_server/omaha/migrations/0019_auto_20150707_0822.py | dentalwings/omaha-server | 3d8e18c8f4aac4eb16445c0f3160ed1fc2fc8de5 | [
"Apache-2.0"
] | 11 | 2019-01-22T01:36:42.000Z | 2022-03-09T01:41:32.000Z | # -*- coding: utf-8 -*-
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('omaha', '0018_auto_20150616_1112'),
]
operations = [
migrations.AlterModelOptions(
name='action',
options={},
),
migrations... | 20.485714 | 45 | 0.496513 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.