hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | 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 4 247 | max_issues_repo_name stringlengths 4 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 4 247 | max_forks_repo_name stringlengths 4 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a2687e729dc9c566324fd7fe51d1b3892834ca97 | 4,516 | py | Python | mmcls/models/backbones/binary_utils/binary_convs.py | lucifer443/BinaryNeuralNetwork | 3ceadfb67cd048fc89f4eea8cc833d9bf5f62153 | [
"Apache-2.0"
] | 13 | 2021-01-19T03:12:38.000Z | 2022-03-23T01:24:19.000Z | mmcls/models/backbones/binary_utils/binary_convs.py | lucifer443/BinaryNeuralNetwork | 3ceadfb67cd048fc89f4eea8cc833d9bf5f62153 | [
"Apache-2.0"
] | null | null | null | mmcls/models/backbones/binary_utils/binary_convs.py | lucifer443/BinaryNeuralNetwork | 3ceadfb67cd048fc89f4eea8cc833d9bf5f62153 | [
"Apache-2.0"
] | 2 | 2021-03-15T09:51:05.000Z | 2021-03-15T09:51:49.000Z | import torch.nn as nn
| 41.814815 | 186 | 0.594331 | import torch.nn as nn
import torch.nn.functional as F
from .binary_functions import IRNetSign, RANetActSign, RANetWSign
import torch
import math
class BaseBinaryConv2d(nn.Conv2d):
def __init__(self, in_channels, out_channels, kernel_size,
stride=1, padding=0, dilation=1, groups=1, bias... | 0 | 0 | 0 | 4,233 | 0 | 0 | 0 | 35 | 216 |
426b859755e66646ff39bc77e8209c786927826b | 2,846 | py | Python | rem_backend/localization.py | wishful-project/wishrem_rem_backend | 71d5874ff25fb2fedb78acea6ac2442a17fce0a0 | [
"Apache-2.0"
] | null | null | null | rem_backend/localization.py | wishful-project/wishrem_rem_backend | 71d5874ff25fb2fedb78acea6ac2442a17fce0a0 | [
"Apache-2.0"
] | null | null | null | rem_backend/localization.py | wishful-project/wishrem_rem_backend | 71d5874ff25fb2fedb78acea6ac2442a17fce0a0 | [
"Apache-2.0"
] | 1 | 2020-06-05T08:23:12.000Z | 2020-06-05T08:23:12.000Z | import math
import numpy as np
__author__ = "Valentin Rakovic"
__copyright__ = "Copyright (c) 2017, Faculty of Electrical Engineering and Information Technologies, UKIM, Skopje, Macedonia"
__version__ = "0.1.0"
__email__ = "{valentin}@feit.ukim.edu.mk"
'''
Localization Module
Used for processing of the localizatio... | 21.398496 | 125 | 0.614547 | import math
import numpy as np
__author__ = "Valentin Rakovic"
__copyright__ = "Copyright (c) 2017, Faculty of Electrical Engineering and Information Technologies, UKIM, Skopje, Macedonia"
__version__ = "0.1.0"
__email__ = "{valentin}@feit.ukim.edu.mk"
'''
Localization Module
Used for processing of the localizatio... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e8f79285676c9c79bb7909395c181600480d30c7 | 42 | py | Python | Handbook4DSAI/RL/__init__.py | tswsxk/CodeBook | 01b976418d64f5f94257ae0e2b36751afb93c105 | [
"MIT"
] | null | null | null | Handbook4DSAI/RL/__init__.py | tswsxk/CodeBook | 01b976418d64f5f94257ae0e2b36751afb93c105 | [
"MIT"
] | 1 | 2019-09-24T22:04:03.000Z | 2019-09-24T22:04:03.000Z | tests/__init__.py | tswsxk/CodeBook | 01b976418d64f5f94257ae0e2b36751afb93c105 | [
"MIT"
] | null | null | null | # coding: utf-8
# 2019/12/24 @ tongshiwei
| 14 | 25 | 0.666667 | # coding: utf-8
# 2019/12/24 @ tongshiwei
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
14584a631db1ad2ad6474d52aebc5a1f1c6e09ac | 409 | py | Python | gesund_projekt/calories/migrations/0005_rename_category_id_caloriefooddetail_category.py | asis2016/gesund-projekt | cb3828b69cd6a86deeab16943e38b6ebffd86abb | [
"MIT"
] | null | null | null | gesund_projekt/calories/migrations/0005_rename_category_id_caloriefooddetail_category.py | asis2016/gesund-projekt | cb3828b69cd6a86deeab16943e38b6ebffd86abb | [
"MIT"
] | null | null | null | gesund_projekt/calories/migrations/0005_rename_category_id_caloriefooddetail_category.py | asis2016/gesund-projekt | cb3828b69cd6a86deeab16943e38b6ebffd86abb | [
"MIT"
] | null | null | null | # Generated by Django 4.0.1 on 2022-03-24 10:15
| 21.526316 | 75 | 0.630807 | # Generated by Django 4.0.1 on 2022-03-24 10:15
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('calories', '0004_rename_category_caloriefooddetail_category_id'),
]
operations = [
migrations.RenameField(
model_name='caloriefooddetail... | 0 | 0 | 0 | 303 | 0 | 0 | 0 | 11 | 46 |
85d7f26ea7b1afc06c9fd46940e324cc88ac3102 | 4,775 | py | Python | contentai_metadata_flatten/parsers/aws_rekognition_video_labels.py | ezavesky/metadata-flatten-extractor | 5e81713424970087492b7835195235575f0024e2 | [
"Apache-2.0"
] | 5 | 2020-01-30T14:04:57.000Z | 2022-02-28T12:49:36.000Z | contentai_metadata_flatten/parsers/aws_rekognition_video_labels.py | ezavesky/metadata-flatten-extractor | 5e81713424970087492b7835195235575f0024e2 | [
"Apache-2.0"
] | 4 | 2020-01-31T02:25:23.000Z | 2020-03-11T20:22:18.000Z | contentai_metadata_flatten/parsers/aws_rekognition_video_labels.py | ezavesky/metadata-flatten-extractor | 5e81713424970087492b7835195235575f0024e2 | [
"Apache-2.0"
] | 2 | 2020-11-26T06:39:38.000Z | 2022-02-28T12:50:06.000Z | #! python
# ===============LICENSE_START=======================================================
# metadata-flatten-extractor Apache-2.0
# ===================================================================================
# Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved.
# =====================... | 51.902174 | 126 | 0.557068 | #! python
# ===============LICENSE_START=======================================================
# metadata-flatten-extractor Apache-2.0
# ===================================================================================
# Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved.
# =====================... | 0 | 181 | 0 | 3,474 | 0 | 0 | 0 | 28 | 113 |
bd646d7466e568df81db5d0801eda6809d816125 | 3,524 | py | Python | syslinkats/framework/common/argparse_helpers.py | stick152/SystemLink-Python-ATS | 82b0fac9bae22b808ba519fa4425a931ff3c77aa | [
"MIT"
] | null | null | null | syslinkats/framework/common/argparse_helpers.py | stick152/SystemLink-Python-ATS | 82b0fac9bae22b808ba519fa4425a931ff3c77aa | [
"MIT"
] | null | null | null | syslinkats/framework/common/argparse_helpers.py | stick152/SystemLink-Python-ATS | 82b0fac9bae22b808ba519fa4425a931ff3c77aa | [
"MIT"
] | null | null | null | """
argparse_helpers.py
This module holds helper functions for use with argparse.
Some of these functions can be used for the "type" property for argparse::add_arguments
calls. Simply pass the function name as such: type=<function name>.
"""
__author__ = 'sedwards'
import ast
from typing import Any, Dict, List, Opt... | 30.643478 | 97 | 0.629966 | """
argparse_helpers.py
This module holds helper functions for use with argparse.
Some of these functions can be used for the "type" property for argparse::add_arguments
calls. Simply pass the function name as such: type=<function name>.
"""
__author__ = 'sedwards'
import ast
from typing import Any, Dict, List, Opt... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f77736f94b3e48ae05ef07fee09d8d86947077bb | 409 | py | Python | blockchain/t/t2.py | lijingmt/cherryhillcoin | 46755a719b44a5537b3cf0fe604f9f86749f1c04 | [
"MIT"
] | 1 | 2018-06-05T04:29:57.000Z | 2018-06-05T04:29:57.000Z | blockchain/t/t2.py | lijingmt/cherryhillcoin | 46755a719b44a5537b3cf0fe604f9f86749f1c04 | [
"MIT"
] | null | null | null | blockchain/t/t2.py | lijingmt/cherryhillcoin | 46755a719b44a5537b3cf0fe604f9f86749f1c04 | [
"MIT"
] | null | null | null | import shelve
if __name__ == '__main__':
s = shelve.open("22901.db")
s["name"] = "www.itdiffer.com"
s["lang"] = "python"
s["pages"] = 1000
s["contents"] = {"first":"base knowledge","second":"day day up"}
s.close()
s = shelve.open("22901.db")
name = s["name"]
print (name)
contents... | 25.5625 | 68 | 0.518337 | import shelve
if __name__ == '__main__':
s = shelve.open("22901.db")
s["name"] = "www.itdiffer.com"
s["lang"] = "python"
s["pages"] = 1000
s["contents"] = {"first":"base knowledge","second":"day day up"}
s.close()
s = shelve.open("22901.db")
name = s["name"]
print (name)
contents... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
caa54a902503a87e676b9070ae2557224455edb9 | 3,827 | py | Python | algorithms/hungarian.py | radosnystudent/Graph-algorithms | af7f09dbdeb2684395a45d2e7333e7339e9ce83f | [
"MIT"
] | null | null | null | algorithms/hungarian.py | radosnystudent/Graph-algorithms | af7f09dbdeb2684395a45d2e7333e7339e9ce83f | [
"MIT"
] | null | null | null | algorithms/hungarian.py | radosnystudent/Graph-algorithms | af7f09dbdeb2684395a45d2e7333e7339e9ce83f | [
"MIT"
] | null | null | null |
if __name__ == '__main__':
files = ['files/Matching.txt','files/Matching2.txt']
matrix = list()
with open(files[0]) as file:
for line in file:
matrix.append(list(map(int,line.split())))
vertices = [i for i in range(len(matrix))]
next_x = [[] for _ in range(len(matrix))]
... | 32.991379 | 100 | 0.436112 | class Hungarian:
def __init__(self):
self.edges = list()
self.m_x = list()
self.m_y = list()
self.procedure_status = False
self.S = list()
self.T = list()
self.p = list()
def matching(self, vertices_x, next_x):
self.p = [None for _ ... | 4 | 0 | 0 | 3,277 | 0 | 0 | 0 | 0 | 23 |
c5cc75b4efd84d6919c76bf73f89e53133e99677 | 2,285 | py | Python | test_image.py | guyii54/UAV-SRGAN | 495ef87f602996ae089185880cf9e75779c14cfd | [
"MIT"
] | null | null | null | test_image.py | guyii54/UAV-SRGAN | 495ef87f602996ae089185880cf9e75779c14cfd | [
"MIT"
] | null | null | null | test_image.py | guyii54/UAV-SRGAN | 495ef87f602996ae089185880cf9e75779c14cfd | [
"MIT"
] | null | null | null | import argparse
import time
from os.path import join
import os
import torch
from PIL import Image
from torch.autograd import Variable
from torchvision.transforms import ToTensor, ToPILImage
import torchvision.utils as utils
from model import Generator
parser = argparse.ArgumentParser(description='Test Single Image')... | 38.728814 | 136 | 0.729978 | import argparse
import time
from os.path import join
import os
import torch
from PIL import Image
from torch.autograd import Variable
from torchvision.transforms import ToTensor, ToPILImage
import torchvision.utils as utils
from data_utils import display_transform
from model import Generator
parser = argparse.Argume... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 19 | 22 |
a8f0864e5ea62d94c6741f61313534f3e9ace6af | 1,128 | py | Python | experiment/overlap_entities_count.py | Zuchens/ner_poleval | 1988b3d814303ce5551a5ebc30104f5b6cc76e01 | [
"Apache-2.0"
] | 3 | 2019-11-02T21:21:03.000Z | 2019-11-02T21:21:39.000Z | experiment/overlap_entities_count.py | Zuchens/ner_poleval | 1988b3d814303ce5551a5ebc30104f5b6cc76e01 | [
"Apache-2.0"
] | 15 | 2019-12-16T21:04:38.000Z | 2022-02-10T00:07:35.000Z | experiment/overlap_entities_count.py | Zuchens/ner_poleval | 1988b3d814303ce5551a5ebc30104f5b6cc76e01 | [
"Apache-2.0"
] | null | null | null | import json
dir = "test"
counts = 0
all_counts =0
with open("POLEVAL-NER_GOLD.json") as f:
main_data = json.load(f)["questions"]
for idx, doc in enumerate(main_data):
answers = doc["answers"][0]["data"]["brat"].split("\n")
new_labels = []
ents = []
for answer in answers:
... | 35.25 | 96 | 0.421986 | import os
import json
dir = "test"
counts = 0
all_counts =0
with open("POLEVAL-NER_GOLD.json") as f:
main_data = json.load(f)["questions"]
for idx, doc in enumerate(main_data):
answers = doc["answers"][0]["data"]["brat"].split("\n")
new_labels = []
ents = []
for answer in answers... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -12 | 22 |
680b04d5957bdc7faac67e25a46aca22c8bfc5b4 | 4,321 | py | Python | ArticleSpider/ArticleSpider/pipelines.py | iahjc/spider | 72dc1e651ed2d242765e4791ec21cf94a0208126 | [
"MIT"
] | null | null | null | ArticleSpider/ArticleSpider/pipelines.py | iahjc/spider | 72dc1e651ed2d242765e4791ec21cf94a0208126 | [
"MIT"
] | null | null | null | ArticleSpider/ArticleSpider/pipelines.py | iahjc/spider | 72dc1e651ed2d242765e4791ec21cf94a0208126 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
import pymysql
pymysql.install_as_MySQLdb()
import MySQLdb
| 30.64539 | 121 | 0.63365 | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
import codecs
import json
from scrapy.pipelines.images import ImagesPipeline
from scrapy.exporters import JsonItemExporter
from... | 348 | 467 | 0 | 3,026 | 0 | 0 | 0 | 71 | 383 |
49db08ee9aa6ece5fb3ce98d190153a4c6042269 | 1,344 | py | Python | settings/config_default.py | yattdev/Jady | 77c74fa4c5cf87cea92334eba1be24d93cbd2eea | [
"MIT"
] | null | null | null | settings/config_default.py | yattdev/Jady | 77c74fa4c5cf87cea92334eba1be24d93cbd2eea | [
"MIT"
] | null | null | null | settings/config_default.py | yattdev/Jady | 77c74fa4c5cf87cea92334eba1be24d93cbd2eea | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" DocString: Load configuration from .yaml file."""
from os import path
import confuse
# get path of the projet !
BASE_DIR = path.dirname(path.dirname(path.abspath(__file__)))
# BASE_DIR = '/home/alassane/Code/JimBot/chatbotapp'
# Load config.yaml
config = confuse.C... | 34.461538 | 82 | 0.730655 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" DocString: Load configuration from .yaml file."""
from pathlib import Path
from os import path
import confuse
# get path of the projet !
BASE_DIR = path.dirname(path.dirname(path.abspath(__file__)))
# BASE_DIR = '/home/alassane/Code/JimBot/chatbotapp'
# Load conf... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 | 23 |
fd6c54ab778e38dc16c6563ba5877f3b76b1ce7e | 2,287 | py | Python | tekinstr/common.py | l-johnston/tekinstr | 92d42004bc8ebc63196f8d75590090615f5301c6 | [
"MIT"
] | 1 | 2021-03-06T13:03:19.000Z | 2021-03-06T13:03:19.000Z | tekinstr/common.py | l-johnston/tekinstr | 92d42004bc8ebc63196f8d75590090615f5301c6 | [
"MIT"
] | null | null | null | tekinstr/common.py | l-johnston/tekinstr | 92d42004bc8ebc63196f8d75590090615f5301c6 | [
"MIT"
] | null | null | null | """Common definitions"""
from collections import namedtuple
IDN = namedtuple("IDN", ["manufacturer", "model", "serial_number", "firmware_version"])
def validate(func):
"""Read the Command Error bit (CME) of the Standard Event Status Register (SESR)"""
return wrapper
| 31.328767 | 87 | 0.606471 | """Common definitions"""
from collections import namedtuple
import functools
IDN = namedtuple("IDN", ["manufacturer", "model", "serial_number", "firmware_version"])
def _get_idn(visa):
idn = visa.query("*IDN?").strip(":\n").split(",")
manufacturer = idn[0]
model = idn[1].replace(" ", "")
serial_numbe... | 0 | 583 | 0 | 982 | 0 | 327 | 0 | -5 | 118 |
0b08d44668091dedcf71bef9c319a841209e393c | 526 | py | Python | psyrun/utils/doc.py | jgosmann/psyrun | 42f58223f864005c9ba427fcc0ccf44bd94df1e8 | [
"MIT"
] | 2 | 2017-07-03T20:03:08.000Z | 2018-04-19T20:36:17.000Z | psyrun/utils/doc.py | jgosmann/psyrun | 42f58223f864005c9ba427fcc0ccf44bd94df1e8 | [
"MIT"
] | 67 | 2015-02-19T02:11:14.000Z | 2018-04-20T15:51:57.000Z | psyrun/utils/doc.py | jgosmann/psyrun | 42f58223f864005c9ba427fcc0ccf44bd94df1e8 | [
"MIT"
] | 1 | 2015-11-13T16:54:16.000Z | 2015-11-13T16:54:16.000Z | """Documentation utilities."""
def inherit_docs(cls):
"""Class decorator that makes it inherit function doc strings."""
for name in dir(cls):
member = getattr(cls, name)
if member.__doc__ is not None:
continue
for parent in cls.mro()[1:]:
if hasattr(parent, nam... | 27.684211 | 71 | 0.558935 | """Documentation utilities."""
def inherit_docs(cls):
"""Class decorator that makes it inherit function doc strings."""
for name in dir(cls):
member = getattr(cls, name)
if member.__doc__ is not None:
continue
for parent in cls.mro()[1:]:
if hasattr(parent, nam... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
604b232a73bd6a72bf227df8ef5684bd59a869a5 | 1,267 | py | Python | core/recc/argparse/parser/cfg_parse.py | bogonets/answer | 57f892a9841980bcbc35fa1e27521b34cd94bc25 | [
"MIT"
] | 3 | 2021-06-20T02:24:10.000Z | 2022-01-26T23:55:33.000Z | core/recc/argparse/parser/cfg_parse.py | bogonets/answer | 57f892a9841980bcbc35fa1e27521b34cd94bc25 | [
"MIT"
] | null | null | null | core/recc/argparse/parser/cfg_parse.py | bogonets/answer | 57f892a9841980bcbc35fa1e27521b34cd94bc25 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
| 28.155556 | 84 | 0.705604 | # -*- coding: utf-8 -*-
from configparser import ConfigParser # [WARNING] Don't use any other `cfg` driver.
from typing import Optional, Dict, Any
from argparse import Namespace
from recc.argparse.parser.dict_parse import get_namespace_by_dict
def config_parser_to_dict(parser: ConfigParser) -> Dict[str, Dict[str, A... | 0 | 0 | 0 | 0 | 0 | 925 | 0 | 86 | 228 |
72c0aa3f663b05c530e3ebb4ca9fc11535b4a56f | 758 | py | Python | scheduler.py | Kaicheng-Yang0828/Vit-ImageClassification | ede55d39f36b890b78754582bc221bc4f8a9cfc1 | [
"MIT"
] | 2 | 2022-01-25T09:03:32.000Z | 2022-01-25T09:05:24.000Z | scheduler.py | Kaicheng-Yang0828/Vit-ImageClassification | ede55d39f36b890b78754582bc221bc4f8a9cfc1 | [
"MIT"
] | 1 | 2022-02-16T21:47:19.000Z | 2022-03-30T08:40:32.000Z | scheduler.py | Kaicheng-Yang0828/Vision-Transformer-ViT | ede55d39f36b890b78754582bc221bc4f8a9cfc1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# @File : scheduler.py
# @Author : Kaicheng Yang
# @Time : 2022/01/26 11:04:07 | 32.956522 | 61 | 0.634565 | # -*- coding: utf-8 -*-
# @File : scheduler.py
# @Author : Kaicheng Yang
# @Time : 2022/01/26 11:04:07
import numpy as np
def assign_learning_rate(optimizer, new_lr):
for param_group in optimizer.param_groups:
param_group["lr"] = new_lr
def _warmup_lr(base_lr, warmup_length, step):
return base_lr * (st... | 0 | 0 | 0 | 0 | 0 | 569 | 0 | -3 | 90 |
419a01d6135e75ee6e18a4c23ac48aa937b37f98 | 655 | py | Python | setup.py | pmachek/barcode | 2be24c34992fb3d7ae853d286eef19bc64b7fc80 | [
"MIT"
] | 1 | 2020-02-23T15:16:08.000Z | 2020-02-23T15:16:08.000Z | setup.py | pmachek/barcode | 2be24c34992fb3d7ae853d286eef19bc64b7fc80 | [
"MIT"
] | null | null | null | setup.py | pmachek/barcode | 2be24c34992fb3d7ae853d286eef19bc64b7fc80 | [
"MIT"
] | null | null | null | import setuptools
with open("README.md", "r") as readme_file:
readme = readme_file.read()
setuptools.setup(
name="stripes-and-squares",
version="0.0.1-rc1",
author="Petr Machek",
description="Barcode generator with no dependencies",
long_description=readme,
long_description_content_type="... | 27.291667 | 57 | 0.654962 | import setuptools
with open("README.md", "r") as readme_file:
readme = readme_file.read()
setuptools.setup(
name="stripes-and-squares",
version="0.0.1-rc1",
author="Petr Machek",
description="Barcode generator with no dependencies",
long_description=readme,
long_description_content_type="... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
00f1f0b9f691570d9aa7b63fe6b8f25bcb8cdbf3 | 1,079 | py | Python | lib/script_utils.py | TimH96/proxer-dl-tools | 6ceb5b47b37cdf1ae5d9d38120194c56f629e770 | [
"MIT"
] | 1 | 2021-07-07T12:16:30.000Z | 2021-07-07T12:16:30.000Z | lib/script_utils.py | TimH96/proxer-dl-tools | 6ceb5b47b37cdf1ae5d9d38120194c56f629e770 | [
"MIT"
] | null | null | null | lib/script_utils.py | TimH96/proxer-dl-tools | 6ceb5b47b37cdf1ae5d9d38120194c56f629e770 | [
"MIT"
] | null | null | null | """
lib/script_utils.py
lib for utility functions for cl script execution
"""
from sys import exit
def script_exit(reason: str) -> None:
"""Wrapper for script exit on error"""
print(f'exit with error: {reason}')
exit()
def check_validity_token(token: str) -> list:
"""Processes token input ... | 27.666667 | 76 | 0.620945 | """
lib/script_utils.py
lib for utility functions for cl script execution
"""
from sys import exit
def script_exit(reason: str) -> None:
"""Wrapper for script exit on error"""
print(f'exit with error: {reason}')
exit()
def check_validity_token(token: str) -> list:
"""Processes token input ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8b8581853f08627ed928bbb4426f60136dc53d6f | 1,699 | py | Python | src/tiden/apps/appfactory.py | mshonichev/example_pkg | 556a703fe8ea4a7737b8cae9c5d4d19c1397a70b | [
"Apache-2.0"
] | 14 | 2020-06-05T09:30:42.000Z | 2022-01-19T00:26:48.000Z | src/tiden/apps/appfactory.py | mshonichev/example_pkg | 556a703fe8ea4a7737b8cae9c5d4d19c1397a70b | [
"Apache-2.0"
] | 6 | 2020-06-09T14:05:21.000Z | 2021-03-18T13:55:15.000Z | src/tiden/apps/appfactory.py | mshonichev/example_pkg | 556a703fe8ea4a7737b8cae9c5d4d19c1397a70b | [
"Apache-2.0"
] | 1 | 2020-06-09T13:53:15.000Z | 2020-06-09T13:53:15.000Z | #!/usr/bin/env python3
#
# Copyright 2017-2020 GridGain Systems.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 39.511628 | 114 | 0.708064 | #!/usr/bin/env python3
#
# Copyright 2017-2020 GridGain Systems.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 0 | 922 | 0 | 0 | 0 | 0 | 0 | 56 | 112 |
5d2932131385b32c6c54616f2af63d8a7059cd97 | 2,032 | py | Python | tools/others/genfn.py | sanyaade-teachings/oxygine-framework_back | 6bbc9ba40e2bfb6c27c2ac008a434244c57b6df6 | [
"MIT"
] | null | null | null | tools/others/genfn.py | sanyaade-teachings/oxygine-framework_back | 6bbc9ba40e2bfb6c27c2ac008a434244c57b6df6 | [
"MIT"
] | null | null | null | tools/others/genfn.py | sanyaade-teachings/oxygine-framework_back | 6bbc9ba40e2bfb6c27c2ac008a434244c57b6df6 | [
"MIT"
] | null | null | null | import cStringIO
lines = open("../../../SDL/include/SDL_opengl.h").readlines()
funcs = ["glUseProgram",
"glVertexAttribPointer",
"glActiveTexture",
"glEnableVertexAttribArray",
"glDisableVertexAttribArray",
"glDeleteProgram",
"glGetShaderiv",
"glGetS... | 22.831461 | 80 | 0.533957 | import cStringIO
lines = open("../../../SDL/include/SDL_opengl.h").readlines()
funcs = ["glUseProgram",
"glVertexAttribPointer",
"glActiveTexture",
"glEnableVertexAttribArray",
"glDisableVertexAttribArray",
"glDeleteProgram",
"glGetShaderiv",
"glGetS... | 0 | 0 | 0 | 0 | 0 | 878 | 0 | 0 | 23 |
75e66994ac462ccb0158bdead31a2030e04785b3 | 2,129 | py | Python | Examples/ApiExamples/ex_digital_signature_collection.py | alex-dudin/Aspose.Words-for-Python-via-.NET | 02b257df8da9892fcce671c473c2ef27b68b5087 | [
"MIT"
] | 3 | 2021-12-04T22:17:28.000Z | 2022-02-22T03:30:01.000Z | Examples/ApiExamples/ex_digital_signature_collection.py | alex-dudin/Aspose.Words-for-Python-via-.NET | 02b257df8da9892fcce671c473c2ef27b68b5087 | [
"MIT"
] | 4 | 2021-11-26T10:01:06.000Z | 2021-12-14T15:01:11.000Z | Examples/ApiExamples/ex_digital_signature_collection.py | alex-dudin/Aspose.Words-for-Python-via-.NET | 02b257df8da9892fcce671c473c2ef27b68b5087 | [
"MIT"
] | 2 | 2021-10-20T18:06:22.000Z | 2021-10-29T20:59:18.000Z | # Copyright (c) 2001-2022 Aspose Pty Ltd. All Rights Reserved.
#
# This file is part of Aspose.Words. The source code in this file
# is only intended as a supplement to the documentation, and is provided
# "as is", without warranty of any kind, either expressed or implied.
| 42.58 | 146 | 0.689526 | # Copyright (c) 2001-2022 Aspose Pty Ltd. All Rights Reserved.
#
# This file is part of Aspose.Words. The source code in this file
# is only intended as a supplement to the documentation, and is provided
# "as is", without warranty of any kind, either expressed or implied.
import aspose.words as aw
from api_example_b... | 0 | 0 | 0 | 1,752 | 0 | 0 | 0 | 34 | 69 |
0fbda78303ff8b27eb8eaa358796fd58f30039f0 | 5,082 | py | Python | TweakApi/models/__init__.py | tweak-com-public/tweak-api-client-python | 019f86da11fdb12683d516f8f37db5d717380bcc | [
"Apache-2.0"
] | null | null | null | TweakApi/models/__init__.py | tweak-com-public/tweak-api-client-python | 019f86da11fdb12683d516f8f37db5d717380bcc | [
"Apache-2.0"
] | null | null | null | TweakApi/models/__init__.py | tweak-com-public/tweak-api-client-python | 019f86da11fdb12683d516f8f37db5d717380bcc | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
tweak-api
Tweak API to integrate with all the Tweak services. You can find out more about Tweak at <a href='https://www.tweak.com'>https://www.tweak.com</a>, #tweak.
OpenAPI spec version: 1.0.8-beta.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
... | 43.810345 | 165 | 0.860685 | # coding: utf-8
"""
tweak-api
Tweak API to integrate with all the Tweak services. You can find out more about Tweak at <a href='https://www.tweak.com'>https://www.tweak.com</a>, #tweak.
OpenAPI spec version: 1.0.8-beta.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,189 | 1,936 |
27ec9ea8554b038c7d6ac555c28a7996ae92dec9 | 93 | py | Python | setup/settings_jqueryui.py | sayanjap/DynamicForms | 071707de36d109fe3a17ae5df239240ea5ba707f | [
"BSD-3-Clause"
] | 42 | 2018-01-18T14:50:05.000Z | 2022-03-24T18:34:19.000Z | setup/settings_jqueryui.py | sayanjap/DynamicForms | 071707de36d109fe3a17ae5df239240ea5ba707f | [
"BSD-3-Clause"
] | 14 | 2018-12-05T21:39:23.000Z | 2022-02-27T06:43:48.000Z | setup/settings_jqueryui.py | sayanjap/DynamicForms | 071707de36d109fe3a17ae5df239240ea5ba707f | [
"BSD-3-Clause"
] | 5 | 2018-01-18T16:32:20.000Z | 2021-06-07T10:15:18.000Z |
DYNAMICFORMS.update({
'template': 'dynamicforms/jquery_ui/',
})
| 15.5 | 42 | 0.698925 | from .settings import *
DYNAMICFORMS.update({
'template': 'dynamicforms/jquery_ui/',
})
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 22 |
3eabf56ecceb7d52909f079836ef7985df5292e6 | 1,460 | py | Python | django_stormpath/management/commands/create_social_directory.py | stormpath/stormpath-django | af60eb5da2115d94ac313613c5d4e6b9f3d16157 | [
"Apache-2.0"
] | 36 | 2015-01-13T00:21:07.000Z | 2017-11-07T11:45:25.000Z | django_stormpath/management/commands/create_social_directory.py | stormpath/stormpath-django | af60eb5da2115d94ac313613c5d4e6b9f3d16157 | [
"Apache-2.0"
] | 55 | 2015-01-07T09:53:50.000Z | 2017-02-07T00:31:20.000Z | django_stormpath/management/commands/create_social_directory.py | stormpath/stormpath-django | af60eb5da2115d94ac313613c5d4e6b9f3d16157 | [
"Apache-2.0"
] | 24 | 2015-01-06T16:17:33.000Z | 2017-04-21T14:00:16.000Z |
try:
input = raw_input
except NameError:
pass
| 29.2 | 119 | 0.641096 | import sys
from django.core.management.base import BaseCommand
try:
input = raw_input
except NameError:
pass
from stormpath.error import Error as StormpathError
from stormpath.resources.provider import Provider
from django_stormpath import social
class Command(BaseCommand):
help = 'Creates a Directory... | 0 | 0 | 0 | 1,176 | 0 | 0 | 0 | 91 | 136 |
5049a90f19df0d67fe41e46688df041718c9387c | 5,351 | py | Python | conference/schedule/models.py | djangocon/2017.djangocon.eu | d811a9cd5b24f48f6e224d0dd4abe9173f7f97d7 | [
"BSD-3-Clause"
] | 7 | 2016-11-21T12:53:37.000Z | 2020-03-30T23:22:48.000Z | conference/schedule/models.py | djangocon/2017.djangocon.eu | d811a9cd5b24f48f6e224d0dd4abe9173f7f97d7 | [
"BSD-3-Clause"
] | 17 | 2016-11-17T19:25:48.000Z | 2017-04-06T08:43:46.000Z | conference/schedule/models.py | FuzzyBrains/DjangoConEurope2017 | d811a9cd5b24f48f6e224d0dd4abe9173f7f97d7 | [
"BSD-3-Clause"
] | 7 | 2016-11-05T11:18:40.000Z | 2016-11-09T17:14:52.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
| 33.236025 | 113 | 0.649038 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import datetime as dt
from autoslug import AutoSlugField
from autoslug.utils import slugify
from django.core.exceptions import ValidationError
from django.db import models
from django.template.defaultfilters import trunca... | 0 | 1,707 | 0 | 3,044 | 0 | 0 | 0 | 234 | 268 |
dbd56c4445315d86e4854f2f4eab79374778f361 | 1,331 | py | Python | comments/forms.py | MinXiaoBo/django_blog | 3ce199a8144dda417b20595bf210ccfe42c0ff4e | [
"MIT"
] | 1 | 2019-09-25T07:58:45.000Z | 2019-09-25T07:58:45.000Z | comments/forms.py | MinXiaoBo/django_blog | 3ce199a8144dda417b20595bf210ccfe42c0ff4e | [
"MIT"
] | null | null | null | comments/forms.py | MinXiaoBo/django_blog | 3ce199a8144dda417b20595bf210ccfe42c0ff4e | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# encoding: utf-8
| 25.596154 | 84 | 0.499624 | #!/usr/bin/env python
# encoding: utf-8
from .models import Comment
from django import forms
from django.forms import ModelForm
from django.contrib.auth.models import User
from django.contrib.auth import get_user_model
class CommentForm(ModelForm):
url = forms.URLField(
label='网址',
required=False... | 72 | 0 | 0 | 1,064 | 0 | 0 | 0 | 69 | 134 |
f7c50d1fc8e413db30c3f8776c6f4c101dfd8964 | 1,718 | py | Python | setup.py | SofienM/py-gitguardian | f1379eafb5d73e90c6a4ee213a08b14c1b567062 | [
"MIT"
] | null | null | null | setup.py | SofienM/py-gitguardian | f1379eafb5d73e90c6a4ee213a08b14c1b567062 | [
"MIT"
] | null | null | null | setup.py | SofienM/py-gitguardian | f1379eafb5d73e90c6a4ee213a08b14c1b567062 | [
"MIT"
] | null | null | null | import io
import os
import re
from setuptools import find_packages, setup
VERSION_RE = re.compile(r"__version__\s*=\s*\"(.*?)\"")
HERE = os.path.abspath(os.path.dirname(__file__))
def read(*args):
"""Reads complete file contents."""
return io.open(os.path.join(HERE, *args), encoding="utf-8").read()
def g... | 31.814815 | 97 | 0.657159 | import io
import os
import re
from setuptools import find_packages, setup
VERSION_RE = re.compile(r"__version__\s*=\s*\"(.*?)\"")
HERE = os.path.abspath(os.path.dirname(__file__))
def read(*args):
"""Reads complete file contents."""
return io.open(os.path.join(HERE, *args), encoding="utf-8").read()
def g... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
eebbddfa426e80782d085b44deb10238b5221f1e | 2,796 | py | Python | dsutil/general.py | tabbartley/python-ds-util | 4bb8a5f387f5b064e9cb9b0566069adc0db63796 | [
"MIT"
] | 4 | 2019-02-23T18:09:04.000Z | 2020-02-26T22:45:49.000Z | dsutil/general.py | tabbartley/python-ds-util | 4bb8a5f387f5b064e9cb9b0566069adc0db63796 | [
"MIT"
] | 7 | 2019-03-16T20:58:37.000Z | 2021-06-30T01:08:00.000Z | dsutil/general.py | tabbartley/python-ds-util | 4bb8a5f387f5b064e9cb9b0566069adc0db63796 | [
"MIT"
] | 3 | 2019-03-17T17:24:26.000Z | 2019-08-20T12:08:38.000Z | # -*- coding: utf-8 -*-
| 33.686747 | 114 | 0.614807 | # -*- coding: utf-8 -*-
import pandas as pd
from sklearn.base import BaseEstimator, TransformerMixin
class ToDenseTransformer(BaseEstimator,TransformerMixin):
# here you define the operation it should perform
def transform(self, X, y=None, **fit_params):
return X.todense()
# just return self
... | 0 | 0 | 0 | 2,624 | 0 | 0 | 0 | 33 | 114 |
07521eba62d18592f9425a4cbad3085445a07129 | 1,718 | py | Python | qrcodes.py | singhsidhukuldeep/QR-Code-decryption-with-tensorflow | ec7236454bb6a3e65d31291e5c4f01a71dbe336e | [
"MIT"
] | 2 | 2020-03-29T09:56:52.000Z | 2020-04-18T05:10:07.000Z | qrcodes.py | singhsidhukuldeep/QR-Code-decryption-with-tensorflow | ec7236454bb6a3e65d31291e5c4f01a71dbe336e | [
"MIT"
] | null | null | null | qrcodes.py | singhsidhukuldeep/QR-Code-decryption-with-tensorflow | ec7236454bb6a3e65d31291e5c4f01a71dbe336e | [
"MIT"
] | 1 | 2020-04-18T05:10:08.000Z | 2020-04-18T05:10:08.000Z | import multiprocessing
import qrcode
import random
import string
import numpy as np
IMAGE_SIZE = 21
STRING_LENGTH = 10
CHARACTER_SET = string.ascii_lowercase + string.ascii_uppercase + \
string.digits
def randomString():
"""
Return a random string where characters are drawn from a fixed
set of chara... | 24.197183 | 80 | 0.665891 | import multiprocessing
import qrcode
import random
import string
import numpy as np
IMAGE_SIZE = 21
STRING_LENGTH = 10
CHARACTER_SET = string.ascii_lowercase + string.ascii_uppercase + \
string.digits
def randomString():
"""
Return a random string where characters are drawn from a fixed
set of chara... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c057e1f2ebf696ab14bda72cfb9ab7648f2a8c67 | 1,754 | py | Python | Dependencies/gyp-master/test/win/win-tool/gyptest-win-tool-handles-readonly-files.py | knight666/exlibris | b21b46e0c84e5c4f81f8048022cda88e7bb3dca2 | [
"MIT"
] | null | null | null | Dependencies/gyp-master/test/win/win-tool/gyptest-win-tool-handles-readonly-files.py | knight666/exlibris | b21b46e0c84e5c4f81f8048022cda88e7bb3dca2 | [
"MIT"
] | null | null | null | Dependencies/gyp-master/test/win/win-tool/gyptest-win-tool-handles-readonly-files.py | knight666/exlibris | b21b46e0c84e5c4f81f8048022cda88e7bb3dca2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2014 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Make sure overwriting read-only files works as expected (via win-tool).
"""
import TestGyp
import filecmp
import os
impo... | 31.321429 | 81 | 0.684151 | #!/usr/bin/env python
# Copyright (c) 2014 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Make sure overwriting read-only files works as expected (via win-tool).
"""
import TestGyp
import filecmp
import os
impo... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b8062a9d8a66a2f4afef8b6b392b2dbc4a92eeee | 4,521 | py | Python | sys-metrics-using-psutil.py | PSJoshi/python_scripts | 740b502e24b44648ff530f0ff9428f5a460fd645 | [
"Apache-2.0"
] | null | null | null | sys-metrics-using-psutil.py | PSJoshi/python_scripts | 740b502e24b44648ff530f0ff9428f5a460fd645 | [
"Apache-2.0"
] | null | null | null | sys-metrics-using-psutil.py | PSJoshi/python_scripts | 740b502e24b44648ff530f0ff9428f5a460fd645 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import psutil
import netifaces
import sys
import logging
import subprocess
# Add various metrics from this code - https://gitlab.ncl.ac.uk/cs-support-group/lcd-monitor-panel/blob/master/data.py
# logging
logging.basicConfig(stream=sys.stdout, level=logging.ERROR)
logger = logging.getLogger(__nam... | 36.459677 | 125 | 0.764211 | #!/usr/bin/env python
import psutil
import netifaces
import sys
import logging
import subprocess
# Add various metrics from this code - https://gitlab.ncl.ac.uk/cs-support-group/lcd-monitor-panel/blob/master/data.py
# logging
logging.basicConfig(stream=sys.stdout, level=logging.ERROR)
logger = logging.getLogger(__nam... | 0 | 0 | 0 | 0 | 0 | 3,186 | 0 | 0 | 138 |
286ce0a7d072d9fe57d2a2641ce59bb2b52419d1 | 1,094 | py | Python | files/default/ec2_dev_2_volid.py | Canufindme/cfncluster-cookbook | 677413dcdd2de792912b6e29391598776d8f2f49 | [
"Apache-2.0"
] | null | null | null | files/default/ec2_dev_2_volid.py | Canufindme/cfncluster-cookbook | 677413dcdd2de792912b6e29391598776d8f2f49 | [
"Apache-2.0"
] | null | null | null | files/default/ec2_dev_2_volid.py | Canufindme/cfncluster-cookbook | 677413dcdd2de792912b6e29391598776d8f2f49 | [
"Apache-2.0"
] | 1 | 2022-01-26T20:12:53.000Z | 2022-01-26T20:12:53.000Z | #!/usr/bin/env python
import boto.ec2
import urllib2
import sys
import os
# Get dev
try:
dev = str(sys.argv[1])
except IndexError:
print "Provide block device i.e. xvdf"
sys.exit(1)
# Convert dev to mapping format
if 'nvme' in dev:
# For newer instances which expose EBS volumes as NVMe devices, translate the... | 24.863636 | 108 | 0.720293 | #!/usr/bin/env python
import boto.ec2
import urllib2
import sys
import os
# Get dev
try:
dev = str(sys.argv[1])
except IndexError:
print "Provide block device i.e. xvdf"
sys.exit(1)
# Convert dev to mapping format
if 'nvme' in dev:
# For newer instances which expose EBS volumes as NVMe devices, translate the... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
04ff2a56f55835cd6913620c27ad17f5ba44e320 | 1,635 | py | Python | sonia_flexbe_states/src/sonia_flexbe_states/create_absolute_depth.py | sonia-auv/sonia-behaviors | 28519551f954616e83b474e6cab6ba3762d238f2 | [
"BSD-3-Clause"
] | null | null | null | sonia_flexbe_states/src/sonia_flexbe_states/create_absolute_depth.py | sonia-auv/sonia-behaviors | 28519551f954616e83b474e6cab6ba3762d238f2 | [
"BSD-3-Clause"
] | 1 | 2022-02-16T01:31:51.000Z | 2022-02-21T22:30:46.000Z | sonia_flexbe_states/src/sonia_flexbe_states/create_absolute_depth.py | sonia-auv/sonia-behaviors | 28519551f954616e83b474e6cab6ba3762d238f2 | [
"BSD-3-Clause"
] | 1 | 2021-11-09T13:34:43.000Z | 2021-11-09T13:34:43.000Z | #!/usr/bin/env python
#-*- coding: utf-8 -*- | 30.849057 | 121 | 0.614067 | #!/usr/bin/env python
#-*- coding: utf-8 -*-
import rospy
from flexbe_core import EventState, Logger
from sonia_common.msg import AddPose
from geometry_msgs.msg import Point, Vector3
from nav_msgs.msg import Odometry
class create_absolute_depth(EventState):
'''
(!!!! DEPRECATED !!!!!) Move the submarine... | 0 | 0 | 0 | 1,393 | 0 | 0 | 0 | 62 | 135 |
6b2a2281c2e648681fbebdd1ad30f57c99980b32 | 746 | py | Python | Bot_Saves_Princess.py | Aditya148/Hackerrank-Artificial-Intelligence | 5abbe561115b75cb28397661b7b0d7d53486ffee | [
"MIT"
] | null | null | null | Bot_Saves_Princess.py | Aditya148/Hackerrank-Artificial-Intelligence | 5abbe561115b75cb28397661b7b0d7d53486ffee | [
"MIT"
] | null | null | null | Bot_Saves_Princess.py | Aditya148/Hackerrank-Artificial-Intelligence | 5abbe561115b75cb28397661b7b0d7d53486ffee | [
"MIT"
] | null | null | null | n = int(input())
matrix = []
for i in range(n):
a = input().strip()
matrix.append(a)
if 'm' in a:
m_r = i
m_c = a.index('m')
if 'p' in a:
p_r = i
p_c = a.index('p')
r_diff = m_r - p_r
c_diff = m_c - p_c
while True:
if r_diff != 0:
if r_diff<0:
... | 14.346154 | 35 | 0.406166 | n = int(input())
matrix = []
for i in range(n):
a = input().strip()
matrix.append(a)
if 'm' in a:
m_r = i
m_c = a.index('m')
if 'p' in a:
p_r = i
p_c = a.index('p')
r_diff = m_r - p_r
c_diff = m_c - p_c
while True:
if r_diff != 0:
if r_diff<0:
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
cbaa48c7037c0c6e9418858d7adfd9278944b1a3 | 32,685 | py | Python | tests/test_relations.py | relaxdiego/charms.reactive | e37e781432e77c12b63d2c739bd6cd70d3230c3a | [
"Apache-2.0"
] | null | null | null | tests/test_relations.py | relaxdiego/charms.reactive | e37e781432e77c12b63d2c739bd6cd70d3230c3a | [
"Apache-2.0"
] | null | null | null | tests/test_relations.py | relaxdiego/charms.reactive | e37e781432e77c12b63d2c739bd6cd70d3230c3a | [
"Apache-2.0"
] | null | null | null | # Copyright 2014-2017 Canonical Limited.
#
# This file is part of charms.reactive.
#
# charms.reactive is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3 as
# published by the Free Software Foundation.
#
# charm-helpers is distributed in the h... | 43.813673 | 115 | 0.623069 | # Copyright 2014-2017 Canonical Limited.
#
# This file is part of charms.reactive.
#
# charms.reactive is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3 as
# published by the Free Software Foundation.
#
# charm-helpers is distributed in the h... | 0 | 22,692 | 0 | 8,978 | 0 | 0 | 0 | -16 | 343 |
648fc4fbe8f331546ba71eb9b858ffcc2def9fb4 | 1,601 | py | Python | s3contents/chunks.py | pisontechnology/s3contents | 11aebbe2d7945e5ca3dacf4b72ee10455a3700cb | [
"Apache-2.0"
] | 2 | 2021-02-19T01:43:46.000Z | 2021-04-19T19:03:20.000Z | s3contents/chunks.py | pisontechnology/s3contents | 11aebbe2d7945e5ca3dacf4b72ee10455a3700cb | [
"Apache-2.0"
] | null | null | null | s3contents/chunks.py | pisontechnology/s3contents | 11aebbe2d7945e5ca3dacf4b72ee10455a3700cb | [
"Apache-2.0"
] | 3 | 2021-01-13T21:09:39.000Z | 2022-03-17T05:26:56.000Z | """
Utilities for managing chunked file uploads.
See https://jupyter-notebook.readthedocs.io/en/stable/extending/contents.html#chunked-saving
"""
import base64
import contextvars
import time
# Used as a "registry" for uploads.
content_chunks = contextvars.ContextVar("jupyterlab_content_chunks", default={})
def sto... | 26.683333 | 92 | 0.697689 | """
Utilities for managing chunked file uploads.
See https://jupyter-notebook.readthedocs.io/en/stable/extending/contents.html#chunked-saving
"""
import base64
import contextvars
import time
# Used as a "registry" for uploads.
content_chunks = contextvars.ContextVar("jupyterlab_content_chunks", default={})
def sto... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f5f8ebf3085032f3cde6b3f0f4d029a233ca6c53 | 8,092 | py | Python | ultracart/models/email_commseq_webhook_send_test_request.py | UltraCart/rest_api_v2_sdk_python | d734ea13fabc7a57872ff68bac06861edb8fd882 | [
"Apache-2.0"
] | 1 | 2018-03-15T16:56:23.000Z | 2018-03-15T16:56:23.000Z | ultracart/models/email_commseq_webhook_send_test_request.py | UltraCart/rest_api_v2_sdk_python | d734ea13fabc7a57872ff68bac06861edb8fd882 | [
"Apache-2.0"
] | null | null | null | ultracart/models/email_commseq_webhook_send_test_request.py | UltraCart/rest_api_v2_sdk_python | d734ea13fabc7a57872ff68bac06861edb8fd882 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
UltraCart Rest API V2
UltraCart REST API Version 2 # noqa: E501
OpenAPI spec version: 2.0.0
Contact: support@ultracart.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
| 29.75 | 160 | 0.62259 | # coding: utf-8
"""
UltraCart Rest API V2
UltraCart REST API Version 2 # noqa: E501
OpenAPI spec version: 2.0.0
Contact: support@ultracart.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class EmailCommseqWebhookSendT... | 0 | 3,847 | 0 | 3,933 | 0 | 0 | 0 | -31 | 105 |
5bcb05c60361341b7b761f5f7dd88766c76c2fa0 | 5,520 | py | Python | experiments/testing_env/process_result.py | michalnand/reinforcement_learning_experiments | 105bcfacd30cfbd1bbd9893859fc7d203e0df1e9 | [
"MIT"
] | null | null | null | experiments/testing_env/process_result.py | michalnand/reinforcement_learning_experiments | 105bcfacd30cfbd1bbd9893859fc7d203e0df1e9 | [
"MIT"
] | null | null | null | experiments/testing_env/process_result.py | michalnand/reinforcement_learning_experiments | 105bcfacd30cfbd1bbd9893859fc7d203e0df1e9 | [
"MIT"
] | null | null | null | import RLAgents
import matplotlib.pyplot as plt
raw_score_col = 3
norm_score_col = 4
result_path = "./results/"
files = []
files.append("./models/ppo_baseline/run_0/result/result.log")
files.append("./models/ppo_baseline/run_1/result/result.log")
files.append("./models/ppo_baseline/run_2/result/result.log")
files... | 41.503759 | 125 | 0.766123 | import RLAgents
import numpy
import matplotlib.pyplot as plt
raw_score_col = 3
norm_score_col = 4
result_path = "./results/"
files = []
files.append("./models/ppo_baseline/run_0/result/result.log")
files.append("./models/ppo_baseline/run_1/result/result.log")
files.append("./models/ppo_baseline/run_2/result/resul... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -9 | 22 |
9d484cdc3161d834ec06a2eb4451c025ee3c7cf8 | 313 | py | Python | COTLR/bots/testbot.py | Destructible-Watermelon/COTLR | 241fb850ce127ea54e0beaf8ec83e25be863645d | [
"MIT"
] | null | null | null | COTLR/bots/testbot.py | Destructible-Watermelon/COTLR | 241fb850ce127ea54e0beaf8ec83e25be863645d | [
"MIT"
] | null | null | null | COTLR/bots/testbot.py | Destructible-Watermelon/COTLR | 241fb850ce127ea54e0beaf8ec83e25be863645d | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
| 19.5625 | 30 | 0.578275 | #!/usr/bin/env python3
import player
class Bam(player.Player):
name = "DropDead"
def __init__(self):
self.health = 3
self.gun_loaded = True
self.carrying = False
self.turn = 0
def play(self, scores):
return "derp"
def inform(self, message):
pass
| 0 | 0 | 0 | 253 | 0 | 0 | 0 | -8 | 44 |
7233481f8ec7679b8e29b77a5465fe46b86344a5 | 1,411 | py | Python | supports/pyload/src/pyload/plugins/downloaders/UpfileVn.py | LuckyNicky/pycrawler | 4b3fe2f6e8e51f236d95a64a89a44199e4e97743 | [
"Apache-2.0"
] | 1 | 2020-04-02T17:03:39.000Z | 2020-04-02T17:03:39.000Z | supports/pyload/src/pyload/plugins/downloaders/UpfileVn.py | LuckyNicky/pycrawler | 4b3fe2f6e8e51f236d95a64a89a44199e4e97743 | [
"Apache-2.0"
] | null | null | null | supports/pyload/src/pyload/plugins/downloaders/UpfileVn.py | LuckyNicky/pycrawler | 4b3fe2f6e8e51f236d95a64a89a44199e4e97743 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
| 30.021277 | 85 | 0.589653 | # -*- coding: utf-8 -*-
import hashlib
import json
from ..base.simple_downloader import SimpleDownloader
class UpfileVn(SimpleDownloader):
__name__ = "UpfileVn"
__type__ = "downloader"
__version__ = "0.01"
__status__ = "testing"
__pyload_version__ = "0.5"
__pattern__ = r"http://(?:www\.)?u... | 0 | 0 | 0 | 1,280 | 0 | 0 | 0 | 15 | 91 |
4c42fcf3fa9eca6388488f41cdf35bf3faab311d | 2,082 | py | Python | src/service/music_list_service.py | kanbang/music-player | 852e65f112b887fb13d75c2a6184dc6570db141f | [
"MIT"
] | null | null | null | src/service/music_list_service.py | kanbang/music-player | 852e65f112b887fb13d75c2a6184dc6570db141f | [
"MIT"
] | null | null | null | src/service/music_list_service.py | kanbang/music-player | 852e65f112b887fb13d75c2a6184dc6570db141f | [
"MIT"
] | null | null | null |
if __name__ == "__main__":
pass
| 30.173913 | 74 | 0.654179 | import time
from src.dao.music_dao import MusicDao
from src.dao.music_list_dao import MusicListDao
from src.entity.music import Music
from src.entity.music_list import MusicList
from src.service.play_list import PlayList
class MusicListService:
def __init__(self) -> None:
super().__init__()
self.... | 270 | 480 | 0 | 1,228 | 0 | 0 | 0 | 89 | 156 |
48ca1c27c02cf5e2ee05c667df25a6ceebb59255 | 2,055 | py | Python | data_structures/queues.py | ahcode0919/python-ds-algorithms | 0d617b78c50b6c18da40d9fa101438749bfc82e1 | [
"MIT"
] | null | null | null | data_structures/queues.py | ahcode0919/python-ds-algorithms | 0d617b78c50b6c18da40d9fa101438749bfc82e1 | [
"MIT"
] | null | null | null | data_structures/queues.py | ahcode0919/python-ds-algorithms | 0d617b78c50b6c18da40d9fa101438749bfc82e1 | [
"MIT"
] | 3 | 2020-10-07T20:24:45.000Z | 2020-12-16T04:53:19.000Z | from typing import TypeVar
T = TypeVar('T')
| 22.582418 | 82 | 0.56253 | from typing import Generic, TypeVar, List
from data_structures.doubly_linked_list import DoublyLinkedList
T = TypeVar('T')
class QueueList(Generic[T]):
"""
Basic queue backed with a list. Not optimal since list has O(N) complexity for
inserting and removing elements at the beginning
"""
def __in... | 0 | 0 | 0 | 1,859 | 0 | 0 | 0 | 57 | 91 |
6adc2f6f3c50593a9a72e68ac5dd03220aacffd5 | 1,766 | py | Python | src/Modules/Web/web_rooms.py | bopopescu/PyHouse_1 | 6444ed0b4c38ab59b9e419e4d54d65d598e6a54e | [
"MIT"
] | 1 | 2016-09-21T19:30:21.000Z | 2016-09-21T19:30:21.000Z | src/Modules/Web/web_rooms.py | bopopescu/PyHouse_1 | 6444ed0b4c38ab59b9e419e4d54d65d598e6a54e | [
"MIT"
] | null | null | null | src/Modules/Web/web_rooms.py | bopopescu/PyHouse_1 | 6444ed0b4c38ab59b9e419e4d54d65d598e6a54e | [
"MIT"
] | 1 | 2020-07-23T11:13:36.000Z | 2020-07-23T11:13:36.000Z | """
-*- test-case-name: PyHouse.src.Modules.web.test.test_web_rooms -*-
@name: PyHouse/src/Modules/web/web_rooms.py
@author: D. Brian Kimmel
@contact: D.BrianKimmel@gmail.com
@copyright: (c) 2013-2016 by D. Brian Kimmel
@license: MIT License
@note: Created on Jun 3, 2013
@summary: Web interface to r... | 30.448276 | 92 | 0.704417 | """
-*- test-case-name: PyHouse.src.Modules.web.test.test_web_rooms -*-
@name: PyHouse/src/Modules/web/web_rooms.py
@author: D. Brian Kimmel
@contact: D.BrianKimmel@gmail.com
@copyright: (c) 2013-2016 by D. Brian Kimmel
@license: MIT License
@note: Created on Jun 3, 2013
@summary: Web interface to r... | 0 | 485 | 0 | 380 | 0 | 0 | 0 | 80 | 111 |
43cd8d61fa8902b32ca154a5534033a5f854568f | 9,222 | py | Python | pybelt.py | srcecde/Pybelt | 91c80cfceccababa4df9569934ee81745bf23855 | [
"MIT"
] | 2 | 2020-06-04T13:47:07.000Z | 2020-07-02T19:19:44.000Z | pybelt.py | srcecde/Pybelt | 91c80cfceccababa4df9569934ee81745bf23855 | [
"MIT"
] | null | null | null | pybelt.py | srcecde/Pybelt | 91c80cfceccababa4df9569934ee81745bf23855 | [
"MIT"
] | 3 | 2020-07-14T19:46:07.000Z | 2022-02-20T14:09:45.000Z | import argparse
import random
import re
import socket
import sys
from urllib2 import HTTPError
# Libraries
from lib.core.dork_check import DorkScanner
from lib.core.errors import GoogleBlockException
from lib.core.hash_cracking import HashCracker
from lib.core.hash_cracking.hash_checker import HashChecker
from lib.cor... | 55.221557 | 120 | 0.619063 | import argparse
import random
import re
import socket
import sys
from urllib2 import HTTPError
# Libraries
from lib.core.dork_check import DorkScanner
from lib.core.errors import GoogleBlockException
from lib.core.hash_cracking import HashCracker
from lib.core.hash_cracking.hash_checker import HashChecker
from lib.cor... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e5278ee77cee868cac1bcc2773304ea0c522b306 | 658 | py | Python | examples/models/train_gan.py | gugarosa/feelyng | 95a427049b9b82b0f5bc2ad200443ae7fc85eb6c | [
"MIT"
] | 1 | 2018-10-01T20:15:31.000Z | 2018-10-01T20:15:31.000Z | examples/models/train_gan.py | gugarosa/feelyng | 95a427049b9b82b0f5bc2ad200443ae7fc85eb6c | [
"MIT"
] | null | null | null | examples/models/train_gan.py | gugarosa/feelyng | 95a427049b9b82b0f5bc2ad200443ae7fc85eb6c | [
"MIT"
] | 1 | 2018-10-01T20:15:37.000Z | 2018-10-01T20:15:37.000Z | import tensorflow as tf
from nalp.datasets import ImageDataset
from nalp.models import GAN
# Loading the MNIST dataset
(x, y), (_, _) = tf.keras.datasets.mnist.load_data()
# Creating an Image Dataset
dataset = ImageDataset(x, batch_size=256, shape=(x.shape[0], 784), normalize=True)
# Creating the GAN
gan = GAN(inpu... | 25.307692 | 82 | 0.74772 | import tensorflow as tf
from nalp.datasets import ImageDataset
from nalp.models import GAN
# Loading the MNIST dataset
(x, y), (_, _) = tf.keras.datasets.mnist.load_data()
# Creating an Image Dataset
dataset = ImageDataset(x, batch_size=256, shape=(x.shape[0], 784), normalize=True)
# Creating the GAN
gan = GAN(inpu... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e3caa2b096a2cc3e218c774d8cdd359537423390 | 291 | py | Python | blog/migrations/0005_delete_image.py | BITS-SU-Tech-Team/Bloggers-Park | e3ace847728dd10d4bbb4a1a5196e73fb820c33f | [
"Apache-2.0"
] | null | null | null | blog/migrations/0005_delete_image.py | BITS-SU-Tech-Team/Bloggers-Park | e3ace847728dd10d4bbb4a1a5196e73fb820c33f | [
"Apache-2.0"
] | 13 | 2019-06-24T22:52:41.000Z | 2022-03-11T23:51:02.000Z | blog/migrations/0005_delete_image.py | BITS-SU-Tech-Team/Bloggers-Park | e3ace847728dd10d4bbb4a1a5196e73fb820c33f | [
"Apache-2.0"
] | 1 | 2019-06-24T13:49:32.000Z | 2019-06-24T13:49:32.000Z | # Generated by Django 2.2.2 on 2019-06-24 17:22
| 17.117647 | 47 | 0.597938 | # Generated by Django 2.2.2 on 2019-06-24 17:22
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('blog', '0004_auto_20190624_1325'),
]
operations = [
migrations.DeleteModel(
name='Image',
),
]
| 0 | 0 | 0 | 185 | 0 | 0 | 0 | 11 | 46 |
8ec06f1f58dcab1c890f561485a795d7c5260659 | 692 | py | Python | oops_fhir/r4/value_set/communication_not_done_reason.py | Mikuana/oops_fhir | 77963315d123756b7d21ae881f433778096a1d25 | [
"MIT"
] | null | null | null | oops_fhir/r4/value_set/communication_not_done_reason.py | Mikuana/oops_fhir | 77963315d123756b7d21ae881f433778096a1d25 | [
"MIT"
] | null | null | null | oops_fhir/r4/value_set/communication_not_done_reason.py | Mikuana/oops_fhir | 77963315d123756b7d21ae881f433778096a1d25 | [
"MIT"
] | null | null | null | from pathlib import Path
from fhir.resources.valueset import ValueSet as _ValueSet
__all__ = ["CommunicationNotDoneReason"]
_resource = _ValueSet.parse_file(Path(__file__).with_suffix(".json"))
| 22.322581 | 69 | 0.768786 | from pathlib import Path
from fhir.resources.valueset import ValueSet as _ValueSet
from oops_fhir.utils import ValueSet
from oops_fhir.r4.code_system.communication_not_done_reason import (
CommunicationNotDoneReason as CommunicationNotDoneReason_,
)
__all__ = ["CommunicationNotDoneReason"]
_resource = _Value... | 0 | 0 | 0 | 296 | 0 | 0 | 0 | 127 | 69 |
159d69e092c7c06a1c59413f9d0f8c186024d90e | 1,562 | py | Python | loafang/methods.py | Adwaith-Rajesh/loafang | 2ccea64ddbc19b7a4ba5219ec2bb5185919146be | [
"MIT"
] | 3 | 2021-11-17T13:32:21.000Z | 2021-11-27T04:20:48.000Z | loafang/methods.py | Adwaith-Rajesh/loafang | 2ccea64ddbc19b7a4ba5219ec2bb5185919146be | [
"MIT"
] | null | null | null | loafang/methods.py | Adwaith-Rajesh/loafang | 2ccea64ddbc19b7a4ba5219ec2bb5185919146be | [
"MIT"
] | null | null | null | from typing import TYPE_CHECKING
if TYPE_CHECKING:
# this class is what is used to generate the output for the each query in the execution block
| 33.956522 | 93 | 0.699104 | from argparse import Namespace
from typing import Any
from typing import Dict
from typing import List
from typing import Optional
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from .query import QueryBuilder
class MethodsError(Exception):
def __init__(self, code: int = 614, msg: str = "Some error occur... | 0 | 0 | 0 | 1,202 | 0 | 0 | 0 | 30 | 181 |
df2bac2b00ccb8f1edd7c14ed2cb9499563f7387 | 506 | py | Python | editfilterloganalyzer.py | mmiyer/galobot | 363b29949f8b3fde1cbe7fe5b12b2305ba16d89e | [
"MIT"
] | null | null | null | editfilterloganalyzer.py | mmiyer/galobot | 363b29949f8b3fde1cbe7fe5b12b2305ba16d89e | [
"MIT"
] | null | null | null | editfilterloganalyzer.py | mmiyer/galobot | 363b29949f8b3fde1cbe7fe5b12b2305ba16d89e | [
"MIT"
] | null | null | null | import regex
args = sys.argv
query = p.data.api.ListGenerator("abuselog", aflprop = "details", aflfilter = args[1], site = site)
query.set_maximum_items(args[2])
query.set_query_increment(50)
extra = r".{,100}"
pattern = regex.compile (r"(?V1)"+extra+r"(?:"+input("Regex: ")+r")"+extra, flags = regex.IGNORECASE)
for... | 26.631579 | 101 | 0.687747 | import regex
from botbase import *
args = sys.argv
query = p.data.api.ListGenerator("abuselog", aflprop = "details", aflfilter = args[1], site = site)
query.set_maximum_items(args[2])
query.set_query_increment(50)
extra = r".{,100}"
pattern = regex.compile (r"(?V1)"+extra+r"(?:"+input("Regex: ")+r")"+extra, flags = ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 22 |
4ce3a45dc2403bf404442eb68925427a762761d6 | 13,337 | py | Python | figaxe.py | trwaters/FigAxe | 445efff4e371593e1f74a8bddf59df1c8eef71f0 | [
"MIT"
] | null | null | null | figaxe.py | trwaters/FigAxe | 445efff4e371593e1f74a8bddf59df1c8eef71f0 | [
"MIT"
] | null | null | null | figaxe.py | trwaters/FigAxe | 445efff4e371593e1f74a8bddf59df1c8eef71f0 | [
"MIT"
] | null | null | null | import warnings
import numpy as np
import pylab as plt
from matplotlib.cbook import mplDeprecation
from mpl_toolkits.axes_grid1.axes_divider import make_axes_locatable
# always reload gridspec_helper.py
from importlib import reload
import gridspec_helper; reload(gridspec_helper)
### fig generator method using LiteF... | 32.608802 | 88 | 0.554398 | import warnings
import numpy as np
import pylab as plt
from matplotlib.gridspec import GridSpec
from matplotlib.cbook import mplDeprecation
from mpl_toolkits.axes_grid1.axes_divider import make_axes_locatable
# always reload gridspec_helper.py
from importlib import reload
import gridspec_helper; reload(gridspec_helper... | 0 | 0 | 0 | 0 | 0 | 4,963 | 0 | 19 | 155 |
ae9283d998a172604db6e5e5629ab4fc7791ece9 | 509 | py | Python | rock_paper_scissors_matrix.py | Welf06/Beginnner_Projects | 61e1c56f3bd7497c4b711a52053fec6f21f67fe1 | [
"MIT"
] | 1 | 2022-01-22T15:53:01.000Z | 2022-01-22T15:53:01.000Z | rock_paper_scissors_matrix.py | Welf06/Beginnner_Projects | 61e1c56f3bd7497c4b711a52053fec6f21f67fe1 | [
"MIT"
] | null | null | null | rock_paper_scissors_matrix.py | Welf06/Beginnner_Projects | 61e1c56f3bd7497c4b711a52053fec6f21f67fe1 | [
"MIT"
] | null | null | null | from random import randint
# 0: draw 1:lost 2:won
matrix = [[0,1,2],
[2,0,1],
[1,2,0]]
choices = ["rock", "paper", "scissors"]
choice_map = {"rock": 0, "paper":1, "scissors":2}
comp_choice = randint(0,2)
user_choice = input("Please choose rock, paper or scissors:\n").lower().strip()
user_choice = ch... | 29.941176 | 79 | 0.660118 | from random import randint
# 0: draw 1:lost 2:won
matrix = [[0,1,2],
[2,0,1],
[1,2,0]]
choices = ["rock", "paper", "scissors"]
choice_map = {"rock": 0, "paper":1, "scissors":2}
comp_choice = randint(0,2)
user_choice = input("Please choose rock, paper or scissors:\n").lower().strip()
user_choice = ch... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
dd8fc399d77c2364a5be739c2a28cec119cf2378 | 206 | py | Python | assignments/catclasstest.py | noelleclement/pythoncourse | 37d6b26aaf7c8d4537f13fd1b92bfa2d5e4d5128 | [
"MIT"
] | null | null | null | assignments/catclasstest.py | noelleclement/pythoncourse | 37d6b26aaf7c8d4537f13fd1b92bfa2d5e4d5128 | [
"MIT"
] | null | null | null | assignments/catclasstest.py | noelleclement/pythoncourse | 37d6b26aaf7c8d4537f13fd1b92bfa2d5e4d5128 | [
"MIT"
] | null | null | null |
cat = Cat('Harry', 2)
cat.speak() | 20.6 | 71 | 0.61165 | class Cat:
def __init__ (self, name, age):
self.name = name
self.age = age
def speak (self):
print('Miauw! I am', self.name, 'and I am', self.age, 'year(s) old!')
cat = Cat('Harry', 2)
cat.speak() | 0 | 0 | 0 | 150 | 0 | 0 | 0 | 0 | 22 |
0bbb45ce3759533fcc1286711302711cf7b9e0ad | 4,405 | py | Python | main_vrp.py | MichaelAllen1966/2004_covid_dialysis | 62c6842fc14acee07aee12ac2f238cbd1c3881d6 | [
"MIT"
] | null | null | null | main_vrp.py | MichaelAllen1966/2004_covid_dialysis | 62c6842fc14acee07aee12ac2f238cbd1c3881d6 | [
"MIT"
] | 1 | 2020-05-15T11:11:53.000Z | 2020-05-15T11:11:53.000Z | main_vrp.py | MichaelAllen1966/2004_covid_dialysis | 62c6842fc14acee07aee12ac2f238cbd1c3881d6 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
from joblib import Parallel, delayed
import vrp.io as io
import vrp.constructive as c
import vrp.sim as sim
from vrp.constructive import SequentialClarkeWright
from vrp.sim import ILSWithConstructive
def multiple_replications(scenario, n_reps=10, n_jobs=1):
'''
Multiple... | 32.873134 | 79 | 0.556186 | import pandas as pd
import numpy as np
from joblib import Parallel, delayed
import vrp.io as io
import vrp.constructive as c
import vrp.sim as sim
from vrp.constructive import SequentialClarkeWright
from vrp.sim import ILSWithConstructive
def multiple_replications(scenario, n_reps=10, n_jobs=1):
'''
Multiple... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5f51a5119f89bbb5389aa873cec2bb5a5146cff8 | 32 | py | Python | asce/engine/env.py | sbeddall/azure-storage-console-explorer | 19320cb34a4391534dbc945464db590e87911bfd | [
"MIT"
] | null | null | null | asce/engine/env.py | sbeddall/azure-storage-console-explorer | 19320cb34a4391534dbc945464db590e87911bfd | [
"MIT"
] | null | null | null | asce/engine/env.py | sbeddall/azure-storage-console-explorer | 19320cb34a4391534dbc945464db590e87911bfd | [
"MIT"
] | null | null | null | INPUT_FIELD_NAME = "input_data"
| 16 | 31 | 0.8125 | INPUT_FIELD_NAME = "input_data"
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ec27606d9eaaf608050ed7907e49a666f66dfc69 | 90 | py | Python | abc/088/a/answer.py | TakuyaNoguchi/atcoder | d079402e6fe9c9aaf3a6fc9272331ee71fc497da | [
"MIT"
] | null | null | null | abc/088/a/answer.py | TakuyaNoguchi/atcoder | d079402e6fe9c9aaf3a6fc9272331ee71fc497da | [
"MIT"
] | null | null | null | abc/088/a/answer.py | TakuyaNoguchi/atcoder | d079402e6fe9c9aaf3a6fc9272331ee71fc497da | [
"MIT"
] | null | null | null | N, A = int(input()), int(input())
if N % 500 <= A:
print('Yes')
else:
print('No') | 15 | 33 | 0.488889 | N, A = int(input()), int(input())
if N % 500 <= A:
print('Yes')
else:
print('No') | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3e25f9b2f74f6e87f28136e40188056eea27f5f2 | 11,614 | py | Python | pyramid/security.py | danielpronych/pyramid-doxygen | ad95a8c151c2c4e029e03aed2feda2993380f36f | [
"BSD-2-Clause"
] | null | null | null | pyramid/security.py | danielpronych/pyramid-doxygen | ad95a8c151c2c4e029e03aed2feda2993380f36f | [
"BSD-2-Clause"
] | null | null | null | pyramid/security.py | danielpronych/pyramid-doxygen | ad95a8c151c2c4e029e03aed2feda2993380f36f | [
"BSD-2-Clause"
] | null | null | null | from zope.interface import providedBy
from pyramid.interfaces import (IAuthenticationPolicy, IAuthorizationPolicy, ISecuredView, IView, IViewClassifier)
from pyramid.compat import map_
from pyramid.threadlocal import get_current_registry
Everyone = 'system.Everyone'
Authenticated = 'system.Authenticated'
Allow = 'Al... | 39.104377 | 78 | 0.670312 | from zope.interface import providedBy
from pyramid.interfaces import (
IAuthenticationPolicy,
IAuthorizationPolicy,
ISecuredView,
IView,
IViewClassifier,
)
from pyramid.compat import map_
from pyramid.threadlocal import get_current_registry
Everyone = 'system.Everyone'
Authenticated = 'system... | 0 | 363 | 0 | 2,984 | 0 | 0 | 0 | 27 | 161 |
18039515b6df32233c7d79ef59e2763cfecc0af7 | 7,530 | py | Python | src/client.py | jasonzliang/dcs | 3ead5d744b73e1b1335709242af67c8da1c1f99d | [
"Unlicense"
] | null | null | null | src/client.py | jasonzliang/dcs | 3ead5d744b73e1b1335709242af67c8da1c1f99d | [
"Unlicense"
] | null | null | null | src/client.py | jasonzliang/dcs | 3ead5d744b73e1b1335709242af67c8da1c1f99d | [
"Unlicense"
] | null | null | null | import sys
if __name__ == "__main__":
if len(sys.argv) < 2:
c = CompletionServiceClient()
elif len(sys.argv) < 3:
c = CompletionServiceClient(config_file=sys.argv[1])
else:
c = CompletionServiceClient(config_file=sys.argv[1], runmode=sys.argv[2])
| 37.277228 | 94 | 0.678619 | import os, time, sys, random, string, subprocess, pprint
from server import DEFAULT_CONFIG
from util import Logger, getTime, full_path, randString, updateConfig
from queue import FIFOQueue, TaskObject, ShortestTaskQueue
class CompletionServiceClient(object):
def __init__(self, config_file=None, runmode="local"):
... | 0 | 0 | 0 | 7,031 | 0 | 0 | 0 | 143 | 90 |
fc2c0be438a7783eb9290dad118370b68ccf561a | 6,882 | py | Python | eth_account/_utils/keyfile.py | KyrinCode/python-sdk | 57dd02388d6b8552ad346d72838c2fd8177fec65 | [
"MIT"
] | 61 | 2019-07-03T07:40:17.000Z | 2022-03-06T13:30:53.000Z | eth_account/_utils/keyfile.py | KyrinCode/python-sdk | 57dd02388d6b8552ad346d72838c2fd8177fec65 | [
"MIT"
] | 105 | 2019-07-25T08:48:59.000Z | 2022-03-23T03:47:34.000Z | eth_account/_utils/keyfile.py | KyrinCode/python-sdk | 57dd02388d6b8552ad346d72838c2fd8177fec65 | [
"MIT"
] | 61 | 2019-07-03T06:58:42.000Z | 2022-02-16T08:50:14.000Z |
#
# Version 3 creators
#
DKLEN = 32
SCRYPT_R = 1
SCRYPT_P = 8
#
# Verson 3 decoder
#
#
# Key derivation
#
#
# Encryption and Decryption
#
#
# Utility
#
| 25.583643 | 89 | 0.643272 | import hashlib
import hmac
import json
import uuid
import os
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
from cryptography.hazmat.backends import default_backend
from Crypto.Protocol.KDF import scrypt
from eth_keys import keys
from eth_utils import (
big_endian_to_int,
decode_... | 0 | 324 | 0 | 0 | 0 | 5,601 | 0 | 219 | 565 |
e9e016a5503cb2ea79dc209a5bd222a928df7e20 | 3,857 | py | Python | nets/coco_dataset.py | MrYYYYYYYYYYY/SESF-Fuse | 1b7789dc880c53d2400f94ce794a0292d82908a3 | [
"MIT"
] | 1 | 2020-06-18T05:45:57.000Z | 2020-06-18T05:45:57.000Z | nets/coco_dataset.py | MrYYYYYYYYYYY/SESF-Fuse | 1b7789dc880c53d2400f94ce794a0292d82908a3 | [
"MIT"
] | null | null | null | nets/coco_dataset.py | MrYYYYYYYYYYY/SESF-Fuse | 1b7789dc880c53d2400f94ce794a0292d82908a3 | [
"MIT"
] | null | null | null | import os
from torch.utils.data import DataLoader
import torchvision.transforms as transforms
if __name__ == "__main__":
batch_size = 3
gpu_device = "cuda:0"
shuffle = True
# address
project_address = os.getcwd()
train_dir = os.path.join(os.path.join(os.path.join(project_address, "datasets"),... | 35.385321 | 120 | 0.667617 | import os
import random
import cv2
import numpy as np
import PIL.Image
from torch.utils.data.dataset import Dataset
from torch.utils.data import DataLoader
import torchvision.transforms as transforms
from nets.nets_utility import *
import torchvision.transforms.functional as F
class COCODataset(Dataset):
def __in... | 66 | 0 | 0 | 2,321 | 0 | 0 | 0 | 30 | 177 |
5ef047db2e3e6be89c15f240798dbc89b1924c5f | 11,169 | py | Python | src/optimizations/thumbnailcache.py | etianen/django-optimizations | c9614c3eeb1cb3482eb2db84d3951356d7fb44a3 | [
"BSD-3-Clause"
] | 12 | 2015-05-06T21:34:11.000Z | 2021-07-31T04:49:25.000Z | src/optimizations/thumbnailcache.py | etianen/django-optimizations | c9614c3eeb1cb3482eb2db84d3951356d7fb44a3 | [
"BSD-3-Clause"
] | 3 | 2015-02-11T16:23:13.000Z | 2018-04-17T09:07:36.000Z | src/optimizations/thumbnailcache.py | etianen/django-optimizations | c9614c3eeb1cb3482eb2db84d3951356d7fb44a3 | [
"BSD-3-Clause"
] | 4 | 2015-02-11T10:21:31.000Z | 2019-07-24T20:29:28.000Z | """A cache for thumbnailed images."""
from __future__ import unicode_literals
import collections
import sys
try:
from io import BytesIO as StringIO
except Exception as e:
from cStringIO import StringIO
from PIL import Image
# Size adjustment callbacks. These are used to determine the display and data size... | 34.260736 | 118 | 0.627451 | """A cache for thumbnailed images."""
from __future__ import unicode_literals
import collections
import sys
import os.path
try:
from io import BytesIO as StringIO
except Exception as e:
from cStringIO import StringIO
from PIL import Image
from django.core.files.base import File
from optimizations.assetcach... | 0 | 867 | 0 | 6,835 | 0 | 0 | 0 | 102 | 205 |
aa8f8f04fa420c881e5266dc7126668c63864f34 | 1,483 | py | Python | practica03/bcd.py | kyordhel/FSEm | 4082a99e06d624807a8f9ef9febfb746df508b95 | [
"MIT"
] | 1 | 2020-03-01T19:59:19.000Z | 2020-03-01T19:59:19.000Z | practica03/bcd.py | kyordhel/FSEm | 4082a99e06d624807a8f9ef9febfb746df508b95 | [
"MIT"
] | null | null | null | practica03/bcd.py | kyordhel/FSEm | 4082a99e06d624807a8f9ef9febfb746df508b95 | [
"MIT"
] | 1 | 2020-02-17T19:40:13.000Z | 2020-02-17T19:40:13.000Z | #!/usr/bin/env python3
# ## ###############################################
#
# pwm.py
# Controls a 7-segments display using Raspberry Pi
# and a 74LS47 driver
#
# Autor: Mauricio Matamoros
# License: MIT
#
# ## ###############################################
# Future imports (Python 2.7 compatibility)
from __future__... | 28.519231 | 68 | 0.685098 | #!/usr/bin/env python3
# ## ###############################################
#
# pwm.py
# Controls a 7-segments display using Raspberry Pi
# and a 74LS47 driver
#
# Autor: Mauricio Matamoros
# License: MIT
#
# ## ###############################################
# Future imports (Python 2.7 compatibility)
from __future__... | 12 | 0 | 0 | 0 | 0 | 269 | 0 | 1 | 44 |
869b1c8b1d268cf1f323c55eb2573d0c5fb000b3 | 1,325 | py | Python | error_posts/migrations/0001_initial.py | vintasoftware/curly-enigma | 7248f93dbe2ba22e4f883786189215cea7cf72d5 | [
"MIT"
] | null | null | null | error_posts/migrations/0001_initial.py | vintasoftware/curly-enigma | 7248f93dbe2ba22e4f883786189215cea7cf72d5 | [
"MIT"
] | null | null | null | error_posts/migrations/0001_initial.py | vintasoftware/curly-enigma | 7248f93dbe2ba22e4f883786189215cea7cf72d5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
| 35.810811 | 203 | 0.53434 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Answer',
fields=[
('id', models.AutoField(verbo... | 0 | 0 | 0 | 1,195 | 0 | 0 | 0 | 19 | 46 |
646cda1ef782adb1a1d7fa97f0ecb6580d5d0f1f | 1,971 | py | Python | ESRGAN.py | DavidInWuhanChina/CartoonizerTheWorldUsingTFLite | e11ec9e38495815753498896d20a2a790fe57127 | [
"MIT"
] | 5 | 2020-10-21T01:41:52.000Z | 2022-01-25T09:19:40.000Z | ESRGAN.py | DavidInWuhanChina/CartoonizerTheWorldUsingTFLite | e11ec9e38495815753498896d20a2a790fe57127 | [
"MIT"
] | null | null | null | ESRGAN.py | DavidInWuhanChina/CartoonizerTheWorldUsingTFLite | e11ec9e38495815753498896d20a2a790fe57127 | [
"MIT"
] | 1 | 2020-12-09T11:41:52.000Z | 2020-12-09T11:41:52.000Z | import tensorflow as tf
from PIL import Image
#Utility for image loading and prepeocessing\
#Load the image
low_res_image = load_img('./cartoonized_image.jpg', None, './cartoonized_image.jpg')
#Load the model
interpreter = tf.lite.Interpreter(model_path=f'./esrgan_dr.tflite')
interpreter.allocate_tensors()
#Set mod... | 28.157143 | 84 | 0.695586 | import tensorflow as tf
import cv2
import numpy as np
from PIL import Image
import matplotlib.pyplot as plt
#Utility for image loading and prepeocessing\
def load_img(path_to_img, scale_factor=4, save_path="downsampled_image.jpg"):
img = tf.io.read_file(path_to_img)
img = tf.io.decode_image(img, channels=3)
... | 78 | 0 | 0 | 0 | 0 | 857 | 0 | -4 | 111 |
99a7c36f53fc1ce7c13d1155fc9ca3918a1bd3c3 | 365 | py | Python | Problem 045.py | Junipyr/Project-Euler | dcc97636d27e9f16a6f80b361689c6bfbd943751 | [
"FSFAP"
] | null | null | null | Problem 045.py | Junipyr/Project-Euler | dcc97636d27e9f16a6f80b361689c6bfbd943751 | [
"FSFAP"
] | null | null | null | Problem 045.py | Junipyr/Project-Euler | dcc97636d27e9f16a6f80b361689c6bfbd943751 | [
"FSFAP"
] | null | null | null | # We iterate hexagonal numbers and check whether they are pentagonal.
# By definition, every hexagonal number is a triangle number.
import math
n_h = 144
n_p = 0.5
while not n_p.is_integer():
h = n_h*(2*n_h - 1)
n_p = (1 + math.sqrt(1 + 24*h))/6
n_h += 1
print(h)
# Copyright Junipyr. All r... | 19.210526 | 70 | 0.652055 | # We iterate hexagonal numbers and check whether they are pentagonal.
# By definition, every hexagonal number is a triangle number.
import math
n_h = 144
n_p = 0.5
while not n_p.is_integer():
h = n_h*(2*n_h - 1)
n_p = (1 + math.sqrt(1 + 24*h))/6
n_h += 1
print(h)
# Copyright Junipyr. All r... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
eaaf9f99b660cf1b71324ade15ae7f3431377cd8 | 498 | py | Python | webapp/drf_network_pipeline/index.py | jay-johnson/train-ai-with-django-swagger-jwt | 3cdd798709b02047eadebccbe2fc9b855cfcac4f | [
"Apache-2.0"
] | 79 | 2018-02-03T08:41:08.000Z | 2022-02-01T20:22:04.000Z | webapp/drf_network_pipeline/index.py | webclinic017/train-ai-with-django-swagger-jwt | 3cdd798709b02047eadebccbe2fc9b855cfcac4f | [
"Apache-2.0"
] | 1 | 2020-10-26T12:05:25.000Z | 2020-10-26T12:05:25.000Z | webapp/drf_network_pipeline/index.py | webclinic017/train-ai-with-django-swagger-jwt | 3cdd798709b02047eadebccbe2fc9b855cfcac4f | [
"Apache-2.0"
] | 23 | 2018-04-10T10:57:58.000Z | 2021-12-05T02:59:06.000Z | from django.conf import settings
from django.shortcuts import render
def handle_sphinx_doc_index(
request,
data=None):
"""handle_sphinx_doc_index
Generic handler for sending the browser to the
sphinx documentation index:
<repo>/webapp/drf_network_pipeline/docs/build/html/index.html
... | 22.636364 | 65 | 0.714859 | from django.conf import settings
from django.shortcuts import render
def handle_sphinx_doc_index(
request,
data=None):
"""handle_sphinx_doc_index
Generic handler for sending the browser to the
sphinx documentation index:
<repo>/webapp/drf_network_pipeline/docs/build/html/index.html
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e4519bb6f3cd7df82f7f6b54f3cd148f37b9349d | 2,900 | py | Python | qa/tasks/object_source_down.py | rpratap-bot/ceph | 9834961a66927ae856935591f2fd51082e2ee484 | [
"MIT"
] | 4 | 2020-04-08T03:42:02.000Z | 2020-10-01T20:34:48.000Z | qa/tasks/object_source_down.py | rpratap-bot/ceph | 9834961a66927ae856935591f2fd51082e2ee484 | [
"MIT"
] | 93 | 2020-03-26T14:29:14.000Z | 2020-11-12T05:54:55.000Z | qa/tasks/object_source_down.py | rpratap-bot/ceph | 9834961a66927ae856935591f2fd51082e2ee484 | [
"MIT"
] | 23 | 2020-03-24T10:28:44.000Z | 2020-09-24T09:42:19.000Z | """
Test Object locations going down
"""
import logging
import time
from teuthology import misc as teuthology
from tasks import ceph_manager
from tasks.util.rados import rados
log = logging.getLogger(__name__)
def task(ctx, config):
"""
Test handling of object location going down
"""
if config is None... | 28.431373 | 81 | 0.632069 | """
Test Object locations going down
"""
import logging
import time
from teuthology import misc as teuthology
from tasks import ceph_manager
from tasks.util.rados import rados
log = logging.getLogger(__name__)
def task(ctx, config):
"""
Test handling of object location going down
"""
if config is None... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f2091cfb8c032872fbd4bfe35f203cdfbc4a433f | 1,178 | py | Python | data/server/king_phisher/alembic/versions/b76eab0a059_schema_v7.py | chachabooboo/king-phisher | 8a91b9043de0f12b5cad9a5f1d64ebd0179a6c4d | [
"BSD-3-Clause"
] | 1,143 | 2015-01-12T15:05:16.000Z | 2020-04-12T16:10:19.000Z | data/server/king_phisher/alembic/versions/b76eab0a059_schema_v7.py | chachabooboo/king-phisher | 8a91b9043de0f12b5cad9a5f1d64ebd0179a6c4d | [
"BSD-3-Clause"
] | 399 | 2015-01-22T15:20:03.000Z | 2020-04-08T23:01:46.000Z | data/server/king_phisher/alembic/versions/b76eab0a059_schema_v7.py | chachabooboo/king-phisher | 8a91b9043de0f12b5cad9a5f1d64ebd0179a6c4d | [
"BSD-3-Clause"
] | 351 | 2015-02-02T21:39:38.000Z | 2020-03-21T11:45:20.000Z | """Schema v7
Revision ID: b76eab0a059
Revises: a695de64338
Create Date: 2016-12-07
"""
# revision identifiers, used by Alembic.
revision = 'b76eab0a059'
down_revision = 'a695de64338'
import os
import sys
sys.path.insert(1, os.path.abspath(os.path.join(os.path.dirname(__file__), *['..'] * 5)))
| 25.608696 | 89 | 0.763158 | """Schema v7
Revision ID: b76eab0a059
Revises: a695de64338
Create Date: 2016-12-07
"""
# revision identifiers, used by Alembic.
revision = 'b76eab0a059'
down_revision = 'a695de64338'
import os
import sys
sys.path.insert(1, os.path.abspath(os.path.join(os.path.dirname(__file__), *['..'] * 5)))
from alembic import o... | 0 | 0 | 0 | 0 | 0 | 728 | 0 | 38 | 113 |
d3d2dfaebf5c667bae583950e27af7876490b277 | 815 | py | Python | openpose_ros2/setup.py | Rits-Interaction-Laboratory/openpose_ros2 | 9771501e9a37cc8a6a22077af24b839e30c96da4 | [
"MIT"
] | 1 | 2021-12-20T22:46:33.000Z | 2021-12-20T22:46:33.000Z | openpose_ros2/setup.py | Rits-Interaction-Laboratory/openpose_ros2 | 9771501e9a37cc8a6a22077af24b839e30c96da4 | [
"MIT"
] | null | null | null | openpose_ros2/setup.py | Rits-Interaction-Laboratory/openpose_ros2 | 9771501e9a37cc8a6a22077af24b839e30c96da4 | [
"MIT"
] | null | null | null | import os
from glob import glob
from setuptools import setup
package_name = 'openpose_ros2'
setup(
name=package_name,
version='1.0.0',
packages=[package_name],
data_files=[
('share/ament_index/resource_index/packages',
['resource/' + package_name]),
('share/' + package_nam... | 26.290323 | 67 | 0.634356 | import os
from glob import glob
from setuptools import setup
package_name = 'openpose_ros2'
setup(
name=package_name,
version='1.0.0',
packages=[package_name],
data_files=[
('share/ament_index/resource_index/packages',
['resource/' + package_name]),
('share/' + package_nam... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
37ef8dbdb1b299a1aa2830d0d07751f700d1cedb | 791 | py | Python | abstrys/cli/cascading_cli_time.py | EronHennessey/abstrys-cli-demos | 36c12dfd85930737ad170256b10f60d85552a90d | [
"BSD-2-Clause"
] | null | null | null | abstrys/cli/cascading_cli_time.py | EronHennessey/abstrys-cli-demos | 36c12dfd85930737ad170256b10f60d85552a90d | [
"BSD-2-Clause"
] | null | null | null | abstrys/cli/cascading_cli_time.py | EronHennessey/abstrys-cli-demos | 36c12dfd85930737ad170256b10f60d85552a90d | [
"BSD-2-Clause"
] | null | null | null | #
# "Cascading CLI" pattern "time" CLI
#
# This CLI provides a "time" command for the main CLI.
| 21.972222 | 65 | 0.553729 | #
# "Cascading CLI" pattern "time" CLI
#
# This CLI provides a "time" command for the main CLI.
import time
from abstrys.cli.common import CliCommand
class TimeCommand(CliCommand):
"""
A CLI command that returns the current time.
"""
def set_up_parser(self, parser):
"""
Set up the ti... | 0 | 0 | 0 | 615 | 0 | 0 | 0 | 10 | 68 |
29b3ac4e270f15f7ffef63281dc071489155dcaa | 2,217 | py | Python | main.py | ride90/asyncio-opencv-face-detection | e2c2a24aa0803372dfe53ed47847034abfd6852f | [
"MIT"
] | 2 | 2021-06-26T04:09:47.000Z | 2022-02-20T22:52:09.000Z | main.py | ride90/asyncio-opencv-face-detection | e2c2a24aa0803372dfe53ed47847034abfd6852f | [
"MIT"
] | null | null | null | main.py | ride90/asyncio-opencv-face-detection | e2c2a24aa0803372dfe53ed47847034abfd6852f | [
"MIT"
] | 1 | 2022-02-20T22:52:26.000Z | 2022-02-20T22:52:26.000Z | import os
import ssl
from distutils.util import strtobool
from aiohttp import web
import jinja2
import aiohttp_jinja2
# settings
DEBUG = strtobool(os.environ.get('DEBUG', 'True'))
PORT = int(os.environ.get('PORT', 8088))
SSL = strtobool(os.environ.get('SSL', 'True'))
SSL_CRT_PATH = os.environ.get('SSL_CRT_PATH', 'cer... | 28.423077 | 86 | 0.678394 | import os
import ssl
import cv2 as cv
import numpy as np
from distutils.util import strtobool
import aiohttp
from aiohttp import web
import jinja2
import aiohttp_jinja2
from camera import VideoCamera
# settings
DEBUG = strtobool(os.environ.get('DEBUG', 'True'))
PORT = int(os.environ.get('PORT', 8088))
SSL = strtobo... | 0 | 1,039 | 0 | 0 | 0 | 0 | 0 | -6 | 136 |
fc335f673564a1327a64ecbfbe3fdf83500ccdb6 | 18,992 | py | Python | routenet/routenet.py | thebambooguy/net2vec | 918d86b2612570be50d46b2ce165902ea8717cad | [
"BSD-3-Clause"
] | 11 | 2019-08-19T15:45:25.000Z | 2021-02-14T02:41:33.000Z | routenet/routenet.py | thebambooguy/net2vec | 918d86b2612570be50d46b2ce165902ea8717cad | [
"BSD-3-Clause"
] | null | null | null | routenet/routenet.py | thebambooguy/net2vec | 918d86b2612570be50d46b2ce165902ea8717cad | [
"BSD-3-Clause"
] | 7 | 2019-01-18T10:44:52.000Z | 2021-04-12T13:20:28.000Z | # Copyright (c) 2018-2019, Krzysztof Rusek
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions an... | 38.290323 | 143 | 0.627896 | # Copyright (c) 2018-2019, Krzysztof Rusek
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions an... | 0 | 0 | 0 | 3,745 | 0 | 10,406 | 0 | -2 | 250 |
ac82214017517f35f91fae61c2f6889f9a66a956 | 1,375 | py | Python | Modules/find_mean_stddev.py | roshantac/EVA4-Phase2 | 8950dc6eeafbe1996a259cab876593e4be0d6c04 | [
"Apache-2.0"
] | null | null | null | Modules/find_mean_stddev.py | roshantac/EVA4-Phase2 | 8950dc6eeafbe1996a259cab876593e4be0d6c04 | [
"Apache-2.0"
] | null | null | null | Modules/find_mean_stddev.py | roshantac/EVA4-Phase2 | 8950dc6eeafbe1996a259cab876593e4be0d6c04 | [
"Apache-2.0"
] | 2 | 2020-08-26T02:33:33.000Z | 2021-03-16T10:51:40.000Z | """Code to calculate the mean and standard deviation of dataset.
Author: Srinivasan G
"""
import os
from PIL import Image
import numpy as np
import time
def find_mean_standard_deviation(image_dir):
"""Return the mean and standard deviation of dataset.
Mean and Standard Deviation required for image normaliza... | 25.462963 | 65 | 0.597818 | """Code to calculate the mean and standard deviation of dataset.
Author: Srinivasan G
"""
import os
from PIL import Image
import numpy as np
import time
def find_mean_standard_deviation(image_dir):
"""Return the mean and standard deviation of dataset.
Mean and Standard Deviation required for image normaliza... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c029406c5aaf7addcbf5ff3376bf284011749e0e | 108 | py | Python | information-disclosure/exploiting/infoleak-via-backup-files.py | brandonaltermatt/penetration-testing-scripts | 433b5d000a5573e60b9d8e49932cedce74937ebc | [
"MIT"
] | null | null | null | information-disclosure/exploiting/infoleak-via-backup-files.py | brandonaltermatt/penetration-testing-scripts | 433b5d000a5573e60b9d8e49932cedce74937ebc | [
"MIT"
] | null | null | null | information-disclosure/exploiting/infoleak-via-backup-files.py | brandonaltermatt/penetration-testing-scripts | 433b5d000a5573e60b9d8e49932cedce74937ebc | [
"MIT"
] | null | null | null | """
https://portswigger.net/web-security/information-disclosure/exploiting/lab-infoleak-via-backup-files
""" | 36 | 100 | 0.796296 | """
https://portswigger.net/web-security/information-disclosure/exploiting/lab-infoleak-via-backup-files
""" | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
dfbf5ce98be5b26c4c6b1c59117d7883be44ca49 | 12,922 | py | Python | trafcap/trafcapEthernetPacket.py | protectus/pfring-to-mongo | 60410d61a8e0b7ed4417cbb40782d169412aa4e0 | [
"MIT"
] | 2 | 2020-04-10T22:08:22.000Z | 2020-04-19T15:50:00.000Z | trafcap/trafcapEthernetPacket.py | protectus/pfring-to-mongo | 60410d61a8e0b7ed4417cbb40782d169412aa4e0 | [
"MIT"
] | null | null | null | trafcap/trafcapEthernetPacket.py | protectus/pfring-to-mongo | 60410d61a8e0b7ed4417cbb40782d169412aa4e0 | [
"MIT"
] | null | null | null | # trafcapEthernetPacket.py
#
# Copyright (c) 2013 Protectus,LLC. All Rights Reserved.
#
# Classes to help pull data off the wire and update mongo
| 35.795014 | 140 | 0.468426 | # trafcapEthernetPacket.py
#
# Copyright (c) 2013 Protectus,LLC. All Rights Reserved.
#
# Classes to help pull data off the wire and update mongo
import subprocess
import time
from trafcap import trafcap
from datetime import datetime
import traceback
import sys
class EthernetPacket(object):
"""
Parent class f... | 0 | 9,211 | 0 | 3,401 | 0 | 0 | 0 | -16 | 178 |
37e7e593de6685542e3e030b269ca8e3b27e52c5 | 1,126 | py | Python | addon_common/common/ui_settings.py | Unnoen/retopoflow | 73c7cfc10a0b58937198d60e308ba5248b446490 | [
"OML"
] | 1,600 | 2015-03-19T12:26:15.000Z | 2022-03-30T21:07:37.000Z | addon_common/common/ui_settings.py | Unnoen/retopoflow | 73c7cfc10a0b58937198d60e308ba5248b446490 | [
"OML"
] | 1,026 | 2015-03-18T22:17:42.000Z | 2022-03-28T17:47:04.000Z | addon_common/common/ui_settings.py | Unnoen/retopoflow | 73c7cfc10a0b58937198d60e308ba5248b446490 | [
"OML"
] | 241 | 2015-03-19T13:44:36.000Z | 2022-03-30T21:07:39.000Z | '''
Copyright (C) 2021 CG Cookie
http://cgcookie.com
hello@cgcookie.com
Created by Jonathan Denning, Jonathan Williamson
This program 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 ... | 31.277778 | 84 | 0.714032 | '''
Copyright (C) 2021 CG Cookie
http://cgcookie.com
hello@cgcookie.com
Created by Jonathan Denning, Jonathan Williamson
This program 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 ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
11c80539e1f577ca6dd67fdb56d31c90276d1a98 | 1,518 | py | Python | modules/extra_tabs/messages.py | sharabeshj/course-editor-test | 9af15d10ef1f039fdf5758134a7cb72384ccf3f5 | [
"Apache-2.0"
] | 1 | 2021-01-06T17:58:30.000Z | 2021-01-06T17:58:30.000Z | modules/extra_tabs/messages.py | priyankagohil/coursebuilder-assessment | 559e867a2a846dd773471c6bc76cf6005a57098f | [
"Apache-2.0"
] | 27 | 2016-08-31T19:04:46.000Z | 2016-09-29T00:22:32.000Z | modules/extra_tabs/messages.py | priyankagohil/coursebuilder-assessment | 559e867a2a846dd773471c6bc76cf6005a57098f | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | 33 | 78 | 0.754941 | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b1820fe9945cb2cf6cb5c29d3823e9a9f74f657a | 344 | py | Python | Codility_18.py | Bartoshko/codility-python-training | 5ac53e85948692c8e6c44090e68b93136b263f9c | [
"MIT"
] | null | null | null | Codility_18.py | Bartoshko/codility-python-training | 5ac53e85948692c8e6c44090e68b93136b263f9c | [
"MIT"
] | null | null | null | Codility_18.py | Bartoshko/codility-python-training | 5ac53e85948692c8e6c44090e68b93136b263f9c | [
"MIT"
] | null | null | null | # works 100%
Size = [4,3,2,1,5]
Dir = [0,1,0,0,0]
print(solution(Size, Dir)) | 13.76 | 26 | 0.526163 | # works 100%
Size = [4,3,2,1,5]
Dir = [0,1,0,0,0]
def solution(A, B):
alive = 0
stack = []
for i in range(len(A)):
if B[i] == 0:
while len(stack) != 0:
if stack[-1] > A[i]:
break
else:
stack.pop()
else:
alive += 1
else:
stack.append(A[i])
alive += len(stack)
return alive
pr... | 0 | 0 | 0 | 0 | 0 | 240 | 0 | 0 | 23 |
14c0f59a7b99c781c33ae604239995f0eff72b48 | 3,629 | py | Python | benchmark_on_flyingthings3d.py | tlkvstepan/PracticalDeepStereo_NIPS2018 | 1f76b4bf414cbde6f9cd976f9d80189ab5414286 | [
"BSD-2-Clause"
] | 63 | 2018-11-01T23:02:45.000Z | 2021-11-22T11:45:34.000Z | benchmark_on_flyingthings3d.py | tlkvstepan/PracticalDeepStereo_NIPS2018 | 1f76b4bf414cbde6f9cd976f9d80189ab5414286 | [
"BSD-2-Clause"
] | 5 | 2019-01-16T20:41:21.000Z | 2021-07-19T08:11:34.000Z | benchmark_on_flyingthings3d.py | tlkvstepan/PracticalDeepStereo_NIPS2018 | 1f76b4bf414cbde6f9cd976f9d80189ab5414286 | [
"BSD-2-Clause"
] | 9 | 2019-01-07T09:06:58.000Z | 2021-03-04T08:49:31.000Z | #!/usr/bin/env python
# Copyrights. All rights reserved.
# ECOLE POLYTECHNIQUE FEDERALE DE LAUSANNE, Switzerland,
# Space Center (eSpace), 2018
# See the LICENSE.TXT file for more details.
"""Script performs benchmarking on flyingthings3D.
Benchmarking in performed with maximum disparity of 191 on
960 x 540 full-size ... | 37.412371 | 79 | 0.754202 | #!/usr/bin/env python
# Copyrights. All rights reserved.
# ECOLE POLYTECHNIQUE FEDERALE DE LAUSANNE, Switzerland,
# Space Center (eSpace), 2018
# See the LICENSE.TXT file for more details.
"""Script performs benchmarking on flyingthings3D.
Benchmarking in performed with maximum disparity of 191 on
960 x 540 full-size ... | 0 | 1,046 | 0 | 0 | 0 | 546 | 0 | 65 | 181 |
553d00c82cf03aa407e69294b108eebe1fc8c7bd | 13,063 | py | Python | tc_gan/tests/test_legacy_drivers.py | ahmadianlab/tc-gan | 06c549e8ae74bc6af62fddeed698565ea1f548c5 | [
"MIT"
] | 4 | 2019-06-04T08:15:43.000Z | 2020-10-03T13:59:15.000Z | tc_gan/tests/test_legacy_drivers.py | ahmadianlab/tc-gan | 06c549e8ae74bc6af62fddeed698565ea1f548c5 | [
"MIT"
] | null | null | null | tc_gan/tests/test_legacy_drivers.py | ahmadianlab/tc-gan | 06c549e8ae74bc6af62fddeed698565ea1f548c5 | [
"MIT"
] | null | null | null | from __future__ import print_function
import collections
from .. import drivers
from .. import execution
from .. import recorders
HistoryRecord = collections.namedtuple('HistoryRecord', ['args', 'result'])
| 31.251196 | 78 | 0.642502 | from __future__ import print_function
from types import SimpleNamespace
from unittest import mock
import collections
import functools
import io
import lasagne
import numpy as np
import pytest
from .. import drivers
from .. import execution
from .. import recorders
from ..execution import DataTables, DataStore
from .... | 0 | 4,673 | 0 | 2,742 | 0 | 4,664 | 0 | 51 | 704 |
d588f6a87c411fe8a97c1726c5e01863027c6a64 | 2,393 | py | Python | tests/tester/test_tester.py | Rajpratik71/workload-collocation-agent | 6cf7bdab97ff61d85c21c3effecea632a225c668 | [
"Apache-2.0"
] | 40 | 2019-05-16T16:42:33.000Z | 2021-11-18T06:33:03.000Z | tests/tester/test_tester.py | Rajpratik71/workload-collocation-agent | 6cf7bdab97ff61d85c21c3effecea632a225c668 | [
"Apache-2.0"
] | 72 | 2019-05-09T02:30:25.000Z | 2020-11-17T09:24:44.000Z | tests/tester/test_tester.py | Rajpratik71/workload-collocation-agent | 6cf7bdab97ff61d85c21c3effecea632a225c668 | [
"Apache-2.0"
] | 26 | 2019-05-20T09:13:38.000Z | 2021-12-15T17:57:21.000Z | # Copyright (c) 2019 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 w... | 35.191176 | 74 | 0.708734 | # Copyright (c) 2019 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 w... | 0 | 1,552 | 0 | 0 | 0 | 0 | 0 | 121 | 136 |
0ba0916da11f6bbefd8774301e4b2968769533b2 | 800 | py | Python | web/addons/product_email_template/__openerp__.py | diogocs1/comps | 63df07f6cf21c41e4527c06e2d0499f23f4322e7 | [
"Apache-2.0"
] | 1 | 2019-12-29T11:53:56.000Z | 2019-12-29T11:53:56.000Z | odoo/addons/product_email_template/__openerp__.py | tuanquanghpvn/odoo8-tutorial | 52d25f1ca5f233c431cb9d3b24b79c3b4fb5127e | [
"MIT"
] | null | null | null | odoo/addons/product_email_template/__openerp__.py | tuanquanghpvn/odoo8-tutorial | 52d25f1ca5f233c431cb9d3b24b79c3b4fb5127e | [
"MIT"
] | 3 | 2020-10-08T14:42:10.000Z | 2022-01-28T14:12:29.000Z | # -*- coding: utf-8 -*-
{
'name': 'Product Email Template',
'depends': ['account'],
'author': 'OpenERP SA',
'category': 'Accounting & Finance',
'description': """
Add email templates to products to be send on invoice confirmation
==================================================================
W... | 30.769231 | 120 | 0.58875 | # -*- coding: utf-8 -*-
{
'name': 'Product Email Template',
'depends': ['account'],
'author': 'OpenERP SA',
'category': 'Accounting & Finance',
'description': """
Add email templates to products to be send on invoice confirmation
==================================================================
W... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
79bbfbe61ecf71e337f284e6424613fdda0a101c | 1,789 | py | Python | data_gen/gen_walls.py | yifan-you-37/rl_swiss | 8b0ee7caa5c1fa93860916004cf4fd970667764f | [
"MIT"
] | 56 | 2019-10-20T03:09:02.000Z | 2022-03-25T09:21:40.000Z | data_gen/gen_walls.py | yifan-you-37/rl_swiss | 8b0ee7caa5c1fa93860916004cf4fd970667764f | [
"MIT"
] | 3 | 2020-10-01T07:33:51.000Z | 2021-05-12T03:40:57.000Z | data_gen/gen_walls.py | yifan-you-37/rl_swiss | 8b0ee7caa5c1fa93860916004cf4fd970667764f | [
"MIT"
] | 10 | 2019-11-04T16:56:09.000Z | 2022-03-25T09:21:41.000Z | import numpy as np
WALL_LEN = 20.0
NUM_PATHS = 8.0
WALL_FROM_CENTER = 8.0
TARGET_DIST = 25.0
xml_block = '<body mocap=\"true\" pos=\"{x} {y} 1\" euler="0 0 {z_rot}\">\n\
\t<geom type=\"box\" size=\"{wall_len} 0.5 2\" group=\"1\" condim=\"3\" conaffinity=\"1\"/>\n\
</body>'
increments = 2*np.pi / NUM_PATHS
half_incre... | 29.816667 | 116 | 0.4673 | import numpy as np
WALL_LEN = 20.0
NUM_PATHS = 8.0
WALL_FROM_CENTER = 8.0
TARGET_DIST = 25.0
xml_block = '<body mocap=\"true\" pos=\"{x} {y} 1\" euler="0 0 {z_rot}\">\n\
\t<geom type=\"box\" size=\"{wall_len} 0.5 2\" group=\"1\" condim=\"3\" conaffinity=\"1\"/>\n\
</body>'
increments = 2*np.pi / NUM_PATHS
half_incre... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
160199e61b9aad392c4d304bf1624d6ebd0c51ea | 2,297 | py | Python | cohesity_management_sdk/models/sql_server_instance_version.py | chandrashekar-cohesity/management-sdk-python | 9e6ec99e8a288005804b808c4e9b19fd204e3a8b | [
"Apache-2.0"
] | 1 | 2021-01-07T20:36:22.000Z | 2021-01-07T20:36:22.000Z | cohesity_management_sdk/models/sql_server_instance_version.py | chandrashekar-cohesity/management-sdk-python | 9e6ec99e8a288005804b808c4e9b19fd204e3a8b | [
"Apache-2.0"
] | null | null | null | cohesity_management_sdk/models/sql_server_instance_version.py | chandrashekar-cohesity/management-sdk-python | 9e6ec99e8a288005804b808c4e9b19fd204e3a8b | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2019 Cohesity Inc.
| 29.831169 | 81 | 0.605137 | # -*- coding: utf-8 -*-
# Copyright 2019 Cohesity Inc.
class SQLServerInstanceVersion(object):
"""Implementation of the 'SQLServerInstanceVersion' model.
Specifies the Server Instance Version.
Attributes:
build (int): Specfies the build.
major_version (int): Specfies the major version.
... | 0 | 1,005 | 0 | 1,211 | 0 | 0 | 0 | 0 | 23 |
5c2c1b5e629370daa360eddd5dff748492cdec4d | 226 | py | Python | fatorial.py | maledicente/codes-python | 1ab2cb150ae66a21517147696029c46c6bd743ca | [
"MIT"
] | null | null | null | fatorial.py | maledicente/codes-python | 1ab2cb150ae66a21517147696029c46c6bd743ca | [
"MIT"
] | null | null | null | fatorial.py | maledicente/codes-python | 1ab2cb150ae66a21517147696029c46c6bd743ca | [
"MIT"
] | null | null | null |
print("Entre com o numero: ")
num=int(input())
print("Fatorial de ", num, " igual a:", fat(num))
| 18.833333 | 49 | 0.539823 | def fat(n):
resultado = 1
while n > 0:
resultado = resultado * n
n = n - 1
return resultado
print("Entre com o numero: ")
num=int(input())
print("Fatorial de ", num, " igual a:", fat(num))
| 0 | 0 | 0 | 0 | 0 | 104 | 0 | 0 | 22 |
9d330cf9d292d0b8040a67ff298de429b9a0dabf | 220 | py | Python | First_sentence.py | GloomyGhost-MosquitoSeal/AutoPoem | 493813627bc03b745224d6a030085148bb748345 | [
"MIT"
] | 2 | 2020-03-02T16:21:02.000Z | 2020-04-04T04:53:09.000Z | First_sentence.py | YuzukiTsuru/AutoPoem | 493813627bc03b745224d6a030085148bb748345 | [
"MIT"
] | null | null | null | First_sentence.py | YuzukiTsuru/AutoPoem | 493813627bc03b745224d6a030085148bb748345 | [
"MIT"
] | 1 | 2021-09-27T16:19:30.000Z | 2021-09-27T16:19:30.000Z | from config import Config
if __name__ == '__main__':
model = PoetryModel(Config)
for i in range(3):
#
sen = model.predict_sen('')
print(sen)
| 22 | 41 | 0.631818 | from AutoPoem.Model import *
from config import Config
if __name__ == '__main__':
model = PoetryModel(Config)
for i in range(3):
# 给出第一句话进行预测
sen = model.predict_sen('山为斜好几,')
print(sen)
| 48 | 0 | 0 | 0 | 0 | 0 | 0 | 7 | 22 |
44dca0edda4b24dea9c173c057ee7042eeb6b726 | 1,931 | py | Python | simpa_tests/automatic_tests/test_device_UUID.py | IMSY-DKFZ/simpa | b8bddcf43a4bff2564f0ec208dc511b82e49bfb4 | [
"MIT"
] | 3 | 2022-03-14T15:40:09.000Z | 2022-03-20T02:34:25.000Z | simpa_tests/automatic_tests/test_device_UUID.py | jgroehl/simpa | e56f0802e5a8555ee8bb139dd4f776025e7e9267 | [
"MIT"
] | 3 | 2022-03-18T07:19:12.000Z | 2022-03-30T12:15:19.000Z | simpa_tests/automatic_tests/test_device_UUID.py | IMSY-DKFZ/simpa | b8bddcf43a4bff2564f0ec208dc511b82e49bfb4 | [
"MIT"
] | null | null | null | # SPDX-FileCopyrightText: 2021 Division of Intelligent Medical Systems, DKFZ
# SPDX-FileCopyrightText: 2021 Janek Groehl
# SPDX-License-Identifier: MIT
| 47.097561 | 96 | 0.751424 | # SPDX-FileCopyrightText: 2021 Division of Intelligent Medical Systems, DKFZ
# SPDX-FileCopyrightText: 2021 Janek Groehl
# SPDX-License-Identifier: MIT
import unittest
from simpa.core.device_digital_twins import RSOMExplorerP50
from simpa.core.device_digital_twins import InVision256TF
from simpa.core.device_digital_tw... | 0 | 0 | 0 | 1,427 | 0 | 0 | 0 | 216 | 134 |
86c2bac9524b083c2ef8d3f5794a22d814972f80 | 19,723 | py | Python | ammf/core/box_8c_encoder.py | bangquanxie/ASM3D | 09a6a6b51599e80dd7ef5226f326d58cf7b5de8e | [
"MIT"
] | 1 | 2021-08-21T02:09:57.000Z | 2021-08-21T02:09:57.000Z | ammf/core/box_8c_encoder.py | bangquanxie/ASM3D | 09a6a6b51599e80dd7ef5226f326d58cf7b5de8e | [
"MIT"
] | null | null | null | ammf/core/box_8c_encoder.py | bangquanxie/ASM3D | 09a6a6b51599e80dd7ef5226f326d58cf7b5de8e | [
"MIT"
] | null | null | null | import numpy as np
import tensorflow as tf
from ammf.core import format_checker
from ammf.core import box_3d_encoder
def np_box_3d_to_box_8co(box_3d):
"""Computes the 3D bounding box corner positions from Box3D format.
The order of corners are preserved during this conversion.
Args:
box_3d: 1 x... | 34.005172 | 79 | 0.586675 | import numpy as np
import tensorflow as tf
from ammf.core import format_checker
from ammf.core import box_3d_encoder
def np_box_3d_to_box_8co(box_3d):
"""Computes the 3D bounding box corner positions from Box3D format.
The order of corners are preserved during this conversion.
Args:
box_3d: 1 x... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2701b1af17d2048d5443870e37753ea10812487c | 422 | py | Python | app/Table.py | cothan/chinese-chess | f896efda7da2b448ffaa1e92ac04397014bde24a | [
"MIT"
] | null | null | null | app/Table.py | cothan/chinese-chess | f896efda7da2b448ffaa1e92ac04397014bde24a | [
"MIT"
] | null | null | null | app/Table.py | cothan/chinese-chess | f896efda7da2b448ffaa1e92ac04397014bde24a | [
"MIT"
] | null | null | null | """Table Model."""
| 24.823529 | 79 | 0.609005 | """Table Model."""
from config.database import Model
from orator.orm import belongs_to
class Table(Model):
"""Table Model."""
__fillable__ = ['user_id', 'oppo_id', 'token', 'move', 'completed',
'last_move_timestamp', 'next_id', 'owner', 'winner', 'msg']
__table__ = 'chesses'
@bel... | 0 | 84 | 0 | 226 | 0 | 0 | 0 | 24 | 68 |
7a76d2bc099d2e1456a2842f4260550cd89ee39c | 9,929 | py | Python | plots.py | 982543386/Risk_aware_MEC_offloading | 62c90954e52e6b37e0fba06ebad37c58f30125f4 | [
"MIT"
] | 17 | 2020-04-27T13:06:53.000Z | 2022-03-30T06:55:12.000Z | plots.py | 982543386/Risk_aware_MEC_offloading | 62c90954e52e6b37e0fba06ebad37c58f30125f4 | [
"MIT"
] | 1 | 2021-06-01T11:02:55.000Z | 2021-09-10T14:29:50.000Z | plots.py | vinPopulaire/Risk_aware_MEC_offloading | 4dcbd8dd40b3d5d72132e05557e2b68f0b382131 | [
"MIT"
] | 8 | 2020-05-25T00:49:34.000Z | 2022-02-09T07:35:20.000Z | '''
Plot functions to graphically present simulation results
'''
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.lines as mlines
from mpl_toolkits.axes_grid1 import host_subplot
import mpl_toolkits.axisartist as AA
def setup_plots(suptitle):
'''
Basic setup of plots so it can be reused o... | 30.457055 | 106 | 0.640649 | '''
Plot functions to graphically present simulation results
'''
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.lines as mlines
from mpl_toolkits.axes_grid1 import host_subplot
import mpl_toolkits.axisartist as AA
def setup_plots(suptitle):
'''
Basic setup of plots so ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -4 | 22 |
51e75060e91f6e03ec3138c9f97b745b5f452370 | 7,191 | py | Python | util/dataset.py | nonstop1962/pytorch-dental_age_estimation | 9bbe72b0dbf83514d900aeebc511fcfd3ab17202 | [
"MIT"
] | 1 | 2021-04-20T17:22:39.000Z | 2021-04-20T17:22:39.000Z | util/dataset.py | nonstop1962/pytorch-dental_age_estimation | 9bbe72b0dbf83514d900aeebc511fcfd3ab17202 | [
"MIT"
] | 1 | 2022-03-14T10:55:54.000Z | 2022-03-14T10:55:54.000Z | util/dataset.py | nonstop1962/pytorch-dental_age_estimation | 9bbe72b0dbf83514d900aeebc511fcfd3ab17202 | [
"MIT"
] | 1 | 2022-01-31T09:03:44.000Z | 2022-01-31T09:03:44.000Z | import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
import logging
logger = logging.getLogger("Logger")
| 27.342205 | 95 | 0.550132 | import os
import sys
from os.path import join as pjoin
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
import logging
from PIL import Image
import numpy as np
import torch
import torch.nn.functional as F
from torch.utils import data
from torchvision import transforms
logger = logging.getLogger("Logg... | 126 | 0 | 0 | 6,777 | 0 | 0 | 0 | 30 | 202 |
b2be1b1fa9fb7bf7b5377ac4fdb62588f6cde9e4 | 9,793 | py | Python | Feature/AdaptedLesk.py | blodstone/CCS590v2 | 8cf5d487568116203816839bb76c800dc02331c1 | [
"MIT"
] | null | null | null | Feature/AdaptedLesk.py | blodstone/CCS590v2 | 8cf5d487568116203816839bb76c800dc02331c1 | [
"MIT"
] | null | null | null | Feature/AdaptedLesk.py | blodstone/CCS590v2 | 8cf5d487568116203816839bb76c800dc02331c1 | [
"MIT"
] | null | null | null | '''
Created on Feb 27, 2011
@author: Blodstone
'''
from nltk.corpus import wordnet, stopwords
from nltk.tokenize import word_tokenize
import string
import time
from operator import itemgetter
from IOPreprocessing.DataPreparation import DataRetrieval
if __name__ == "__main__":
lesk = AdaptedLesk... | 44.112613 | 295 | 0.529153 | '''
Created on Feb 27, 2011
@author: Blodstone
'''
from nltk.corpus import wordnet, stopwords
from nltk.tokenize import word_tokenize
import string
import time
from operator import itemgetter
from IOPreprocessing.DataPreparation import DataRetrieval
class AdaptedLesk:
def __init__(self,k):
... | 0 | 0 | 0 | 8,738 | 0 | 0 | 0 | 0 | 25 |
4d3b2b67ffedb3da13db63e0dc189cea59901a98 | 7,795 | py | Python | gui/wellplot/toolbar/logsettingstoolbar.py | adriangrepo/qreservoir | 20fba1b1fd1a42add223d9e8af2d267665bec493 | [
"MIT"
] | 2 | 2019-10-04T13:54:51.000Z | 2021-05-21T19:36:15.000Z | gui/wellplot/toolbar/logsettingstoolbar.py | adriangrepo/qreservoir | 20fba1b1fd1a42add223d9e8af2d267665bec493 | [
"MIT"
] | 3 | 2019-11-19T17:06:09.000Z | 2020-01-18T20:39:54.000Z | gui/wellplot/toolbar/logsettingstoolbar.py | adriangrepo/qreservoir | 20fba1b1fd1a42add223d9e8af2d267665bec493 | [
"MIT"
] | 2 | 2020-07-02T13:20:48.000Z | 2020-11-11T00:18:51.000Z |
from __future__ import absolute_import
from PyQt4.QtGui import QToolBar, QLabel, QPixmap, QApplication, QCursor
from PyQt4 import QtGui, QtCore
from PyQt4.QtCore import pyqtSlot, Qt
from views.core import centraltabwidget
from gui.wellplot.subplots.wellplotwidget import WellPlotWidget
from globalvalues.appsetting... | 43.305556 | 155 | 0.708403 |
from __future__ import absolute_import
from PyQt4.QtGui import QToolBar, QLabel, QPixmap, QApplication, QCursor
from PyQt4 import QtGui, QtCore
from PyQt4.QtCore import pyqtSlot, Qt
from views.core import centraltabwidget
from gui.wellplot.subplots.wellplotwidget import WellPlotWidget
from globalvalues.appsetting... | 0 | 144 | 0 | 6,428 | 0 | 341 | 0 | 0 | 147 |
894a3a1cf6d57faf1bd36d1eda4cba436fc31a29 | 4,661 | py | Python | server.py | HananBar/esp8266_workshop | 80cffb208fd3639e291db5d4349d627676e9819f | [
"MIT"
] | null | null | null | server.py | HananBar/esp8266_workshop | 80cffb208fd3639e291db5d4349d627676e9819f | [
"MIT"
] | null | null | null | server.py | HananBar/esp8266_workshop | 80cffb208fd3639e291db5d4349d627676e9819f | [
"MIT"
] | null | null | null | from flask import Flask
from flask_cors import CORS
from pymongo import MongoClient
from config_manager import ConfigManager
from task01_connect import Task01_Connect
from task02_static import Task02_StaticIp
from task03_webserver import Task03_WebServer
from task04_api import Task04_ApiResponse
from task05_temperature... | 30.464052 | 104 | 0.646642 | from flask import Flask, jsonify, request
from flask_cors import CORS
from pymongo import MongoClient
from db_access import WorkshopDb
from config_manager import ConfigManager
from task01_connect import Task01_Connect
from task02_static import Task02_StaticIp
from task03_webserver import Task03_WebServer
from task04_ap... | 0 | 3,265 | 0 | 0 | 0 | 0 | 0 | 29 | 206 |
43c518103fc02ea05d97461bec0b5db564d45b29 | 6,752 | py | Python | scapy/modules/nmap.py | kosciolek/J-Tracert | 89ed802f700e02600138ad7132e6a856463620dd | [
"MIT"
] | 3 | 2019-04-09T22:59:33.000Z | 2019-06-14T09:23:24.000Z | scapy/modules/nmap.py | kosciolek/J-Tracert | 89ed802f700e02600138ad7132e6a856463620dd | [
"MIT"
] | null | null | null | scapy/modules/nmap.py | kosciolek/J-Tracert | 89ed802f700e02600138ad7132e6a856463620dd | [
"MIT"
] | 1 | 2018-11-15T12:37:04.000Z | 2018-11-15T12:37:04.000Z | ## This file is part of Scapy
## See http://www.secdev.org/projects/scapy for more informations
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
"""Clone of Nmap's first generation OS fingerprinting.
This code works with the first-generation OS detection and
nmap-o... | 30.414414 | 80 | 0.54843 | ## This file is part of Scapy
## See http://www.secdev.org/projects/scapy for more informations
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
"""Clone of Nmap's first generation OS fingerprinting.
This code works with the first-generation OS detection and
nmap-o... | 0 | 858 | 0 | 1,376 | 0 | 2,952 | 0 | 97 | 340 |
3f2ea56d4d70ee4e15661743478b006703934d50 | 2,399 | py | Python | infer.py | constanreedjohn/Dogs_Cats_Classification_Resnet50 | cbe662e181144a4f6b2d99810200b5c944250341 | [
"Apache-2.0"
] | null | null | null | infer.py | constanreedjohn/Dogs_Cats_Classification_Resnet50 | cbe662e181144a4f6b2d99810200b5c944250341 | [
"Apache-2.0"
] | null | null | null | infer.py | constanreedjohn/Dogs_Cats_Classification_Resnet50 | cbe662e181144a4f6b2d99810200b5c944250341 | [
"Apache-2.0"
] | null | null | null | from eval import load_model
import torch
import os
if __name__ == "__main__":
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
print(f"Using {device}")
args = parse_opt()
model = load_model(device, args.model_path)
if not os.path.exists(args.out_path):
os.mkdir(a... | 32.418919 | 127 | 0.604835 | from eval import load_model
import torch
import matplotlib.pyplot as plt
from torchvision import transforms
from torch.utils.data import DataLoader
from PIL import Image
import cv2
import argparse
import os
def Inference(device, model, img_path, out_path):
count = 0
if not os.path.exists(out_path):
... | 0 | 0 | 0 | 0 | 0 | 1,730 | 0 | 24 | 190 |
dd5989ab7a6b1d8c7db0efc9678ea8c050ddc599 | 1,687 | py | Python | adventofcode2020/08.py | matslindh/codingchallenges | b6792808b03ea07304fda7e74c874c2c4d200dac | [
"MIT"
] | 2 | 2016-12-28T09:40:07.000Z | 2020-12-08T13:58:15.000Z | adventofcode2020/08.py | matslindh/codingchallenges | b6792808b03ea07304fda7e74c874c2c4d200dac | [
"MIT"
] | null | null | null | adventofcode2020/08.py | matslindh/codingchallenges | b6792808b03ea07304fda7e74c874c2c4d200dac | [
"MIT"
] | null | null | null |
if __name__ == '__main__':
print(parse_and_execute([x.strip() for x in open('input/08').readlines()]))
print(parse_modify_and_execute([x.strip() for x in open('input/08').readlines()])) | 24.808824 | 96 | 0.602845 | import copy
def parse(raw_instructions):
instructions = []
for r_i in raw_instructions:
p = r_i.split(' ')
instructions.append(
[p[0], int(p[1])]
)
return instructions
def parse_and_execute(raw_instructions):
instructions = parse(raw_instructions)
return exe... | 0 | 0 | 0 | 0 | 0 | 1,337 | 0 | -10 | 160 |
4d0e6a700fdd100085067e81e7e3555f70d236cd | 322 | py | Python | webservice/manage.py | wilcarllopez/capstone | bdb984f93d020ffa7584fafd29cc8955b896eafb | [
"MIT"
] | null | null | null | webservice/manage.py | wilcarllopez/capstone | bdb984f93d020ffa7584fafd29cc8955b896eafb | [
"MIT"
] | 1 | 2021-06-02T00:40:55.000Z | 2021-06-02T00:40:55.000Z | webservice/manage.py | wilcarllopez/capstone | bdb984f93d020ffa7584fafd29cc8955b896eafb | [
"MIT"
] | null | null | null | import os
from flask_script import Manager
from flask_migrate import Migrate, MigrateCommand
from app import app, db
env_name = os.getenv('FLASK_ENV')
app = app(env_name)
migrate = Migrate(app=app, db=db)
manager = Manager(app=app)
manager.add_command('db', MigrateCommand)
if __name__ == '__main__':
manager.run(... | 21.466667 | 49 | 0.757764 | import os
from flask_script import Manager
from flask_migrate import Migrate, MigrateCommand
from app import app, db
env_name = os.getenv('FLASK_ENV')
app = app(env_name)
migrate = Migrate(app=app, db=db)
manager = Manager(app=app)
manager.add_command('db', MigrateCommand)
if __name__ == '__main__':
manager.run(... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
341c9eba0762d38d517d439e95f02672cfe49104 | 12,779 | py | Python | app/main/views.py | qingduyu/BackManager | 4227ea7b3608c1f814e9496382772a3ace0dbff9 | [
"Apache-2.0"
] | 32 | 2016-11-10T12:59:53.000Z | 2021-09-17T12:24:47.000Z | app/main/views.py | ljb-2000/BackManager | 4227ea7b3608c1f814e9496382772a3ace0dbff9 | [
"Apache-2.0"
] | 1 | 2019-01-09T01:33:17.000Z | 2019-01-09T01:33:17.000Z | app/main/views.py | linuxyan/BackManager | 4227ea7b3608c1f814e9496382772a3ace0dbff9 | [
"Apache-2.0"
] | 33 | 2016-07-21T15:07:13.000Z | 2022-01-07T07:44:19.000Z | #!/usr/bin/python
# coding=utf-8
#__author__ = 'CY'
from .. import db
| 47.505576 | 170 | 0.649503 | #!/usr/bin/python
# coding=utf-8
#__author__ = 'CY'
from flask import render_template, request, flash,abort,redirect,url_for
from flask.ext.login import login_required, current_user
from . import main
from .. import db
from sqlalchemy import and_,desc,or_
from app.models import users,backhosts,customers,backar... | 207 | 11,836 | 0 | 0 | 0 | 106 | 0 | 204 | 481 |
ac025dac5cda286434f34519afebf46029bf14dd | 1,816 | py | Python | mirnet/model/residual_resizing_modules.py | prachigaikwad201994/https-github.com-prachi12345-MIRNet | c6812f5bc4ac87e4e63af21aa4e0db84597a17c8 | [
"Apache-2.0"
] | 78 | 2020-12-04T10:38:58.000Z | 2022-03-22T09:16:53.000Z | mirnet/model/residual_resizing_modules.py | prachigaikwad201994/https-github.com-prachi12345-MIRNet | c6812f5bc4ac87e4e63af21aa4e0db84597a17c8 | [
"Apache-2.0"
] | 3 | 2021-01-14T21:46:34.000Z | 2022-02-23T17:20:41.000Z | mirnet/model/residual_resizing_modules.py | prachigaikwad201994/https-github.com-prachi12345-MIRNet | c6812f5bc4ac87e4e63af21aa4e0db84597a17c8 | [
"Apache-2.0"
] | 26 | 2020-12-18T00:56:20.000Z | 2022-03-13T19:30:19.000Z | import tensorflow as tf
def down_sampling_module(input_tensor):
"""Downsampling Module"""
channels = list(input_tensor.shape)[-1]
main_branch = tf.keras.layers.Conv2D(
channels, kernel_size=(1, 1))(input_tensor)
main_branch = tf.nn.relu(main_branch)
# main_branch = tf.keras.layers.Conv2D(
... | 43.238095 | 69 | 0.689427 | import tensorflow as tf
def down_sampling_module(input_tensor):
"""Downsampling Module"""
channels = list(input_tensor.shape)[-1]
main_branch = tf.keras.layers.Conv2D(
channels, kernel_size=(1, 1))(input_tensor)
main_branch = tf.nn.relu(main_branch)
# main_branch = tf.keras.layers.Conv2D(
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7dafc93a1444426f1091e413070ddf8fef3aef98 | 3,032 | py | Python | sqlsite/routing.py | j4mie/sqlsite | f2dadb8db5ed7880f8872b6591d8cb1487f777ea | [
"Unlicense"
] | 192 | 2020-01-13T17:12:07.000Z | 2021-08-13T21:44:38.000Z | sqlsite/routing.py | j4mie/sqlsite | f2dadb8db5ed7880f8872b6591d8cb1487f777ea | [
"Unlicense"
] | 6 | 2020-01-12T15:55:32.000Z | 2020-02-08T03:29:26.000Z | sqlsite/routing.py | j4mie/sqlsite | f2dadb8db5ed7880f8872b6591d8cb1487f777ea | [
"Unlicense"
] | 3 | 2020-01-16T18:42:33.000Z | 2022-02-06T23:21:38.000Z | from sqlsite.database import install_function
import re
PATH_MATCH_FUNCTION_NAME = "PATH_MATCH"
PATTERN_COMPONENT_RE = re.compile(r"<(?P<param_type>[a-z]+):(?P<param_name>[a-z_]+)>")
PATTERN_PARAM_TYPES = {
"str": "[^/]+",
"int": "[0-9]+",
"slug": "[-a-zA-Z0-9_]+",
"uuid": "[0-9a-f]{8}-[0-9a-f]{4}-[... | 29.72549 | 86 | 0.637203 | from functools import lru_cache
from sqlsite.database import install_function
import re
PATH_MATCH_FUNCTION_NAME = "PATH_MATCH"
PATTERN_COMPONENT_RE = re.compile(r"<(?P<param_type>[a-z]+):(?P<param_name>[a-z_]+)>")
PATTERN_PARAM_TYPES = {
"str": "[^/]+",
"int": "[0-9]+",
"slug": "[-a-zA-Z0-9_]+",
"u... | 0 | 745 | 0 | 319 | 0 | 502 | 0 | 10 | 118 |