hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | 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 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f727a4a852b255e576e4ed8f9b5db24f9d41a4fc | 27,397 | py | Python | openstack_dashboard/test/api_tests/neutron_tests.py | HaManhDong/Custom-Horizon | 17513ebbe03b8ae58e0925f826801343e1e3e3e0 | [
"Apache-2.0"
] | null | null | null | openstack_dashboard/test/api_tests/neutron_tests.py | HaManhDong/Custom-Horizon | 17513ebbe03b8ae58e0925f826801343e1e3e3e0 | [
"Apache-2.0"
] | null | null | null | openstack_dashboard/test/api_tests/neutron_tests.py | HaManhDong/Custom-Horizon | 17513ebbe03b8ae58e0925f826801343e1e3e3e0 | [
"Apache-2.0"
] | null | null | null | # Copyright 2012 NEC 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 ag... | 42.019939 | 84 | 0.638756 |
import copy
import uuid
from mox3.mox import IsA
from django import http
from django.test.utils import override_settings
from neutronclient.common import exceptions as neutron_exc
from openstack_dashboard import api
from openstack_dashboard import policy
from openstack_dashboard.test import helpers a... | true | true |
f727a6fbe910664403fa49773ddc8bc6ca0f017c | 3,896 | py | Python | cfgs_fatdet/voc/fatnat/ttfnet_fatnet_ttfheadfull_96_10x_aug_no_pretrain.py | Leotju/ttfnet | 94eea28ea22215310140caee492d5de2b01b3d04 | [
"Apache-2.0"
] | null | null | null | cfgs_fatdet/voc/fatnat/ttfnet_fatnet_ttfheadfull_96_10x_aug_no_pretrain.py | Leotju/ttfnet | 94eea28ea22215310140caee492d5de2b01b3d04 | [
"Apache-2.0"
] | null | null | null | cfgs_fatdet/voc/fatnat/ttfnet_fatnet_ttfheadfull_96_10x_aug_no_pretrain.py | Leotju/ttfnet | 94eea28ea22215310140caee492d5de2b01b3d04 | [
"Apache-2.0"
] | null | null | null | # model settings
model = dict(
type='TTFNet',
# pretrained='modelzoo://resnet18',
pretrained=None,
backbone=dict(
type='FatNetSimple',
norm_cfg = dict(type='BN', requires_grad=True),
),
neck=None,
bbox_head=dict(
type='TTFHeadFull',
inplanes=16,
planes=64,... | 29.969231 | 91 | 0.592402 |
model = dict(
type='TTFNet',
pretrained=None,
backbone=dict(
type='FatNetSimple',
norm_cfg = dict(type='BN', requires_grad=True),
),
neck=None,
bbox_head=dict(
type='TTFHeadFull',
inplanes=16,
planes=64,
head_conv=64,
down_ratio=1,
... | true | true |
f727a95057ac0c7fae2ad50f1000ff55d2fd438e | 35,520 | py | Python | tests/test_project.py | Anton-Latukha/wakatime | 3035a28a3f996a11d928802dcb05844bb0a52655 | [
"BSD-3-Clause"
] | 1,198 | 2015-01-02T12:08:49.000Z | 2021-10-07T02:46:59.000Z | tests/test_project.py | Anton-Latukha/wakatime | 3035a28a3f996a11d928802dcb05844bb0a52655 | [
"BSD-3-Clause"
] | 249 | 2015-01-22T13:31:12.000Z | 2021-05-01T08:01:22.000Z | tests/test_project.py | Anton-Latukha/wakatime | 3035a28a3f996a11d928802dcb05844bb0a52655 | [
"BSD-3-Clause"
] | 118 | 2015-01-16T19:13:15.000Z | 2021-07-21T15:09:15.000Z | # -*- coding: utf-8 -*-
from wakatime.main import execute
from wakatime.packages import requests
from wakatime.packages.requests.models import Response
import logging
import os
import shutil
import tempfile
import time
from testfixtures import log_capture
from wakatime.compat import u, open
from wakatime.constants i... | 41.788235 | 147 | 0.633136 |
from wakatime.main import execute
from wakatime.packages import requests
from wakatime.packages.requests.models import Response
import logging
import os
import shutil
import tempfile
import time
from testfixtures import log_capture
from wakatime.compat import u, open
from wakatime.constants import API_ERROR, SUCCES... | true | true |
f727a9f08929b08e1199a143d5fe11d7e1b8cf8a | 2,647 | py | Python | flask/tutorial/flaskr/blog.py | jianchengwang/todo-python | 36bdaf6fae714531946047ececca995d60f86e4a | [
"MIT"
] | null | null | null | flask/tutorial/flaskr/blog.py | jianchengwang/todo-python | 36bdaf6fae714531946047ececca995d60f86e4a | [
"MIT"
] | null | null | null | flask/tutorial/flaskr/blog.py | jianchengwang/todo-python | 36bdaf6fae714531946047ececca995d60f86e4a | [
"MIT"
] | null | null | null | from flask import (
Blueprint, flash, g, redirect, render_template, request, url_for
)
from werkzeug.exceptions import abort
from flaskr.auth import login_required
from flaskr.db import get_db
bp = Blueprint('blog', __name__)
@bp.route('/')
def index():
db = get_db()
posts = db.execute(
... | 27.28866 | 69 | 0.530412 | from flask import (
Blueprint, flash, g, redirect, render_template, request, url_for
)
from werkzeug.exceptions import abort
from flaskr.auth import login_required
from flaskr.db import get_db
bp = Blueprint('blog', __name__)
@bp.route('/')
def index():
db = get_db()
posts = db.execute(
... | true | true |
f727ad7b679d2e1f9b7546a04cf754276693bc15 | 418 | py | Python | backend/wishlist/settings/development.py | oaguy1/wishlist.vote | 3440cc05cfe039e905064fd2dfcb0ae06402e12c | [
"MIT"
] | null | null | null | backend/wishlist/settings/development.py | oaguy1/wishlist.vote | 3440cc05cfe039e905064fd2dfcb0ae06402e12c | [
"MIT"
] | null | null | null | backend/wishlist/settings/development.py | oaguy1/wishlist.vote | 3440cc05cfe039e905064fd2dfcb0ae06402e12c | [
"MIT"
] | null | null | null | from .base import *
DEBUG = True
ALLOWED_HOSTS = []
# Database
# https://docs.djangoproject.com/en/3.1/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': os.environ.get("POSTGRES_DB"),
'USER': os.environ.get("POSTGRES_USER"),
'P... | 20.9 | 63 | 0.593301 | from .base import *
DEBUG = True
ALLOWED_HOSTS = []
S = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': os.environ.get("POSTGRES_DB"),
'USER': os.environ.get("POSTGRES_USER"),
'PASSWORD': os.environ.get("POSTGRES_PASSWORD"),
'HOST': 'db',
'PORT'... | true | true |
f727af1c0db0d85bc6562a4f4ff54917e782503c | 1,030 | py | Python | annotater/memetext/decorators.py | stricoff92/annotater | 8ca471477e2d567945e14f09d3d763d379e7587e | [
"MIT"
] | null | null | null | annotater/memetext/decorators.py | stricoff92/annotater | 8ca471477e2d567945e14f09d3d763d379e7587e | [
"MIT"
] | null | null | null | annotater/memetext/decorators.py | stricoff92/annotater | 8ca471477e2d567945e14f09d3d763d379e7587e | [
"MIT"
] | null | null | null |
from functools import wraps
from django.http import HttpResponse
from rest_framework.response import Response
from rest_framework import status
from website.constants import WIDGET_NAMES
def user_can_use_web_widget(function):
@wraps(function)
def decorator(request, *a, **k):
if request.user.userpro... | 29.428571 | 80 | 0.646602 |
from functools import wraps
from django.http import HttpResponse
from rest_framework.response import Response
from rest_framework import status
from website.constants import WIDGET_NAMES
def user_can_use_web_widget(function):
@wraps(function)
def decorator(request, *a, **k):
if request.user.userpro... | true | true |
f727af8237ad53753e4c67cd9224b1cb5ed49267 | 4,059 | py | Python | tests/module/fetch/test_init.py | mgorny/pkgcore | ab4a718aa1626f4edeb385383f5595a1e262b0dc | [
"BSD-3-Clause"
] | null | null | null | tests/module/fetch/test_init.py | mgorny/pkgcore | ab4a718aa1626f4edeb385383f5595a1e262b0dc | [
"BSD-3-Clause"
] | null | null | null | tests/module/fetch/test_init.py | mgorny/pkgcore | ab4a718aa1626f4edeb385383f5595a1e262b0dc | [
"BSD-3-Clause"
] | null | null | null | # Copyright: 2006 Brian Harring <ferringb@gmail.com>
# License: GPL2/BSD
from snakeoil.sequences import iflatten_instance
from snakeoil.test import TestCase
from pkgcore import fetch
class base(TestCase):
def assertUri(self, obj, uri):
uri = list(uri)
self.assertEqual(list(iflatten_instance(obj... | 32.472 | 80 | 0.614437 |
from snakeoil.sequences import iflatten_instance
from snakeoil.test import TestCase
from pkgcore import fetch
class base(TestCase):
def assertUri(self, obj, uri):
uri = list(uri)
self.assertEqual(list(iflatten_instance(obj)), uri)
if uri:
self.assertTrue(obj)
else:... | true | true |
f727aff556ad2c85d3ab130a226c9d8be9a26bce | 5,527 | py | Python | Practice/adapter_roberta_v4/adapter_model.py | accordproject/labs-cicero-classify | 3a52ebaf45252515c417bf94a05e33fc1c2628b8 | [
"Apache-2.0"
] | 2 | 2021-07-07T01:06:18.000Z | 2021-11-12T18:54:21.000Z | Practice/adapter_roberta_v4/adapter_model.py | accordproject/labs_cicero_classify | 3a52ebaf45252515c417bf94a05e33fc1c2628b8 | [
"Apache-2.0"
] | 3 | 2021-06-25T12:40:23.000Z | 2022-02-14T13:42:30.000Z | Practice/adapter_roberta_v4/adapter_model.py | accordproject/labs_cicero_classify | 3a52ebaf45252515c417bf94a05e33fc1c2628b8 | [
"Apache-2.0"
] | null | null | null | import pandas as pd
import numpy as np
import torch
print(f"Torch Version: {torch.__version__}")
import transformers
print(f"transformers (Adapter) Version: {transformers.__version__}")
from transformers import RobertaTokenizer
import numpy as np
tokenizer = RobertaTokenizer.from_pretrained("roberta-base")
from tra... | 29.875676 | 87 | 0.701646 | import pandas as pd
import numpy as np
import torch
print(f"Torch Version: {torch.__version__}")
import transformers
print(f"transformers (Adapter) Version: {transformers.__version__}")
from transformers import RobertaTokenizer
import numpy as np
tokenizer = RobertaTokenizer.from_pretrained("roberta-base")
from tra... | true | true |
f727b1c8a4f7b616a8ac216e156b396852c3e415 | 23,151 | py | Python | src/python/WMCore/MicroService/MSTransferor/RequestInfo.py | vkuznet/WMCore | 001cc51651052405a7ecd811cde91da611b1dc57 | [
"Apache-2.0"
] | null | null | null | src/python/WMCore/MicroService/MSTransferor/RequestInfo.py | vkuznet/WMCore | 001cc51651052405a7ecd811cde91da611b1dc57 | [
"Apache-2.0"
] | 1 | 2018-10-30T16:23:07.000Z | 2018-10-30T16:23:07.000Z | src/python/WMCore/MicroService/MSTransferor/RequestInfo.py | vkuznet/WMCore | 001cc51651052405a7ecd811cde91da611b1dc57 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""
_RequestInfo_
Class to hold and parse all information related to a given request
"""
# futures
from __future__ import division, print_function
from future.utils import viewitems
# system modules
import datetime
import time
# WMCore modules
from pprint import pformat
from copy import deepcopy... | 48.03112 | 118 | 0.619066 |
from __future__ import division, print_function
from future.utils import viewitems
import datetime
import time
from pprint import pformat
from copy import deepcopy
from Utils.IteratorTools import grouper
from WMCore.DataStructs.LumiList import LumiList
from WMCore.MicroService.MSTransferor.Workflow import Workflow... | true | true |
f727b49174b3a60786564bef9812ead45c308098 | 1,363 | py | Python | database/migrations/0016_auto_20190113_0449.py | ccraddock/beiwe-backend-cc | b37c2604800aafcf81c93bc14673ada6aed17a39 | [
"BSD-3-Clause"
] | null | null | null | database/migrations/0016_auto_20190113_0449.py | ccraddock/beiwe-backend-cc | b37c2604800aafcf81c93bc14673ada6aed17a39 | [
"BSD-3-Clause"
] | null | null | null | database/migrations/0016_auto_20190113_0449.py | ccraddock/beiwe-backend-cc | b37c2604800aafcf81c93bc14673ada6aed17a39 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2019-01-13 04:49
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('database', '0015_auto_20190112_0251'),
]
operation... | 38.942857 | 159 | 0.623624 |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('database', '0015_auto_20190112_0251'),
]
operations = [
migrations.CreateModel(
name='ReceivedDataSta... | true | true |
f727b5c41eac8de45cd42818ceedba94bf6fbdec | 427 | py | Python | Extra Exercises/artbyraza.py | luizpavanello/python_udacity | 6411af82db8123e5b6b731c5a3bced2c31dc2c57 | [
"MIT"
] | null | null | null | Extra Exercises/artbyraza.py | luizpavanello/python_udacity | 6411af82db8123e5b6b731c5a3bced2c31dc2c57 | [
"MIT"
] | null | null | null | Extra Exercises/artbyraza.py | luizpavanello/python_udacity | 6411af82db8123e5b6b731c5a3bced2c31dc2c57 | [
"MIT"
] | null | null | null | import turtle
t = turtle.Turtle()
turtle.bgcolor('black')
def triangle():
t.forward(100)
t.left(120)
t.forward(100)
t.left(120)
t.forward(100)
t.left(120)
t.forward(100)
t.speed(0)
t.pencolor('red')
t.penup()
t.goto(-350,250)
t.pendown()
for numbers in range(7):
x = 250 - (86*numbers)
... | 17.791667 | 27 | 0.59719 | import turtle
t = turtle.Turtle()
turtle.bgcolor('black')
def triangle():
t.forward(100)
t.left(120)
t.forward(100)
t.left(120)
t.forward(100)
t.left(120)
t.forward(100)
t.speed(0)
t.pencolor('red')
t.penup()
t.goto(-350,250)
t.pendown()
for numbers in range(7):
x = 250 - (86*numbers)
... | true | true |
f727b654f4653c3f574ae05040ca03e4ed0356f1 | 1,821 | py | Python | setup.py | pauleveritt/wired | 629f950176a9682a7ccb68efbb27cb2e23b4e93e | [
"MIT"
] | 1 | 2021-01-09T00:05:54.000Z | 2021-01-09T00:05:54.000Z | setup.py | pauleveritt/wired | 629f950176a9682a7ccb68efbb27cb2e23b4e93e | [
"MIT"
] | null | null | null | setup.py | pauleveritt/wired | 629f950176a9682a7ccb68efbb27cb2e23b4e93e | [
"MIT"
] | 1 | 2019-04-22T14:22:39.000Z | 2019-04-22T14:22:39.000Z | from setuptools import setup, find_packages
def readfile(name):
with open(name) as f:
return f.read()
readme = readfile('README.rst')
changes = readfile('CHANGES.rst')
requires = ['zope.interface']
docs_require = ['Sphinx', 'sphinx_rtd_theme']
tests_require = ['pytest', 'pytest-cov', 'venusian', 'syb... | 29.852459 | 74 | 0.606809 | from setuptools import setup, find_packages
def readfile(name):
with open(name) as f:
return f.read()
readme = readfile('README.rst')
changes = readfile('CHANGES.rst')
requires = ['zope.interface']
docs_require = ['Sphinx', 'sphinx_rtd_theme']
tests_require = ['pytest', 'pytest-cov', 'venusian', 'syb... | true | true |
f727b7bdfdf05c7eb3a30b160d05ef9a20097bfc | 227,887 | py | Python | src/borg/testsuite/archiver.py | adrian5/borg | 6f371d5522e515c738340c2cd6dc2473b644c4d2 | [
"BSD-3-Clause"
] | 1 | 2021-03-20T15:13:11.000Z | 2021-03-20T15:13:11.000Z | src/borg/testsuite/archiver.py | adrian5/borg | 6f371d5522e515c738340c2cd6dc2473b644c4d2 | [
"BSD-3-Clause"
] | 9 | 2020-12-05T01:08:44.000Z | 2021-04-19T23:06:12.000Z | src/borg/testsuite/archiver.py | adrian5/borg | 6f371d5522e515c738340c2cd6dc2473b644c4d2 | [
"BSD-3-Clause"
] | null | null | null | import argparse
import dateutil.tz
import errno
import io
import json
import logging
import os
import pstats
import random
import re
import shutil
import socket
import stat
import subprocess
import sys
import tempfile
import time
import unittest
from binascii import unhexlify, b2a_base64
from configparser import Config... | 51.418547 | 148 | 0.630304 | import argparse
import dateutil.tz
import errno
import io
import json
import logging
import os
import pstats
import random
import re
import shutil
import socket
import stat
import subprocess
import sys
import tempfile
import time
import unittest
from binascii import unhexlify, b2a_base64
from configparser import Config... | true | true |
f727b88af81bc3a82c519d895f95d0e68a9f59ab | 1,583 | py | Python | sandbox/lib/jumpscale/JumpScale9Lib/clients/atyourservice/ays/ClientFactory.py | Jumpscale/sandbox_linux | 2aacd36b467ef30ac83718abfa82c6883b67a02f | [
"Apache-2.0"
] | 2 | 2017-06-07T08:11:47.000Z | 2017-11-10T02:19:48.000Z | JumpScale9Lib/clients/atyourservice/ays/ClientFactory.py | Jumpscale/lib9 | 82224784ef2a7071faeb48349007211c367bc673 | [
"Apache-2.0"
] | 188 | 2017-06-21T06:16:13.000Z | 2020-06-17T14:20:24.000Z | sandbox/lib/jumpscale/JumpScale9Lib/clients/atyourservice/ays/ClientFactory.py | Jumpscale/sandbox_linux | 2aacd36b467ef30ac83718abfa82c6883b67a02f | [
"Apache-2.0"
] | 3 | 2018-06-12T05:18:28.000Z | 2019-09-24T06:49:17.000Z | from js9 import j
from .client import Client
JSConfigBase = j.tools.configmanager.base_class_configs
JSBASE = j.application.jsbase_get_class()
class ClientFactory(JSConfigBase):
def __init__(self):
self.__jslocation__ = 'j.clients.ays'
JSConfigBase.__init__(self, Client)
# def get(self, url... | 45.228571 | 140 | 0.672142 | from js9 import j
from .client import Client
JSConfigBase = j.tools.configmanager.base_class_configs
JSBASE = j.application.jsbase_get_class()
class ClientFactory(JSConfigBase):
def __init__(self):
self.__jslocation__ = 'j.clients.ays'
JSConfigBase.__init__(self, Client)
# Get... | true | true |
f727b91907659f8e5e86ad39633e0f340dedda64 | 3,175 | py | Python | models/object_detection/model_templates/horizontal-text-detection/tools/draw_recall_graph.py | dqawami/openvino_training_extensions | dddda1dfd651eaae2d59cecda84275b1b03bd0ad | [
"Apache-2.0"
] | 256 | 2020-09-09T03:27:57.000Z | 2022-03-30T10:06:06.000Z | models/object_detection/model_templates/horizontal-text-detection/tools/draw_recall_graph.py | dqawami/openvino_training_extensions | dddda1dfd651eaae2d59cecda84275b1b03bd0ad | [
"Apache-2.0"
] | 604 | 2020-09-08T12:29:49.000Z | 2022-03-31T21:51:08.000Z | models/object_detection/model_templates/horizontal-text-detection/tools/draw_recall_graph.py | dqawami/openvino_training_extensions | dddda1dfd651eaae2d59cecda84275b1b03bd0ad | [
"Apache-2.0"
] | 160 | 2020-09-09T14:06:07.000Z | 2022-03-30T14:50:48.000Z | # Copyright (C) 2020 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 36.918605 | 99 | 0.68 |
import argparse
from os.path import exists
import subprocess
import mmcv
from mmdet.datasets import build_dataset
from mmdet.core.evaluation.text_evaluation import text_eval
def parse_args():
parser = argparse.ArgumentParser(
description='This script draws a histogram of the detected wo... | true | true |
f727b9d4cab59ebd33276d381d0c931725d42173 | 2,391 | py | Python | session8/bloomfilter.py | zhiweih/pb-exercises | c5e64075c47503a40063aa836c06a452af14246d | [
"BSD-2-Clause"
] | 153 | 2017-09-27T01:10:19.000Z | 2022-03-17T12:13:59.000Z | session8/bloomfilter.py | zhiweih/pb-exercises | c5e64075c47503a40063aa836c06a452af14246d | [
"BSD-2-Clause"
] | 3 | 2018-11-10T20:04:13.000Z | 2022-02-15T23:12:53.000Z | session8/bloomfilter.py | zhiweih/pb-exercises | c5e64075c47503a40063aa836c06a452af14246d | [
"BSD-2-Clause"
] | 85 | 2017-10-09T16:18:00.000Z | 2022-02-09T14:21:08.000Z | from unittest import TestCase
from helper import bit_field_to_bytes, encode_varint, int_to_little_endian, murmur3
from network import GenericMessage
BIP37_CONSTANT = 0xfba4c795
class BloomFilter:
def __init__(self, size, function_count, tweak):
self.size = size
self.bit_field = [0] * (size * 8... | 34.157143 | 83 | 0.634463 | from unittest import TestCase
from helper import bit_field_to_bytes, encode_varint, int_to_little_endian, murmur3
from network import GenericMessage
BIP37_CONSTANT = 0xfba4c795
class BloomFilter:
def __init__(self, size, function_count, tweak):
self.size = size
self.bit_field = [0] * (size * 8... | true | true |
f727ba6681f8dfea391e57c63b138af4829f136b | 301 | py | Python | Communication/temp_driver.py | Forence1999/SmartWalker | 635410bf44234eead9fd1e2fe226eb8eafa9d27d | [
"MIT"
] | 2 | 2021-11-13T14:16:06.000Z | 2022-01-12T06:07:32.000Z | Communication/temp_driver.py | Forence1999/SmartWalker | 635410bf44234eead9fd1e2fe226eb8eafa9d27d | [
"MIT"
] | null | null | null | Communication/temp_driver.py | Forence1999/SmartWalker | 635410bf44234eead9fd1e2fe226eb8eafa9d27d | [
"MIT"
] | 3 | 2021-08-30T04:40:39.000Z | 2022-01-09T11:34:04.000Z |
import os, sys
pwd = os.path.abspath(os.path.abspath(__file__))
father_path = os.path.abspath(os.path.dirname(pwd) + os.path.sep + "..")
sys.path.append(father_path)
from Communication.Modules.Driver_recv import DriverRecv
if __name__ == "__main__":
drv_recv = DriverRecv()
drv_recv.start() | 27.363636 | 72 | 0.734219 |
import os, sys
pwd = os.path.abspath(os.path.abspath(__file__))
father_path = os.path.abspath(os.path.dirname(pwd) + os.path.sep + "..")
sys.path.append(father_path)
from Communication.Modules.Driver_recv import DriverRecv
if __name__ == "__main__":
drv_recv = DriverRecv()
drv_recv.start() | true | true |
f727bbf4f042610f878f6f2a4448221ae54ed568 | 147 | py | Python | yc166/525.py | c-yan/yukicoder | cdbbd65402177225dd989df7fe01f67908484a69 | [
"MIT"
] | null | null | null | yc166/525.py | c-yan/yukicoder | cdbbd65402177225dd989df7fe01f67908484a69 | [
"MIT"
] | null | null | null | yc166/525.py | c-yan/yukicoder | cdbbd65402177225dd989df7fe01f67908484a69 | [
"MIT"
] | null | null | null | T = input()
hh, mm = map(int, T.split(':'))
mm += 5
if mm > 59:
hh += 1
mm %= 60
if hh > 23:
hh %= 24
print('%02d:%02d' % (hh, mm))
| 11.307692 | 31 | 0.428571 | T = input()
hh, mm = map(int, T.split(':'))
mm += 5
if mm > 59:
hh += 1
mm %= 60
if hh > 23:
hh %= 24
print('%02d:%02d' % (hh, mm))
| true | true |
f727bc6b391386643fcb9047d7e3f34d29e75ee1 | 3,712 | py | Python | intersight/models/hyperflex_ucsm_config_policy_ref.py | ategaw-cisco/intersight-python | 9d6476620507281b1dc358e29ac452d56081bbb0 | [
"Apache-2.0"
] | null | null | null | intersight/models/hyperflex_ucsm_config_policy_ref.py | ategaw-cisco/intersight-python | 9d6476620507281b1dc358e29ac452d56081bbb0 | [
"Apache-2.0"
] | null | null | null | intersight/models/hyperflex_ucsm_config_policy_ref.py | ategaw-cisco/intersight-python | 9d6476620507281b1dc358e29ac452d56081bbb0 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Intersight REST API
This is Intersight REST API
OpenAPI spec version: 1.0.9-262
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class HyperflexUcsmConfigPolicyRef(object):
"""
NOT... | 24.746667 | 81 | 0.554149 |
from pprint import pformat
from six import iteritems
import re
class HyperflexUcsmConfigPolicyRef(object):
swagger_types = {
'moid': 'str',
'object_type': 'str'
}
attribute_map = {
'moid': 'Moid',
'object_type': 'ObjectType'
}
def __init__(self, moid=None, o... | true | true |
f727bc6fd1864b3db8c69008ff273cd86317a3fd | 545 | py | Python | conda_verify/package/test_files.py | soapy1/conda-verify | 4941b8ea37bf4afa5ca16366ae855f756037f230 | [
"BSD-3-Clause"
] | null | null | null | conda_verify/package/test_files.py | soapy1/conda-verify | 4941b8ea37bf4afa5ca16366ae855f756037f230 | [
"BSD-3-Clause"
] | null | null | null | conda_verify/package/test_files.py | soapy1/conda-verify | 4941b8ea37bf4afa5ca16366ae855f756037f230 | [
"BSD-3-Clause"
] | 1 | 2020-02-03T12:43:17.000Z | 2020-02-03T12:43:17.000Z | from conda_verify.conda_package_check import CondaPackageCheck
def verify(path_to_package=None, verbose=True, **kwargs):
package_check = CondaPackageCheck(path_to_package, verbose)
package_check.info_files()
package_check.no_hardlinks()
package_check.not_allowed_files()
package_check.index_json()
... | 34.0625 | 78 | 0.774312 | from conda_verify.conda_package_check import CondaPackageCheck
def verify(path_to_package=None, verbose=True, **kwargs):
package_check = CondaPackageCheck(path_to_package, verbose)
package_check.info_files()
package_check.no_hardlinks()
package_check.not_allowed_files()
package_check.index_json()
... | true | true |
f727be7b1536a7590641b1a6b3f2745fd7b98775 | 433 | py | Python | src/batch_iterator.py | thealah/imdb-import | fd51d7fbefc419c134277bc0c85b59dcbb457350 | [
"MIT"
] | null | null | null | src/batch_iterator.py | thealah/imdb-import | fd51d7fbefc419c134277bc0c85b59dcbb457350 | [
"MIT"
] | null | null | null | src/batch_iterator.py | thealah/imdb-import | fd51d7fbefc419c134277bc0c85b59dcbb457350 | [
"MIT"
] | null | null | null | def batch_iterator(iterable, size=100, filter_expression=None):
current_batch = []
for x in iterable:
if filter_expression:
if filter_expression(x):
current_batch.append(x)
else:
current_batch.append(x)
if len(current_batch) == size:
... | 27.0625 | 63 | 0.575058 | def batch_iterator(iterable, size=100, filter_expression=None):
current_batch = []
for x in iterable:
if filter_expression:
if filter_expression(x):
current_batch.append(x)
else:
current_batch.append(x)
if len(current_batch) == size:
... | true | true |
f727be9a5c7b0dee1552109b912eec3664b93ab0 | 3,227 | py | Python | exavault/models/share_relationships_notification.py | ExaVault/evapi-python | 769bfa9fbb683f2b4653ca2564029ffb72445c8c | [
"MIT"
] | null | null | null | exavault/models/share_relationships_notification.py | ExaVault/evapi-python | 769bfa9fbb683f2b4653ca2564029ffb72445c8c | [
"MIT"
] | 3 | 2017-07-13T20:58:05.000Z | 2019-08-02T19:08:37.000Z | exavault/models/share_relationships_notification.py | ExaVault/evapi-python | 769bfa9fbb683f2b4653ca2564029ffb72445c8c | [
"MIT"
] | 4 | 2016-11-16T00:14:23.000Z | 2020-09-24T14:50:46.000Z | # coding: utf-8
"""
ExaVault API
See our API reference documentation at https://www.exavault.com/developer/api-docs/ # noqa: E501
OpenAPI spec version: 2.0
Contact: support@exavault.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
i... | 29.072072 | 101 | 0.575147 |
import pprint
import re
import six
class ShareRelationshipsNotification(object):
swagger_types = {
'data': 'ShareRelationshipsData'
}
attribute_map = {
'data': 'data'
}
def __init__(self, data=None):
self._data = None
self.discriminator = None
if da... | true | true |
f727bf0787af05ae30dd3c315f89a1ffc68b1a5f | 126 | py | Python | models.py | banr1jnts/kaggle-youtube2nd | 21248d563afcf707cc7665703a987d71c94f4c5a | [
"MIT"
] | null | null | null | models.py | banr1jnts/kaggle-youtube2nd | 21248d563afcf707cc7665703a987d71c94f4c5a | [
"MIT"
] | null | null | null | models.py | banr1jnts/kaggle-youtube2nd | 21248d563afcf707cc7665703a987d71c94f4c5a | [
"MIT"
] | null | null | null | class BaseModel(object):
def create_model(self, unused_model_input, **unused_params):
raise NotImplementedError()
| 31.5 | 64 | 0.746032 | class BaseModel(object):
def create_model(self, unused_model_input, **unused_params):
raise NotImplementedError()
| true | true |
f727c080bee1883b62b81efe7828d2d40ce4de8a | 375 | py | Python | CodeSignal/Arcade/The_Core/Level_10_Lab_Of_Transformation/085_Higher_Version.py | Zubieta/CPP | fb4a3cbf2e4edcc590df15663cd28fb9ecab679c | [
"MIT"
] | 8 | 2017-03-02T07:56:45.000Z | 2021-08-07T20:20:19.000Z | CodeSignal/Arcade/The_Core/Level_10_Lab_Of_Transformation/085_Higher_Version.py | zubie7a/Algorithms | fb4a3cbf2e4edcc590df15663cd28fb9ecab679c | [
"MIT"
] | null | null | null | CodeSignal/Arcade/The_Core/Level_10_Lab_Of_Transformation/085_Higher_Version.py | zubie7a/Algorithms | fb4a3cbf2e4edcc590df15663cd28fb9ecab679c | [
"MIT"
] | 1 | 2021-08-07T20:20:20.000Z | 2021-08-07T20:20:20.000Z | # https://app.codesignal.com/arcade/code-arcade/lab-of-transformations/vsKRjYKv4SCjzJc8r/
def higherVersion(ver1, ver2):
# Split by dots, convert individual elements to ints.
ver1 = [int(x) for x in ver1.split(".")]
ver2 = [int(x) for x in ver2.split(".")]
# This will do a comparison item-wise of all e... | 41.666667 | 89 | 0.696 |
def higherVersion(ver1, ver2):
ver1 = [int(x) for x in ver1.split(".")]
ver2 = [int(x) for x in ver2.split(".")]
return ver1 > ver2
| true | true |
f727c1a63c15749305645ffe5f2bcd064e0496d2 | 23,239 | py | Python | code_generate.py | Taekyoon/Python-Mini-C-Compiler | deabdba9f92f772e7b5276288d05b94cb96e4d72 | [
"MIT"
] | 4 | 2018-10-11T12:30:46.000Z | 2019-11-12T12:17:17.000Z | code_generate.py | Taekyoon/Python-Mini-C-Compiler | deabdba9f92f772e7b5276288d05b94cb96e4d72 | [
"MIT"
] | null | null | null | code_generate.py | Taekyoon/Python-Mini-C-Compiler | deabdba9f92f772e7b5276288d05b94cb96e4d72 | [
"MIT"
] | null | null | null | from lex import tsymbol_dict
from expression import *
from code_generate_table import *
from code_generate_utils import *
class CodeGenerator(object):
def __init__(self, tree):
self.tree = tree
self.base, self.offset, self.width = 1, 1, 1
self.TERMINAL, self.NONTERMINAL = 0, 1
self... | 36.887302 | 132 | 0.547399 | from lex import tsymbol_dict
from expression import *
from code_generate_table import *
from code_generate_utils import *
class CodeGenerator(object):
def __init__(self, tree):
self.tree = tree
self.base, self.offset, self.width = 1, 1, 1
self.TERMINAL, self.NONTERMINAL = 0, 1
self... | true | true |
f727c25e97bf1486886310c30e2304cba568c8b8 | 3,816 | py | Python | core/metrics/recall_k.py | overlordmax/PaddleRec | ddf6ec25b228ffde83e6592163d88c3ace9069f0 | [
"Apache-2.0"
] | 1 | 2020-09-29T01:14:22.000Z | 2020-09-29T01:14:22.000Z | core/metrics/recall_k.py | Qdriving/PaddleRec | b4d6ac77450d98a935c6a5d0eba6abbb21b9d06a | [
"Apache-2.0"
] | null | null | null | core/metrics/recall_k.py | Qdriving/PaddleRec | b4d6ac77450d98a935c6a5d0eba6abbb21b9d06a | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 36.692308 | 74 | 0.612945 |
import math
import numpy as np
import paddle.fluid as fluid
from paddlerec.core.metric import Metric
from paddle.fluid.layers import accuracy
from paddle.fluid.initializer import Constant
from paddle.fluid.layer_helper import LayerHelper
from paddle.fluid.layers.tensor import Variable
class RecallK(Me... | true | true |
f727c2bb12990251b7186d56d9373b097441a307 | 4,591 | py | Python | examples/pagination.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | examples/pagination.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | examples/pagination.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 48.840426 | 245 | 0.648007 |
import oci
config = oci.config.from_file()
compartment_id = config["tenancy"]
identity = oci.identity.IdentityClient(config)
print('--------------------------------------------')
print('Eager load all results')
print('--------------------------------------------')
response = oci.pagination.list_call_ge... | true | true |
f727c3080a1e1cf10bc6a51628ccb3002fa6f009 | 6,213 | py | Python | slack/webhook/client.py | timgates42/python-slack-sdk | 6339fbe81031c9aec3f95927ac03706fd31f3544 | [
"MIT"
] | null | null | null | slack/webhook/client.py | timgates42/python-slack-sdk | 6339fbe81031c9aec3f95927ac03706fd31f3544 | [
"MIT"
] | null | null | null | slack/webhook/client.py | timgates42/python-slack-sdk | 6339fbe81031c9aec3f95927ac03706fd31f3544 | [
"MIT"
] | null | null | null | import json
import logging
import urllib
from http.client import HTTPResponse
from ssl import SSLContext
from typing import Dict, Union, List, Optional
from urllib.error import HTTPError
from urllib.request import Request, urlopen, OpenerDirector, ProxyHandler, HTTPSHandler
from slack.errors import SlackRequestError
f... | 40.607843 | 124 | 0.584259 | import json
import logging
import urllib
from http.client import HTTPResponse
from ssl import SSLContext
from typing import Dict, Union, List, Optional
from urllib.error import HTTPError
from urllib.request import Request, urlopen, OpenerDirector, ProxyHandler, HTTPSHandler
from slack.errors import SlackRequestError
f... | true | true |
f727c35e7fd050c837120bd4cb292fd43c9f546f | 73 | py | Python | Codewars/8kyu/reversed-words/Python/solution1.py | RevansChen/online-judge | ad1b07fee7bd3c49418becccda904e17505f3018 | [
"MIT"
] | 7 | 2017-09-20T16:40:39.000Z | 2021-08-31T18:15:08.000Z | Codewars/8kyu/reversed-words/Python/solution1.py | RevansChen/online-judge | ad1b07fee7bd3c49418becccda904e17505f3018 | [
"MIT"
] | null | null | null | Codewars/8kyu/reversed-words/Python/solution1.py | RevansChen/online-judge | ad1b07fee7bd3c49418becccda904e17505f3018 | [
"MIT"
] | null | null | null | # Python - 3.6.0
reverseWords = lambda str: ' '.join(str.split()[::-1])
| 18.25 | 54 | 0.589041 |
reverseWords = lambda str: ' '.join(str.split()[::-1])
| true | true |
f727c565e144343ffc38a97bdeaadb5f3c26c99d | 3,587 | py | Python | restui/lib/alignments.py | brjones/gifts_rest | 8217e45fd1a692b00c9e9ae9f022ac2d2fab211e | [
"Apache-2.0"
] | null | null | null | restui/lib/alignments.py | brjones/gifts_rest | 8217e45fd1a692b00c9e9ae9f022ac2d2fab211e | [
"Apache-2.0"
] | 7 | 2018-09-05T10:53:44.000Z | 2022-03-08T09:36:14.000Z | restui/lib/alignments.py | brjones/gifts_rest | 8217e45fd1a692b00c9e9ae9f022ac2d2fab211e | [
"Apache-2.0"
] | 8 | 2018-09-03T14:29:28.000Z | 2020-07-30T12:54:04.000Z | """
.. See the NOTICE file distributed with this work for additional information
regarding copyright ownership.
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.... | 26.182482 | 85 | 0.647338 |
from sam_alignment_reconstructor.pairwise import pairwise_alignment
from sam_alignment_reconstructor.pairwise import cigar_split
from restui.lib.external import ensembl_sequence
from restui.lib.external import ensembl_protein
def fetch_pairwise(mapping):
pairwise_alignments = []
enst = mapping.transcript.e... | true | true |
f727c5f55aa71d5cb21714681206c4fac4c7f6bc | 762 | py | Python | state_management/python/sdk/order-processor/app.py | amulyavarote/quickstarts | c21a8f58d515b28eaa8a3680388fa06995c2331b | [
"Apache-2.0"
] | null | null | null | state_management/python/sdk/order-processor/app.py | amulyavarote/quickstarts | c21a8f58d515b28eaa8a3680388fa06995c2331b | [
"Apache-2.0"
] | null | null | null | state_management/python/sdk/order-processor/app.py | amulyavarote/quickstarts | c21a8f58d515b28eaa8a3680388fa06995c2331b | [
"Apache-2.0"
] | null | null | null | from time import sleep
import logging
from dapr.clients import DaprClient
logging.basicConfig(level=logging.INFO)
DAPR_STORE_NAME = "statestore"
for i in range(1, 10):
orderId = str(i)
order = {'orderId': orderId}
with DaprClient() as client:
# Save state into the state store
client.save_... | 29.307692 | 68 | 0.670604 | from time import sleep
import logging
from dapr.clients import DaprClient
logging.basicConfig(level=logging.INFO)
DAPR_STORE_NAME = "statestore"
for i in range(1, 10):
orderId = str(i)
order = {'orderId': orderId}
with DaprClient() as client:
client.save_state(DAPR_STORE_NAME, orderId, s... | true | true |
f727c7c44cfc150a303ad06b4cd37d80fe4a6d31 | 3,598 | py | Python | thomasdevri_es/thomasdevri_es/settings.py | jdevries3133/chaotic_christmas_present | c7ef3f9a8fdef43211c59398b6bb9b45383cdc0d | [
"Apache-2.0"
] | null | null | null | thomasdevri_es/thomasdevri_es/settings.py | jdevries3133/chaotic_christmas_present | c7ef3f9a8fdef43211c59398b6bb9b45383cdc0d | [
"Apache-2.0"
] | null | null | null | thomasdevri_es/thomasdevri_es/settings.py | jdevries3133/chaotic_christmas_present | c7ef3f9a8fdef43211c59398b6bb9b45383cdc0d | [
"Apache-2.0"
] | null | null | null | """
Django settings for thomasdevri_es project.
Generated by 'django-admin startproject' using Django 3.0.7.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""
impor... | 24.47619 | 91 | 0.663424 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = os.getenv('DJANGO_SECRET')
DEBUG = False
ALLOWED_HOSTS = [
'*'
]
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'dja... | true | true |
f727c8673af3cda14875414f836d4092d8d30ac1 | 6,282 | py | Python | compose/container.py | alunduil/fig | fc63454c99674b3758721bcc5df0cea841ed6ba5 | [
"Apache-2.0"
] | null | null | null | compose/container.py | alunduil/fig | fc63454c99674b3758721bcc5df0cea841ed6ba5 | [
"Apache-2.0"
] | null | null | null | compose/container.py | alunduil/fig | fc63454c99674b3758721bcc5df0cea841ed6ba5 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from __future__ import unicode_literals
from functools import reduce
import six
from .const import LABEL_CONTAINER_NUMBER
from .const import LABEL_SERVICE
class Container(object):
"""
Represents a Docker container, constructed from the output of
GET /containers/:i... | 28.554545 | 78 | 0.60554 | from __future__ import absolute_import
from __future__ import unicode_literals
from functools import reduce
import six
from .const import LABEL_CONTAINER_NUMBER
from .const import LABEL_SERVICE
class Container(object):
def __init__(self, client, dictionary, has_been_inspected=False):
self.client = clie... | true | true |
f727c89ca6002e8cedcf4b9d1b2de5100c7c9fad | 1,149 | py | Python | lib/systems/beta-l-lyxopyranose.py | pulsar-chem/BPModule | f8e64e04fdb01947708f098e833600c459c2ff0e | [
"BSD-3-Clause"
] | null | null | null | lib/systems/beta-l-lyxopyranose.py | pulsar-chem/BPModule | f8e64e04fdb01947708f098e833600c459c2ff0e | [
"BSD-3-Clause"
] | null | null | null | lib/systems/beta-l-lyxopyranose.py | pulsar-chem/BPModule | f8e64e04fdb01947708f098e833600c459c2ff0e | [
"BSD-3-Clause"
] | null | null | null | import pulsar as psr
def load_ref_system():
""" Returns beta-l-lyxopyranose as found in the IQMol fragment library.
All credit to https://github.com/nutjunkie/IQmol
"""
return psr.make_system("""
C 1.4299 0.2461 0.7896
O 0.4230 1.0739 1.3901
C ... | 41.035714 | 75 | 0.409051 | import pulsar as psr
def load_ref_system():
return psr.make_system("""
C 1.4299 0.2461 0.7896
O 0.4230 1.0739 1.3901
C -0.9416 0.6206 1.4010
C -1.3780 0.0314 0.0512
C -0.4016 -1.0958 -0.3576
O -... | true | true |
f727cb3319b78a06a0480e8cba138dfc007d6cb9 | 515 | py | Python | FreeTAKServer/controllers/services/federation/ConnectHandler.py | logikal/FreeTakServer | c0916ce65781b5c60079d6440e52db8fc6ee0467 | [
"MIT"
] | null | null | null | FreeTAKServer/controllers/services/federation/ConnectHandler.py | logikal/FreeTakServer | c0916ce65781b5c60079d6440e52db8fc6ee0467 | [
"MIT"
] | null | null | null | FreeTAKServer/controllers/services/federation/ConnectHandler.py | logikal/FreeTakServer | c0916ce65781b5c60079d6440e52db8fc6ee0467 | [
"MIT"
] | null | null | null | #######################################################
#
# ConnectHandler.py
# Python implementation of the Class ConnectHandler
# Generated by Enterprise Architect
# Created on: 29-Dec-2020 8:10:45 AM
# Original author: natha
#
#######################################################
from Catalog.Data.Federatio... | 27.105263 | 55 | 0.56699 | true | true | |
f727cb4f493f60788d46a5d0eb9211f2230cd556 | 3,947 | py | Python | detr_tf/data/tfcsv.py | falcon2212/detr-tensorflow | 119da1390a02b6013e7147d822e72c38fc3a2dd9 | [
"MIT"
] | null | null | null | detr_tf/data/tfcsv.py | falcon2212/detr-tensorflow | 119da1390a02b6013e7147d822e72c38fc3a2dd9 | [
"MIT"
] | null | null | null | detr_tf/data/tfcsv.py | falcon2212/detr-tensorflow | 119da1390a02b6013e7147d822e72c38fc3a2dd9 | [
"MIT"
] | null | null | null | import tensorflow as tf
from random import shuffle
import pandas as pd
import numpy as np
import imageio
import os
from detr_tf.data import processing
from detr_tf.data.transformation import detr_transform
from detr_tf import bbox
def morethan1(img, tbbox, tclass):
ret = False
print("morethan1 ", tbbox.shape... | 39.079208 | 174 | 0.7132 | import tensorflow as tf
from random import shuffle
import pandas as pd
import numpy as np
import imageio
import os
from detr_tf.data import processing
from detr_tf.data.transformation import detr_transform
from detr_tf import bbox
def morethan1(img, tbbox, tclass):
ret = False
print("morethan1 ", tbbox.shape... | true | true |
f727cbca391bd911c82cd15a769a1235f13eebfd | 13,500 | py | Python | Simulation_Python/scenarios.py | tomAntoine/multi-UAV-simulator | 2fbd8b802ea1a5f388722714bac5563d0718b28f | [
"MIT"
] | 22 | 2021-04-07T21:10:53.000Z | 2022-03-26T08:21:06.000Z | Simulation_Python/scenarios.py | alexMarFar/multi-UAV-simulator-1 | 2fbd8b802ea1a5f388722714bac5563d0718b28f | [
"MIT"
] | 2 | 2021-04-12T06:23:50.000Z | 2021-05-20T04:33:35.000Z | Simulation_Python/scenarios.py | alexMarFar/multi-UAV-simulator-1 | 2fbd8b802ea1a5f388722714bac5563d0718b28f | [
"MIT"
] | 4 | 2021-05-21T06:11:34.000Z | 2022-03-09T18:41:10.000Z | # -*- coding: utf-8 -*-
"""
author: John Bass
email: john.bobzwik@gmail.com
license: MIT
Please feel free to use and modify this, but keep the above information. Thanks!
adaptation
author: Tom Antoine and Alex Martinez
"""
import numpy as np
import matplotlib.pyplot as plt
import time
import cProfile
from trajectory i... | 56.25 | 199 | 0.669333 |
import numpy as np
import matplotlib.pyplot as plt
import time
import cProfile
from trajectory import Trajectory
from ctrl import Control
from quadFiles.quad import Quadcopter
from utils.windModel import Wind
import utils
import config
import mpl_toolkits.mplot3d.axes3d as p3
from matplotlib.legend import Legend
impor... | true | true |
f727cc1948a85ac6d72771c8c995e728612019c7 | 4,358 | py | Python | src/tequila/quantumchemistry/__init__.py | naomicurnow/tequila | 739a76222005558d348a428cf2ce7cb5dfe290de | [
"MIT"
] | 1 | 2021-01-11T18:40:47.000Z | 2021-01-11T18:40:47.000Z | src/tequila/quantumchemistry/__init__.py | kiminh/tequila | 464085265e125222c63e65446861e9c0a2428bab | [
"MIT"
] | null | null | null | src/tequila/quantumchemistry/__init__.py | kiminh/tequila | 464085265e125222c63e65446861e9c0a2428bab | [
"MIT"
] | null | null | null | import typing
from .qc_base import ParametersQC, QuantumChemistryBase
SUPPORTED_QCHEMISTRY_BACKENDS = ["base", "psi4"]
INSTALLED_QCHEMISTRY_BACKENDS = {"base": QuantumChemistryBase}
try:
from .psi4_interface import QuantumChemistryPsi4
INSTALLED_QCHEMISTRY_BACKENDS["psi4"] = QuantumChemistryPsi4
except Impo... | 37.568966 | 149 | 0.652593 | import typing
from .qc_base import ParametersQC, QuantumChemistryBase
SUPPORTED_QCHEMISTRY_BACKENDS = ["base", "psi4"]
INSTALLED_QCHEMISTRY_BACKENDS = {"base": QuantumChemistryBase}
try:
from .psi4_interface import QuantumChemistryPsi4
INSTALLED_QCHEMISTRY_BACKENDS["psi4"] = QuantumChemistryPsi4
except Impo... | true | true |
f727cd0adc9bd8230963be0b0db67ba35b37d18b | 2,254 | py | Python | tests/apitests/python/test_user_group.py | shaobo322/harbor | eca3de3489a009dfced253779e6aabdaa14dad70 | [
"Apache-2.0"
] | 5 | 2021-06-08T07:10:55.000Z | 2021-09-29T03:17:09.000Z | tests/apitests/python/test_user_group.py | shaobo322/harbor | eca3de3489a009dfced253779e6aabdaa14dad70 | [
"Apache-2.0"
] | 10 | 2020-04-02T01:58:11.000Z | 2021-04-19T02:13:29.000Z | tests/apitests/python/test_user_group.py | shaobo322/harbor | eca3de3489a009dfced253779e6aabdaa14dad70 | [
"Apache-2.0"
] | 4 | 2021-02-19T08:41:13.000Z | 2021-09-29T03:17:12.000Z | # coding: utf-8
"""
Harbor API
These APIs provide services for manipulating Harbor project.
OpenAPI spec version: 1.4.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
sys.path.append(os.environ["SWAGGER_CLIENT_PATH"]... | 30.053333 | 245 | 0.712067 |
from __future__ import absolute_import
import os
import sys
sys.path.append(os.environ["SWAGGER_CLIENT_PATH"])
import unittest
import testutils
import swagger_client
from swagger_client.rest import ApiException
from swagger_client.models.user_group import UserGroup
from swagger_client.models.configurations impor... | true | true |
f727ce30bcfff6735069c4eb270c2a0dffe87867 | 2,140 | py | Python | Sketch.py | sunkr1995/genetic-drawing | 6e5cc755a55c1994770c3f18fb14f1cc651bb700 | [
"MIT"
] | null | null | null | Sketch.py | sunkr1995/genetic-drawing | 6e5cc755a55c1994770c3f18fb14f1cc651bb700 | [
"MIT"
] | null | null | null | Sketch.py | sunkr1995/genetic-drawing | 6e5cc755a55c1994770c3f18fb14f1cc651bb700 | [
"MIT"
] | null | null | null | '''
Author: your name
Date: 2021-07-02 17:20:23
LastEditTime: 2021-07-08 16:28:05
LastEditors: Please set LastEditors
Description: In User Settings Edit
FilePath: /genetic-drawing/2.py
'''
#coding:utf-8
import cv2
import math
import numpy as np
def dodgeNaive(image, mask):
# determine the shape of the input im... | 28.918919 | 64 | 0.614019 |
import cv2
import math
import numpy as np
def dodgeNaive(image, mask):
width, height = image.shape[:2]
blend = np.zeros((width, height), np.uint8)
for col in range(width):
for row in range(height):
if mask[col, row] == 255:
... | true | true |
f727cfe26e46b219012e5f007bb0788969651bf9 | 1,045 | py | Python | app/core/migrations/0004_recipe.py | samacyc/loanBook | 75f50635bfe15e5fd022e9c3fbf2ed165c51a494 | [
"MIT"
] | null | null | null | app/core/migrations/0004_recipe.py | samacyc/loanBook | 75f50635bfe15e5fd022e9c3fbf2ed165c51a494 | [
"MIT"
] | null | null | null | app/core/migrations/0004_recipe.py | samacyc/loanBook | 75f50635bfe15e5fd022e9c3fbf2ed165c51a494 | [
"MIT"
] | null | null | null | # Generated by Django 2.1.15 on 2020-04-25 00:55
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0003_ingredients'),
]
operations = [
migrations.CreateModel(
... | 36.034483 | 118 | 0.604785 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0003_ingredients'),
]
operations = [
migrations.CreateModel(
name='Recipe',
fields=[
... | true | true |
f727d135c106864dba69965703e7f5f5144d703d | 1,168 | py | Python | tests/util/network.py | zcomputerwiz/gojiv2-blockchain | 3be896d4dcb48a734f8d2a901ab5648201fbd4d7 | [
"Apache-2.0"
] | 2 | 2022-02-09T04:30:19.000Z | 2022-03-19T14:01:43.000Z | tests/util/network.py | zcomputerwiz/goji-blockchain | 3be896d4dcb48a734f8d2a901ab5648201fbd4d7 | [
"Apache-2.0"
] | 1 | 2021-12-30T09:17:47.000Z | 2021-12-30T09:17:47.000Z | tests/util/network.py | zcomputerwiz/gojiv2-blockchain | 3be896d4dcb48a734f8d2a901ab5648201fbd4d7 | [
"Apache-2.0"
] | 1 | 2022-03-15T08:42:52.000Z | 2022-03-15T08:42:52.000Z | import pytest
from goji.util.network import get_host_addr
class TestNetwork:
@pytest.mark.asyncio
async def test_get_host_addr4(self):
# Run these tests forcing IPv4 resolution
prefer_ipv6 = False
assert get_host_addr("127.0.0.1", prefer_ipv6) == "127.0.0.1"
assert get_host_add... | 44.923077 | 96 | 0.662671 | import pytest
from goji.util.network import get_host_addr
class TestNetwork:
@pytest.mark.asyncio
async def test_get_host_addr4(self):
prefer_ipv6 = False
assert get_host_addr("127.0.0.1", prefer_ipv6) == "127.0.0.1"
assert get_host_addr("10.11.12.13", prefer_ipv6) == "10.11.1... | true | true |
f727d1701f52f74bac125ca10ff531847da7e541 | 3,111 | py | Python | test/test_session.py | SergeyBurma/B2_Command_Line_Tool | 65d8adf080e1502cd51c78f9bc9ce3b0bc787147 | [
"MIT"
] | 1 | 2020-09-06T09:32:44.000Z | 2020-09-06T09:32:44.000Z | test/test_session.py | SergeyBurma/B2_Command_Line_Tool | 65d8adf080e1502cd51c78f9bc9ce3b0bc787147 | [
"MIT"
] | null | null | null | test/test_session.py | SergeyBurma/B2_Command_Line_Tool | 65d8adf080e1502cd51c78f9bc9ce3b0bc787147 | [
"MIT"
] | null | null | null | ######################################################################
#
# File: test_session.py
#
# Copyright 2018 Backblaze Inc. All Rights Reserved.
#
# License https://www.backblaze.com/using_b2_code.html
#
######################################################################
from b2.exception import InvalidAuthT... | 33.451613 | 160 | 0.608807 | true | true | |
f727d21a828f288a73ec9d141abf5a7e7130abba | 16,717 | py | Python | salt/utils/verify.py | jkur/salt | 3e62675550f9869d550d7787800270e632955d2f | [
"Apache-2.0"
] | null | null | null | salt/utils/verify.py | jkur/salt | 3e62675550f9869d550d7787800270e632955d2f | [
"Apache-2.0"
] | null | null | null | salt/utils/verify.py | jkur/salt | 3e62675550f9869d550d7787800270e632955d2f | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
A few checks to make sure the environment is sane
'''
from __future__ import absolute_import
# Original Author: Jeff Schroeder <jeffschroeder@computer.org>
# Import python libs
import os
import re
import sys
import stat
import errno
import socket
import logging
# Import third party libs
i... | 34.046843 | 83 | 0.562481 |
from __future__ import absolute_import
import os
import re
import sys
import stat
import errno
import socket
import logging
if sys.platform.startswith('win'):
import win32file
else:
import resource
from salt.log import is_console_configured
from salt.exceptions import SaltClientError
import salt.defaul... | true | true |
f727d2d7e7376be3e613532b9e1ea017af35747c | 1,794 | py | Python | tests/ml/pipeline_test.py | cyrusradfar/vaex | 6a37bd4509c9a0823b4f01075049f3331fabea77 | [
"MIT"
] | 2 | 2020-12-01T09:41:54.000Z | 2020-12-13T14:10:19.000Z | tests/ml/pipeline_test.py | cyrusradfar/vaex | 6a37bd4509c9a0823b4f01075049f3331fabea77 | [
"MIT"
] | null | null | null | tests/ml/pipeline_test.py | cyrusradfar/vaex | 6a37bd4509c9a0823b4f01075049f3331fabea77 | [
"MIT"
] | null | null | null | import vaex
import vaex.ml
import tempfile
import vaex.ml.datasets
features = ['petal_length', 'petal_width', 'sepal_length', 'sepal_width']
def test_pca():
ds = vaex.ml.datasets.load_iris()
pca = vaex.ml.PCA(features=features, n_components=2)
pca.fit(ds)
ds1 = pca.transform(ds)
path = tempfile.m... | 27.181818 | 73 | 0.673356 | import vaex
import vaex.ml
import tempfile
import vaex.ml.datasets
features = ['petal_length', 'petal_width', 'sepal_length', 'sepal_width']
def test_pca():
ds = vaex.ml.datasets.load_iris()
pca = vaex.ml.PCA(features=features, n_components=2)
pca.fit(ds)
ds1 = pca.transform(ds)
path = tempfile.m... | true | true |
f727d359d96619c0985b1970043b681970bc7181 | 937 | py | Python | Project_Tuples_Alpha/moduleForFindingTuplesTime.py | zacandcheese/Keyboard-Biometric-Project | 0cdc0fef65b34624e80a5e96e2457c9cf958fb6d | [
"MIT"
] | 1 | 2017-10-03T14:40:09.000Z | 2017-10-03T14:40:09.000Z | Project_Tuples_Alpha/moduleForFindingTuplesTime.py | zacandcheese/Keyboard-Biometric-Project | 0cdc0fef65b34624e80a5e96e2457c9cf958fb6d | [
"MIT"
] | null | null | null | Project_Tuples_Alpha/moduleForFindingTuplesTime.py | zacandcheese/Keyboard-Biometric-Project | 0cdc0fef65b34624e80a5e96e2457c9cf958fb6d | [
"MIT"
] | 2 | 2019-02-20T02:28:13.000Z | 2021-12-01T19:50:19.000Z | __version__ = '1.0'
__author__ = 'Zachary Nowak'
"""STANDARD LIBRARY IMPORTS"""
from statistics import *
def create_dict(tupleList,pressCharTimeLine,pressTimeLine,dataDict):
keyHistory = ""
timingList = [[] for i in range(len(tupleList))]
"""CREATE A STRING WITH ALL THE EVENTS"""
for char in pressCharTimeLine:
... | 30.225806 | 75 | 0.701174 | __version__ = '1.0'
__author__ = 'Zachary Nowak'
from statistics import *
def create_dict(tupleList,pressCharTimeLine,pressTimeLine,dataDict):
keyHistory = ""
timingList = [[] for i in range(len(tupleList))]
for char in pressCharTimeLine:
keyHistory += char
for string in tupleList:
i = 0
index = tupleLis... | true | true |
f727d3a4b3cb35b73b91afefa5df649fd90c9c96 | 1,670 | py | Python | test/python/foursquare_test/source_code_analysis/scala/test_scala_unused_import_remover.py | foursquare/source_code_analysis | 4323efdb1b41c3726c8ddf0d7276698400640bfd | [
"Apache-2.0"
] | 5 | 2015-01-28T14:32:27.000Z | 2020-03-23T03:01:34.000Z | test/python/foursquare_test/source_code_analysis/scala/test_scala_unused_import_remover.py | caiocasado/source_code_analysis | 4323efdb1b41c3726c8ddf0d7276698400640bfd | [
"Apache-2.0"
] | 1 | 2015-01-19T20:16:18.000Z | 2015-02-03T02:35:56.000Z | test/python/foursquare_test/source_code_analysis/scala/test_scala_unused_import_remover.py | caiocasado/source_code_analysis | 4323efdb1b41c3726c8ddf0d7276698400640bfd | [
"Apache-2.0"
] | 6 | 2015-01-09T21:05:16.000Z | 2020-10-29T09:53:14.000Z | # coding=utf-8
# Copyright 2011 Foursquare Labs Inc. All Rights Reserved
from __future__ import (nested_scopes, generators, division, absolute_import, with_statement,
print_function, unicode_literals)
import unittest
from foursquare.source_code_analysis.scala.scala_unused_import_remover impor... | 14.910714 | 102 | 0.697006 |
from __future__ import (nested_scopes, generators, division, absolute_import, with_statement,
print_function, unicode_literals)
import unittest
from foursquare.source_code_analysis.scala.scala_unused_import_remover import ScalaUnusedImportRemover
class ScalaUnusedImportRemoverTest(unittes... | true | true |
f727d3d70ff583c6743d4843417bbc2ecf9584ca | 4,770 | py | Python | stackoverflow/venv/lib/python3.6/site-packages/twisted/positioning/test/test_sentence.py | wusirs/learn_python3_spider | a3301f8112e4ded25c3578162db8c6a263a0693b | [
"MIT"
] | 9,953 | 2019-04-03T23:41:04.000Z | 2022-03-31T11:54:44.000Z | stackoverflow/venv/lib/python3.6/site-packages/twisted/positioning/test/test_sentence.py | W4LKURE/learn_python3_spider | 98dd354a41598b31302641f9a0ea49d1ecfa0fb1 | [
"MIT"
] | 44 | 2019-05-27T10:59:29.000Z | 2022-03-31T14:14:29.000Z | stackoverflow/venv/lib/python3.6/site-packages/twisted/positioning/test/test_sentence.py | W4LKURE/learn_python3_spider | 98dd354a41598b31302641f9a0ea49d1ecfa0fb1 | [
"MIT"
] | 2,803 | 2019-04-06T13:15:33.000Z | 2022-03-31T07:42:01.000Z | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for positioning sentences.
"""
from __future__ import absolute_import, division
import itertools
from twisted.positioning import _sentence
from twisted.trial.unittest import TestCase
sentinelValueOne = "someStringValue"
sentinelValue... | 30 | 78 | 0.674843 |
from __future__ import absolute_import, division
import itertools
from twisted.positioning import _sentence
from twisted.trial.unittest import TestCase
sentinelValueOne = "someStringValue"
sentinelValueTwo = "someOtherStringValue"
class DummyProtocol(object):
@staticmethod
def getSentenceAttributes():... | true | true |
f727d41d6e60219428f3f297b23ca0f713529146 | 6,573 | py | Python | FatherSon/HelloWorld2_source_code/listing_22-8.py | axetang/AxePython | 3b517fa3123ce2e939680ad1ae14f7e602d446a6 | [
"Apache-2.0"
] | 1 | 2019-01-04T05:47:50.000Z | 2019-01-04T05:47:50.000Z | FatherSon/HelloWorld2_source_code/listing_22-8.py | axetang/AxePython | 3b517fa3123ce2e939680ad1ae14f7e602d446a6 | [
"Apache-2.0"
] | null | null | null | FatherSon/HelloWorld2_source_code/listing_22-8.py | axetang/AxePython | 3b517fa3123ce2e939680ad1ae14f7e602d446a6 | [
"Apache-2.0"
] | null | null | null | # Listing_22-8.py
# Copyright Warren & Csrter Sande, 2013
# Released under MIT license http://www.opensource.org/licenses/mit-license.php
# Version $version ----------------------------
# Hangman game using PyQt
import sys
from PyQt4 import QtCore, QtGui, uic
import random
form_class = uic.loadUiType("... | 54.775 | 138 | 0.386125 |
import sys
from PyQt4 import QtCore, QtGui, uic
import random
form_class = uic.loadUiType("hangman.ui")[0]
def find_letters(letter, a_string):
locations = []
start = 0 ... | true | true |
f727d4361a24d0843a7fbc97eb2728198e8f07f6 | 1,923 | py | Python | models/Gan.py | debashishc/texygan-analysis | f44d559b15da988080bc1a1d84399db04e69d755 | [
"MIT"
] | 881 | 2018-02-06T18:20:34.000Z | 2022-03-29T13:18:12.000Z | models/Gan.py | debashishc/texygan-analysis | f44d559b15da988080bc1a1d84399db04e69d755 | [
"MIT"
] | 48 | 2018-02-13T21:31:24.000Z | 2021-07-03T13:35:21.000Z | models/Gan.py | debashishc/texygan-analysis | f44d559b15da988080bc1a1d84399db04e69d755 | [
"MIT"
] | 224 | 2018-02-07T04:48:31.000Z | 2022-03-18T12:26:25.000Z | from abc import abstractmethod
from utils.utils import init_sess
class Gan:
def __init__(self):
self.oracle = None
self.generator = None
self.discriminator = None
self.gen_data_loader = None
self.dis_data_loader = None
self.oracle_data_loader = None
self.se... | 24.653846 | 81 | 0.583983 | from abc import abstractmethod
from utils.utils import init_sess
class Gan:
def __init__(self):
self.oracle = None
self.generator = None
self.discriminator = None
self.gen_data_loader = None
self.dis_data_loader = None
self.oracle_data_loader = None
self.se... | true | true |
f727d50e8dc0e67cf07b6f0c64f482507f96fdd0 | 1,306 | py | Python | helloWorld/helloWorldApp/consumers.py | jcheon/reddit_clone | e4efc5dac7b131e564296cb2421b296c860b47bf | [
"MIT"
] | 4 | 2019-10-29T22:49:54.000Z | 2020-02-17T06:14:07.000Z | helloWorld/helloWorldApp/consumers.py | jcheon/reddit_clone | e4efc5dac7b131e564296cb2421b296c860b47bf | [
"MIT"
] | 16 | 2019-11-25T02:39:18.000Z | 2022-02-10T13:28:22.000Z | helloWorld/helloWorldApp/consumers.py | jcheon/reddit_clone | e4efc5dac7b131e564296cb2421b296c860b47bf | [
"MIT"
] | 1 | 2020-02-17T06:14:08.000Z | 2020-02-17T06:14:08.000Z | # chat/consumers.py
from channels.generic.websocket import AsyncWebsocketConsumer
import json
class ChatConsumer(AsyncWebsocketConsumer):
async def connect(self):
self.room_name = self.scope['url_route']['kwargs']['room_name']
self.room_group_name = 'chat_%s' % self.room_name
# Join room g... | 28.391304 | 71 | 0.607198 |
from channels.generic.websocket import AsyncWebsocketConsumer
import json
class ChatConsumer(AsyncWebsocketConsumer):
async def connect(self):
self.room_name = self.scope['url_route']['kwargs']['room_name']
self.room_group_name = 'chat_%s' % self.room_name
await self.channel_laye... | true | true |
f727d5d867163c130092b8569593782b91841822 | 716 | py | Python | robustness/CLEVER/cal_clever.py | asplos2020/DRTest | c3de497142d9b226e518a1a0f95f7350d2f7acd6 | [
"MIT"
] | 1 | 2021-04-01T07:31:17.000Z | 2021-04-01T07:31:17.000Z | robustness/CLEVER/cal_clever.py | Justobe/DRTest | 85c3c9b2a46cafa7184130f2596c5f9eb3b20bff | [
"MIT"
] | null | null | null | robustness/CLEVER/cal_clever.py | Justobe/DRTest | 85c3c9b2a46cafa7184130f2596c5f9eb3b20bff | [
"MIT"
] | 1 | 2020-12-24T12:12:54.000Z | 2020-12-24T12:12:54.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
clever.py
Compute CLEVER score using collected Lipschitz constants
Copyright (C) 2017-2018, IBM Corp.
Copyright (C) 2017, Lily Weng <twweng@mit.edu>
and Huan Zhang <ecezhang@ucdavis.edu>
This program is licenced under the Apache 2.0 licence,
contain... | 26.518519 | 132 | 0.717877 |
from clever import clever_score
dataset='mnist'
models=['vgg13']
attacks=['oritest']
istarget='target'
for model in models:
for attack in attacks:
clever_score(data_folder='lipschitz_mat/'+istarget+'/'+dataset+'/'+model+'/'+attack+'/'+dataset+'_'+model, untargeted=False)
| true | true |
f727d699f5a615818259e65a2e917920aa02c900 | 6,699 | py | Python | libs/segment_tree.py | yskang/AlgorithmPracticeWithPython | f7129bd1924a7961489198f0ee052d2cd1e9cf40 | [
"MIT"
] | null | null | null | libs/segment_tree.py | yskang/AlgorithmPracticeWithPython | f7129bd1924a7961489198f0ee052d2cd1e9cf40 | [
"MIT"
] | null | null | null | libs/segment_tree.py | yskang/AlgorithmPracticeWithPython | f7129bd1924a7961489198f0ee052d2cd1e9cf40 | [
"MIT"
] | null | null | null | from types import SimpleNamespace
class Segment_Tree:
'''
A Class used to get partial sum of an array and update data
...
Attributes
----------
array : list
a list which to make a segment tree
Methods
-------
init(tree, start, end, node)
make segment t... | 35.632979 | 135 | 0.526198 | from types import SimpleNamespace
class Segment_Tree:
def __init__(self, array):
self.array = array
self.tree = [SimpleNamespace(value=0, lazy=0) for _ in range(len(self.array) * 4)]
self.init(self.tree, 0, len(self.array)-1, 1)
self.last_index = len(array)-1
def ini... | true | true |
f727d70b1803aaf3658f028f09b317b8765886e1 | 1,110 | py | Python | DataSynthesizer/datatypes/IntegerAttribute.py | crangelsmith/synthetic-data-tutorial | a997e045fa8d8384a812ba615af55ae418d68439 | [
"MIT"
] | 68 | 2019-03-21T13:39:01.000Z | 2022-01-22T13:53:43.000Z | DataSynthesizer/datatypes/IntegerAttribute.py | crangelsmith/synthetic-data-tutorial | a997e045fa8d8384a812ba615af55ae418d68439 | [
"MIT"
] | 3 | 2019-03-18T13:29:45.000Z | 2021-08-04T11:13:23.000Z | DataSynthesizer/datatypes/IntegerAttribute.py | crangelsmith/synthetic-data-tutorial | a997e045fa8d8384a812ba615af55ae418d68439 | [
"MIT"
] | 23 | 2020-01-14T10:05:03.000Z | 2021-12-08T03:43:10.000Z | from typing import Union
from pandas import Series
from datatypes.AbstractAttribute import AbstractAttribute
from datatypes.utils.DataType import DataType
class IntegerAttribute(AbstractAttribute):
def __init__(self, name: str, is_candidate_key, is_categorical, histogram_size: Union[int, str], data: Series):
... | 37 | 115 | 0.741441 | from typing import Union
from pandas import Series
from datatypes.AbstractAttribute import AbstractAttribute
from datatypes.utils.DataType import DataType
class IntegerAttribute(AbstractAttribute):
def __init__(self, name: str, is_candidate_key, is_categorical, histogram_size: Union[int, str], data: Series):
... | true | true |
f727d812d6c4a543c146cb1e1a5fbdc9a8873c15 | 45,449 | py | Python | t2t_bert/utils/tensor2tensor/trax/rlax/ppo.py | yyht/bert | 480c909e0835a455606e829310ff949c9dd23549 | [
"Apache-2.0"
] | 34 | 2018-12-19T01:00:57.000Z | 2021-03-26T09:36:37.000Z | t2t_bert/utils/tensor2tensor/trax/rlax/ppo.py | yyht/bert | 480c909e0835a455606e829310ff949c9dd23549 | [
"Apache-2.0"
] | 11 | 2018-12-25T03:37:59.000Z | 2021-08-25T14:43:58.000Z | t2t_bert/utils/tensor2tensor/trax/rlax/ppo.py | yyht/bert | 480c909e0835a455606e829310ff949c9dd23549 | [
"Apache-2.0"
] | 9 | 2018-12-27T08:00:44.000Z | 2020-06-08T03:05:14.000Z | # coding=utf-8
# Copyright 2019 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 36.388311 | 81 | 0.650685 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import functools
import os
import time
from absl import logging
import cloudpickle as pickle
import gin
import gym
from jax import grad
from jax import jit
from jax import la... | true | true |
f727db28729a6cb29c683b37edffca2af1fdd1c2 | 6,875 | py | Python | dashboard/dashboard_build/preprocess.py | alekzonder/catapult | f1017f0c7bd2b766674888d5e88d42fcc61d632c | [
"BSD-3-Clause"
] | null | null | null | dashboard/dashboard_build/preprocess.py | alekzonder/catapult | f1017f0c7bd2b766674888d5e88d42fcc61d632c | [
"BSD-3-Clause"
] | null | null | null | dashboard/dashboard_build/preprocess.py | alekzonder/catapult | f1017f0c7bd2b766674888d5e88d42fcc61d632c | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import contextlib
import logging
import os
impo... | 36.184211 | 80 | 0.652945 |
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import contextlib
import logging
import os
import subprocess
import sys
import time
def _AddToPathIfNeeded(path):
if path not in sys.path:
sys.path.insert(0, path)
@contextlib.contextmanager
def C... | true | true |
f727dba422b880a9a9bc67a389966d3ac11e1460 | 463 | py | Python | econml/tree/__init__.py | lwschm/EconML | 6e7b107e1f8a7a5922489eb81143db8656ff01af | [
"BSD-3-Clause"
] | 1 | 2021-02-08T22:58:39.000Z | 2021-02-08T22:58:39.000Z | econml/tree/__init__.py | Jimmy-INL/EconML | 3e66b9507b43f8af291009d26186283fa4bb4ced | [
"BSD-3-Clause"
] | null | null | null | econml/tree/__init__.py | Jimmy-INL/EconML | 3e66b9507b43f8af291009d26186283fa4bb4ced | [
"BSD-3-Clause"
] | 1 | 2021-08-20T09:06:42.000Z | 2021-08-20T09:06:42.000Z | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
from ._criterion import Criterion, RegressionCriterion, MSE
from ._splitter import Splitter, BestSplitter
from ._tree import DepthFirstTreeBuilder
from ._tree import Tree
__all__ = ["Tree",
"Splitter",
... | 28.9375 | 60 | 0.650108 |
from ._criterion import Criterion, RegressionCriterion, MSE
from ._splitter import Splitter, BestSplitter
from ._tree import DepthFirstTreeBuilder
from ._tree import Tree
__all__ = ["Tree",
"Splitter",
"BestSplitter",
"DepthFirstTreeBuilder",
"Criterion",
... | true | true |
f727dd0ea24c6f6c7eef4fa81bae3e2d89fcaac3 | 3,250 | py | Python | Results/ResultUniLex.py | viitormiiguel/AnalysisFinancial | 21d19c4eb200655ffd8605d4c38ab280a4552384 | [
"MIT"
] | null | null | null | Results/ResultUniLex.py | viitormiiguel/AnalysisFinancial | 21d19c4eb200655ffd8605d4c38ab280a4552384 | [
"MIT"
] | null | null | null | Results/ResultUniLex.py | viitormiiguel/AnalysisFinancial | 21d19c4eb200655ffd8605d4c38ab280a4552384 | [
"MIT"
] | 2 | 2020-04-30T18:47:05.000Z | 2021-05-24T15:07:41.000Z | import nltk
import csv
import datetime
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
now = datetime.datetime.now()
today = now.strftime("%Y-%m-%d")
dInfoMoney = 'C:/Users/vitor/Documents/GetDataset/Infomoney/'
dInvesting = 'C:/Users/vitor/Documents/GetDataset/Investing.com/'
dTrad... | 33.505155 | 114 | 0.641538 | import nltk
import csv
import datetime
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
now = datetime.datetime.now()
today = now.strftime("%Y-%m-%d")
dInfoMoney = 'C:/Users/vitor/Documents/GetDataset/Infomoney/'
dInvesting = 'C:/Users/vitor/Documents/GetDataset/Investing.com/'
dTrad... | true | true |
f727dd3b7d4b012d0f7dec1bce4d8082d376ec1c | 295,763 | py | Python | kubernetes/client/apis/apps_v1beta1_api.py | TomasTomecek/kubernetes-python | c37c074303a13c72662b9201ccc023fb0ca45755 | [
"Apache-2.0"
] | null | null | null | kubernetes/client/apis/apps_v1beta1_api.py | TomasTomecek/kubernetes-python | c37c074303a13c72662b9201ccc023fb0ca45755 | [
"Apache-2.0"
] | 1 | 2021-04-30T20:41:19.000Z | 2021-04-30T20:41:19.000Z | venv/lib/python2.7/site-packages/kubernetes/client/apis/apps_v1beta1_api.py | 784134748/kubernetes-install | 5df59632c2619632e422948b667fb68eab9ff5be | [
"MIT"
] | 1 | 2020-05-09T07:16:55.000Z | 2020-05-09T07:16:55.000Z | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.12.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import sys
import os
i... | 64.661784 | 1,390 | 0.651883 |
from __future__ import absolute_import
import sys
import os
import re
from six import iteritems
from ..api_client import ApiClient
class AppsV1beta1Api(object):
def __init__(self, api_client=None):
if api_client is None:
api_client = ApiClient()
self.api_client = api_client
... | true | true |
f727dd8d7d3f08eb3d6179104991040375e54f90 | 5,354 | py | Python | test/integration/smoke/test_async_job.py | saliven1970/cloudstack | 4617be458387421bbbfc120c1f054c9939ba52eb | [
"Apache-2.0"
] | 2 | 2021-10-31T01:04:26.000Z | 2021-11-08T09:43:30.000Z | test/integration/smoke/test_async_job.py | saliven1970/cloudstack | 4617be458387421bbbfc120c1f054c9939ba52eb | [
"Apache-2.0"
] | 20 | 2020-12-19T22:32:23.000Z | 2022-02-01T01:07:06.000Z | test/integration/smoke/test_async_job.py | saliven1970/cloudstack | 4617be458387421bbbfc120c1f054c9939ba52eb | [
"Apache-2.0"
] | 2 | 2016-11-10T16:29:26.000Z | 2019-05-20T12:23:35.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 39.367647 | 92 | 0.649234 |
from nose.plugins.attrib import attr
from marvin.cloudstackTestCase import cloudstackTestCase
from marvin.lib.utils import cleanup_resources
from marvin.lib.base import ServiceOffering, DiskOffering, Account, VirtualMachine,\
queryAsyncJobResult, PASS
from marvin.lib.common import get_domain, get_z... | true | true |
f727ddec1d4bf396d3560c014f5899414eb5618e | 180 | py | Python | src/app/blueprints/main/controllers.py | Dev-Nebe/student-hub | fe6718aced065dab4bb8d92372bfe098c1a75137 | [
"MIT"
] | 3 | 2020-05-25T19:36:11.000Z | 2021-09-15T09:05:57.000Z | src/app/blueprints/main/controllers.py | Dev-Nebe/student-hub | fe6718aced065dab4bb8d92372bfe098c1a75137 | [
"MIT"
] | 1 | 2021-04-30T21:11:44.000Z | 2021-04-30T21:11:44.000Z | src/app/blueprints/main/controllers.py | Dev-Nebe/student-hub | fe6718aced065dab4bb8d92372bfe098c1a75137 | [
"MIT"
] | null | null | null | from flask import Blueprint, jsonify
main_bp = Blueprint('main', __name__)
@main_bp.route('/')
def api_home():
return jsonify({"message": "Welcome to the Student Hub API"})
| 20 | 65 | 0.705556 | from flask import Blueprint, jsonify
main_bp = Blueprint('main', __name__)
@main_bp.route('/')
def api_home():
return jsonify({"message": "Welcome to the Student Hub API"})
| true | true |
f727e110b2656c38f2c08d157ab83662cd7bb00d | 3,506 | py | Python | tools/validators/instance_validator/tests/instance_parser_test.py | HTKshimo/digitalbuildings | a6dad0282cac7dbe2a31d1b3c9a6dc9adddb5177 | [
"Apache-2.0"
] | null | null | null | tools/validators/instance_validator/tests/instance_parser_test.py | HTKshimo/digitalbuildings | a6dad0282cac7dbe2a31d1b3c9a6dc9adddb5177 | [
"Apache-2.0"
] | null | null | null | tools/validators/instance_validator/tests/instance_parser_test.py | HTKshimo/digitalbuildings | a6dad0282cac7dbe2a31d1b3c9a6dc9adddb5177 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the License);
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, sof... | 34.372549 | 74 | 0.666572 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import instance_parser
from absl.testing import absltest
_TESTCASE_PATH = os.path.join('.', 'tests', 'fake_instances')
class ParserTest(absltest.TestCase):
def testInstanceValidat... | true | true |
f727e15a3cb3d79ce95f8fecbf0b1a12b57e08b8 | 1,268 | py | Python | prova/relazioni/views.py | mary023010/prova_django | a69a37a4f26f21018cef48e5d637dd630ca68877 | [
"MIT"
] | null | null | null | prova/relazioni/views.py | mary023010/prova_django | a69a37a4f26f21018cef48e5d637dd630ca68877 | [
"MIT"
] | null | null | null | prova/relazioni/views.py | mary023010/prova_django | a69a37a4f26f21018cef48e5d637dd630ca68877 | [
"MIT"
] | null | null | null | from django.shortcuts import render, redirect
from django.views.generic.detail import DetailView
from .models import Fly,Airport
from django.db.models import Q
from django.contrib import messages
from django.contrib.auth.decorators import login_required
# Create your views here.
@login_required(login_url='/login/'... | 31.7 | 141 | 0.689274 | from django.shortcuts import render, redirect
from django.views.generic.detail import DetailView
from .models import Fly,Airport
from django.db.models import Q
from django.contrib import messages
from django.contrib.auth.decorators import login_required
@login_required(login_url='/login/')
def selection_airport(r... | true | true |
f727e2c8e1a28f98877f1994152992973984a11f | 879 | py | Python | recipes/models.py | asis2016/momo-ristorante-v1 | d46c36d1b92212ade34d781c4e2adc91cb52cac7 | [
"MIT"
] | null | null | null | recipes/models.py | asis2016/momo-ristorante-v1 | d46c36d1b92212ade34d781c4e2adc91cb52cac7 | [
"MIT"
] | null | null | null | recipes/models.py | asis2016/momo-ristorante-v1 | d46c36d1b92212ade34d781c4e2adc91cb52cac7 | [
"MIT"
] | null | null | null | import uuid
from django.db import models
from django.urls import reverse
from core.models import (Authorable,
Titleable,
TimeStampedModel)
class Recipe(Authorable, Titleable, TimeStampedModel):
"""
Recipe model as of v.1.0.
"""
CATEGORY = (
(... | 28.354839 | 79 | 0.633675 | import uuid
from django.db import models
from django.urls import reverse
from core.models import (Authorable,
Titleable,
TimeStampedModel)
class Recipe(Authorable, Titleable, TimeStampedModel):
CATEGORY = (
('WS', 'Western'),
('TB', 'Tibetan'),
... | true | true |
f727e34363c19a7e7e17351055f27d2efc065ca3 | 1,932 | py | Python | src/bot/keyboards/claim_parts.py | nchursin/claimant | 890ce1a3ced8db9d2e2fbddb8a3207e82ac05326 | [
"BSD-3-Clause"
] | 3 | 2022-03-03T19:10:25.000Z | 2022-03-03T19:57:15.000Z | src/bot/keyboards/claim_parts.py | nchursin/claimant | 890ce1a3ced8db9d2e2fbddb8a3207e82ac05326 | [
"BSD-3-Clause"
] | 9 | 2022-03-03T18:56:37.000Z | 2022-03-29T18:34:02.000Z | src/bot/keyboards/claim_parts.py | nchursin/claimant | 890ce1a3ced8db9d2e2fbddb8a3207e82ac05326 | [
"BSD-3-Clause"
] | 1 | 2022-03-04T11:59:11.000Z | 2022-03-04T11:59:11.000Z | from typing import List
from aiogram.types import KeyboardButton, ReplyKeyboardMarkup
from keyboards import emojis
from repository import Repository
PART_NAMES: List[str] = ["head", "story", "essence", "proofs", "claims", "additions"]
def get_claim_parts_kb(user_id: int) -> ReplyKeyboardMarkup:
parts_status: d... | 49.538462 | 137 | 0.710145 | from typing import List
from aiogram.types import KeyboardButton, ReplyKeyboardMarkup
from keyboards import emojis
from repository import Repository
PART_NAMES: List[str] = ["head", "story", "essence", "proofs", "claims", "additions"]
def get_claim_parts_kb(user_id: int) -> ReplyKeyboardMarkup:
parts_status: d... | true | true |
f727e3458cf9ec525e06fec4d8066046877248f1 | 5,378 | py | Python | modules/REPORT_RESULTS/scripts/select-motifs.py | gruber-sciencelab/MAPP | 81563f676b284c5b283a193a698ce618c044d3b5 | [
"Apache-2.0"
] | null | null | null | modules/REPORT_RESULTS/scripts/select-motifs.py | gruber-sciencelab/MAPP | 81563f676b284c5b283a193a698ce618c044d3b5 | [
"Apache-2.0"
] | null | null | null | modules/REPORT_RESULTS/scripts/select-motifs.py | gruber-sciencelab/MAPP | 81563f676b284c5b283a193a698ce618c044d3b5 | [
"Apache-2.0"
] | 1 | 2022-01-15T04:39:30.000Z | 2022-01-15T04:39:30.000Z | """
##############################################################################
#
# Select top N distinct motifs with highest (statistically significant)
# activity Z-score (for every site separately)
#
# AUTHOR: Maciej_Bak
# AFFILIATION: University_of_Basel
# AFFILIATION: Swiss_Institute_of_Bioinformatics... | 30.556818 | 86 | 0.554481 |
import time
import logging
import logging.handlers
from argparse import ArgumentParser, RawTextHelpFormatter
import os
import pandas as pd
def parse_arguments():
parser = ArgumentParser(description=__doc__, formatter_class=RawTextHelpFormatter)
parser.add_argument(
"-v",
"--verbosity",
... | true | true |
f727e3880049704ad4f93c71f9dada6ffc47feb8 | 1,530 | py | Python | top10losers/top10losers.py | KevBarbour/cryptobot | 57239c83ca5dd84d2a0e273f20782cf608ce99ba | [
"MIT"
] | null | null | null | top10losers/top10losers.py | KevBarbour/cryptobot | 57239c83ca5dd84d2a0e273f20782cf608ce99ba | [
"MIT"
] | null | null | null | top10losers/top10losers.py | KevBarbour/cryptobot | 57239c83ca5dd84d2a0e273f20782cf608ce99ba | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import requests
from bs4 import BeautifulSoup
import sys
from twython import Twython
import numpy as np
apiKey = '...'
apiSecret = '...'
accessToken = '...'
accessTokenSecret = '...'
#BeautifulSoup scraping algorythm
url = 'https://coinmarketcap.com'
soup = BeautifulSoup(requests.get(url).text, ... | 26.37931 | 138 | 0.62549 |
import requests
from bs4 import BeautifulSoup
import sys
from twython import Twython
import numpy as np
apiKey = '...'
apiSecret = '...'
accessToken = '...'
accessTokenSecret = '...'
url = 'https://coinmarketcap.com'
soup = BeautifulSoup(requests.get(url).text, 'lxml')
L=[]
F=0
for tr in soup.select('#currencies ... | true | true |
f727e3d280dbac1f16c6fe5d8782bb4bd6564767 | 59,646 | py | Python | allennlp/nn/util.py | threefoldo/allennlp | 983db284cb46fd18c898dd3b0e04eed6cb932768 | [
"Apache-2.0"
] | 3 | 2019-06-17T21:09:07.000Z | 2022-03-18T05:19:31.000Z | allennlp/nn/util.py | alisdairv/allennlp | 9fcc79566cc148cce9f967a7962ac03bc300f011 | [
"Apache-2.0"
] | null | null | null | allennlp/nn/util.py | alisdairv/allennlp | 9fcc79566cc148cce9f967a7962ac03bc300f011 | [
"Apache-2.0"
] | 1 | 2020-03-12T06:53:53.000Z | 2020-03-12T06:53:53.000Z | """
Assorted utilities for working with neural networks in AllenNLP.
"""
# pylint: disable=too-many-lines
from collections import defaultdict
from typing import Any, Dict, List, Optional, Sequence, Tuple, TypeVar
import logging
import math
import warnings
import torch
from allennlp.common.checks import ConfigurationE... | 46.634871 | 130 | 0.669349 |
from collections import defaultdict
from typing import Any, Dict, List, Optional, Sequence, Tuple, TypeVar
import logging
import math
import warnings
import torch
from allennlp.common.checks import ConfigurationError
logger = logging.getLogger(__name__)
T = TypeVar('T')
def has_tensor(obj) -> bool:
if isin... | true | true |
f727e5f78b42c3a1e0eaf2ad37a23824a5767c53 | 828 | py | Python | build_scripts/generate_rc_build_number.py | MATTHEWFRAZER/trochilidae | 35e907ba9dcb1f283f79f4f32d61db6b53a1ca97 | [
"MIT"
] | null | null | null | build_scripts/generate_rc_build_number.py | MATTHEWFRAZER/trochilidae | 35e907ba9dcb1f283f79f4f32d61db6b53a1ca97 | [
"MIT"
] | null | null | null | build_scripts/generate_rc_build_number.py | MATTHEWFRAZER/trochilidae | 35e907ba9dcb1f283f79f4f32d61db6b53a1ca97 | [
"MIT"
] | 1 | 2021-11-12T18:49:15.000Z | 2021-11-12T18:49:15.000Z | #!/usr/bin/python
import subprocess
try:
from subprocess import DEVNULL # py3k
except ImportError:
import os
DEVNULL = open(os.devnull, 'wb')
version_path = "version.txt"
build_type = "rc"
with open(version_path, "r") as f:
version = f.readline()
build_number = 0
tag = "{0}-{1}.{2}".format(versio... | 28.551724 | 107 | 0.704106 |
import subprocess
try:
from subprocess import DEVNULL
except ImportError:
import os
DEVNULL = open(os.devnull, 'wb')
version_path = "version.txt"
build_type = "rc"
with open(version_path, "r") as f:
version = f.readline()
build_number = 0
tag = "{0}-{1}.{2}".format(version, build_type, build_nu... | true | true |
f727e839bc9f60bee5264f963b12f7ba8265d8ef | 6,935 | py | Python | dsmr_parser/parsers.py | Smeedy/dsmr_parser | 1ab4cb4b11eec41c559a33d73e70c211216854d1 | [
"MIT"
] | null | null | null | dsmr_parser/parsers.py | Smeedy/dsmr_parser | 1ab4cb4b11eec41c559a33d73e70c211216854d1 | [
"MIT"
] | null | null | null | dsmr_parser/parsers.py | Smeedy/dsmr_parser | 1ab4cb4b11eec41c559a33d73e70c211216854d1 | [
"MIT"
] | null | null | null | import logging
import re
from PyCRC.CRC16 import CRC16
from dsmr_parser.objects import MBusObject, CosemObject
from dsmr_parser.exceptions import ParseContentError, InvalidChecksumError, NoChecksumError
logger = logging.getLogger(__name__)
class TelegramParser(object):
def __init__(self, telegram_specificatio... | 31.098655 | 92 | 0.617159 | import logging
import re
from PyCRC.CRC16 import CRC16
from dsmr_parser.objects import MBusObject, CosemObject
from dsmr_parser.exceptions import ParseContentError, InvalidChecksumError, NoChecksumError
logger = logging.getLogger(__name__)
class TelegramParser(object):
def __init__(self, telegram_specificatio... | true | true |
f727e89ef20c8fb9be92012ad38858b527ba3813 | 579 | py | Python | src/bot/discord_ext.py | MycroftKang/mulgyeol-mkbot | 77bcfc5c93e02dbc983d2e6a137ddf835d450c29 | [
"MIT"
] | null | null | null | src/bot/discord_ext.py | MycroftKang/mulgyeol-mkbot | 77bcfc5c93e02dbc983d2e6a137ddf835d450c29 | [
"MIT"
] | null | null | null | src/bot/discord_ext.py | MycroftKang/mulgyeol-mkbot | 77bcfc5c93e02dbc983d2e6a137ddf835d450c29 | [
"MIT"
] | null | null | null | discord_extensions = (
"core.controllers.discord.delete",
"core.controllers.discord.join",
"core.controllers.discord.leave",
"core.controllers.discord.logout",
"core.controllers.discord.ping",
"core.controllers.discord.tts",
"core.controllers.discord.poll",
"core.controllers.discord.roul... | 34.058824 | 43 | 0.721934 | discord_extensions = (
"core.controllers.discord.delete",
"core.controllers.discord.join",
"core.controllers.discord.leave",
"core.controllers.discord.logout",
"core.controllers.discord.ping",
"core.controllers.discord.tts",
"core.controllers.discord.poll",
"core.controllers.discord.roul... | true | true |
f727e976fa0a94180dd9383f9dc5be94b4aa493a | 8,537 | py | Python | train.py | DylanHooz/uestc_yolov3 | 72ed60aaf68a0ab2dbc8d4dfad7bddffce826dde | [
"MIT"
] | null | null | null | train.py | DylanHooz/uestc_yolov3 | 72ed60aaf68a0ab2dbc8d4dfad7bddffce826dde | [
"MIT"
] | null | null | null | train.py | DylanHooz/uestc_yolov3 | 72ed60aaf68a0ab2dbc8d4dfad7bddffce826dde | [
"MIT"
] | null | null | null | """
Retrain the YOLO model for your own dataset.
"""
import numpy as np
import keras.backend as K
from keras.layers import Input, Lambda
from keras.models import Model
from keras.optimizers import Adam
from keras.callbacks import TensorBoard, ModelCheckpoint, ReduceLROnPlateau, EarlyStopping
from yolo3.mod... | 44.463542 | 130 | 0.660536 |
import numpy as np
import keras.backend as K
from keras.layers import Input, Lambda
from keras.models import Model
from keras.optimizers import Adam
from keras.callbacks import TensorBoard, ModelCheckpoint, ReduceLROnPlateau, EarlyStopping
from yolo3.model import preprocess_true_boxes, yolo_body, tiny_yolo_bo... | true | true |
f727ea71d77bc5a71cddd8eb8f7f9da14738cd39 | 165 | py | Python | src/timeatlas/generators/anomaly_generator/__init__.py | fredmontet/timeatlas | 9a439a913ef9a8a1ef9833b42e5fb4e988d7e35e | [
"MIT"
] | 10 | 2020-08-25T09:23:02.000Z | 2021-01-12T14:00:35.000Z | src/timeatlas/generators/anomaly_generator/__init__.py | fredmontet/timeatlas | 9a439a913ef9a8a1ef9833b42e5fb4e988d7e35e | [
"MIT"
] | 140 | 2020-06-30T11:59:47.000Z | 2021-08-23T20:58:43.000Z | src/timeatlas/generators/anomaly_generator/__init__.py | fredmontet/timeatlas | 9a439a913ef9a8a1ef9833b42e5fb4e988d7e35e | [
"MIT"
] | null | null | null | from .anomalies import AnomalyABC
from .labeler import AnomalySetLabeler
from .anomaly_generator import AnomalyGenerator
from .config import AnomalyGeneratorTemplate | 41.25 | 47 | 0.884848 | from .anomalies import AnomalyABC
from .labeler import AnomalySetLabeler
from .anomaly_generator import AnomalyGenerator
from .config import AnomalyGeneratorTemplate | true | true |
f727eacf052868602d35b1841a9c93d769a8fe24 | 4,382 | py | Python | packages/syft/src/syft/core/node/common/action/get_enum_attribute_action.py | jackbandy/PySyft | 0e20e90abab6a7a7ca672d6eedfa1e7f83c4981b | [
"Apache-2.0"
] | null | null | null | packages/syft/src/syft/core/node/common/action/get_enum_attribute_action.py | jackbandy/PySyft | 0e20e90abab6a7a7ca672d6eedfa1e7f83c4981b | [
"Apache-2.0"
] | null | null | null | packages/syft/src/syft/core/node/common/action/get_enum_attribute_action.py | jackbandy/PySyft | 0e20e90abab6a7a7ca672d6eedfa1e7f83c4981b | [
"Apache-2.0"
] | null | null | null | # stdlib
from typing import Dict
from typing import Optional
# third party
from google.protobuf.reflection import GeneratedProtocolMessageType
from nacl.signing import VerifyKey
# syft absolute
import syft as sy
# relative
from ..... import lib
from .....proto.core.node.common.action.get_enum_attribute_pb2 import (
... | 38.104348 | 95 | 0.689411 |
from typing import Dict
from typing import Optional
from google.protobuf.reflection import GeneratedProtocolMessageType
from nacl.signing import VerifyKey
import syft as sy
from ..... import lib
from .....proto.core.node.common.action.get_enum_attribute_pb2 import (
GetEnumAttributeAction as GetEnumAttribute... | true | true |
f727ec286ffb28b7cbdb0a43ec55f52b2d947849 | 496 | py | Python | package_maker/py2exe/single_file/setup.py | thanhkaist/Qt-Python-Binding-Examples | 25b3313fd03e396014cce0e8f7eec8823b3ebd29 | [
"BSD-3-Clause"
] | 2 | 2019-10-20T05:40:51.000Z | 2019-10-31T17:26:27.000Z | package_maker/py2exe/single_file/setup.py | thanhkaist/Qt-Python-Binding-Examples | 25b3313fd03e396014cce0e8f7eec8823b3ebd29 | [
"BSD-3-Clause"
] | null | null | null | package_maker/py2exe/single_file/setup.py | thanhkaist/Qt-Python-Binding-Examples | 25b3313fd03e396014cce0e8f7eec8823b3ebd29 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
#-*- coding:utf-8 -*-
import os
import glob
##
from distutils.core import setup
import py2exe
assert py2exe != None
##
osp=os.path
windows = [
{
"script": "btn.py",
"icon_resources": [(1, "gui.ico")],
}
]
options = {
"py2exe": {
"includes": ["PyQt4", "sip"],
... | 16 | 43 | 0.528226 |
import os
import glob
from distutils.core import setup
import py2exe
assert py2exe != None
osp=os.path
windows = [
{
"script": "btn.py",
"icon_resources": [(1, "gui.ico")],
}
]
options = {
"py2exe": {
"includes": ["PyQt4", "sip"],
"dll_excludes": ["MSVCP90.dll"],
"... | true | true |
f727ecacbdc8f8fdc864e9a7692a7f8384a45b5b | 763 | py | Python | account/forms.py | mateuszwwwrobel/Expense_Tracker_Django | e84bda82433427608e026faa00a634c46a433179 | [
"MIT"
] | null | null | null | account/forms.py | mateuszwwwrobel/Expense_Tracker_Django | e84bda82433427608e026faa00a634c46a433179 | [
"MIT"
] | null | null | null | account/forms.py | mateuszwwwrobel/Expense_Tracker_Django | e84bda82433427608e026faa00a634c46a433179 | [
"MIT"
] | null | null | null | from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
class SignUpForm(UserCreationForm):
"""Custom signup form with additional fields."""
first_name = forms.CharField(max_length=50, required=False,
help_te... | 40.157895 | 92 | 0.646134 | from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
class SignUpForm(UserCreationForm):
first_name = forms.CharField(max_length=50, required=False,
help_text='Optional. 50 characters or fewer.')
last_name... | true | true |
f727ed1dd0b38515ab9c60f47bb34d9f08bb15ec | 253 | py | Python | test.py | essethon/Python_HC_SR501 | 2ccae65651d82875a449e51b77aa5077ae78c19a | [
"MIT"
] | 4 | 2017-12-27T08:00:57.000Z | 2020-07-12T08:32:58.000Z | test.py | essethon/Python_HC_SR501 | 2ccae65651d82875a449e51b77aa5077ae78c19a | [
"MIT"
] | null | null | null | test.py | essethon/Python_HC_SR501 | 2ccae65651d82875a449e51b77aa5077ae78c19a | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import time
import motion_detector
if __name__ == "__main__":
while True:
if motion_detector.motion_detect():
print("Somebody is closing")
else:
print("Nobody")
time.sleep(1)
| 18.071429 | 43 | 0.596838 |
import time
import motion_detector
if __name__ == "__main__":
while True:
if motion_detector.motion_detect():
print("Somebody is closing")
else:
print("Nobody")
time.sleep(1)
| true | true |
f727ed746f16c529677c000a761dd7cf38da957f | 8,929 | py | Python | .history/pages/intro_20220304123207.py | rypaik/Streamlit_Ref | 5ce11cecbe8307238463c126b88b3beed66c99fa | [
"MIT"
] | null | null | null | .history/pages/intro_20220304123207.py | rypaik/Streamlit_Ref | 5ce11cecbe8307238463c126b88b3beed66c99fa | [
"MIT"
] | null | null | null | .history/pages/intro_20220304123207.py | rypaik/Streamlit_Ref | 5ce11cecbe8307238463c126b88b3beed66c99fa | [
"MIT"
] | null | null | null | """
Off Multipage Cheatsheet
https://github.com/daniellewisDL/streamlit-cheat-sheet
@daniellewisDL : https://github.com/daniellewisDL
"""
import streamlit as st
from pathlib import Path
import base64
from modules.toc import *
# Initial page config
st.set_page_config(
page_title='Code Compendium Intro Page',
... | 28.527157 | 206 | 0.652593 |
import streamlit as st
from pathlib import Path
import base64
from modules.toc import *
st.set_page_config(
page_title='Code Compendium Intro Page',
layout="wide"
)
def img_to_bytes(img_path):
img_bytes = Path(img_path).read_bytes()
encoded = base64.b64encode(img_bytes).decode()
... | true | true |
f727ee1e7b53a6244678c9e08fe4eea5eec42c76 | 509 | py | Python | src/waldur_ansible/playbook_jobs/extension.py | opennode/waldur-ansible | c81c5f0491be02fa9a55a6d5bf9d845750fd1ba9 | [
"MIT"
] | 1 | 2017-09-05T08:09:47.000Z | 2017-09-05T08:09:47.000Z | src/waldur_ansible/playbook_jobs/extension.py | opennode/waldur-ansible | c81c5f0491be02fa9a55a6d5bf9d845750fd1ba9 | [
"MIT"
] | null | null | null | src/waldur_ansible/playbook_jobs/extension.py | opennode/waldur-ansible | c81c5f0491be02fa9a55a6d5bf9d845750fd1ba9 | [
"MIT"
] | 3 | 2017-09-24T03:13:19.000Z | 2018-08-12T07:44:38.000Z | from waldur_core.core import WaldurExtension
class PlaybookJobsExtension(WaldurExtension):
class Settings:
WALDUR_PLAYBOOK_JOBS = {
'PLAYBOOKS_DIR_NAME': 'ansible_playbooks',
'PLAYBOOK_ICON_SIZE': (64, 64),
}
@staticmethod
def django_app():
return 'waldur_a... | 22.130435 | 54 | 0.650295 | from waldur_core.core import WaldurExtension
class PlaybookJobsExtension(WaldurExtension):
class Settings:
WALDUR_PLAYBOOK_JOBS = {
'PLAYBOOKS_DIR_NAME': 'ansible_playbooks',
'PLAYBOOK_ICON_SIZE': (64, 64),
}
@staticmethod
def django_app():
return 'waldur_a... | true | true |
f727eea3db865e0f61cecbb74cf9356d9badf3b1 | 558 | py | Python | pythonaem/error.py | mbloch1986/pythonaem | ce3ac1cb045a3cae912e7a76148130f645f61b91 | [
"Apache-2.0"
] | 3 | 2017-09-18T18:02:42.000Z | 2021-05-19T06:47:46.000Z | pythonaem/error.py | mbloch1986/pythonaem | ce3ac1cb045a3cae912e7a76148130f645f61b91 | [
"Apache-2.0"
] | 1 | 2021-05-19T01:49:04.000Z | 2021-05-19T01:49:04.000Z | pythonaem/error.py | mbloch1986/pythonaem | ce3ac1cb045a3cae912e7a76148130f645f61b91 | [
"Apache-2.0"
] | 5 | 2017-07-13T11:31:38.000Z | 2021-05-19T01:12:47.000Z | """
PythonAEM error, contains a message and PythonAEM Result object
"""
class Error(RuntimeError):
"""
PythonAEM error, contains a message and PythonAEM Result object
useful for debugging the result and response when an error occurs
"""
def __init__(self, message, result):
"""
Ini... | 24.26087 | 69 | 0.636201 |
class Error(RuntimeError):
def __init__(self, message, result):
super().__init__()
self.message = message
self.result = result
| true | true |
f727eee784d7ad52a67a2cd8eda72f4b1d6284ef | 407 | py | Python | app/run/migrations/0015_alter_run_pipeline_command.py | Masado/django-app-api-3 | 88def27f1cd8974c62dead282cd04d1384054888 | [
"MIT"
] | null | null | null | app/run/migrations/0015_alter_run_pipeline_command.py | Masado/django-app-api-3 | 88def27f1cd8974c62dead282cd04d1384054888 | [
"MIT"
] | null | null | null | app/run/migrations/0015_alter_run_pipeline_command.py | Masado/django-app-api-3 | 88def27f1cd8974c62dead282cd04d1384054888 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.9 on 2021-11-25 10:37
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('run', '0014_run_duration'),
]
operations = [
migrations.AlterField(
model_name='run',
name='pipeline_command',
... | 21.421053 | 74 | 0.604423 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('run', '0014_run_duration'),
]
operations = [
migrations.AlterField(
model_name='run',
name='pipeline_command',
field=models.CharField(blank=True, max_l... | true | true |
f727f0ca02c8ddd7cc426b246a89148e585b2b62 | 1,181 | py | Python | daemon/examples/api/switch_inject.py | shanv82/core | 70abb8cc1426ffceb53a03e84edc26f56f9ed4c0 | [
"BSD-2-Clause"
] | null | null | null | daemon/examples/api/switch_inject.py | shanv82/core | 70abb8cc1426ffceb53a03e84edc26f56f9ed4c0 | [
"BSD-2-Clause"
] | null | null | null | daemon/examples/api/switch_inject.py | shanv82/core | 70abb8cc1426ffceb53a03e84edc26f56f9ed4c0 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/python
#
# run iperf to measure the effective throughput between two nodes when
# n nodes are connected to a virtual wlan; run test for testsec
# and repeat for minnodes <= n <= maxnodes with a step size of
# nodestep
from core import load_logging_config
from core.emulator.emudata import IpPrefixes
from core... | 29.525 | 84 | 0.731583 |
from core import load_logging_config
from core.emulator.emudata import IpPrefixes
from core.enumerations import NodeTypes, EventTypes
load_logging_config()
def example(nodes):
prefixes = IpPrefixes("10.83.0.0/16")
coreemu = globals()["coreemu"]
session = coreemu.create_session()
... | true | true |
f727f10e73f0dd4907a634b339ec124db37c3bc9 | 20,980 | py | Python | makepanda/makewheel.py | sean5470/panda3d | ea2d4fecd4af1d4064c5fe2ae2a902ef4c9b903d | [
"PHP-3.0",
"PHP-3.01"
] | null | null | null | makepanda/makewheel.py | sean5470/panda3d | ea2d4fecd4af1d4064c5fe2ae2a902ef4c9b903d | [
"PHP-3.0",
"PHP-3.01"
] | null | null | null | makepanda/makewheel.py | sean5470/panda3d | ea2d4fecd4af1d4064c5fe2ae2a902ef4c9b903d | [
"PHP-3.0",
"PHP-3.01"
] | null | null | null | """
Generates a wheel (.whl) file from the output of makepanda.
Since the wheel requires special linking, this will only work if compiled with
the `--wheel` parameter.
Please keep this file work with Panda3D 1.9 until that reaches EOL.
"""
from __future__ import print_function, unicode_literals
from distutils.util im... | 35.863248 | 153 | 0.60715 | from __future__ import print_function, unicode_literals
from distutils.util import get_platform
import json
import sys
import os
from os.path import join
import shutil
import zipfile
import hashlib
import tempfile
import subprocess
from distutils.sysconfig import get_config_var
from optparse import OptionParser
from m... | true | true |
f727f2af04e77662cb1b105b6ea82138d5057c4d | 435 | py | Python | sigmoid.py | tyburam/python-machine-learning | 7cb346c99d24e959c1af63532603dd118558b16f | [
"MIT"
] | 1 | 2021-04-28T05:40:59.000Z | 2021-04-28T05:40:59.000Z | sigmoid.py | tyburam/python-machine-learning | 7cb346c99d24e959c1af63532603dd118558b16f | [
"MIT"
] | null | null | null | sigmoid.py | tyburam/python-machine-learning | 7cb346c99d24e959c1af63532603dd118558b16f | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import matplotlib.pyplot as plt
import numpy as np
def sigmoid(z):
return 1.0 / (1.0 + np.exp(-z))
z = np.arange(-7, 7, 0.01)
phi_z = sigmoid(z)
plt.plot(z, phi_z)
plt.axvline(0.0, color = 'k')
plt.axhspan(0.0, 1.0, facecolor = '1.0', alpha = 1.0, ls = 'dotted')
plt.axhline(0.5, ls = 'dotted... | 20.714286 | 68 | 0.602299 |
import matplotlib.pyplot as plt
import numpy as np
def sigmoid(z):
return 1.0 / (1.0 + np.exp(-z))
z = np.arange(-7, 7, 0.01)
phi_z = sigmoid(z)
plt.plot(z, phi_z)
plt.axvline(0.0, color = 'k')
plt.axhspan(0.0, 1.0, facecolor = '1.0', alpha = 1.0, ls = 'dotted')
plt.axhline(0.5, ls = 'dotted', color = 'k')
pl... | true | true |
f727f32f70eef26c04e670bca0235c128dc1f09b | 11,477 | py | Python | simplejson/simplejson/tests/test_decoder.py | gollum18/simplejson-test-suite | 3fea15709adb79ef33d7e020e38ec29bf82f2269 | [
"MIT"
] | null | null | null | simplejson/simplejson/tests/test_decoder.py | gollum18/simplejson-test-suite | 3fea15709adb79ef33d7e020e38ec29bf82f2269 | [
"MIT"
] | null | null | null | simplejson/simplejson/tests/test_decoder.py | gollum18/simplejson-test-suite | 3fea15709adb79ef33d7e020e38ec29bf82f2269 | [
"MIT"
] | null | null | null | # Name: test_decoder.py
# Since: April 13th, 2020
# Author: Christen Ford
# Purpose: Implementes unit tests for simplejson.decoder.
from unittest import TestCase
import simplejson.decoder as decoder
import simplejson.errors as errors
class TestDecoder(TestCase):
"""Implements a set of unit tests for the simplej... | 26.87822 | 83 | 0.544393 |
from unittest import TestCase
import simplejson.decoder as decoder
import simplejson.errors as errors
class TestDecoder(TestCase):
def test_scanstring_correct(self):
test_input = '"{"abc": 0, "def": 1, "ghi": 2}"'
decoded_str, last_char_index = decoder.py_scanstring(
s=test_inpu... | true | true |
f727f373f944a10554dfcea5975a2aeb12ec2e24 | 21,937 | py | Python | src/pyrobot/locobot/camera.py | kalyanvasudev/pyrobot | 839ab89a5b3cdd6af9b1e884fa8e8f0007497e32 | [
"MIT"
] | 1 | 2021-12-22T04:14:08.000Z | 2021-12-22T04:14:08.000Z | src/pyrobot/locobot/camera.py | kalyanvasudev/pyrobot | 839ab89a5b3cdd6af9b1e884fa8e8f0007497e32 | [
"MIT"
] | 16 | 2020-01-28T22:49:47.000Z | 2022-03-11T23:51:24.000Z | src/pyrobot/locobot/camera.py | kalyanvasudev/pyrobot | 839ab89a5b3cdd6af9b1e884fa8e8f0007497e32 | [
"MIT"
] | 1 | 2020-09-30T15:14:19.000Z | 2020-09-30T15:14:19.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
import rospkg
import threading
import yaml
from copy import deepcopy
import message_filters
import numpy as np
import pyrobot.util a... | 35.962295 | 79 | 0.548161 |
import os
import rospkg
import threading
import yaml
from copy import deepcopy
import message_filters
import numpy as np
import pyrobot.util as prutil
import rospy
from cv_bridge import CvBridge, CvBridgeError
from pyrobot.core import Camera
from sensor_msgs.msg import CameraInfo
from sensor_msgs.msg import Image... | true | true |
f727f3abb30dc023a71e5a4bb0a7f4af4c4e0c66 | 8,529 | py | Python | pyglet/input/evdev_constants.py | qbektrix/pyglet | ab3f73dfd37abf75041e86310416b18138c34c33 | [
"BSD-3-Clause"
] | 2 | 2015-06-02T19:14:37.000Z | 2017-09-17T03:49:19.000Z | pyglet/input/evdev_constants.py | qbektrix/pyglet | ab3f73dfd37abf75041e86310416b18138c34c33 | [
"BSD-3-Clause"
] | 1 | 2018-08-27T22:31:16.000Z | 2018-08-27T22:31:16.000Z | pyglet/input/evdev_constants.py | qbektrix/pyglet | ab3f73dfd37abf75041e86310416b18138c34c33 | [
"BSD-3-Clause"
] | 2 | 2016-07-28T18:45:57.000Z | 2020-12-05T06:13:00.000Z | #!/usr/bin/env python
'''Event constants from /usr/include/linux/input.h
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
EV_SYN = 0x00
EV_KEY = 0x01
EV_REL = 0x02
EV_ABS = 0x03
EV_MSC = 0x04
EV_LED = 0x11
EV_SND = 0x12
EV_REP = 0x14
EV_FF = 0x15
EV_PWR = 0x16
EV_FF_STATUS = 0x17
EV_MAX = 0x1f
# Synchro... | 15.736162 | 62 | 0.749326 |
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
EV_SYN = 0x00
EV_KEY = 0x01
EV_REL = 0x02
EV_ABS = 0x03
EV_MSC = 0x04
EV_LED = 0x11
EV_SND = 0x12
EV_REP = 0x14
EV_FF = 0x15
EV_PWR = 0x16
EV_FF_STATUS = 0x17
EV_MAX = 0x1f
SYN_REPORT = 0
SYN_CONFIG = 1
KEY_RESERVED = 0
KEY_ESC = 1
KEY_1 = 2
KEY_2 = 3
K... | true | true |
f727f3b193a37188b7de74a5fd1ff300f301659a | 1,439 | py | Python | MoneyChangeAlgorithm/moneychange.py | HeavyWolfPL/SchoolTools | d665d5cbecae7a7d1e7c2406b08471cf0242ed7f | [
"MIT"
] | null | null | null | MoneyChangeAlgorithm/moneychange.py | HeavyWolfPL/SchoolTools | d665d5cbecae7a7d1e7c2406b08471cf0242ed7f | [
"MIT"
] | null | null | null | MoneyChangeAlgorithm/moneychange.py | HeavyWolfPL/SchoolTools | d665d5cbecae7a7d1e7c2406b08471cf0242ed7f | [
"MIT"
] | null | null | null |
monety = input("Podaj posiadane monety, dzieląc je przecinkiem: ")
monety = monety.replace(" ", "")
monety = monety.split(",")
monety = list(map(int, monety))
ilosc = len(monety)
reszta = int(input("Jaką reszte chcesz wydać? "))
licznik = 0
historia = []
while reszta > 0:
if licznik >= ilosc:
print("Nie... | 24.389831 | 98 | 0.549687 |
monety = input("Podaj posiadane monety, dzieląc je przecinkiem: ")
monety = monety.replace(" ", "")
monety = monety.split(",")
monety = list(map(int, monety))
ilosc = len(monety)
reszta = int(input("Jaką reszte chcesz wydać? "))
licznik = 0
historia = []
while reszta > 0:
if licznik >= ilosc:
print("Nie... | true | true |
f727f4410396c7d32520f3d46daef479d465926c | 991 | py | Python | coto/clients/signin/__init__.py | wvanheerde/coto | d7eeb2e98a24b743d879ef5e2da9cbbacc417d8d | [
"Apache-2.0"
] | 42 | 2018-04-13T18:02:04.000Z | 2022-03-30T00:21:26.000Z | coto/clients/signin/__init__.py | wvanheerde/coto | d7eeb2e98a24b743d879ef5e2da9cbbacc417d8d | [
"Apache-2.0"
] | 18 | 2019-02-08T11:50:46.000Z | 2022-03-29T10:12:03.000Z | coto/clients/signin/__init__.py | wvanheerde/coto | d7eeb2e98a24b743d879ef5e2da9cbbacc417d8d | [
"Apache-2.0"
] | 19 | 2019-02-04T14:57:46.000Z | 2022-03-24T13:39:21.000Z | from .. import BaseClient
class Client(BaseClient):
REQUIRES_AUTHENTICATION = False
def __init__(self, session):
super().__init__(session)
self._signin_aws = self.session().client('signin_aws')
self._signin_amazon = self.session().client('signin_amazon')
def signin(self, email, ... | 30.030303 | 73 | 0.576186 | from .. import BaseClient
class Client(BaseClient):
REQUIRES_AUTHENTICATION = False
def __init__(self, session):
super().__init__(session)
self._signin_aws = self.session().client('signin_aws')
self._signin_amazon = self.session().client('signin_amazon')
def signin(self, email, ... | true | true |
f727f4f0204f36cf8008b3978cac8641ec0e174c | 216 | py | Python | beneficiaries/beneficiaries/doctype/beneficiary_aid_type/test_beneficiary_aid_type.py | baidalala/beneficiaries | b7299e0a7da91e90c607e70d76994ec0aebae402 | [
"MIT"
] | null | null | null | beneficiaries/beneficiaries/doctype/beneficiary_aid_type/test_beneficiary_aid_type.py | baidalala/beneficiaries | b7299e0a7da91e90c607e70d76994ec0aebae402 | [
"MIT"
] | null | null | null | beneficiaries/beneficiaries/doctype/beneficiary_aid_type/test_beneficiary_aid_type.py | baidalala/beneficiaries | b7299e0a7da91e90c607e70d76994ec0aebae402 | [
"MIT"
] | 1 | 2021-08-31T18:47:58.000Z | 2021-08-31T18:47:58.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2021, Baida and Contributors
# See license.txt
from __future__ import unicode_literals
# import frappe
import unittest
class TestBeneficiaryAidType(unittest.TestCase):
pass
| 19.636364 | 48 | 0.768519 |
from __future__ import unicode_literals
import unittest
class TestBeneficiaryAidType(unittest.TestCase):
pass
| true | true |
f727f5054ef0bf3d339c999db4daac4c53effb65 | 3,466 | py | Python | enas/cifar10/data_utils.py | j-varun/enas | 1a19ccbd7c06168ae51e0de2986b30ea01cce070 | [
"Apache-2.0"
] | 10 | 2018-05-07T15:59:55.000Z | 2021-04-18T12:51:14.000Z | enas/cifar10/data_utils.py | j-varun/enas | 1a19ccbd7c06168ae51e0de2986b30ea01cce070 | [
"Apache-2.0"
] | 4 | 2018-06-03T16:46:57.000Z | 2018-08-08T21:48:05.000Z | enas/cifar10/data_utils.py | j-varun/enas | 1a19ccbd7c06168ae51e0de2986b30ea01cce070 | [
"Apache-2.0"
] | 4 | 2018-05-25T04:39:56.000Z | 2019-04-29T05:08:25.000Z | import os
import sys
try:
import cPickle as pickle
except ImportError:
import _pickle as pickle
import numpy as np
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
def _read_data(data_path, train_files):
"""Reads CIFAR-10 format data. Always returns NHWC format.
Returns:
... | 29.372881 | 73 | 0.644547 | import os
import sys
try:
import cPickle as pickle
except ImportError:
import _pickle as pickle
import numpy as np
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
def _read_data(data_path, train_files):
images, labels = [], []
for file_name in train_files:
print(file_n... | true | true |
f727f57947e671ebd44b45237afa3f439dc6b3c3 | 8,633 | py | Python | conans/client/rest/auth_manager.py | amatoshka/conan | c2726e8c255adb120b5f7bdee9e3ec0bc90f1d7a | [
"MIT"
] | null | null | null | conans/client/rest/auth_manager.py | amatoshka/conan | c2726e8c255adb120b5f7bdee9e3ec0bc90f1d7a | [
"MIT"
] | null | null | null | conans/client/rest/auth_manager.py | amatoshka/conan | c2726e8c255adb120b5f7bdee9e3ec0bc90f1d7a | [
"MIT"
] | null | null | null | """
Collaborate with RestApiClient to make remote anonymous and authenticated calls.
Uses user_io to request user's login and password and obtain a token for calling authenticated
methods if receives AuthenticationException from RestApiClient.
Flow:
Directly invoke a REST method in RestApiClient, example: get_co... | 42.737624 | 100 | 0.664196 |
import hashlib
from uuid import getnode as get_mac
from conans.client.cmd.user import update_localdb
from conans.errors import AuthenticationException, ConanException, ForbiddenException
from conans.util.log import logger
def input_credentials_if_unauthorized(func):
LOGIN_RETRIES = 3
def wrapper(self, *arg... | true | true |
f727f68949533cfb5e6250be94f67cb523575870 | 21,471 | py | Python | src/runner/trainer.py | minhhoangbui/PICK-pytorch | c74d2d1e5d1f8c7e837ea9776146bc84a7ecf30a | [
"MIT"
] | null | null | null | src/runner/trainer.py | minhhoangbui/PICK-pytorch | c74d2d1e5d1f8c7e837ea9776146bc84a7ecf30a | [
"MIT"
] | null | null | null | src/runner/trainer.py | minhhoangbui/PICK-pytorch | c74d2d1e5d1f8c7e837ea9776146bc84a7ecf30a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# @Author: Wenwen Yu
# @Created Time: 7/12/2020 9:50 PM
import os
import numpy as np
from numpy import inf
import torch
import torch.distributed as dist
from torch.nn.parallel import DistributedDataParallel as DDP
from src.utils import inf_loop
from src.utils.metrics import MetricTracker, Spa... | 44.088296 | 120 | 0.589912 |
import os
import numpy as np
from numpy import inf
import torch
import torch.distributed as dist
from torch.nn.parallel import DistributedDataParallel as DDP
from src.utils import inf_loop
from src.utils.metrics import MetricTracker, SpanBasedF1MetricTracker
from torch.utils.tensorboard import SummaryWriter
from... | true | true |
f727f6cf011e2798bbf44b01f9e61c7dbe87ceb3 | 142 | py | Python | gala/potential/potential/__init__.py | zilishen/gala | f7184e6b09fbc42a349f6b5a2bca6242f1e9936e | [
"MIT"
] | 1 | 2020-11-20T18:27:25.000Z | 2020-11-20T18:27:25.000Z | gala/potential/potential/__init__.py | ltlancas/gala | 2621bb599d67e74a85446abf72d5930ef70ca181 | [
"MIT"
] | 3 | 2021-07-26T15:07:25.000Z | 2021-09-13T15:04:27.000Z | gala/potential/potential/__init__.py | ltlancas/gala | 2621bb599d67e74a85446abf72d5930ef70ca181 | [
"MIT"
] | 1 | 2018-10-23T23:20:20.000Z | 2018-10-23T23:20:20.000Z | from .core import *
from .cpotential import *
from .ccompositepotential import *
from .builtin import *
from .io import *
from .util import *
| 20.285714 | 34 | 0.746479 | from .core import *
from .cpotential import *
from .ccompositepotential import *
from .builtin import *
from .io import *
from .util import *
| true | true |
f727f7ba434ba285d0316a1377f3b4ae81748ed9 | 22,575 | py | Python | scrap_players.py | Toulik1729231/WebScraping1-Using-Python | 42562c66c905f925ea0848b8ae7dfbca6b5a1afd | [
"MIT"
] | null | null | null | scrap_players.py | Toulik1729231/WebScraping1-Using-Python | 42562c66c905f925ea0848b8ae7dfbca6b5a1afd | [
"MIT"
] | null | null | null | scrap_players.py | Toulik1729231/WebScraping1-Using-Python | 42562c66c905f925ea0848b8ae7dfbca6b5a1afd | [
"MIT"
] | null | null | null | import requests
from bs4 import BeautifulSoup
from logger_impl import *
import MongoDao
import pandas as pd
import time
payload = {'key': 'ac9e8cf2dec81949d9ee1235ed6ae3fb', 'url':
'https://httpbin.org/ip'}
def scrapData(scorecardSoup, matchId, matchDesc, matchTypeText, pageUrl, season, Date, venue):
... | 48.340471 | 154 | 0.454707 | import requests
from bs4 import BeautifulSoup
from logger_impl import *
import MongoDao
import pandas as pd
import time
payload = {'key': 'ac9e8cf2dec81949d9ee1235ed6ae3fb', 'url':
'https://httpbin.org/ip'}
def scrapData(scorecardSoup, matchId, matchDesc, matchTypeText, pageUrl, season, Date, venue):
... | true | true |
f727f81a283fdf0533813dc879af7cc5b21230da | 879 | py | Python | armi/meta.py | keckler/armi | b5f95b4795aa21e00fd6786f6994862a4bdccb16 | [
"Apache-2.0"
] | 162 | 2019-11-01T17:35:58.000Z | 2022-03-18T04:22:39.000Z | armi/meta.py | keckler/armi | b5f95b4795aa21e00fd6786f6994862a4bdccb16 | [
"Apache-2.0"
] | 315 | 2019-11-01T17:32:05.000Z | 2022-03-30T03:51:42.000Z | armi/meta.py | keckler/armi | b5f95b4795aa21e00fd6786f6994862a4bdccb16 | [
"Apache-2.0"
] | 55 | 2019-11-01T16:59:59.000Z | 2022-03-25T18:19:06.000Z | # Copyright 2019 TerraPower, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | 38.217391 | 84 | 0.753129 |
__version__ = "0.2.0"
| true | true |
f727fa256e9c15830ec9c93a29d55173626569d5 | 4,224 | py | Python | generate_training_commands.py | dumpmemory/academic-budget-bert | ea000838156e3be251699ad6a3c8b1339c76e987 | [
"Apache-2.0"
] | 146 | 2021-08-01T12:51:04.000Z | 2022-03-27T18:34:11.000Z | generate_training_commands.py | dumpmemory/academic-budget-bert | ea000838156e3be251699ad6a3c8b1339c76e987 | [
"Apache-2.0"
] | 14 | 2021-08-01T12:53:27.000Z | 2022-03-24T09:55:53.000Z | generate_training_commands.py | dumpmemory/academic-budget-bert | ea000838156e3be251699ad6a3c8b1339c76e987 | [
"Apache-2.0"
] | 29 | 2021-08-02T12:04:14.000Z | 2022-03-31T03:56:55.000Z | # coding=utf-8
# Copyright 2021 Intel Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | 33.792 | 100 | 0.742661 |
import argparse
import datetime
import random
from itertools import product
import yaml
def get_yaml(file_name):
with open(file_name, "r") as stream:
try:
ym = yaml.safe_load(stream)
return ym
except yaml.YAMLError as e:
print(e)
def get_run_id... | true | true |
f727fa6638c95253d96d2e8f5ab19ff10be0c38a | 655 | py | Python | App/Config/db.py | pyworksasia/pyworks | 01aefa9e7db4c980dc7518f40a84b99d6137f906 | [
"Apache-2.0"
] | null | null | null | App/Config/db.py | pyworksasia/pyworks | 01aefa9e7db4c980dc7518f40a84b99d6137f906 | [
"Apache-2.0"
] | null | null | null | App/Config/db.py | pyworksasia/pyworks | 01aefa9e7db4c980dc7518f40a84b99d6137f906 | [
"Apache-2.0"
] | null | null | null | from App.Config.app import settings
DATABASES = {
'default': 'mysql',
'mysql': {
'driver': 'mysql',
'host': settings.DB_HOST,
'port': settings.DB_PORT,
'database': settings.DB_DATABASE,
'user': settings.DB_USER,
'password': settings.DB_PASSWORD,
'prefix':... | 27.291667 | 41 | 0.567939 | from App.Config.app import settings
DATABASES = {
'default': 'mysql',
'mysql': {
'driver': 'mysql',
'host': settings.DB_HOST,
'port': settings.DB_PORT,
'database': settings.DB_DATABASE,
'user': settings.DB_USER,
'password': settings.DB_PASSWORD,
'prefix':... | true | true |
f727fb7b85952005743a11740a3245a5d33e2124 | 4,124 | py | Python | scatterauth/views.py | caniko2/django-scatter-auth | 962b352f4deaf91de7daa8a85b8ee82852962032 | [
"MIT"
] | null | null | null | scatterauth/views.py | caniko2/django-scatter-auth | 962b352f4deaf91de7daa8a85b8ee82852962032 | [
"MIT"
] | null | null | null | scatterauth/views.py | caniko2/django-scatter-auth | 962b352f4deaf91de7daa8a85b8ee82852962032 | [
"MIT"
] | null | null | null | import random
import string
import json
from django.shortcuts import render, redirect, reverse
from django.urls.exceptions import NoReverseMatch
from django.contrib.auth import login, authenticate
from django.conf import settings
from django.views.decorators.http import require_http_methods
from django.http import Jso... | 39.653846 | 102 | 0.690592 | import random
import string
import json
from django.shortcuts import render, redirect, reverse
from django.urls.exceptions import NoReverseMatch
from django.contrib.auth import login, authenticate
from django.conf import settings
from django.views.decorators.http import require_http_methods
from django.http import Jso... | true | true |
f727fd004d9faf9730132464a1939ae041c64ead | 13,745 | py | Python | plugins/modules/nsi_api_v2_0_fres.py | ciena/ciena.mcp | b266a7cbd912c547f6e4877597d67ea9254e5758 | [
"Apache-2.0"
] | 3 | 2021-07-19T23:56:34.000Z | 2021-11-08T14:23:53.000Z | plugins/modules/nsi_api_v2_0_fres.py | ciena/ciena.mcp | b266a7cbd912c547f6e4877597d67ea9254e5758 | [
"Apache-2.0"
] | 1 | 2022-01-19T22:06:49.000Z | 2022-01-24T15:16:53.000Z | plugins/modules/nsi_api_v2_0_fres.py | ciena/ciena.mcp | b266a7cbd912c547f6e4877597d67ea9254e5758 | [
"Apache-2.0"
] | 1 | 2021-11-08T14:25:29.000Z | 2021-11-08T14:25:29.000Z | #!/usr/bin/env python
# Info module template
#############################################
# WARNING #
#############################################
#
# This file is auto generated by
# https://github.com/jgroom33/vmware_rest_code_generator
#
# Do not edit this file manually.
#
# Ch... | 32.72619 | 99 | 0.621462 |
s are: tpes, expectations'
- Used by I(state=['get'])
type: str
includeMetaData:
description:
- 'MetaData to be included. The allowed values are: layerRate'
- Used by I(state=['get'])
type: str
included:
description:
- Resources related to a FRE, such as FreData, EndPointData, Tpe... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.