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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ba8f3e37ec4368570a4ebb46bfcac5258a4c23c5 | 1,952 | py | Python | extracting/main.py | Das-Boot/eason | 2d50b3e1738e483284a487eb5a2f273b54f1c3a0 | [
"Apache-2.0"
] | 2 | 2020-12-02T11:21:20.000Z | 2021-08-30T01:58:53.000Z | extracting/main.py | Das-Boot/eason | 2d50b3e1738e483284a487eb5a2f273b54f1c3a0 | [
"Apache-2.0"
] | null | null | null | extracting/main.py | Das-Boot/eason | 2d50b3e1738e483284a487eb5a2f273b54f1c3a0 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Author: Zhaoning Li
'''
from model import *
from util import *
import argparse
def initialize(args):
extractor = ChineseClinicalExtracter(args).slm()
extractor.load_weights(args.modelPath)
return extractor
def predict(extractor, predText, args):
index2tag = {
... | 38.27451 | 313 | 0.638832 |
9382d73c1cc3e8a597d5c199732f483ebf444b8e | 671 | py | Python | application/main/utility/config_loader/read_yaml.py | willuvbb/test_fastapi_template | 2d0c0b0526c7e490dd85905c03d7537cdc45f01f | [
"MIT"
] | 128 | 2021-05-14T14:31:05.000Z | 2022-03-21T14:46:16.000Z | application/main/utility/config_loader/read_yaml.py | willuvbb/test_fastapi_template | 2d0c0b0526c7e490dd85905c03d7537cdc45f01f | [
"MIT"
] | 3 | 2021-05-15T22:00:07.000Z | 2021-11-16T07:09:31.000Z | application/main/utility/config_loader/read_yaml.py | willuvbb/test_fastapi_template | 2d0c0b0526c7e490dd85905c03d7537cdc45f01f | [
"MIT"
] | 20 | 2021-05-14T16:11:22.000Z | 2022-01-26T12:51:21.000Z | from pathlib import Path
import yaml
from application.main.config import settings
from application.main.utility.config_loader.config_interface import ConfigReaderInterface
from application.main.utility.config_loader.serializer import Struct
class YamlConfigReader(ConfigReaderInterface):
def __init__(self):
... | 31.952381 | 94 | 0.764531 |
8a32c18d700cf38aa3cf4df404a37cc7711b172a | 15,724 | py | Python | topi/tests/python/test_topi_pooling.py | wix-playground/incubator-tvm | c9e2cc2c3daa8065257c76fce42d9c22e06ebb54 | [
"Apache-2.0"
] | 1 | 2021-07-07T09:14:22.000Z | 2021-07-07T09:14:22.000Z | topi/tests/python/test_topi_pooling.py | wix-playground/incubator-tvm | c9e2cc2c3daa8065257c76fce42d9c22e06ebb54 | [
"Apache-2.0"
] | null | null | null | topi/tests/python/test_topi_pooling.py | wix-playground/incubator-tvm | c9e2cc2c3daa8065257c76fce42d9c22e06ebb54 | [
"Apache-2.0"
] | 1 | 2019-12-27T02:52:58.000Z | 2019-12-27T02:52:58.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 43.677778 | 123 | 0.565123 |
7220fd8c5f891e1ecce50871566950b878e8a9a8 | 3,714 | py | Python | alerta/webhooks/pagerduty.py | tester22/alerta | 0d3c1004bac41540d4a97a255973ea457d540a74 | [
"Apache-2.0"
] | 1 | 2019-02-07T14:37:12.000Z | 2019-02-07T14:37:12.000Z | alerta/webhooks/pagerduty.py | francopeapea/alerta | dce18f0ab93a1feff518289d51261cccf151d3e8 | [
"Apache-2.0"
] | null | null | null | alerta/webhooks/pagerduty.py | francopeapea/alerta | dce18f0ab93a1feff518289d51261cccf151d3e8 | [
"Apache-2.0"
] | null | null | null |
from flask import request, g, jsonify
from flask_cors import cross_origin
from alerta.auth.utils import permission
from alerta.exceptions import ApiError
from alerta.models.alert import Alert
from . import webhooks
def parse_pagerduty(message):
try:
incident_key = message['data']['incident']['incident_... | 37.897959 | 90 | 0.591546 |
287c619bb566778e7ac1d33cfe8633cb53e3da13 | 65,742 | py | Python | pycqed/measurement/composite_detector_functions.py | nuttamas/PycQED_py3 | 1ee35c7428d36ed42ba4afb5d4bda98140b2283e | [
"MIT"
] | null | null | null | pycqed/measurement/composite_detector_functions.py | nuttamas/PycQED_py3 | 1ee35c7428d36ed42ba4afb5d4bda98140b2283e | [
"MIT"
] | null | null | null | pycqed/measurement/composite_detector_functions.py | nuttamas/PycQED_py3 | 1ee35c7428d36ed42ba4afb5d4bda98140b2283e | [
"MIT"
] | null | null | null | import numpy as np
import time
from pycqed.measurement import sweep_functions as swf
from pycqed.measurement import awg_sweep_functions as awg_swf
from pycqed.measurement import CBox_sweep_functions as CB_swf
from pycqed.measurement import detector_functions as det
from pycqed.analysis import measurement_analysis as ma... | 41.556258 | 139 | 0.57245 |
ac8ce46c988a6a9e0ee29122a9648e1094f70505 | 5,805 | py | Python | sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/_microsoft_storage_sync.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/_microsoft_storage_sync.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/storage/azure-mgmt-storagesync/azure/mgmt/storagesync/_microsoft_storage_sync.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 50.043103 | 129 | 0.744358 |
c5516dcfe4b04f359e05eca570c781e598d2d740 | 1,330 | py | Python | test/functional/resendwallettransactions.py | BlenderSleuth/schleems | 0dbaa35598e4a8352192615085da54b85192a205 | [
"MIT"
] | null | null | null | test/functional/resendwallettransactions.py | BlenderSleuth/schleems | 0dbaa35598e4a8352192615085da54b85192a205 | [
"MIT"
] | null | null | null | test/functional/resendwallettransactions.py | BlenderSleuth/schleems | 0dbaa35598e4a8352192615085da54b85192a205 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test resendwallettransactions RPC."""
from test_framework.test_framework import SchleemsTestFramework
from ... | 44.333333 | 151 | 0.741353 |
8fa9c8336db9db9eea56d28906cfa2a6adafc30f | 17,396 | py | Python | src/welcome_system.py | UnableToCode/Welcome_system | 1076fce6ab8ee135f34207077937d40b88c84449 | [
"MIT"
] | null | null | null | src/welcome_system.py | UnableToCode/Welcome_system | 1076fce6ab8ee135f34207077937d40b88c84449 | [
"MIT"
] | 6 | 2020-01-28T22:14:36.000Z | 2022-02-09T23:33:25.000Z | src/welcome_system.py | UnableToCode/Welcome_system | 1076fce6ab8ee135f34207077937d40b88c84449 | [
"MIT"
] | 2 | 2019-09-06T00:57:57.000Z | 2019-09-06T05:05:23.000Z | import datetime
import json
import os
import sys
import threading
import time
from multiprocessing import Process, Pipe
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from src.get_weather import get_weather
from src.video import face_regcon
log_file = "../log.txt"
out_mode = 0
d... | 35.574642 | 121 | 0.576167 |
2bfd937fc89f6440570eb57a63ec8609a9386135 | 1,414 | py | Python | torchblocks/models/transformer/utils.py | lonePatient/TorchBlocks | 4a65d746cc8a396cb7df73ed4644d97ddf843e29 | [
"MIT"
] | 82 | 2020-06-23T05:51:08.000Z | 2022-03-29T08:11:08.000Z | torchblocks/models/transformer/utils.py | Raiselimit/TorchBlocks | a5baecb9a2470ff175087475630f2b7db3f7ef51 | [
"MIT"
] | null | null | null | torchblocks/models/transformer/utils.py | Raiselimit/TorchBlocks | a5baecb9a2470ff175087475630f2b7db3f7ef51 | [
"MIT"
] | 22 | 2020-06-23T05:51:10.000Z | 2022-03-18T07:01:43.000Z | from torchblocks.models.transformer.modeling_bert_for_theseus import BertEncoder
class ConstantReplacementScheduler:
def __init__(self, bert_encoder: BertEncoder, replacing_rate, replacing_steps=None):
self.bert_encoder = bert_encoder
self.replacing_rate = replacing_rate
self.replacin... | 41.588235 | 97 | 0.690948 |
353b864aa599d574dd46b1034e931456f0df8389 | 6,708 | py | Python | faersPreprocess.py | jl223vy/FAERS-data-toolkit | 7927d28267ddc2733938b0823c4aff6b28018642 | [
"MIT"
] | 8 | 2021-03-10T12:42:36.000Z | 2021-07-30T20:46:11.000Z | faersPreprocess.py | backmind/FAERS-data-toolkit | 7927d28267ddc2733938b0823c4aff6b28018642 | [
"MIT"
] | null | null | null | faersPreprocess.py | backmind/FAERS-data-toolkit | 7927d28267ddc2733938b0823c4aff6b28018642 | [
"MIT"
] | 8 | 2021-02-01T15:01:11.000Z | 2022-01-15T00:29:26.000Z | # coding: utf-8
# author: Jing Li
# date: 2019/04/01
import os
import warnings
import pandas as pd
import numpy as np
# local directory to save files.
data_dir = "FAERSdata"
directoryPath = os.getcwd() + '/' + data_dir
# ignore warnings
warnings.filterwarnings('ignore')
def processDemo():
for filename in os.lis... | 47.914286 | 117 | 0.561717 |
1db8fe9abaf1d64968b9e90f6ad4fe25ed6a0f43 | 3,521 | py | Python | blueoil/common.py | oatawa1/blueoil | 6a5f1cc1fb78c86423338f99cb9dbf506a76f3d6 | [
"Apache-2.0"
] | 2 | 2020-02-06T08:59:50.000Z | 2020-03-05T10:11:50.000Z | blueoil/common.py | oatawa1/blueoil | 6a5f1cc1fb78c86423338f99cb9dbf506a76f3d6 | [
"Apache-2.0"
] | null | null | null | blueoil/common.py | oatawa1/blueoil | 6a5f1cc1fb78c86423338f99cb9dbf506a76f3d6 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2018 The Blueoil 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
#
# Unles... | 34.519608 | 80 | 0.618006 |
5f26470f84de1b3a1832bba8536aa7cfb4b157f1 | 2,085 | py | Python | tests/test_geometry.py | blrm/vsketch | 38bd24e121edb6e654e66c51f0a45005c3e5627e | [
"MIT"
] | null | null | null | tests/test_geometry.py | blrm/vsketch | 38bd24e121edb6e654e66c51f0a45005c3e5627e | [
"MIT"
] | null | null | null | tests/test_geometry.py | blrm/vsketch | 38bd24e121edb6e654e66c51f0a45005c3e5627e | [
"MIT"
] | null | null | null | import numpy as np
import pytest
from shapely.geometry import (
LinearRing,
LineString,
MultiLineString,
MultiPoint,
MultiPolygon,
Point,
Polygon,
)
from tests.utils import line_count_equal, line_exists
@pytest.mark.parametrize(
["data", "expected"],
[
[LinearRing([(0, 0),... | 28.958333 | 84 | 0.393765 |
74ce614d5cfd4cc722721b28a4ebb20e46ed69ae | 2,175 | py | Python | shards/utils/colors.py | ReigenAraka/milvus | b2f19ace0e1dcd431a512141f42b748581d4b92d | [
"Apache-2.0"
] | 4 | 2020-07-29T02:59:53.000Z | 2021-11-16T11:07:51.000Z | shards/utils/colors.py | liangwlw/milvus | 7e7f626b9c7288c1c82f5dafed87d33897f4b64e | [
"Apache-2.0"
] | 2 | 2020-08-20T07:17:50.000Z | 2020-08-21T04:21:34.000Z | shards/utils/colors.py | liangwlw/milvus | 7e7f626b9c7288c1c82f5dafed87d33897f4b64e | [
"Apache-2.0"
] | 2 | 2020-03-02T05:16:57.000Z | 2020-03-04T06:05:55.000Z | # Reset
Color_Off = '\033[0m' # Text Reset
# Regular Colors
Black = '\033[0;30m' # Black
Red = '\033[0;31m' # Red
Green = '\033[0;32m' # Green
Yellow = '\033[0;33m' # Yellow
Blue = '\033[0;34m' # Blue
Purple = '\033[0;35m' # Purple
Cyan = '\033[0;36m' # Cyan
Whi... | 29.794521 | 40 | 0.523218 |
9146da596886640da27bf6b979a7d3a99cde7064 | 3,297 | py | Python | accounts/dashboards/migrations/0001_initial.py | HaeckelK/bookkeeping | 6f8b62f1322fe1c409f397222653382d302d9754 | [
"MIT"
] | null | null | null | accounts/dashboards/migrations/0001_initial.py | HaeckelK/bookkeeping | 6f8b62f1322fe1c409f397222653382d302d9754 | [
"MIT"
] | 7 | 2021-06-30T12:05:47.000Z | 2021-07-14T07:50:27.000Z | accounts/dashboards/migrations/0001_initial.py | HaeckelK/bookkeeping | 6f8b62f1322fe1c409f397222653382d302d9754 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.5 on 2021-07-03 17:59
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = []
operations = [
migrations.CreateModel(
name="GLTransactionLine",
fields=[
... | 40.703704 | 117 | 0.536548 |
84985c8b56f1ab9e33dc7b9debc7a9f9bc55ccab | 1,948 | py | Python | 2020/D11/D11Q1.py | buchasia/advent-of-code | f568c6330c8934325913705b39ef8c25a1023057 | [
"MIT"
] | null | null | null | 2020/D11/D11Q1.py | buchasia/advent-of-code | f568c6330c8934325913705b39ef8c25a1023057 | [
"MIT"
] | null | null | null | 2020/D11/D11Q1.py | buchasia/advent-of-code | f568c6330c8934325913705b39ef8c25a1023057 | [
"MIT"
] | null | null | null | def solveQuestion(inputPath):
fileP = open(inputPath, 'r')
fileLines = fileP.readlines()
fileP.close()
newPosition = []
numRows = len(fileLines)
numCols = len(fileLines[0].strip('\n'))
for line in fileLines:
currentLine = []
for grid in line.strip('\n'):
... | 29.074627 | 86 | 0.533368 |
baf19f92c808ca6ce34fa48cee0308de4c24b75b | 935 | py | Python | 6/test.py | cwaffles/CMPT225Labs | c4c6c2ff90e99ec3a5938a63f48c41dab4a8190b | [
"MIT"
] | 1 | 2016-06-04T07:39:21.000Z | 2016-06-04T07:39:21.000Z | 6/test.py | cwaffles/CMPT225Labs | c4c6c2ff90e99ec3a5938a63f48c41dab4a8190b | [
"MIT"
] | null | null | null | 6/test.py | cwaffles/CMPT225Labs | c4c6c2ff90e99ec3a5938a63f48c41dab4a8190b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import subprocess
import sys,os
passed = 0
n_tests = 6;
# Unbuffered stdout.
sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)
# Run a for loop of tests.
sys.stdout.write("Running merge_sort on battery of " + str(n_tests) + " tests.\n");
for i in range(1,n_tests+1):
sys.stdout.write(" R... | 27.5 | 98 | 0.585027 |
6bc9584418fad424e19f5bea7cc746141561a163 | 22,863 | py | Python | openapi_client/api/sources_api.py | chargio/using-koku-api-test | 2f41fd83ab730705352b116b7a6e05ae3d9a8ebd | [
"MIT"
] | 1 | 2020-03-18T11:32:09.000Z | 2020-03-18T11:32:09.000Z | openapi_client/api/sources_api.py | chargio/using-koku-api-test | 2f41fd83ab730705352b116b7a6e05ae3d9a8ebd | [
"MIT"
] | null | null | null | openapi_client/api/sources_api.py | chargio/using-koku-api-test | 2f41fd83ab730705352b116b7a6e05ae3d9a8ebd | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Cost Management
The API for Project Koku and OpenShift cost management. You can find out more about Project Koku at [https://github.com/project-koku/](https://github.com/project-koku/). # noqa: E501
The version of the OpenAPI document: 1.0.2
Generated by: https://openapi-generato... | 44.30814 | 187 | 0.592529 |
2b4182928cc38346886d8eb7cc25264888bad6e7 | 1,204 | py | Python | vote/app.py | eluminare/example-voting-app | 475d79b12b8f8a6d3621ddcdd19ed87eb2159319 | [
"Apache-2.0"
] | null | null | null | vote/app.py | eluminare/example-voting-app | 475d79b12b8f8a6d3621ddcdd19ed87eb2159319 | [
"Apache-2.0"
] | null | null | null | vote/app.py | eluminare/example-voting-app | 475d79b12b8f8a6d3621ddcdd19ed87eb2159319 | [
"Apache-2.0"
] | 1 | 2020-03-19T13:53:58.000Z | 2020-03-19T13:53:58.000Z | # -*- coding: utf-8 -*-
from flask import Flask, render_template, request, make_response, g
from redis import Redis
import os
import socket
import random
import json
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
option_a = os.getenv('OPTION_A', 'Zurück')
option_b = os.getenv('OPTION_B', 'Vor')
hostname = soc... | 23.607843 | 67 | 0.638704 |
ae2569cb56a76c23f80f25715e70f398e1f4bd8a | 766 | py | Python | datasets/dataset_prepare/prepare_VisDrone.py | pohjao/IIM | c721c952c5bc99af4bc8019f67afc613113e6ac6 | [
"MIT"
] | null | null | null | datasets/dataset_prepare/prepare_VisDrone.py | pohjao/IIM | c721c952c5bc99af4bc8019f67afc613113e6ac6 | [
"MIT"
] | null | null | null | datasets/dataset_prepare/prepare_VisDrone.py | pohjao/IIM | c721c952c5bc99af4bc8019f67afc613113e6ac6 | [
"MIT"
] | null | null | null | from PIL import Image
import os
import cv2 as cv
import matplotlib.pyplot as plt
from pylab import plot
import numpy as np
import json
import math
import torch
from functions import euclidean_dist, generate_cycle_mask, average_del_min
mode = 'train'
import glob
img_path = '/home/ubuntu/src/IIM/datasets/ProcessedData... | 24.709677 | 77 | 0.736292 |
14958c099525d43f7e81fa9cc0cbaab372a54a7e | 2,919 | py | Python | paasta_tools/cli/cmds/autoscale.py | jackchi/paasta | 0899adcef43cb07c247a36f5af82f09bb6f8db12 | [
"Apache-2.0"
] | 1 | 2019-05-07T12:01:48.000Z | 2019-05-07T12:01:48.000Z | paasta_tools/cli/cmds/autoscale.py | jackchi/paasta | 0899adcef43cb07c247a36f5af82f09bb6f8db12 | [
"Apache-2.0"
] | 4 | 2021-02-08T21:00:33.000Z | 2021-06-02T03:29:31.000Z | paasta_tools/cli/cmds/autoscale.py | jackchi/paasta | 0899adcef43cb07c247a36f5af82f09bb6f8db12 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2015-2016 Yelp 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 ... | 37.423077 | 105 | 0.715313 |
9287b6d92d8e3c2703b4ef67673dde4413e32cfe | 17,050 | py | Python | mysmb.py | 0x24bin/MS17-010-Python | ff3abc167b862c120931369abacd7e89739b649c | [
"MIT"
] | 1 | 2019-11-09T13:16:12.000Z | 2019-11-09T13:16:12.000Z | mysmb.py | killvxk/MS17-010_WORAWIT | c55361263171827081b91c66db0b1c9335193ec4 | [
"MIT"
] | null | null | null | mysmb.py | killvxk/MS17-010_WORAWIT | c55361263171827081b91c66db0b1c9335193ec4 | [
"MIT"
] | null | null | null | # impacket SMB extension for MS17-010 exploit.
# this file contains only valid SMB packet format operation.
from impacket import smb, smbconnection
from impacket.dcerpc.v5 import transport
from struct import pack
import os
import random
def getNTStatus(self):
return (self['ErrorCode'] << 16) | (self['_rese... | 44.633508 | 227 | 0.726862 |
6939f9f0103110d15d45cea1dfce4153a3eef1b1 | 1,774 | py | Python | fibonacci_generators.py | johnnydevriese/python_fun | 01fc5fcc82c7c27e25eabff85a2e88f3554129fe | [
"MIT"
] | null | null | null | fibonacci_generators.py | johnnydevriese/python_fun | 01fc5fcc82c7c27e25eabff85a2e88f3554129fe | [
"MIT"
] | null | null | null | fibonacci_generators.py | johnnydevriese/python_fun | 01fc5fcc82c7c27e25eabff85a2e88f3554129fe | [
"MIT"
] | null | null | null | # See: http://stackoverflow.com/questions/102535/what-can-you-use-python-generator-functions-for
# Generators give you lazy evaluation.
# You use them by iterating over them, either explicitly with 'for' or implicitly by
# passing it to any function or construct that iterates. You can think of generators as
# returnin... | 28.15873 | 97 | 0.711387 |
ab599dd89f2031e1e26c93734dec1cd484ad511a | 664 | py | Python | simuvex/procedures/libc___so___6/socket_.py | praetorian-inc/simuvex | 7984bc4432a1c2126e6f2eb963c935e9f6a98da5 | [
"BSD-2-Clause"
] | 8 | 2016-01-19T03:13:32.000Z | 2020-11-03T09:30:05.000Z | simuvex/procedures/libc___so___6/socket_.py | praetorian-inc/simuvex | 7984bc4432a1c2126e6f2eb963c935e9f6a98da5 | [
"BSD-2-Clause"
] | null | null | null | simuvex/procedures/libc___so___6/socket_.py | praetorian-inc/simuvex | 7984bc4432a1c2126e6f2eb963c935e9f6a98da5 | [
"BSD-2-Clause"
] | 3 | 2017-04-24T00:22:30.000Z | 2020-11-03T09:30:06.000Z | import simuvex
######################################
# socket
######################################
class socket(simuvex.SimProcedure):
#pylint:disable=arguments-differ
def run(self, sim_sock_type):
# TODO: Handling parameters
sock_type = self.state.se.any_int(sim_sock_type)
# TODO... | 30.181818 | 118 | 0.579819 |
5fce1942cf5f3d2b6d047a203cfdbc4b2d775d99 | 48,960 | py | Python | pyscf/dft/libxc.py | nmardirossian/pyscf | 57c8912dcfcc1157a822feede63df54ed1067115 | [
"BSD-2-Clause"
] | 1 | 2018-05-02T19:55:30.000Z | 2018-05-02T19:55:30.000Z | pyscf/dft/libxc.py | nmardirossian/pyscf | 57c8912dcfcc1157a822feede63df54ed1067115 | [
"BSD-2-Clause"
] | null | null | null | pyscf/dft/libxc.py | nmardirossian/pyscf | 57c8912dcfcc1157a822feede63df54ed1067115 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
#
# Authors: Qiming Sun <osirpt.sun@gmail.com>
# Susi Lehtola <susi.lehtola@gmail.com>
'''
XC functional, the interface to libxc
(http://www.tddft.org/programs/octopus/wiki/index.php/Libxc)
'''
import sys
import copy
import ctypes
import math
import numpy
from pyscf import lib
_itrf = ... | 51.106472 | 238 | 0.586275 |
8d594466deaee947cb56bbf6fe330b07b1eff217 | 3,531 | py | Python | tests/sources/basic/73-pscosRedis_python/src/modules/testRedis.py | mF2C/COMPSsOLD | ba5727e818735fd45fba4e9793cefe40456b2e1e | [
"Apache-2.0"
] | 1 | 2020-11-25T13:01:27.000Z | 2020-11-25T13:01:27.000Z | tests/sources/basic/73-pscosRedis_python/src/modules/testRedis.py | mF2C/COMPSsOLD | ba5727e818735fd45fba4e9793cefe40456b2e1e | [
"Apache-2.0"
] | 1 | 2019-11-13T14:30:21.000Z | 2019-11-13T14:30:21.000Z | tests/sources/basic/73-pscosRedis_python/src/modules/testRedis.py | mF2C/COMPSsOLD | ba5727e818735fd45fba4e9793cefe40456b2e1e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
PyCOMPSs Testbench Tasks
========================
"""
# Imports
import unittest
from .psco import PSCO
from .psco_with_tasks import PSCOWithTasks
from pycompss.api.task import task
@task(returns=int)
def compute_sum(psco):
return sum(psco.get_content())
@task(r... | 26.954198 | 64 | 0.624752 |
e4f4d7fee01ce7ebe200aa10478d40daefc44f6a | 4,419 | py | Python | figure 2b pk fitting.py | grantiain/Dendrimer-Drug-Delivery-Model | a03d234d4786e1acb5f0f211e4bbe3ec5de1b9a8 | [
"MIT"
] | 2 | 2020-10-07T22:13:51.000Z | 2020-10-07T22:14:41.000Z | figure 2b pk fitting.py | grantiain/Dendrimer-Drug-Delivery-Model | a03d234d4786e1acb5f0f211e4bbe3ec5de1b9a8 | [
"MIT"
] | null | null | null | figure 2b pk fitting.py | grantiain/Dendrimer-Drug-Delivery-Model | a03d234d4786e1acb5f0f211e4bbe3ec5de1b9a8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# =============================================================================
# Python script to optimize the PK parameters of the Naked API
#
# iain.grant@astrazeneca.com
# =============================================================================
import numpy as n... | 30.267123 | 80 | 0.560987 |
060842c1fb8a624b342ce31824abc79e9e687eeb | 8,344 | py | Python | pdf4me/Pdf4mePythonClientApi/pdf4me/model/mail_merge_doc_action.py | pdf4me/pdf4me-clientapi-python | 17a1c1baae861369084d658475be56be42ca92d0 | [
"MIT"
] | 1 | 2020-06-30T22:18:17.000Z | 2020-06-30T22:18:17.000Z | pdf4me/Pdf4mePythonClientApi/pdf4me/model/mail_merge_doc_action.py | pdf4me/pdf4me-clientapi-python | 17a1c1baae861369084d658475be56be42ca92d0 | [
"MIT"
] | null | null | null | pdf4me/Pdf4mePythonClientApi/pdf4me/model/mail_merge_doc_action.py | pdf4me/pdf4me-clientapi-python | 17a1c1baae861369084d658475be56be42ca92d0 | [
"MIT"
] | 1 | 2018-07-10T17:40:37.000Z | 2018-07-10T17:40:37.000Z | # coding: utf-8
"""
Pdf4me
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: v1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class... | 28 | 179 | 0.600671 |
2aeb64e467e0c3ac5bb19e1f9e802dfcbdc51bf9 | 935 | py | Python | core/migrations/0004_auto_20180423_1619.py | kaedroho/dit-directory-cms | 67c15eeed19e7b3583f1fce1969230ddf83b6813 | [
"MIT"
] | 6 | 2018-03-20T11:19:07.000Z | 2021-10-05T07:53:11.000Z | core/migrations/0004_auto_20180423_1619.py | kaedroho/dit-directory-cms | 67c15eeed19e7b3583f1fce1969230ddf83b6813 | [
"MIT"
] | 802 | 2018-02-05T14:16:13.000Z | 2022-02-10T10:59:21.000Z | core/migrations/0004_auto_20180423_1619.py | kaedroho/dit-directory-cms | 67c15eeed19e7b3583f1fce1969230ddf83b6813 | [
"MIT"
] | 6 | 2019-01-22T13:19:37.000Z | 2019-07-01T10:35:26.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2018-04-23 16:19
from __future__ import unicode_literals
from django.db import migrations
def set_historic_slugs(apps, schema_manager):
Page = apps.get_model('wagtailcore', 'Page')
HistoricSlug = apps.get_model('core', 'HistoricSlug')
for model_cla... | 24.605263 | 57 | 0.617112 |
a8ed9e2ca244d64b50626ac22456be575f3451e7 | 2,331 | py | Python | Copycat/Framework/copycat/test.py | um-dsp/Morphence | 0a109548bba87ca33fd98a6da7197967ea2d1e1b | [
"MIT"
] | 7 | 2021-09-01T05:12:37.000Z | 2022-03-11T08:39:50.000Z | Copycat/Framework/copycat/test.py | Zhuosd/Morphence | 781d84ebc884ee3053a0355adfbd20312c627308 | [
"MIT"
] | null | null | null | Copycat/Framework/copycat/test.py | Zhuosd/Morphence | 781d84ebc884ee3053a0355adfbd20312c627308 | [
"MIT"
] | 1 | 2021-10-18T08:07:50.000Z | 2021-10-18T08:07:50.000Z |
"""
@author: Abderrahmen Amich
@email: aamich@umich.edu
"""
#torch
import torch
#local files
from model import CNN
from cifar_data import get_datasets
from train_mnist import PyNet, ld_mnist
#general
from tqdm import tqdm
import numpy as np
from sklearn.metrics import f1_score
#system
from sys import argv, exit, st... | 31.5 | 103 | 0.607036 |
e0649b9b5760fe1bb91cf34f254ae9c11debb326 | 2,186 | py | Python | projects/python_plugin_code/pandas_1.1_code/tests/test_highlight_max.py | rendner/py-plugin-dataframe-viewer | 188585bd31a6c14413949865b3467dcbf6f5e2d1 | [
"Apache-2.0"
] | 1 | 2021-11-07T03:47:51.000Z | 2021-11-07T03:47:51.000Z | projects/python_plugin_code/pandas_1.2_code/tests/test_highlight_max.py | rendner/py-plugin-dataframe-viewer | 188585bd31a6c14413949865b3467dcbf6f5e2d1 | [
"Apache-2.0"
] | null | null | null | projects/python_plugin_code/pandas_1.2_code/tests/test_highlight_max.py | rendner/py-plugin-dataframe-viewer | 188585bd31a6c14413949865b3467dcbf6f5e2d1 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 cms.rendner (Daniel Schmidt)
#
# 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... | 32.147059 | 83 | 0.668801 |
5f541da3d222b91958f0dafae28e1b7c91caad34 | 4,911 | py | Python | d7a/dll/test/access_profile.py | L-I-Am/pyd7a | 7e3dd6ff71c92df72570d6b852ca74cc5af50707 | [
"Apache-2.0"
] | 9 | 2016-05-12T20:11:30.000Z | 2020-08-18T05:46:15.000Z | d7a/dll/test/access_profile.py | L-I-Am/pyd7a | 7e3dd6ff71c92df72570d6b852ca74cc5af50707 | [
"Apache-2.0"
] | 2 | 2018-01-14T12:39:06.000Z | 2019-11-25T09:11:08.000Z | d7a/dll/test/access_profile.py | L-I-Am/pyd7a | 7e3dd6ff71c92df72570d6b852ca74cc5af50707 | [
"Apache-2.0"
] | 7 | 2016-09-06T11:08:15.000Z | 2020-10-27T10:29:24.000Z | #
# Copyright (c) 2015-2021 University of Antwerp, Aloxy NV.
#
# This file is part of pyd7a.
# See https://github.com/Sub-IoT/pyd7a for further info.
#
# 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 Lice... | 34.104167 | 96 | 0.706984 |
7cfcb3627623439dac4fc3af3da94dda0cdd839b | 473 | py | Python | aoc_wim/aoc2018/q25.py | wimglenn/advent-of-code-wim | 6308c3fa5d29b318680419f877fd5b8ac1359b5d | [
"WTFPL"
] | 20 | 2019-10-15T07:33:13.000Z | 2022-01-19T13:40:36.000Z | aoc_wim/aoc2018/q25.py | wimglenn/advent-of-code-wim | 6308c3fa5d29b318680419f877fd5b8ac1359b5d | [
"WTFPL"
] | 5 | 2019-02-01T23:31:27.000Z | 2021-12-03T06:55:58.000Z | aoc_wim/aoc2018/q25.py | wimglenn/advent-of-code-wim | 6308c3fa5d29b318680419f877fd5b8ac1359b5d | [
"WTFPL"
] | 8 | 2019-12-03T15:41:23.000Z | 2021-12-06T17:13:57.000Z | """
--- Day 25: Four-Dimensional Adventure ---
https://adventofcode.com/2018/day/25
"""
from itertools import combinations
import networkx as nx
from aocd import data
nodes = [tuple(int(n) for n in s.split(",")) for s in data.splitlines()]
graph = nx.Graph()
graph.add_nodes_from(nodes)
for node1, node2 in combinations... | 29.5625 | 72 | 0.704017 |
93f02bc5dd8280249dd537a719197f79f717be91 | 20,108 | py | Python | adb_shell/transport/usb_transport.py | maybe-sybr/adb_shell | 41c52ed9a315735ecb7187d905fec65eaeea73a5 | [
"Apache-2.0"
] | 268 | 2019-09-25T16:38:51.000Z | 2022-03-31T07:08:17.000Z | adb_shell/transport/usb_transport.py | maybe-sybr/adb_shell | 41c52ed9a315735ecb7187d905fec65eaeea73a5 | [
"Apache-2.0"
] | 73 | 2019-09-30T14:25:38.000Z | 2022-01-23T23:04:29.000Z | adb_shell/transport/usb_transport.py | maybe-sybr/adb_shell | 41c52ed9a315735ecb7187d905fec65eaeea73a5 | [
"Apache-2.0"
] | 48 | 2019-11-05T20:37:59.000Z | 2022-03-09T08:12:06.000Z | # Copyright (c) 2021 Jeff Irion and contributors
#
# This file is part of the adb-shell package. It incorporates work
# covered by the following license notice:
#
#
# Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file ex... | 31.223602 | 179 | 0.578078 |
2c783ac67b64221254e2baca7cd33b05e83f0714 | 493 | py | Python | setup.py | AidanTweedy/PhoTex | 3e7f24785d6f0f500db53cc56c706ab77840043e | [
"MIT"
] | 1 | 2021-03-03T02:51:12.000Z | 2021-03-03T02:51:12.000Z | setup.py | AidanTweedy/PhoTex | 3e7f24785d6f0f500db53cc56c706ab77840043e | [
"MIT"
] | null | null | null | setup.py | AidanTweedy/PhoTex | 3e7f24785d6f0f500db53cc56c706ab77840043e | [
"MIT"
] | null | null | null | from setuptools import setup
REQUIREMENTS = [i.strip() for i in open("requirements.txt").readlines()]
with open("README", 'r') as f:
long_description = f.read()
setup(
name='wordRecog',
version='1.0',
description='A small module to transcribe photos of handwritten text',
license="MIT",
... | 25.947368 | 74 | 0.685598 |
381b92414345a320aaf3c9456c45f32a67e820ed | 15,843 | py | Python | package/PartSeg/plugins/napari_widgets/roi_extraction_algorithms.py | neuromusic/PartSeg | a4edff1b9fbe55eb7f5e1fc8b5b3f8e730b35caf | [
"BSD-3-Clause"
] | 15 | 2020-03-21T03:27:56.000Z | 2022-03-21T07:46:39.000Z | package/PartSeg/plugins/napari_widgets/roi_extraction_algorithms.py | neuromusic/PartSeg | a4edff1b9fbe55eb7f5e1fc8b5b3f8e730b35caf | [
"BSD-3-Clause"
] | 479 | 2019-10-27T22:57:22.000Z | 2022-03-30T12:48:14.000Z | package/PartSeg/plugins/napari_widgets/roi_extraction_algorithms.py | neuromusic/PartSeg | a4edff1b9fbe55eb7f5e1fc8b5b3f8e730b35caf | [
"BSD-3-Clause"
] | 5 | 2020-02-05T14:25:02.000Z | 2021-12-21T03:44:52.000Z | import typing
from contextlib import suppress
import numpy as np
import pandas as pd
from napari import Viewer
from napari.layers import Image as NapariImage
from napari.layers import Labels, Layer
from napari.utils.notifications import show_info
from qtpy.QtCore import Qt
from qtpy.QtWidgets import (
QDialog,
... | 39.410448 | 116 | 0.676576 |
6d4b5726c40f3cdd7414f9f2194141fd3c03d48d | 189 | py | Python | Fibonacci.py | DanielJHaar/pythonpracticejun2020 | 24e2501fab559841c976eca07bd1900b356c3336 | [
"MIT"
] | null | null | null | Fibonacci.py | DanielJHaar/pythonpracticejun2020 | 24e2501fab559841c976eca07bd1900b356c3336 | [
"MIT"
] | null | null | null | Fibonacci.py | DanielJHaar/pythonpracticejun2020 | 24e2501fab559841c976eca07bd1900b356c3336 | [
"MIT"
] | null | null | null | def fibonacci(n):
if n == 0:
return 0
elif n == 1:
return 1
else:
return fibonacci(n-1)+fibonacci(n-2)
n = int(raw_input())
print(fibonacci(n))
| 18.9 | 45 | 0.513228 |
847d62fb0ecfbf0312e10db92527e436ef72eda7 | 29,839 | py | Python | azure/mgmt/network/v2015_06_15/operations/network_interfaces_operations.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 1 | 2022-01-25T22:52:58.000Z | 2022-01-25T22:52:58.000Z | azure/mgmt/network/v2015_06_15/operations/network_interfaces_operations.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | azure/mgmt/network/v2015_06_15/operations/network_interfaces_operations.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"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 ... | 47.81891 | 242 | 0.666142 |
32d8eeb20e04fadf4c68b0fa8539d81f20bd826d | 679 | py | Python | fastybird_tuya_connector/events/__init__.py | FastyBird/tuya-connector | 46668191367cf854684bcb5297d30935737ba735 | [
"Apache-2.0"
] | null | null | null | fastybird_tuya_connector/events/__init__.py | FastyBird/tuya-connector | 46668191367cf854684bcb5297d30935737ba735 | [
"Apache-2.0"
] | null | null | null | fastybird_tuya_connector/events/__init__.py | FastyBird/tuya-connector | 46668191367cf854684bcb5297d30935737ba735 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
# Copyright 2021. FastyBird s.r.o.
#
# 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 re... | 33.95 | 78 | 0.705449 |
b44cb7d46ad6975522e55a53d481f3aecfded969 | 30,548 | py | Python | meeseeksdev/meeseeksbox/commands.py | Carreau/MeeseeksDev | 805d8e0eff60d5241d2d9bc4fbd63614bfbb291f | [
"MIT"
] | null | null | null | meeseeksdev/meeseeksbox/commands.py | Carreau/MeeseeksDev | 805d8e0eff60d5241d2d9bc4fbd63614bfbb291f | [
"MIT"
] | 54 | 2018-10-29T19:08:24.000Z | 2021-07-14T13:14:42.000Z | meeseeksdev/meeseeksbox/commands.py | Carreau/MeeseeksDev | 805d8e0eff60d5241d2d9bc4fbd63614bfbb291f | [
"MIT"
] | 1 | 2022-03-29T14:45:48.000Z | 2022-03-29T14:45:48.000Z | """
Define a few commands
"""
import random
import os
import re
import subprocess
import git
import pipes
import mock
import keen
import time
import traceback
import sys
from textwrap import dedent
# from friendlyautopep8 import run_on_cwd
from .utils import Session, fix_issue_body, fix_comment_body
from .scopes i... | 34.832383 | 146 | 0.561935 |
4aff52dfb013d865678539377a03d26c662c312d | 12,280 | py | Python | pox/openflow/flow_table.py | felipetomm/POX-Django | 6060a9e2a999dc56b63826d0ec3498b11b03adce | [
"Apache-2.0"
] | 1 | 2019-10-20T00:05:34.000Z | 2019-10-20T00:05:34.000Z | pox/openflow/flow_table.py | felipetomm/POX-Django | 6060a9e2a999dc56b63826d0ec3498b11b03adce | [
"Apache-2.0"
] | null | null | null | pox/openflow/flow_table.py | felipetomm/POX-Django | 6060a9e2a999dc56b63826d0ec3498b11b03adce | [
"Apache-2.0"
] | null | null | null | # Copyright 2011,2012,2013 Colin Scott
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 33.922652 | 79 | 0.657573 |
9e61dcccd30293aafc84b47977315c546730930c | 4,421 | py | Python | openstack_dashboard/contrib/sahara/content/data_processing/cluster_templates/workflows/copy.py | timpricecatalyst/horizon | 8279ae0ed464e62e1c91e78341342160f8a07172 | [
"Apache-2.0"
] | 1 | 2021-01-20T00:14:15.000Z | 2021-01-20T00:14:15.000Z | openstack_dashboard/contrib/sahara/content/data_processing/cluster_templates/workflows/copy.py | timpricecatalyst/horizon | 8279ae0ed464e62e1c91e78341342160f8a07172 | [
"Apache-2.0"
] | 1 | 2019-10-27T15:57:25.000Z | 2019-10-27T15:57:25.000Z | openstack_dashboard/contrib/sahara/content/data_processing/cluster_templates/workflows/copy.py | timpricecatalyst/horizon | 8279ae0ed464e62e1c91e78341342160f8a07172 | [
"Apache-2.0"
] | 15 | 2017-01-12T10:40:00.000Z | 2019-04-19T08:28:05.000Z | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | 44.21 | 79 | 0.564804 |
9a7055d7819d566f528f37f009efb8d94962d9fc | 1,692 | py | Python | models/object_detection/model_templates/face-detection/tools/test_out_to_wider_predictions.py | dqawami/openvino_training_extensions | dddda1dfd651eaae2d59cecda84275b1b03bd0ad | [
"Apache-2.0"
] | 775 | 2019-03-01T02:13:33.000Z | 2020-09-07T22:49:15.000Z | models/object_detection/model_templates/face-detection/tools/test_out_to_wider_predictions.py | dqawami/openvino_training_extensions | dddda1dfd651eaae2d59cecda84275b1b03bd0ad | [
"Apache-2.0"
] | 604 | 2020-09-08T12:29:49.000Z | 2022-03-31T21:51:08.000Z | models/object_detection/model_templates/face-detection/tools/test_out_to_wider_predictions.py | dqawami/openvino_training_extensions | dddda1dfd651eaae2d59cecda84275b1b03bd0ad | [
"Apache-2.0"
] | 290 | 2019-02-28T20:32:11.000Z | 2020-09-07T05:51:41.000Z | # Copyright (C) 2020 Intel 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 License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 40.285714 | 87 | 0.70922 |
9b3cd1e2f248896590179b4037ec913e5fee864d | 22,701 | py | Python | volttrontesting/multiplatform/test_multiplatform_pubsub.py | laroque/volttron | 3ea851b718aa87d7f2c824298cf8a1a4c5920460 | [
"Apache-2.0"
] | 2 | 2019-10-03T17:00:34.000Z | 2019-10-03T17:00:38.000Z | volttrontesting/multiplatform/test_multiplatform_pubsub.py | laroque/volttron | 3ea851b718aa87d7f2c824298cf8a1a4c5920460 | [
"Apache-2.0"
] | 2 | 2018-08-29T13:45:17.000Z | 2018-09-06T12:34:23.000Z | volttrontesting/multiplatform/test_multiplatform_pubsub.py | cbs-iiith/volttron | a676d4af19a808581dde172ab08820087854e157 | [
"Apache-2.0"
] | 1 | 2019-04-04T17:13:46.000Z | 2019-04-04T17:13:46.000Z | import os
import gevent
import pytest
import json
from volttron.platform import get_ops
from volttrontesting.utils.utils import (poll_gevent_sleep,
messages_contains_prefix)
from volttrontesting.fixtures.volttron_platform_fixtures import get_rand_vip, \
build_wrapper, get... | 38.411168 | 118 | 0.597639 |
ed17febb1705a0cbae95977819fc6eed05cbd658 | 2,091 | py | Python | examples/pie_and_polar_charts/pie_demo_features.py | argriffing/matplotlib | 5555f5463fb5f995a59f7651c0034a5d6a4c7e84 | [
"MIT",
"BSD-3-Clause"
] | 1 | 2019-04-15T09:40:53.000Z | 2019-04-15T09:40:53.000Z | examples/pie_and_polar_charts/pie_demo_features.py | argriffing/matplotlib | 5555f5463fb5f995a59f7651c0034a5d6a4c7e84 | [
"MIT",
"BSD-3-Clause"
] | 2 | 2021-05-10T17:57:41.000Z | 2021-07-26T16:23:09.000Z | examples/pie_and_polar_charts/pie_demo_features.py | kdavies4/matplotlib | 330aefbd031ee227213afe655c5158320015d45b | [
"MIT",
"BSD-3-Clause"
] | 1 | 2015-12-21T07:24:54.000Z | 2015-12-21T07:24:54.000Z | """
Demo of a basic pie chart plus a few additional features.
In addition to the basic pie chart, this demo shows a few optional features:
* slice labels
* auto-labeling the percentage
* offsetting a slice with "explode"
* drop-shadow
* custom start angle
Note about the custom start angle:
The d... | 34.85 | 78 | 0.682927 |
31eafa257e592d661db68da53e8821c05e69b030 | 63 | py | Python | src/efipy/__init__.py | LiorAvrahami/efipy | 3ef07678f54a11d8d3fdd79eab8b493aba5f8aa3 | [
"MIT"
] | 2 | 2021-09-12T09:42:51.000Z | 2021-09-23T07:21:15.000Z | src/efipy/__init__.py | LiorAvrahami/efipy | 3ef07678f54a11d8d3fdd79eab8b493aba5f8aa3 | [
"MIT"
] | null | null | null | src/efipy/__init__.py | LiorAvrahami/efipy | 3ef07678f54a11d8d3fdd79eab8b493aba5f8aa3 | [
"MIT"
] | null | null | null | from ._efipy import run,inquire_output_path,inquire_input_path
| 31.5 | 62 | 0.888889 |
027b3e587c788eb54f87292689da65fe99b99bc3 | 3,400 | py | Python | packages/jet_bridge_base/jet_bridge_base/fields/field.py | F2210/jet-bridge | 72b1af5cd7df585a4026d65170d3607f8cdf6bea | [
"MIT"
] | null | null | null | packages/jet_bridge_base/jet_bridge_base/fields/field.py | F2210/jet-bridge | 72b1af5cd7df585a4026d65170d3607f8cdf6bea | [
"MIT"
] | null | null | null | packages/jet_bridge_base/jet_bridge_base/fields/field.py | F2210/jet-bridge | 72b1af5cd7df585a4026d65170d3607f8cdf6bea | [
"MIT"
] | null | null | null | from collections import Mapping
from jet_bridge_base.exceptions.validation_error import ValidationError
class empty:
"""
This class is used to represent no data being provided for a given input
or output value.
It is required because `None` may be a valid input or output value.
"""
pass
cl... | 31.481481 | 121 | 0.610882 |
97e30983ec9efe953a32bf83ee1b7c9901d2d62c | 951 | py | Python | stdlibs/__init__.py | thatch/stdlibs | 90a1759562ba7226ccefdedf1887146c21592ab4 | [
"MIT"
] | 5 | 2021-03-26T03:01:35.000Z | 2022-01-21T18:00:46.000Z | stdlibs/__init__.py | thatch/stdlibs | 90a1759562ba7226ccefdedf1887146c21592ab4 | [
"MIT"
] | 2 | 2021-03-29T05:40:09.000Z | 2022-03-01T17:05:31.000Z | stdlibs/__init__.py | thatch/stdlibs | 90a1759562ba7226ccefdedf1887146c21592ab4 | [
"MIT"
] | 2 | 2021-03-28T18:29:19.000Z | 2022-01-27T13:32:38.000Z | # Copyright 2021 John Reese
# Licensed under the MIT license
"""
List of packages in the stdlib
"""
__author__ = "John Reese"
import importlib
import sys
from typing import FrozenSet, Optional
from .__version__ import __version__
from .py3 import module_names
ALL = "all"
KNOWN_VERSIONS = [
"2.3",
"2.4",
... | 16.982143 | 85 | 0.574132 |
219e16c28cd93985ea7c12ab9d871e04794a67e8 | 19,725 | py | Python | apivideo/api/raw_statistics_api.py | apivideo/api.video-python | 7c5c70a9a638c2c1d3af18aabb09dda7b4db32a4 | [
"MIT"
] | 6 | 2021-05-20T08:51:27.000Z | 2021-10-07T16:04:32.000Z | apivideo/api/raw_statistics_api.py | apivideo/python-api-client | 9de1127aee8ed36c42084357bfa3cda54110554a | [
"MIT"
] | 1 | 2022-03-21T17:15:29.000Z | 2022-03-22T09:10:10.000Z | apivideo/api/raw_statistics_api.py | apivideo/python-api-client | 9de1127aee8ed36c42084357bfa3cda54110554a | [
"MIT"
] | 1 | 2022-03-01T08:58:02.000Z | 2022-03-01T08:58:02.000Z | """
api.video
api.video is an API that encodes on the go to facilitate immediate playback, enhancing viewer streaming experiences across multiple devices and platforms. You can stream live or on-demand online videos within minutes. # noqa: E501
Contact: ecosystem@api.video
"""
import os # noqa: F401
im... | 41.613924 | 261 | 0.505095 |
afcef3e90855f4d6f0776e86045a4004882e6e71 | 2,123 | py | Python | lizard_auth_server/migrations/0004_auto_20160818_1641.py | lisannewapstra/lizard-auth-server | 3824edfaedd01caff5eb84bbcb9557ccfec2371a | [
"MIT",
"BSD-3-Clause"
] | 1 | 2019-02-21T02:12:04.000Z | 2019-02-21T02:12:04.000Z | lizard_auth_server/migrations/0004_auto_20160818_1641.py | lisannewapstra/lizard-auth-server | 3824edfaedd01caff5eb84bbcb9557ccfec2371a | [
"MIT",
"BSD-3-Clause"
] | 88 | 2015-04-23T15:37:17.000Z | 2021-02-18T15:28:32.000Z | lizard_auth_server/migrations/0004_auto_20160818_1641.py | lisannewapstra/lizard-auth-server | 3824edfaedd01caff5eb84bbcb9557ccfec2371a | [
"MIT",
"BSD-3-Clause"
] | 2 | 2018-04-24T08:48:35.000Z | 2021-02-17T10:18:26.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-08-18 14:41
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("lizard_auth_server", "0003_auto_20160818_1631"),
]
operations = [
migrations.AlterModelOptions(
name="invitation"... | 30.768116 | 70 | 0.473387 |
242fb29151b8c84538b59b342c75a728a883db8f | 1,961 | py | Python | LASCAD/experiments/expr1_classification.py | NiSE-Virginia-Tech/doaa-altarawy-LASCAD | d44c9606c4d9a36979195de811575b74648006d5 | [
"BSD-3-Clause"
] | 7 | 2018-01-30T21:35:20.000Z | 2022-03-18T02:34:28.000Z | LASCAD/experiments/expr1_classification.py | NiSE-Virginia-Tech/doaa-altarawy-LASCAD | d44c9606c4d9a36979195de811575b74648006d5 | [
"BSD-3-Clause"
] | null | null | null | LASCAD/experiments/expr1_classification.py | NiSE-Virginia-Tech/doaa-altarawy-LASCAD | d44c9606c4d9a36979195de811575b74648006d5 | [
"BSD-3-Clause"
] | 4 | 2019-08-03T00:03:53.000Z | 2020-09-09T19:35:19.000Z | import pandas as pd
import numpy as np
import traceback
from LASCAD.LDA.Clustering import testClustering
import os
results = pd.DataFrame(columns=['Dataset', 'n_clusters', 'NUM_TOPICS', 'max_df', 'min_df',
'precision', 'recall', 'f-score'])
i = 0
dataset = 'showcase_noStem2'
method = ... | 42.630435 | 100 | 0.462519 |
82b494cf5fd8b5ea40fc520a40fd4f7b0e526b1c | 20,809 | py | Python | trainval.py | masami87/Human-Pose-Estimation-3D | 3118cb9176118dcad9667f24c765e6c8a56cd69c | [
"MIT"
] | null | null | null | trainval.py | masami87/Human-Pose-Estimation-3D | 3118cb9176118dcad9667f24c765e6c8a56cd69c | [
"MIT"
] | null | null | null | trainval.py | masami87/Human-Pose-Estimation-3D | 3118cb9176118dcad9667f24c765e6c8a56cd69c | [
"MIT"
] | null | null | null | import os
from alive_progress import alive_bar
import numpy as np
import torch
from common.camera import normalize_screen_coordinates, world_to_camera
from common.loss import mpjpe, p_mpjpe
from common.utils import deterministic_random
from model.VideoPose3D import TemporalModel, TemporalModelOptimized1f
def load_d... | 40.722114 | 142 | 0.593974 |
154741ef14890d2bc6bdc3aec88197dc3b13106f | 1,709 | py | Python | test/rules/parameters/test_cidr_allowed_values.py | KeyCore/cfn-python-lint | 342ac61db052224314ca1219a7a073b45841d78e | [
"MIT-0"
] | 1 | 2019-03-23T06:04:16.000Z | 2019-03-23T06:04:16.000Z | test/rules/parameters/test_cidr_allowed_values.py | eshack94/cfn-python-lint | 9ec44f41ae24b9d62576aed53efa888b00641e04 | [
"MIT-0"
] | null | null | null | test/rules/parameters/test_cidr_allowed_values.py | eshack94/cfn-python-lint | 9ec44f41ae24b9d62576aed53efa888b00641e04 | [
"MIT-0"
] | 2 | 2019-06-21T13:17:02.000Z | 2020-02-29T08:11:00.000Z | """
Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy of this
software and associated documentation files (the "Software"), to deal in the Software
without restriction, including without limitation the rights to ... | 43.820513 | 97 | 0.747806 |
923b0f2612194ec7bbf0369e554ef6b53cfd19a3 | 5,947 | py | Python | src/evaluating_rewards/rewards/comparisons.py | HumanCompatibleAI/evaluating_rewards | 7b99ec9b415d805bd77041f2f7807d112dec9802 | [
"Apache-2.0"
] | 42 | 2020-04-27T06:54:39.000Z | 2022-02-10T00:59:53.000Z | src/evaluating_rewards/rewards/comparisons.py | HumanCompatibleAI/evaluating-rewards | 7b99ec9b415d805bd77041f2f7807d112dec9802 | [
"Apache-2.0"
] | 49 | 2019-11-07T22:01:35.000Z | 2021-02-08T17:27:36.000Z | src/evaluating_rewards/rewards/comparisons.py | HumanCompatibleAI/evaluating_rewards | 7b99ec9b415d805bd77041f2f7807d112dec9802 | [
"Apache-2.0"
] | 2 | 2020-10-06T12:17:31.000Z | 2021-06-22T18:03:02.000Z | # Copyright 2019 DeepMind Technologies Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 33.789773 | 92 | 0.651757 |
8879087fcc8cdc5f38e4a931b237d2bade931933 | 1,319 | py | Python | desuprofile_integration/urls.py | darkismus/kompassi | 35dea2c7af2857a69cae5c5982b48f01ba56da1f | [
"CC-BY-3.0"
] | 13 | 2015-11-29T12:19:12.000Z | 2021-02-21T15:42:11.000Z | desuprofile_integration/urls.py | darkismus/kompassi | 35dea2c7af2857a69cae5c5982b48f01ba56da1f | [
"CC-BY-3.0"
] | 23 | 2015-04-29T19:43:34.000Z | 2021-02-10T05:50:17.000Z | desuprofile_integration/urls.py | darkismus/kompassi | 35dea2c7af2857a69cae5c5982b48f01ba56da1f | [
"CC-BY-3.0"
] | 11 | 2015-09-20T18:59:00.000Z | 2020-02-07T08:47:34.000Z | from django.conf.urls import include, url
from django.views.generic.base import TemplateView
from .views import (
CallbackView,
LoginView,
ConfirmationView,
desuprogramme_import_view,
desuprogramme_feedback_view,
)
urlpatterns = [
url(
r'^desuprofile/oauth2/login/?$',
LoginVie... | 25.862745 | 106 | 0.649735 |
4b72cd105dd77b23e0d38d368dc66f62a8b3fdb9 | 3,630 | py | Python | .leetcode/393.utf-8-validation.py | KuiyuanFu/PythonLeetCode | 8962df2fa838eb7ae48fa59de272ba55a89756d8 | [
"MIT"
] | null | null | null | .leetcode/393.utf-8-validation.py | KuiyuanFu/PythonLeetCode | 8962df2fa838eb7ae48fa59de272ba55a89756d8 | [
"MIT"
] | null | null | null | .leetcode/393.utf-8-validation.py | KuiyuanFu/PythonLeetCode | 8962df2fa838eb7ae48fa59de272ba55a89756d8 | [
"MIT"
] | null | null | null | # @lc app=leetcode id=393 lang=python3
#
# [393] UTF-8 Validation
#
# https://leetcode.com/problems/utf-8-validation/description/
#
# algorithms
# Medium (38.53%)
# Likes: 314
# Dislikes: 1337
# Total Accepted: 61K
# Total Submissions: 158K
# Testcase Example: '[197,130,1]'
#
# Given an integer array data repres... | 23.419355 | 79 | 0.579614 |
32b354ef0163eabe4fce7866a2af52b9a93af1bb | 50,822 | py | Python | fcts/servers.py | ZRunner/ZBot-test | 6b1b906807405ab73c721aa92cd7230a8636e61c | [
"MIT"
] | null | null | null | fcts/servers.py | ZRunner/ZBot-test | 6b1b906807405ab73c721aa92cd7230a8636e61c | [
"MIT"
] | null | null | null | fcts/servers.py | ZRunner/ZBot-test | 6b1b906807405ab73c721aa92cd7230a8636e61c | [
"MIT"
] | null | null | null | import copy
import time
import typing
from math import ceil
import discord
import emoji
from cachingutils import LRUCache
from discord.ext import commands
from libs.classes import MyContext, Zbot
from fcts import checks
roles_options = ["clear", "slowmode", "mute", "kick", "ban", "warn", "say", "welcome_roles",
... | 45.015058 | 625 | 0.552792 |
498874c8291b4802765948e465b49d6c952a8997 | 3,179 | py | Python | tc_manager_rest.py | Gradiant/tc-manager | 4a1809e3019ac469c9a45a021351b25b99d5a47f | [
"MIT"
] | 1 | 2019-04-08T00:49:11.000Z | 2019-04-08T00:49:11.000Z | tc_manager_rest.py | Gradiant/tc-manager | 4a1809e3019ac469c9a45a021351b25b99d5a47f | [
"MIT"
] | null | null | null | tc_manager_rest.py | Gradiant/tc-manager | 4a1809e3019ac469c9a45a021351b25b99d5a47f | [
"MIT"
] | 1 | 2019-03-06T15:43:10.000Z | 2019-03-06T15:43:10.000Z | from flask import Flask, jsonify, request, render_template
from tc_manager import NetworkInterfaces
import sys
import logging
app = Flask(__name__)
@app.route('/')
def index():
return render_template('index.html')
@app.route('/api/interfaces', methods=['GET'])
def get_interfaces():
return jsonify({'interfa... | 30.567308 | 113 | 0.698333 |
a9efd4726eee7ff939c7a3b848f77fcd86cc3ca2 | 7,792 | py | Python | yolox/utils/visualize.py | Bruce198899/YOLOX_Runway | aa3bd25112cfe131556e9e9354288f6b50f3892c | [
"Apache-2.0"
] | null | null | null | yolox/utils/visualize.py | Bruce198899/YOLOX_Runway | aa3bd25112cfe131556e9e9354288f6b50f3892c | [
"Apache-2.0"
] | null | null | null | yolox/utils/visualize.py | Bruce198899/YOLOX_Runway | aa3bd25112cfe131556e9e9354288f6b50f3892c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
import cv2
import matplotlib.pyplot
import numpy as np
import scipy.special
import torch
import torchvision.transforms as transforms
from PIL import Image
import torch
from ufld.data.constant import runway_row_anch... | 36.92891 | 113 | 0.51386 |
6f0e0123a71db9c11e657bba9c232ef263546e67 | 56,424 | py | Python | dataset/models/tf/base.py | mikhailkin/dataset | 7417483fdbe2e3743af4d614cb9036fd5b1375c0 | [
"Apache-2.0"
] | null | null | null | dataset/models/tf/base.py | mikhailkin/dataset | 7417483fdbe2e3743af4d614cb9036fd5b1375c0 | [
"Apache-2.0"
] | null | null | null | dataset/models/tf/base.py | mikhailkin/dataset | 7417483fdbe2e3743af4d614cb9036fd5b1375c0 | [
"Apache-2.0"
] | null | null | null | # pylint: disable=undefined-variable
""" Contains base class for tensorflow models """
import os
import glob
import re
import json
import threading
import contextlib
import numpy as np
import tensorflow as tf
from ... import is_best_practice, Config
from ..base import BaseModel
from .layers import mip, conv_block, u... | 36.638961 | 118 | 0.578708 |
e8fae19c6e76fad7ae0b826725845b45908db8e2 | 2,069 | py | Python | sdk/redhatopenshift/azure-mgmt-redhatopenshift/azure/mgmt/redhatopenshift/v2022_04_01/models/__init__.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-02-01T18:50:12.000Z | 2022-02-01T18:50:12.000Z | sdk/redhatopenshift/azure-mgmt-redhatopenshift/azure/mgmt/redhatopenshift/v2022_04_01/models/__init__.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/redhatopenshift/azure-mgmt-redhatopenshift/azure/mgmt/redhatopenshift/v2022_04_01/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 ... | 31.348485 | 94 | 0.724505 |
b9cea0e13ee553f4234ff6bcdae860f394aaa700 | 1,067 | py | Python | example.py | HW-MLCS/Python-RVO2 | 502eed2e6656772728b7f9bdacf9423cf84a6801 | [
"Apache-2.0"
] | null | null | null | example.py | HW-MLCS/Python-RVO2 | 502eed2e6656772728b7f9bdacf9423cf84a6801 | [
"Apache-2.0"
] | null | null | null | example.py | HW-MLCS/Python-RVO2 | 502eed2e6656772728b7f9bdacf9423cf84a6801 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import rvo2
sim = rvo2.PyRVOSimulator(1/60., 1.5, 5, 1.5, 2, 0.4, 2)
# Pass either just the position (the other parameters then use
# the default values passed to the PyRVOSimulator constructor),
# or pass all available parameters.
a0 = sim.addAgent((0, 0))
a1 = sim.addAgent((1, 0))
a2 = sim.ad... | 29.638889 | 85 | 0.643861 |
edd6c317e0bd4bab3340dc468d458ccf83773036 | 10,782 | py | Python | utils.py | Yixin-Liu-323/SUBLIME | f8ac29a124b60e80557a9e405e9c3d784e52279a | [
"MIT"
] | null | null | null | utils.py | Yixin-Liu-323/SUBLIME | f8ac29a124b60e80557a9e405e9c3d784e52279a | [
"MIT"
] | null | null | null | utils.py | Yixin-Liu-323/SUBLIME | f8ac29a124b60e80557a9e405e9c3d784e52279a | [
"MIT"
] | null | null | null | import numpy as np
import scipy.sparse as sp
import torch
import torch.nn.functional as F
from sklearn.neighbors import kneighbors_graph
import dgl
from sklearn import metrics
from munkres import Munkres
EOS = 1e-10
def apply_non_linearity(tensor, non_linearity, i):
if non_linearity == 'elu':
return F.el... | 36.924658 | 116 | 0.643294 |
e4a026323ce58c59a5b943db8ff54bdfed23e955 | 17,621 | py | Python | bdgym/envs/driver_assistant/action.py | RDLLab/benevolent-deception-gym | 4d04e097609097e0f07c661aac221184ebdec2fe | [
"MIT"
] | null | null | null | bdgym/envs/driver_assistant/action.py | RDLLab/benevolent-deception-gym | 4d04e097609097e0f07c661aac221184ebdec2fe | [
"MIT"
] | null | null | null | bdgym/envs/driver_assistant/action.py | RDLLab/benevolent-deception-gym | 4d04e097609097e0f07c661aac221184ebdec2fe | [
"MIT"
] | null | null | null | """Action class for BDGym Highway Autopilot environment """
from typing import TYPE_CHECKING, Callable, Tuple, List, Dict
import numpy as np
from gym import spaces
from highway_env import utils
from highway_env.envs.common.abstract import Observation
from highway_env.envs.common.action import \
ContinuousAction, ... | 35.887984 | 79 | 0.631462 |
a00c561a3a36993eff149ab2ff136225c76ae706 | 197 | py | Python | hackday/assets/admin.py | mpirnat/hackday | 82a13665e2d93c80d6dfb1a1d5602495d01a243e | [
"MIT"
] | 4 | 2015-05-21T19:44:09.000Z | 2019-12-03T11:07:03.000Z | hackday/assets/admin.py | mpirnat/hackday | 82a13665e2d93c80d6dfb1a1d5602495d01a243e | [
"MIT"
] | 3 | 2020-02-11T21:47:49.000Z | 2021-06-10T17:28:44.000Z | hackday/assets/admin.py | mpirnat/hackday | 82a13665e2d93c80d6dfb1a1d5602495d01a243e | [
"MIT"
] | 2 | 2016-01-05T13:39:09.000Z | 2017-02-19T09:31:58.000Z | from hackday.assets.models import Attachment, ImageAttachment, Link
from django.contrib import admin
admin.site.register(Attachment)
admin.site.register(ImageAttachment)
admin.site.register(Link)
| 28.142857 | 67 | 0.84264 |
0ebb41f8b3ffa9546507ac3f620bb1b1fe1b0956 | 2,937 | py | Python | main.py | vishalpolley/Handwritten-Digit-Recognition-using-Neural-Networks | 871722b747a4b45c324a706a46a0294a8034a702 | [
"MIT"
] | null | null | null | main.py | vishalpolley/Handwritten-Digit-Recognition-using-Neural-Networks | 871722b747a4b45c324a706a46a0294a8034a702 | [
"MIT"
] | null | null | null | main.py | vishalpolley/Handwritten-Digit-Recognition-using-Neural-Networks | 871722b747a4b45c324a706a46a0294a8034a702 | [
"MIT"
] | null | null | null | import numpy as np
import tensorflow as tf
from PIL import Image
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
n_train = mnist.train.num_examples # Taining data
n_validation = mnist.validation.num_examples # Validation data
n_test = mnist.tes... | 39.689189 | 126 | 0.735785 |
02f4dc23c5a817d0277273e1386fe72814a5e744 | 9,902 | py | Python | old/FastFourierTransform/Rotate_by_complex.py | Tony031218/manim-projects | b243dec0f0a007649a92938e90d60eccb4c7dd15 | [
"Apache-2.0"
] | 45 | 2019-10-08T23:58:20.000Z | 2020-05-20T03:49:15.000Z | old/FastFourierTransform/Rotate_by_complex.py | Tony031218/manim-projects | b243dec0f0a007649a92938e90d60eccb4c7dd15 | [
"Apache-2.0"
] | null | null | null | old/FastFourierTransform/Rotate_by_complex.py | Tony031218/manim-projects | b243dec0f0a007649a92938e90d60eccb4c7dd15 | [
"Apache-2.0"
] | 12 | 2019-08-15T08:07:22.000Z | 2020-05-09T12:34:14.000Z | from manimlib.imports import *
class Angle(VGroup):
CONFIG = {
'radius': 1,
'color': RED,
'opacity': 0.4,
'stroke_width': 10,
# 'below_180': True,
}
def __init__(self, A, O, B, **kwargs):
VMobject.__init__(self, **kwargs)
OA, OB = A-O, B-O
... | 47.37799 | 161 | 0.572309 |
1feb0ff9d9988823f3205f7e840e590a3898c651 | 22,484 | py | Python | addons/io_scene_gltf_ksons/material/__init__.py | Andgonag/gltf-blender-importer | a4c719dc155ff0726bc160057e411fa9f956db9f | [
"MIT"
] | 199 | 2017-03-14T18:41:55.000Z | 2022-02-23T09:43:42.000Z | addons/io_scene_gltf_ksons/material/__init__.py | Andgonag/gltf-blender-importer | a4c719dc155ff0726bc160057e411fa9f956db9f | [
"MIT"
] | 38 | 2017-08-01T15:54:55.000Z | 2019-08-15T07:59:55.000Z | addons/io_scene_gltf_ksons/material/__init__.py | Andgonag/gltf-blender-importer | a4c719dc155ff0726bc160057e411fa9f956db9f | [
"MIT"
] | 33 | 2017-06-27T20:29:16.000Z | 2022-01-19T13:51:07.000Z | import json
import bpy
from .block import Block
from .texture import create_texture_block
from . import image, node_groups, precompute
# Re-exports
create_image = image.create_image
create_group = node_groups.create_group
material_precomputation = precompute.material_procomputation
def create_material(op, idx):
... | 32.304598 | 115 | 0.578456 |
38df2b0cd3f04801de3f7e7a492199b1d64f7390 | 1,341 | py | Python | src/pygenec/cruzamento/umponto.py | duducosmos/pygenec | 6d3ec464231ae7e1f9f39e4fa3ff3a3a71e45f06 | [
"Apache-2.0"
] | 1 | 2019-08-05T17:23:15.000Z | 2019-08-05T17:23:15.000Z | src/pygenec/cruzamento/umponto.py | duducosmos/pygenec | 6d3ec464231ae7e1f9f39e4fa3ff3a3a71e45f06 | [
"Apache-2.0"
] | null | null | null | src/pygenec/cruzamento/umponto.py | duducosmos/pygenec | 6d3ec464231ae7e1f9f39e4fa3ff3a3a71e45f06 | [
"Apache-2.0"
] | 1 | 2021-01-10T19:45:31.000Z | 2021-01-10T19:45:31.000Z | #!/usr/bin/env python3.6
# -*- Coding: UTF-8 -*-
"""
Cruzamento por por um ponto.
Programa sob licença GNU V.3.
Desenvolvido por: E. S. Pereira.
Versão 0.0.1.
"""
from numpy.random import randint
from numpy import array
from .cruzamento import Cruzamento, NoCompatibleIndividualSize
class UmPonto(Cruzamento):
"... | 26.294118 | 77 | 0.634601 |
2c0eaa83a4dcc60d1705291e3dffac497e766e1b | 357 | py | Python | traceroute/src/simple_send_receive.py | Ak-Shaw/Networking | 03eba022f368155bd40b8e53455282e1469469d1 | [
"MIT"
] | 3 | 2020-10-17T07:06:06.000Z | 2020-11-09T03:49:27.000Z | traceroute/src/simple_send_receive.py | Ak-Shaw/Networking | 03eba022f368155bd40b8e53455282e1469469d1 | [
"MIT"
] | 10 | 2020-10-19T06:50:54.000Z | 2020-11-01T18:07:16.000Z | traceroute/src/simple_send_receive.py | Ak-Shaw/Networking | 03eba022f368155bd40b8e53455282e1469469d1 | [
"MIT"
] | 5 | 2020-10-18T01:20:23.000Z | 2020-10-25T16:08:33.000Z | from scapy.all import *
import sys
host=sys.argv[1]
ttl = 200
print("Sending packet to "+host);
ipLayer = IP()
ipLayer.dst = host #set destination host
ipLayer.ttl = ttl #set TTL for packet
ICMPpkt = ICMP()
pkt = ipLayer/ICMPpkt
reply = sr1(pkt, verbose = 0) #send packet and wait for reply
print("Reply: Type:",reply[... | 23.8 | 63 | 0.708683 |
8713003490e3752136167d18d0a37bf4e25eb98d | 664 | py | Python | django101/django102/migrations/0004_person.py | Minkov/python-web-2020-09 | a43baf4dd4dd811caf25aad971a0f1a4d3d486a4 | [
"MIT"
] | 4 | 2020-10-30T23:13:50.000Z | 2020-12-26T21:35:00.000Z | django101/django102/migrations/0004_person.py | Minkov/python-web-2020-09 | a43baf4dd4dd811caf25aad971a0f1a4d3d486a4 | [
"MIT"
] | null | null | null | django101/django102/migrations/0004_person.py | Minkov/python-web-2020-09 | a43baf4dd4dd811caf25aad971a0f1a4d3d486a4 | [
"MIT"
] | 7 | 2020-09-17T13:08:35.000Z | 2020-10-31T15:01:46.000Z | # Generated by Django 3.1.2 on 2020-10-06 15:16
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('django102', '0003_auto_20201006_1815'),
]
operations = [
migrations.CreateModel(
name='Person',
fields... | 28.869565 | 115 | 0.557229 |
5ef69d018fe0ca2a339d52e7107cbe3e2f2e2ce6 | 740 | py | Python | tests/test_5_auth.py | Pytlicek/FlaskRSS | d7cb4192f5b62630de3312837826c3a97b4a3c2f | [
"MIT"
] | 2 | 2021-11-12T23:15:47.000Z | 2021-12-07T22:18:38.000Z | tests/test_5_auth.py | Pytlicek/FlaskRSS | d7cb4192f5b62630de3312837826c3a97b4a3c2f | [
"MIT"
] | 1 | 2020-11-26T15:58:10.000Z | 2020-11-26T15:58:44.000Z | tests/test_5_auth.py | Pytlicek/FlaskRSS | d7cb4192f5b62630de3312837826c3a97b4a3c2f | [
"MIT"
] | null | null | null | from flask import url_for
from app import app
def test_index_path(client):
response = client.get("/logout", follow_redirects=True)
assert response.status_code == 200
assert response.status_code != 302
assert "Login" in str(response.data)
assert "Articles:" not in str(response.data)
def test_feed... | 29.6 | 59 | 0.728378 |
ffb67c5d5780c20a48623adde8f0e537aedd2483 | 154 | py | Python | personal/views.py | florimondmanca/personal-api | 6300f965d3f51d1bf5f10cf1eb15d673bd627631 | [
"MIT"
] | 4 | 2018-08-17T08:06:06.000Z | 2020-02-20T15:15:56.000Z | personal/views.py | florimondmanca/personal-api | 6300f965d3f51d1bf5f10cf1eb15d673bd627631 | [
"MIT"
] | 2 | 2018-10-08T15:59:58.000Z | 2018-10-20T16:50:13.000Z | personal/views.py | florimondmanca/personal-api | 6300f965d3f51d1bf5f10cf1eb15d673bd627631 | [
"MIT"
] | 1 | 2019-09-14T23:15:10.000Z | 2019-09-14T23:15:10.000Z | """Project views."""
from django.views.generic import RedirectView
class IndexView(RedirectView):
"""Home page."""
pattern_name = "post-list"
| 15.4 | 45 | 0.688312 |
4bfd5b383e82e1a272cba3dcabf477fc62eea066 | 50,490 | py | Python | tarpn/ax25/statemachine.py | rxt1077/tarpn-node-controller | ffbe1d78fbd1c10e891b3339b50002e5233e21ad | [
"MIT"
] | null | null | null | tarpn/ax25/statemachine.py | rxt1077/tarpn-node-controller | ffbe1d78fbd1c10e891b3339b50002e5233e21ad | [
"MIT"
] | null | null | null | tarpn/ax25/statemachine.py | rxt1077/tarpn-node-controller | ffbe1d78fbd1c10e891b3339b50002e5233e21ad | [
"MIT"
] | null | null | null | """
AX.25 State Machine Code
"""
import asyncio
from asyncio import Future
import queue
from dataclasses import dataclass, field
from enum import Enum, auto
from functools import partial
import logging
from typing import Callable, cast, Dict, Optional, List, Tuple
from tarpn.ax25 import AX25Call, AX25Packet, IFrame, S... | 44.211909 | 122 | 0.647257 |
31884fbe9e12177eb9a8364107617b9f07ee3c86 | 589 | py | Python | arda_db/browser/migrations/0001_initial.py | rwspicer/ARDA | 9bd98786feff4afbd45afdf3f3f1c2549f6356cf | [
"MIT"
] | 5 | 2015-04-22T09:20:10.000Z | 2021-03-12T01:52:07.000Z | arda_db/browser/migrations/0001_initial.py | rwspicer/ARDA | 9bd98786feff4afbd45afdf3f3f1c2549f6356cf | [
"MIT"
] | null | null | null | arda_db/browser/migrations/0001_initial.py | rwspicer/ARDA | 9bd98786feff4afbd45afdf3f3f1c2549f6356cf | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Resource',
fields=[
('r_id', models.AutoField(s... | 24.541667 | 128 | 0.531409 |
06c316734d0c5dfdec35448932dcdb142c786a56 | 27,691 | py | Python | desktop/core/src/desktop/tests.py | erickt/hue | a046f1dd21226689ed447422f3373d96c65b2fd2 | [
"Apache-2.0"
] | null | null | null | desktop/core/src/desktop/tests.py | erickt/hue | a046f1dd21226689ed447422f3373d96c65b2fd2 | [
"Apache-2.0"
] | null | null | null | desktop/core/src/desktop/tests.py | erickt/hue | a046f1dd21226689ed447422f3373d96c65b2fd2 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (... | 34.441542 | 152 | 0.739049 |
dd4e256e04a70231681e654657954d492e6fd8f2 | 29,982 | py | Python | week2/utilities/build_ltr.py | fredriko/search_with_machine_learning_course | 85670d7adf337fede418fa5665b3c5ee80e42b2b | [
"Apache-2.0"
] | null | null | null | week2/utilities/build_ltr.py | fredriko/search_with_machine_learning_course | 85670d7adf337fede418fa5665b3c5ee80e42b2b | [
"Apache-2.0"
] | null | null | null | week2/utilities/build_ltr.py | fredriko/search_with_machine_learning_course | 85670d7adf337fede418fa5665b3c5ee80e42b2b | [
"Apache-2.0"
] | null | null | null | ####
#
# Our main class for creating an LTR model via XG Boost and uploading it to OpenSearch
#
###
import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
import warnings
warnings.filterwarnings("ignore", category=FutureWarning)
import argparse
import json
import os
from getpass import getpass... | 67.073826 | 274 | 0.649356 |
8c9774d34d0f9b617ccb0e032aed97df48589381 | 161,648 | py | Python | google/container/v1/container-v1-py/google/container_v1/services/cluster_manager/client.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 7 | 2021-02-21T10:39:41.000Z | 2021-12-07T07:31:28.000Z | google/container/v1/container-v1-py/google/container_v1/services/cluster_manager/client.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 6 | 2021-02-02T23:46:11.000Z | 2021-11-15T01:46:02.000Z | google/container/v1/container-v1-py/google/container_v1/services/cluster_manager/client.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 4 | 2021-01-28T23:25:45.000Z | 2021-08-30T01:55:16.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 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... | 43.22139 | 149 | 0.584764 |
5ad1cd4eb463dc49a9bdbe48221a6dd2e63ef1e7 | 24,718 | py | Python | tests/gpuarray/test_scan.py | canyon289/Theano-PyMC | 1a9b04bfe480b758ddfa54ba49c88bee3bec419c | [
"BSD-3-Clause"
] | null | null | null | tests/gpuarray/test_scan.py | canyon289/Theano-PyMC | 1a9b04bfe480b758ddfa54ba49c88bee3bec419c | [
"BSD-3-Clause"
] | null | null | null | tests/gpuarray/test_scan.py | canyon289/Theano-PyMC | 1a9b04bfe480b758ddfa54ba49c88bee3bec419c | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
import pytest
import theano
import theano.sandbox.rng_mrg
from tests import unittest_tools as utt
from tests.gpuarray.config import mode_with_gpu, test_ctx_name
from theano import gpuarray, tensor
from theano.gpuarray.basic_ops import GpuFromHost, HostFromGpu
from theano.gpuarray.elemwise import Gpu... | 33.906722 | 87 | 0.572983 |
fa3aee06123e1e4109a3fe3b5184ea02735b0a5d | 1,034 | py | Python | draugr/python_utilities/strings.py | cnHeider/draugr | b95e0bb1fa5efa581bfb28ff604f296ed2e6b7d6 | [
"Apache-2.0"
] | 3 | 2019-09-27T08:04:59.000Z | 2020-12-02T06:14:45.000Z | draugr/python_utilities/strings.py | cnHeider/draugr | b95e0bb1fa5efa581bfb28ff604f296ed2e6b7d6 | [
"Apache-2.0"
] | 64 | 2019-09-27T08:03:42.000Z | 2022-03-28T15:07:30.000Z | draugr/python_utilities/strings.py | cnHeider/draugr | b95e0bb1fa5efa581bfb28ff604f296ed2e6b7d6 | [
"Apache-2.0"
] | 1 | 2020-10-01T00:18:57.000Z | 2020-10-01T00:18:57.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = "Christian Heider Nielsen"
__doc__ = r"""
Created on 09/10/2019
"""
__all__ = ["indent_lines"]
from typing import Any
def indent_lines(
input_str: Any, indent_spaces_num: int = 2, ignore_single_lines: bool = False
) -> str:
... | 21.541667 | 81 | 0.594778 |
bd3f6ae4802e4d5d01a48ae599756247ce79d46b | 7,747 | py | Python | docs/source/conf.py | plamere/PlaylistBuilder | ae71c0b493e9cb6ecca5cc02fd3f51afa3fb8d07 | [
"MIT"
] | 41 | 2015-06-20T10:47:57.000Z | 2022-01-31T16:55:37.000Z | docs/source/conf.py | plamere/PlaylistBuilder | ae71c0b493e9cb6ecca5cc02fd3f51afa3fb8d07 | [
"MIT"
] | 5 | 2015-10-06T22:08:59.000Z | 2016-05-21T04:47:38.000Z | docs/source/conf.py | plamere/PlaylistBuilder | ae71c0b493e9cb6ecca5cc02fd3f51afa3fb8d07 | [
"MIT"
] | 13 | 2015-07-23T14:35:28.000Z | 2020-07-04T05:27:33.000Z | # -*- coding: utf-8 -*-
#
# pbl documentation build configuration file, created by
# sphinx-quickstart on Sat Jun 20 07:20:44 2015.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All con... | 31.49187 | 80 | 0.711759 |
a74c5a71401d99753345b0d22cfbb2475dc96f3b | 7,890 | py | Python | setup.py | stjordanis/nlp-4 | d30d25d3dad590dffe2d3004b4b301dd562dd4f2 | [
"Apache-2.0"
] | 2 | 2021-11-14T09:11:43.000Z | 2021-11-14T10:07:49.000Z | setup.py | stjordanis/nlp-4 | d30d25d3dad590dffe2d3004b4b301dd562dd4f2 | [
"Apache-2.0"
] | null | null | null | setup.py | stjordanis/nlp-4 | d30d25d3dad590dffe2d3004b4b301dd562dd4f2 | [
"Apache-2.0"
] | null | null | null | # Lint as: python3
""" HuggingFace/Datasets is an open library of datasets.
Note:
VERSION needs to be formatted following the MAJOR.MINOR.PATCH convention
(we need to follow this convention to be able to retrieve versioned scripts)
Simple check list for release from AllenNLP repo: https://github.com/allenai/al... | 31.434263 | 117 | 0.646641 |
df3b416df81c2e2a458da90b43af19bb43e5284a | 173 | py | Python | lesson9/homework.py | kelinsobw/lessons | cc0008c31c3397ddadfa80d5e77f746c0a3817f6 | [
"BSD-3-Clause"
] | null | null | null | lesson9/homework.py | kelinsobw/lessons | cc0008c31c3397ddadfa80d5e77f746c0a3817f6 | [
"BSD-3-Clause"
] | null | null | null | lesson9/homework.py | kelinsobw/lessons | cc0008c31c3397ddadfa80d5e77f746c0a3817f6 | [
"BSD-3-Clause"
] | null | null | null | from class_car import Car
if __name__=="__main__":
my_car=Car("Mercedes","E500",2000)
while my_car.speed<100:
my_car.speed_up()
my_car.print_speed()
| 15.727273 | 38 | 0.66474 |
ba8d36e070b54b8406954bc16352b465a740db41 | 678 | py | Python | animate.py | frostburn/buddhabulb | 1a4c5e4ef6858e02bc2127930ed3e1b721fc5a35 | [
"MIT"
] | null | null | null | animate.py | frostburn/buddhabulb | 1a4c5e4ef6858e02bc2127930ed3e1b721fc5a35 | [
"MIT"
] | null | null | null | animate.py | frostburn/buddhabulb | 1a4c5e4ef6858e02bc2127930ed3e1b721fc5a35 | [
"MIT"
] | null | null | null | import subprocess
width = 300
height = 300
layer = 1
num_layers = 50
num_frames = 60
normalizer = 350000
subprocess.call(["rm", "tmp/*.rgb"])
# subprocess.call(["rm", "./tmp/*.png"])
for i in range(num_frames):
subprocess.call(map(str, ["./process", width, height, layer, num_layers, i, num_frames, normalizer]))... | 32.285714 | 147 | 0.591445 |
a57902d5e2616c76d87fa71a75c7235444cdbe12 | 2,435 | py | Python | config/urls.py | patruq/ronatrack | ce18e1a5c0d77f9cfe5425a1a10f6778343f6bd4 | [
"MIT"
] | 1 | 2020-08-26T21:21:26.000Z | 2020-08-26T21:21:26.000Z | config/urls.py | patruq/ronatrack | ce18e1a5c0d77f9cfe5425a1a10f6778343f6bd4 | [
"MIT"
] | null | null | null | config/urls.py | patruq/ronatrack | ce18e1a5c0d77f9cfe5425a1a10f6778343f6bd4 | [
"MIT"
] | null | null | null | from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.urls import include, path
from django.views import defaults as default_views
from django.views.generic import TemplateView
from res... | 37.461538 | 88 | 0.678439 |
72e4e0128a499be2451ba24919ae0a8a300129c3 | 2,453 | py | Python | ornitho/model/field.py | dda-dev/ornitho-client-python | 94d09774026786c021f35cae8cc74b65a28075d9 | [
"MIT"
] | 3 | 2020-06-17T17:58:54.000Z | 2022-03-27T17:26:07.000Z | ornitho/model/field.py | dda-dev/ornitho-client-python | 94d09774026786c021f35cae8cc74b65a28075d9 | [
"MIT"
] | null | null | null | ornitho/model/field.py | dda-dev/ornitho-client-python | 94d09774026786c021f35cae8cc74b65a28075d9 | [
"MIT"
] | 1 | 2021-12-17T13:13:10.000Z | 2021-12-17T13:13:10.000Z | from typing import List, Optional, Union
from ornitho import APIException
from ornitho.api_requester import APIRequester
from ornitho.model.abstract import ListableModel
from ornitho.model.field_option import FieldOption
class Field(ListableModel):
ENDPOINT: str = "fields"
def __init__(self, id_: int) -> No... | 31.857143 | 108 | 0.62128 |
95e1c07ef4805af2dea1ff54992c732d65591edf | 3,190 | py | Python | tests/integration_tests/charts/schema_tests.py | cryptomela/superset | 69c3cc712d8399a81b5b1b4783ea17a8c1f1cf70 | [
"Apache-2.0"
] | 1 | 2021-11-21T15:18:19.000Z | 2021-11-21T15:18:19.000Z | tests/integration_tests/charts/schema_tests.py | cryptomela/superset | 69c3cc712d8399a81b5b1b4783ea17a8c1f1cf70 | [
"Apache-2.0"
] | null | null | null | tests/integration_tests/charts/schema_tests.py | cryptomela/superset | 69c3cc712d8399a81b5b1b4783ea17a8c1f1cf70 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 40.897436 | 82 | 0.695298 |
2f4b8e487cb002019d24e2014d8ca85b42b4f5b6 | 840 | py | Python | flask/src/flask_app/web_app/app.py | AlTosterino/FlaskVsFastAPI | db826b1bd19216ff1ae7bdba518244178d8f59bf | [
"MIT"
] | 5 | 2021-04-16T20:00:09.000Z | 2022-01-23T23:39:03.000Z | flask/src/flask_app/web_app/app.py | AlTosterino/FlaskVsFastAPI | db826b1bd19216ff1ae7bdba518244178d8f59bf | [
"MIT"
] | null | null | null | flask/src/flask_app/web_app/app.py | AlTosterino/FlaskVsFastAPI | db826b1bd19216ff1ae7bdba518244178d8f59bf | [
"MIT"
] | null | null | null | import os
from http import HTTPStatus
from typing import Tuple
from flask_app.shared.exceptions import DatabaseRepositoryError
from flask_app.shared.exceptions.validation import ValidationError
from flask_app.web_app.routes import news_router
from flask import Flask
app = Flask(__name__)
app.register_blueprint(news_... | 28.965517 | 76 | 0.791667 |
183a376c10fb595137f133afeafc0612ccf8cad7 | 5,479 | py | Python | src/webdav/Lockable.py | tseaver/Zope-RFA | 08634f39b0f8b56403a2a9daaa6ee4479ef0c625 | [
"ZPL-2.1"
] | 2 | 2015-12-21T10:34:56.000Z | 2017-09-24T11:07:58.000Z | src/webdav/Lockable.py | MatthewWilkes/Zope | 740f934fc9409ae0062e8f0cd6dcfd8b2df00376 | [
"ZPL-2.1"
] | null | null | null | src/webdav/Lockable.py | MatthewWilkes/Zope | 740f934fc9409ae0062e8f0cd6dcfd8b2df00376 | [
"ZPL-2.1"
] | null | null | null | ##############################################################################
#
# Copyright (c) 2002 Zope Foundation and Contributors.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS I... | 35.577922 | 78 | 0.641175 |
7fb30423d009ca2113f6a0dacfeffe5a60a90b24 | 1,800 | py | Python | haar_cascade/arac_plakasi_algilama/resimden_plaka_okuma.py | malidrsn/OpenCV-Tutorial-w-Basic-Examples | 70e117ba4f3b46b937a92e35f7ddaedb46f8b7be | [
"MIT"
] | null | null | null | haar_cascade/arac_plakasi_algilama/resimden_plaka_okuma.py | malidrsn/OpenCV-Tutorial-w-Basic-Examples | 70e117ba4f3b46b937a92e35f7ddaedb46f8b7be | [
"MIT"
] | null | null | null | haar_cascade/arac_plakasi_algilama/resimden_plaka_okuma.py | malidrsn/OpenCV-Tutorial-w-Basic-Examples | 70e117ba4f3b46b937a92e35f7ddaedb46f8b7be | [
"MIT"
] | null | null | null | import cv2
import numpy as np
import pytesseract
import imutils
img = cv2.imread("licence_plate.jpg")
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
# filtreleme işlemleri gürültü yok etme işlemleri
filtered = cv2.bilateralFilter(gray, 7, 250, 250)
# köşe bulma algoritması
edges = cv2.Canny(filtered, 30, 200)
# con... | 26.086957 | 101 | 0.713333 |
4772d3ee13a6abeda6eb319fc67d1892775f2a89 | 3,950 | py | Python | parser/fase2/team03/parse/functions/functions_string.py | webdev188/tytus | 847071edb17b218f51bb969d335a8ec093d13f94 | [
"MIT"
] | 1 | 2021-01-09T09:39:57.000Z | 2021-01-09T09:39:57.000Z | parser/fase2/team03/parse/functions/functions_string.py | webdev188/tytus | 847071edb17b218f51bb969d335a8ec093d13f94 | [
"MIT"
] | null | null | null | parser/fase2/team03/parse/functions/functions_string.py | webdev188/tytus | 847071edb17b218f51bb969d335a8ec093d13f94 | [
"MIT"
] | 4 | 2020-12-19T17:12:13.000Z | 2021-01-07T20:29:53.000Z | from hashlib import md5, sha256
from parse.ast_node import ASTNode
# From here on, classes describing aggregate functions
# TODO: Convert, SetByte, Substr
class Convert(ASTNode):
def __init__(self, exp, line, column):
ASTNode.__init__(self, line, column)
self.exp = exp
def execute(self, table... | 24.534161 | 54 | 0.600759 |
14ef855f6636cbc3639feecca56621446ef4c505 | 4,371 | py | Python | lib/streamlit/ReportThread.py | brandonJY/streamlit | afb51bdef42df3b9f4f1dfc23dc749974a5e4fc6 | [
"Apache-2.0"
] | 1 | 2020-04-01T19:53:28.000Z | 2020-04-01T19:53:28.000Z | lib/streamlit/ReportThread.py | sudachen/streamlit | f5326d68eb914eb5bb49da01b7f406ba4f5845d0 | [
"Apache-2.0"
] | null | null | null | lib/streamlit/ReportThread.py | sudachen/streamlit | f5326d68eb914eb5bb49da01b7f406ba4f5845d0 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2018-2020 Streamlit 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 applicabl... | 30.566434 | 81 | 0.658888 |
04b230c08a3896d3794806e023a1cef80b0a9b2a | 1,815 | py | Python | data_structures/hash-table/hash_table.py | katcosgrove/data-structures-and-algorithms | 8683268183e79c6abeeb58187101cb140c65568d | [
"MIT"
] | 1 | 2021-04-02T12:12:20.000Z | 2021-04-02T12:12:20.000Z | data_structures/hash-table/hash_table.py | katcosgrove/data-structures-and-algorithms | 8683268183e79c6abeeb58187101cb140c65568d | [
"MIT"
] | 2 | 2018-03-21T17:34:34.000Z | 2018-03-26T16:46:07.000Z | data_structures/hash-table/hash_table.py | katcosgrove/data-structures-and-algorithms | 8683268183e79c6abeeb58187101cb140c65568d | [
"MIT"
] | 2 | 2018-08-29T18:59:59.000Z | 2019-04-12T21:16:14.000Z | from linked_list import LinkedList
# from functools import reduce
class HashTable:
"""Class for building a hash table."""
def __init__(self, max_size=1024):
self.max_size = max_size
self.buckets = [LinkedList() for _ in range(max_size)]
def __iter__(self):
keys = []
for b... | 29.274194 | 66 | 0.544353 |
bd9941c6022598e11ecbd41e95b3f08074e5cc74 | 4,409 | py | Python | utils/extra/common.py | luis-guilherme/mitra | 18bd935b11dc8fcf594255a96809c05abc324e87 | [
"MIT"
] | 864 | 2020-09-22T18:52:27.000Z | 2022-03-28T19:57:25.000Z | utils/extra/common.py | luis-guilherme/mitra | 18bd935b11dc8fcf594255a96809c05abc324e87 | [
"MIT"
] | 13 | 2020-09-24T10:42:21.000Z | 2021-12-20T14:44:36.000Z | utils/extra/common.py | luis-guilherme/mitra | 18bd935b11dc8fcf594255a96809c05abc324e87 | [
"MIT"
] | 55 | 2020-09-22T19:01:19.000Z | 2022-03-20T09:15:45.000Z | #!/usr/bin/env python3
# common functions
# Ange Albertini 2020
import random
import re
from string import punctuation, digits, ascii_letters
def randblock(l):
return bytes([random.randrange(255) for i in range(l)])
# Cosmetic functions ###########################################################
ASCII = (punctu... | 19.595556 | 98 | 0.607621 |
2613b9d56184e4bb217f29cbb5246e3f2438da60 | 19,421 | py | Python | lib/python2.7/site-packages/mpl_toolkits/mplot3d/axis3d.py | wfehrnstrom/harmonize | e5661d24b2021739e8ac4bf1d3a530eda4e155b3 | [
"MIT"
] | 1 | 2017-12-05T15:35:47.000Z | 2017-12-05T15:35:47.000Z | lib/python2.7/site-packages/mpl_toolkits/mplot3d/axis3d.py | wfehrnstrom/harmonize | e5661d24b2021739e8ac4bf1d3a530eda4e155b3 | [
"MIT"
] | 10 | 2017-07-13T00:24:03.000Z | 2017-07-17T07:39:03.000Z | lib/python2.7/site-packages/mpl_toolkits/mplot3d/axis3d.py | wfehrnstrom/harmonize | e5661d24b2021739e8ac4bf1d3a530eda4e155b3 | [
"MIT"
] | 7 | 2017-08-01T04:02:07.000Z | 2018-10-06T21:07:20.000Z | # axis3d.py, original mplot3d version by John Porter
# Created: 23 Sep 2005
# Parts rewritten by Reinier Heeres <reinier@heeres.eu>
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import math
import copy
from matplotlib import lines as mlines, ... | 39.393509 | 87 | 0.530045 |
18857771b04e321d3dd8ce1933ef2e836bca59e7 | 19,703 | py | Python | dist_matrix/njit_dist_matrix_full.py | sparks-baird/wasserstein-distance | a37b5c2a0f7322cd8edb1432148445cf5de468a2 | [
"MIT"
] | 5 | 2021-12-10T15:48:55.000Z | 2022-03-29T15:28:06.000Z | dist_matrix/njit_dist_matrix_full.py | sparks-baird/wasserstein-distance | a37b5c2a0f7322cd8edb1432148445cf5de468a2 | [
"MIT"
] | null | null | null | dist_matrix/njit_dist_matrix_full.py | sparks-baird/wasserstein-distance | a37b5c2a0f7322cd8edb1432148445cf5de468a2 | [
"MIT"
] | null | null | null | """Nopython version of dist_matrix."""
import os
import numpy as np
from math import sqrt
from numba import prange, njit
from numba.types import int32, float32, int64, float64
from dist_matrix.utils import cpu_helper as hp
# settings
inline = os.environ.get("INLINE", "never")
fastmath = bool(os.environ.get("FASTMATH... | 34.266087 | 124 | 0.583667 |
c68d83c5b7bb5794171d3a0a8f5ba2dc82c3db25 | 10,628 | py | Python | nova/network/quantum/melange_ipam_lib.py | bopopescu/trusted-nova | b440afb89f6f170c0831f5d6318a08ec41bc8c0a | [
"Apache-2.0"
] | 1 | 2015-07-15T08:51:16.000Z | 2015-07-15T08:51:16.000Z | nova/network/quantum/melange_ipam_lib.py | bopopescu/trusted-nova | b440afb89f6f170c0831f5d6318a08ec41bc8c0a | [
"Apache-2.0"
] | null | null | null | nova/network/quantum/melange_ipam_lib.py | bopopescu/trusted-nova | b440afb89f6f170c0831f5d6318a08ec41bc8c0a | [
"Apache-2.0"
] | 2 | 2019-06-12T00:52:15.000Z | 2020-07-24T10:35:29.000Z | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 Nicira Networks, 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.apach... | 41.354086 | 78 | 0.616014 |
a073705505eac8829812e10ea128977165683972 | 10,316 | py | Python | src/twisted/python/test/test_sendmsg.py | apjanke/twisted | 22f949f7ce187513f0c218b73186c8a73baa00b4 | [
"Unlicense",
"MIT"
] | 1 | 2021-01-03T01:54:14.000Z | 2021-01-03T01:54:14.000Z | src/twisted/python/test/test_sendmsg.py | zerospam/twisted | e23b5e2040a4d643bc6a43785621358569886a0d | [
"MIT",
"Unlicense"
] | null | null | null | src/twisted/python/test/test_sendmsg.py | zerospam/twisted | e23b5e2040a4d643bc6a43785621358569886a0d | [
"MIT",
"Unlicense"
] | null | null | null | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.python.sendmsg}.
"""
import os
import sys
import errno
import warnings
from os import pipe, read, close, pathsep
from struct import pack
from socket import SOL_SOCKET, AF_INET, AF_INET6, socket, error
try:
from socket... | 30.341176 | 86 | 0.623691 |
f94508f58d5279d62b6ad98792f48a0b250b569c | 9,517 | py | Python | openstates/models/tests/test_models.py | openstates/openstates-core | 5590e1fa5de7794325ca1666bac1015f0ce7b102 | [
"MIT"
] | 9 | 2020-04-04T00:19:07.000Z | 2022-02-27T02:24:12.000Z | openstates/models/tests/test_models.py | openstates/openstates-core | 5590e1fa5de7794325ca1666bac1015f0ce7b102 | [
"MIT"
] | 17 | 2020-03-31T18:19:59.000Z | 2022-01-03T15:18:48.000Z | openstates/models/tests/test_models.py | openstates/openstates-core | 5590e1fa5de7794325ca1666bac1015f0ce7b102 | [
"MIT"
] | 19 | 2020-04-10T21:32:21.000Z | 2022-03-02T20:23:21.000Z | import pytest # type: ignore
import datetime
from pydantic import ValidationError
from openstates.models.common import (
validate_fuzzy_date,
validate_ocd_jurisdiction,
validate_ocd_person,
validate_str_no_newline,
validate_url,
Link,
OtherName,
OtherIdentifier,
)
from openstates.models... | 30.022082 | 88 | 0.641168 |
f551486beaf40cb106a3d431658a394b4631732b | 203 | py | Python | src/icotools/icosoc/mod_pmodssd/mod_pmodssd.py | dm7h/fpga-event-recorder | 4e53babbbb514ee375f4b5585b1d24e5b40f8df7 | [
"0BSD"
] | null | null | null | src/icotools/icosoc/mod_pmodssd/mod_pmodssd.py | dm7h/fpga-event-recorder | 4e53babbbb514ee375f4b5585b1d24e5b40f8df7 | [
"0BSD"
] | null | null | null | src/icotools/icosoc/mod_pmodssd/mod_pmodssd.py | dm7h/fpga-event-recorder | 4e53babbbb514ee375f4b5585b1d24e5b40f8df7 | [
"0BSD"
] | null | null | null |
def generate_c_code(icosoc_h, icosoc_c, mod):
icosoc_h.append("""
static inline void icosoc_%s_set(uint8_t x)
{
*(uint32_t*)(0x20000000 + %s * 0x10000) = x;
}
""" % (mod["name"], mod["addr"]))
| 20.3 | 48 | 0.630542 |
df72a83158a4b5c6bbe449a19505acaeeb7f77bd | 3,563 | py | Python | chatsite/settings.py | Twicefan98/django-chatting-app | d77aad66f3a401384bb766dd6fb5d2246e6712a1 | [
"BSD-3-Clause"
] | null | null | null | chatsite/settings.py | Twicefan98/django-chatting-app | d77aad66f3a401384bb766dd6fb5d2246e6712a1 | [
"BSD-3-Clause"
] | 1 | 2022-02-21T15:16:03.000Z | 2022-02-21T15:16:03.000Z | chatsite/settings.py | Twicefan98/django-chatting-app | d77aad66f3a401384bb766dd6fb5d2246e6712a1 | [
"BSD-3-Clause"
] | null | null | null | """
Django settings for chatsite project.
Generated by 'django-admin startproject' using Django 3.2.10.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
from pathl... | 25.45 | 91 | 0.691271 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.