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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f75253eb431d15c4b026d5342d550db4c0857d31 | 4,620 | py | Python | helpers/bloom.py | ARKseal/crawlingathome-gpu-hcloud | 73f185df36eb5e420e6513bcf1b518dd21499b76 | [
"MIT"
] | null | null | null | helpers/bloom.py | ARKseal/crawlingathome-gpu-hcloud | 73f185df36eb5e420e6513bcf1b518dd21499b76 | [
"MIT"
] | null | null | null | helpers/bloom.py | ARKseal/crawlingathome-gpu-hcloud | 73f185df36eb5e420e6513bcf1b518dd21499b76 | [
"MIT"
] | null | null | null | # use this file inside every minute cron in order to recalculate bloom filters. location: staging server
# folder structure
# /home/archiveteam/CAH/
# |_bloom archiveteam@IP::bloom contains bloom filters
# |_clipped contains clipped lists
# ... | 46.2 | 261 | 0.615152 |
import sys
import time
import requests
import pandas as pd
from glob import glob
from pathlib import Path
from datetime import datetime
from bloom_filter2 import BloomFilter
bloomip = "116.202.162.146"
serverbloom = BloomFilter(max_elements=10000000, error_rate=0.01, filename=(f"/home/archiveteam/bloom... | true | true |
f75256736d24a39c7c39c048a1c443954662abe3 | 32 | py | Python | python/testData/completion/className/submoduleRegularImport/submoduleRegularImport.after.py | truthiswill/intellij-community | fff88cfb0dc168eea18ecb745d3e5b93f57b0b95 | [
"Apache-2.0"
] | 2 | 2019-04-28T07:48:50.000Z | 2020-12-11T14:18:08.000Z | python/testData/completion/className/submoduleRegularImport/submoduleRegularImport.after.py | truthiswill/intellij-community | fff88cfb0dc168eea18ecb745d3e5b93f57b0b95 | [
"Apache-2.0"
] | 173 | 2018-07-05T13:59:39.000Z | 2018-08-09T01:12:03.000Z | python/testData/completion/className/submoduleRegularImport/submoduleRegularImport.after.py | truthiswill/intellij-community | fff88cfb0dc168eea18ecb745d3e5b93f57b0b95 | [
"Apache-2.0"
] | 2 | 2020-03-15T08:57:37.000Z | 2020-04-07T04:48:14.000Z | import pack.submod
pack.submod
| 8 | 18 | 0.8125 | import pack.submod
pack.submod
| true | true |
f752568f84e1627d0055abbe83d26d9e81eb9e98 | 5,491 | py | Python | examples/applications/plot_tomography_l1_reconstruction.py | ikingye/scikit-learn | 3254e98a79e5c1172c794ad38f222dc45f0fb65c | [
"BSD-3-Clause"
] | 3 | 2020-02-28T09:28:09.000Z | 2020-10-12T07:09:40.000Z | examples/applications/plot_tomography_l1_reconstruction.py | ikingye/scikit-learn | 3254e98a79e5c1172c794ad38f222dc45f0fb65c | [
"BSD-3-Clause"
] | 2 | 2019-07-11T13:48:42.000Z | 2020-08-09T18:30:36.000Z | examples/applications/plot_tomography_l1_reconstruction.py | ikingye/scikit-learn | 3254e98a79e5c1172c794ad38f222dc45f0fb65c | [
"BSD-3-Clause"
] | 1 | 2021-09-06T08:42:02.000Z | 2021-09-06T08:42:02.000Z | """
======================================================================
Compressive sensing: tomography reconstruction with L1 prior (Lasso)
======================================================================
This example shows the reconstruction of an image from a set of parallel
projections, acquired along dif... | 36.606667 | 77 | 0.692042 |
print(__doc__)
import numpy as np
from scipy import sparse
from scipy import ndimage
from sklearn.linear_model import Lasso
from sklearn.linear_model import Ridge
import matplotlib.pyplot as plt
def _weights(x, dx=1, orig=0):
x = np.ravel(x)
floor_x = np.floor((x - orig) / dx).astype(np.int64)
alpha ... | true | true |
f75256b11cc184fc73b0c941c48e9e3ecb65eae8 | 4,417 | py | Python | conll.py | ChristianHesels/e2e-german | c0410a558ad9f332553518c3b588fd193c9e2bc4 | [
"Apache-2.0"
] | null | null | null | conll.py | ChristianHesels/e2e-german | c0410a558ad9f332553518c3b588fd193c9e2bc4 | [
"Apache-2.0"
] | null | null | null | conll.py | ChristianHesels/e2e-german | c0410a558ad9f332553518c3b588fd193c9e2bc4 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import re
import os
import sys
from evaluate.arcs_inferred_antecedents import evaluate
import json
import tempfile
import subprocess
import operator
import collections
BEGIN_DOCUMENT_REGEX = re.compile(r"#begi... | 36.808333 | 166 | 0.679194 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import re
import os
import sys
from evaluate.arcs_inferred_antecedents import evaluate
import json
import tempfile
import subprocess
import operator
import collections
BEGIN_DOCUMENT_REGEX = re.compile(r"#begi... | true | true |
f752575636b82a62fd7cf7ce099717094abc1708 | 10,951 | py | Python | api/migrations/versions/8e5760ed365b_.py | 9kittikul/machinaris | 08b2306d91940e2f64436184ac3acc48b9f1a803 | [
"Apache-2.0"
] | 1 | 2022-01-12T19:56:31.000Z | 2022-01-12T19:56:31.000Z | api/migrations/versions/8e5760ed365b_.py | 9kittikul/machinaris | 08b2306d91940e2f64436184ac3acc48b9f1a803 | [
"Apache-2.0"
] | null | null | null | api/migrations/versions/8e5760ed365b_.py | 9kittikul/machinaris | 08b2306d91940e2f64436184ac3acc48b9f1a803 | [
"Apache-2.0"
] | null | null | null | """empty message
Revision ID: 8e5760ed365b
Revises:
Create Date: 2021-06-20 09:49:52.813237
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '8e5760ed365b'
down_revision = None
branch_labels = None
depends_on = None
def upgrade(engine_name):
globals()["up... | 41.324528 | 105 | 0.675007 | from alembic import op
import sqlalchemy as sa
revision = '8e5760ed365b'
down_revision = None
branch_labels = None
depends_on = None
def upgrade(engine_name):
globals()["upgrade_%s" % engine_name]()
def downgrade(engine_name):
globals()["downgrade_%s" % engine_name]()
def upgrade_():
riority', s... | true | true |
f752582883d5b35388be28ba85a83f67d240da70 | 3,010 | py | Python | scripts/update.py | vmchale/dhall-ansible | f1cd6c7151507e9151b341c8efe4effcef251388 | [
"Apache-2.0"
] | null | null | null | scripts/update.py | vmchale/dhall-ansible | f1cd6c7151507e9151b341c8efe4effcef251388 | [
"Apache-2.0"
] | null | null | null | scripts/update.py | vmchale/dhall-ansible | f1cd6c7151507e9151b341c8efe4effcef251388 | [
"Apache-2.0"
] | null | null | null | #!/bin/env python3
# Copyright 2019 Red Hat
#
# 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... | 35.833333 | 110 | 0.610631 |
import os
from pathlib import Path
from textwrap import dedent
from typing import Any, Iterator, List
def write(dest: Path, content: str) -> None:
if content[-1] != "\n":
content += "\n"
if (dest.exists() and dest.read_text() != content) or not dest.exists():
dest.parent.mkdir(... | true | true |
f752592c7fe59e8be90435734677a852bbdf71cf | 723 | py | Python | lambdas/setup/sonrai/graphql/__init__.py | sonraisecurity/control-tower-integration | 838a91636a7f6f947fcdc624cb9f0ca6aab61e14 | [
"MIT-0"
] | null | null | null | lambdas/setup/sonrai/graphql/__init__.py | sonraisecurity/control-tower-integration | 838a91636a7f6f947fcdc624cb9f0ca6aab61e14 | [
"MIT-0"
] | null | null | null | lambdas/setup/sonrai/graphql/__init__.py | sonraisecurity/control-tower-integration | 838a91636a7f6f947fcdc624cb9f0ca6aab61e14 | [
"MIT-0"
] | null | null | null | import threading
import requests
class APIClient:
def __init__(self):
super().__init__()
self._thread_local = threading.local()
def request(self, method, url, token, **kwargs):
session = self._session()
headers = kwargs.pop('headers', {})
if (not headers or 'Authorizat... | 32.863636 | 104 | 0.644537 | import threading
import requests
class APIClient:
def __init__(self):
super().__init__()
self._thread_local = threading.local()
def request(self, method, url, token, **kwargs):
session = self._session()
headers = kwargs.pop('headers', {})
if (not headers or 'Authorizat... | true | true |
f752593da58e9a854df033bdad8ff818d4b41318 | 3,390 | py | Python | api/migrations/0001_initial.py | jadsonlucio/TodoApp | 0aaa0f0aa6753516b7fe4957ef5b64a13627fb46 | [
"MIT"
] | 1 | 2021-06-08T00:57:53.000Z | 2021-06-08T00:57:53.000Z | api/migrations/0001_initial.py | jadsonlucio/TodoApp | 0aaa0f0aa6753516b7fe4957ef5b64a13627fb46 | [
"MIT"
] | 1 | 2021-04-10T05:51:51.000Z | 2021-04-10T05:51:51.000Z | api/migrations/0001_initial.py | jadsonlucio/TodoApp | 0aaa0f0aa6753516b7fe4957ef5b64a13627fb46 | [
"MIT"
] | null | null | null | # Generated by Django 3.2 on 2021-04-08 21:49
from django.conf import settings
import django.contrib.auth.models
import django.contrib.auth.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
... | 59.473684 | 329 | 0.648673 |
from django.conf import settings
import django.contrib.auth.models
import django.contrib.auth.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0012_alte... | true | true |
f75259de7355897358c6b50579fdced9c6d59127 | 352 | py | Python | account/urls.py | maysse17/account_basix_admin | 136b994bd93bb27dede827e46ee4e5486952ab65 | [
"MIT"
] | null | null | null | account/urls.py | maysse17/account_basix_admin | 136b994bd93bb27dede827e46ee4e5486952ab65 | [
"MIT"
] | null | null | null | account/urls.py | maysse17/account_basix_admin | 136b994bd93bb27dede827e46ee4e5486952ab65 | [
"MIT"
] | null | null | null | from django.urls import re_path
from django.conf import settings
from django.conf.urls.static import static
from account.views import CreateUserView
urlpatterns = [
re_path('^signup/$', CreateUserView.as_view(), name='signup'),
]
if settings.DEBUG:
urlpatterns += static(settings.STATIC_URL + 'account/', docu... | 27.076923 | 95 | 0.769886 | from django.urls import re_path
from django.conf import settings
from django.conf.urls.static import static
from account.views import CreateUserView
urlpatterns = [
re_path('^signup/$', CreateUserView.as_view(), name='signup'),
]
if settings.DEBUG:
urlpatterns += static(settings.STATIC_URL + 'account/', docu... | true | true |
f7525ad42e18ecd2225cfc0c635320fc6660fb32 | 2,534 | py | Python | telebot/plugins/meme.py | IloveOrbiter/TinyBot | 1b89757859f2c493f8405120b2b8e848e5c6b554 | [
"MIT"
] | null | null | null | telebot/plugins/meme.py | IloveOrbiter/TinyBot | 1b89757859f2c493f8405120b2b8e848e5c6b554 | [
"MIT"
] | null | null | null | telebot/plugins/meme.py | IloveOrbiter/TinyBot | 1b89757859f2c493f8405120b2b8e848e5c6b554 | [
"MIT"
] | null | null | null | """
Memes Plugin for Userbot
usage = .meme someCharacter //default delay will be 3
By : - @Zero_cool7870
"""
import asyncio
from telebot import CMD_HELP
from telebot.utils import admin_cmd
@telebot.on(admin_cmd(pattern=r"meme", outgoing=True))
@telebot.on(sudo_cmd(pattern=r"meme", allow_sudo=True))
async def meme(e... | 26.123711 | 85 | 0.511444 | import asyncio
from telebot import CMD_HELP
from telebot.utils import admin_cmd
@telebot.on(admin_cmd(pattern=r"meme", outgoing=True))
@telebot.on(sudo_cmd(pattern=r"meme", allow_sudo=True))
async def meme(event):
if event.fwd_from:
return
memeVar = event.text
sleepValue = 3
memeVar = memeVar... | true | true |
f7525fa6497ff6b9b8dc0478e32d6735b7e86192 | 2,927 | py | Python | tools/dubrovnik/router_map.py | physycom/slides | ff73de94997e39673d6d5c82b1bb4d9d0069fee6 | [
"BSD-3-Clause"
] | 1 | 2020-05-29T09:40:19.000Z | 2020-05-29T09:40:19.000Z | tools/dubrovnik/router_map.py | physycom/slides | ff73de94997e39673d6d5c82b1bb4d9d0069fee6 | [
"BSD-3-Clause"
] | null | null | null | tools/dubrovnik/router_map.py | physycom/slides | ff73de94997e39673d6d5c82b1bb4d9d0069fee6 | [
"BSD-3-Clause"
] | 2 | 2022-01-27T08:53:19.000Z | 2022-03-28T07:14:56.000Z | #! /usr/bin/env python3
import os
import json
import folium
import argparse
import pandas as pd
import mysql.connector
from matplotlib import cm
from matplotlib.colors import to_hex
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('-c', '--cfg', type=str, required=True)
args = ... | 32.88764 | 161 | 0.645712 |
import os
import json
import folium
import argparse
import pandas as pd
import mysql.connector
from matplotlib import cm
from matplotlib.colors import to_hex
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('-c', '--cfg', type=str, required=True)
args = parser.parse_args()
... | true | true |
f7526036aadc9b76dbf2813bbae2651904f12059 | 17,680 | py | Python | cinder/tests/unit/db/test_purge.py | lightsey/cinder | e03d68e42e57a63f8d0f3e177fb4287290612b24 | [
"Apache-2.0"
] | 3 | 2015-04-02T21:44:36.000Z | 2016-04-29T21:19:04.000Z | cinder/tests/unit/db/test_purge.py | lightsey/cinder | e03d68e42e57a63f8d0f3e177fb4287290612b24 | [
"Apache-2.0"
] | 3 | 2016-04-29T21:45:26.000Z | 2016-05-04T19:41:23.000Z | cinder/tests/unit/db/test_purge.py | lightsey/cinder | e03d68e42e57a63f8d0f3e177fb4287290612b24 | [
"Apache-2.0"
] | 4 | 2016-01-27T00:25:52.000Z | 2021-03-25T19:54:08.000Z | # Copyright (C) 2015 OpenStack Foundation
# 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 ... | 44.422111 | 79 | 0.636991 |
import datetime
import uuid
from oslo_db import exception as db_exc
from oslo_db.sqlalchemy import utils as sqlalchemyutils
from oslo_utils import timeutils
from sqlalchemy.dialects import sqlite
from cinder import context
from cinder import db
from cinder.db.sqlalchemy import api as db_api
from cinde... | true | true |
f7526076dc3a0e1d3a42184e08bba64ca4d0685d | 1,115 | py | Python | measurement/onewire.py | cgiacofei/pybrew | 40062f9b6ccb96ca3cbbb9784434dd9281a9caba | [
"MIT"
] | null | null | null | measurement/onewire.py | cgiacofei/pybrew | 40062f9b6ccb96ca3cbbb9784434dd9281a9caba | [
"MIT"
] | null | null | null | measurement/onewire.py | cgiacofei/pybrew | 40062f9b6ccb96ca3cbbb9784434dd9281a9caba | [
"MIT"
] | null | null | null | """
Download the device tree overlay package use Robert C Nelson's source install:
https://raw.github.com/RobertCNelson/tools/master/pkgs/dtc.sh
After installing the software, make the file executable, and then run the bash
file to install device-tree-overlay (dtc) from the source:
> sudo chmod +x dtc.sh
> sudo bash d... | 27.875 | 86 | 0.690583 |
import os
os.system("echo BB-W1:00A0 > /sys/devices/bone_capemgr.9/slots")
class OneWire(object):
def init(self, address, path='/sys/bus/w1/devices/'):
self.device_path = path
self.device_file = ''.join([self.device_path, address])
def list_devices(self):
contents = os.listdir(self.... | true | true |
f75260f3ad6f785990f90160fe699ab339f2b7be | 26,287 | py | Python | lbry/lbry/extras/daemon/Components.py | AakashKhatu/lbry-sdk | 27bbd916353ac391a5adbe7fdf03aecedc5f72b9 | [
"MIT"
] | null | null | null | lbry/lbry/extras/daemon/Components.py | AakashKhatu/lbry-sdk | 27bbd916353ac391a5adbe7fdf03aecedc5f72b9 | [
"MIT"
] | null | null | null | lbry/lbry/extras/daemon/Components.py | AakashKhatu/lbry-sdk | 27bbd916353ac391a5adbe7fdf03aecedc5f72b9 | [
"MIT"
] | null | null | null | import hashlib
import os
import asyncio
import logging
import math
import binascii
import typing
import base58
from aioupnp import __version__ as aioupnp_version
from aioupnp.upnp import UPnP
from aioupnp.fault import UPnPError
from lbry import utils
from lbry.dht.node import Node
from lbry.dht.blob_announcer import ... | 41.992013 | 119 | 0.657093 | import hashlib
import os
import asyncio
import logging
import math
import binascii
import typing
import base58
from aioupnp import __version__ as aioupnp_version
from aioupnp.upnp import UPnP
from aioupnp.fault import UPnPError
from lbry import utils
from lbry.dht.node import Node
from lbry.dht.blob_announcer import ... | true | true |
f752611eefd59bf48c75af1e2ca0d70801b6e954 | 1,657 | py | Python | WBSX.py | ProgrammerTheUnique/Webbrowser-Sidekick | 06e671b8c420667812128fb80b696c67ba35592d | [
"MIT"
] | null | null | null | WBSX.py | ProgrammerTheUnique/Webbrowser-Sidekick | 06e671b8c420667812128fb80b696c67ba35592d | [
"MIT"
] | null | null | null | WBSX.py | ProgrammerTheUnique/Webbrowser-Sidekick | 06e671b8c420667812128fb80b696c67ba35592d | [
"MIT"
] | null | null | null | import webbrowser
def open_term(home_url, term):
'''Open a search term in the home_url'''
if ' ' in term:
new_term=term.replace(' ', '%20')
webbrowser.open_new_tab('%s/search?q=%s' % (home_url, new_term))
else:
webbrowser.open_new_tab('%s/search?q=%s' % (home_url, term))
def wbsxcred... | 43.605263 | 78 | 0.748944 | import webbrowser
def open_term(home_url, term):
if ' ' in term:
new_term=term.replace(' ', '%20')
webbrowser.open_new_tab('%s/search?q=%s' % (home_url, new_term))
else:
webbrowser.open_new_tab('%s/search?q=%s' % (home_url, term))
def wbsxcredits():
print('''Webbrowser-X credits:
... | true | true |
f752628c65b8514f30f86fa1ea8c6cec80de59b9 | 2,110 | py | Python | python/IECore/registerObject.py | bradleyhenke/cortex | f8245cc6c9464b1de9e6c6e57068248198e63de0 | [
"BSD-3-Clause"
] | 386 | 2015-01-02T11:10:43.000Z | 2022-03-10T15:12:20.000Z | python/IECore/registerObject.py | bradleyhenke/cortex | f8245cc6c9464b1de9e6c6e57068248198e63de0 | [
"BSD-3-Clause"
] | 484 | 2015-01-09T18:28:06.000Z | 2022-03-31T16:02:04.000Z | python/IECore/registerObject.py | bradleyhenke/cortex | f8245cc6c9464b1de9e6c6e57068248198e63de0 | [
"BSD-3-Clause"
] | 99 | 2015-01-28T23:18:04.000Z | 2022-03-27T00:59:39.000Z | ##########################################################################
#
# Copyright (c) 2007-2010, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redis... | 47.954545 | 76 | 0.7 | true | true | |
f752633c1cca3530548069345de7a29dab65be55 | 40,287 | py | Python | test/functional/p2p_compactblocks.py | Afrigonblockchain/Afrigon-Core | c1f11ae205d37d78da02599049aa41ebaf8ed3c5 | [
"MIT"
] | null | null | null | test/functional/p2p_compactblocks.py | Afrigonblockchain/Afrigon-Core | c1f11ae205d37d78da02599049aa41ebaf8ed3c5 | [
"MIT"
] | null | null | null | test/functional/p2p_compactblocks.py | Afrigonblockchain/Afrigon-Core | c1f11ae205d37d78da02599049aa41ebaf8ed3c5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2016-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test compact blocks (BIP 152).
Version 1 compact blocks are pre-segwit (txids)
Version 2 compact block... | 46.628472 | 500 | 0.672227 |
import random
from decimal import Decimal
from test_framework.blocktools import create_block, create_coinbase, add_witness_commitment
from test_framework.messages import BlockTransactions, BlockTransactionsRequest, calculate_shortid, CBlock, CBlockHeader, CInv, COutPoint, CTransaction, CTxIn, CTxInWitness, CTxOut,... | true | true |
f75263912fa72e188bdc02c8b55a4afd1546cd41 | 441 | py | Python | test.py | applejenny66/snoopy | 916700661976aef121c16c3cf1418f395eff54a6 | [
"MIT"
] | null | null | null | test.py | applejenny66/snoopy | 916700661976aef121c16c3cf1418f395eff54a6 | [
"MIT"
] | null | null | null | test.py | applejenny66/snoopy | 916700661976aef121c16c3cf1418f395eff54a6 | [
"MIT"
] | null | null | null | import numpy
import argparse
import cv2
image = cv2.imread('pikachu.jpg')
cv2.imshow("Original", image)
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
cv2.imshow("Gray", gray)
eq = cv2.equalizeHist(gray)
##cv2.imshow("Gray EQ", eq)
#display two images in a figure
cv2.imshow("Histogram Equalization", numpy.hstack([gr... | 21 | 62 | 0.723356 | import numpy
import argparse
import cv2
image = cv2.imread('pikachu.jpg')
cv2.imshow("Original", image)
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
cv2.imshow("Gray", gray)
eq = cv2.equalizeHist(gray)
qualization", numpy.hstack([gray, eq]))
cv2.imwrite("pikachu_eq.jpg", numpy.hstack([gray, eq]))
if(cv2.waitKey(... | true | true |
f752647d919a4dadbf6b93af16ff79131b6e4d01 | 9,273 | py | Python | test.py | mprimi/skill-bot | d0d0278944ee777b05b1970011952cc612d92cc4 | [
"MIT"
] | 8 | 2021-04-16T12:42:07.000Z | 2021-12-16T16:53:34.000Z | test.py | mprimi/skill-bot | d0d0278944ee777b05b1970011952cc612d92cc4 | [
"MIT"
] | 2 | 2021-05-19T14:05:20.000Z | 2021-12-17T01:21:02.000Z | test.py | mprimi/skill-bot | d0d0278944ee777b05b1970011952cc612d92cc4 | [
"MIT"
] | 2 | 2021-04-14T20:04:59.000Z | 2021-11-21T18:47:24.000Z |
def print_graph(g):
print(f"People: {len(g.people)}")
for pid, p in g.people.items():
print(f" * {p.name} ({p.id})")
for s in p.skills:
print(f" - {s.name} ({s.id})")
print(f"Skills: {len(g.skills)}")
for sid, s in g.skills.items():
print(f" * {s.name} ({s.id})")
... | 28.88785 | 92 | 0.703656 |
def print_graph(g):
print(f"People: {len(g.people)}")
for pid, p in g.people.items():
print(f" * {p.name} ({p.id})")
for s in p.skills:
print(f" - {s.name} ({s.id})")
print(f"Skills: {len(g.skills)}")
for sid, s in g.skills.items():
print(f" * {s.name} ({s.id})")
... | true | true |
f75266e1820205f8c21040ff2eea5508f1bc86c1 | 13,673 | py | Python | reversion/models.py | sperrygrove/django-reversion | de5862a60e8fcfc9c14634dd51e004a0420a50b5 | [
"BSD-3-Clause"
] | null | null | null | reversion/models.py | sperrygrove/django-reversion | de5862a60e8fcfc9c14634dd51e004a0420a50b5 | [
"BSD-3-Clause"
] | null | null | null | reversion/models.py | sperrygrove/django-reversion | de5862a60e8fcfc9c14634dd51e004a0420a50b5 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import unicode_literals
from collections import defaultdict
from itertools import chain
from django.contrib.contenttypes.models import ContentType
try:
from django.contrib.contenttypes.fields import GenericForeignKey
except ImportError: # Django < 1.9 pragma: no cover
from django.contrib.conten... | 38.29972 | 117 | 0.630366 | from __future__ import unicode_literals
from collections import defaultdict
from itertools import chain
from django.contrib.contenttypes.models import ContentType
try:
from django.contrib.contenttypes.fields import GenericForeignKey
except ImportError:
from django.contrib.contenttypes.generic import GenericFo... | true | true |
f75267577955178a49d614486d554b9c0f37fc35 | 660 | py | Python | day3/day3b.py | lehoczkics/aoc2020 | 43e640694d05ffbb47568254aeba6d2b2a89ab04 | [
"Unlicense"
] | null | null | null | day3/day3b.py | lehoczkics/aoc2020 | 43e640694d05ffbb47568254aeba6d2b2a89ab04 | [
"Unlicense"
] | null | null | null | day3/day3b.py | lehoczkics/aoc2020 | 43e640694d05ffbb47568254aeba6d2b2a89ab04 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python3
import os, re
rshift = [1,3,5,7,1]
dshift = [1,1,1,1,2]
def splitter(word):
return [char for char in word]
for i in range(len(rshift)) :
cou = 0
right = 0
lineno = 0
with open("input.txt") as f:
for line in f:
if lineno % dshift[i] == 1:
... | 23.571429 | 79 | 0.466667 |
import os, re
rshift = [1,3,5,7,1]
dshift = [1,1,1,1,2]
def splitter(word):
return [char for char in word]
for i in range(len(rshift)) :
cou = 0
right = 0
lineno = 0
with open("input.txt") as f:
for line in f:
if lineno % dshift[i] == 1:
lineno = lineno + 1
... | true | true |
f75267dc3072b03552ce31a930a8a3a0c0179b88 | 5,275 | py | Python | info/modules/news/views.py | Dreamlilan/info23 | ba662500ba2f9288d4b41d46b73c31501f326ecf | [
"MIT"
] | null | null | null | info/modules/news/views.py | Dreamlilan/info23 | ba662500ba2f9288d4b41d46b73c31501f326ecf | [
"MIT"
] | null | null | null | info/modules/news/views.py | Dreamlilan/info23 | ba662500ba2f9288d4b41d46b73c31501f326ecf | [
"MIT"
] | null | null | null | from flask import abort
from flask import current_app, jsonify
from flask import g
from flask import json
from flask import render_template
from flask import request
from flask import session
from info import db
from info.models import News, User, Comment
from info.utils.common import user_login_data
from info.utils.r... | 26.641414 | 110 | 0.636588 | from flask import abort
from flask import current_app, jsonify
from flask import g
from flask import json
from flask import render_template
from flask import request
from flask import session
from info import db
from info.models import News, User, Comment
from info.utils.common import user_login_data
from info.utils.r... | true | true |
f752688710261afb606424ef99972a1b8b4d8bdd | 10,200 | py | Python | src/olympia/git/tests/test_commands.py | xlisachan/addons-server | 5dedeb33e7ad3972e99101f2cb846266744bdd06 | [
"BSD-3-Clause"
] | null | null | null | src/olympia/git/tests/test_commands.py | xlisachan/addons-server | 5dedeb33e7ad3972e99101f2cb846266744bdd06 | [
"BSD-3-Clause"
] | null | null | null | src/olympia/git/tests/test_commands.py | xlisachan/addons-server | 5dedeb33e7ad3972e99101f2cb846266744bdd06 | [
"BSD-3-Clause"
] | null | null | null | import datetime
from pathlib import Path
from unittest import mock
import pytest
from django.test.utils import override_settings
from olympia import amo
from olympia.amo.tests import (
TestCase,
addon_factory,
create_switch,
version_factory,
)
from olympia.git.utils import AddonGitRepository, Broken... | 36.55914 | 79 | 0.685588 | import datetime
from pathlib import Path
from unittest import mock
import pytest
from django.test.utils import override_settings
from olympia import amo
from olympia.amo.tests import (
TestCase,
addon_factory,
create_switch,
version_factory,
)
from olympia.git.utils import AddonGitRepository, Broken... | true | true |
f7526895b6b8bbebd85d9acf9175b28c0449753e | 572 | py | Python | src/crawlers/uber-county-city.py | qmolee/Map-for-Lumpies | c8c5f7d418c4212cfe6be379908dc1eb42ef1a65 | [
"MIT"
] | 1 | 2021-01-25T07:20:52.000Z | 2021-01-25T07:20:52.000Z | src/crawlers/uber-county-city.py | qmolee/Map-for-Lumpies | c8c5f7d418c4212cfe6be379908dc1eb42ef1a65 | [
"MIT"
] | null | null | null | src/crawlers/uber-county-city.py | qmolee/Map-for-Lumpies | c8c5f7d418c4212cfe6be379908dc1eb42ef1a65 | [
"MIT"
] | null | null | null | import requests
import time
import lxml
from selenium import webdriver
from bs4 import BeautifulSoup
from sys import argv
#open page
driver = webdriver.Chrome(executable_path="/Users/chocolee/git/Map-for-Lumpie/src/crawlers/chromedriver")
#load page with input model
driver.get("https://www.ubereats.com/au/location"... | 21.185185 | 105 | 0.755245 | import requests
import time
import lxml
from selenium import webdriver
from bs4 import BeautifulSoup
from sys import argv
driver = webdriver.Chrome(executable_path="/Users/chocolee/git/Map-for-Lumpie/src/crawlers/chromedriver")
driver.get("https://www.ubereats.com/au/location")
source = driver.page_source
soup ... | true | true |
f75269130fb2e48f80ae20b83e292e8572dca01a | 19,416 | py | Python | tools/chart_code_size.py | MakeItZone/circuitpython | 7f803c0b51c333210ed267502422ed7bb28b9be7 | [
"Unlicense",
"BSD-3-Clause",
"MIT-0",
"MIT"
] | 13 | 2021-01-27T13:12:17.000Z | 2022-02-25T20:16:00.000Z | tools/chart_code_size.py | MakeItZone/circuitpython | 7f803c0b51c333210ed267502422ed7bb28b9be7 | [
"Unlicense",
"BSD-3-Clause",
"MIT-0",
"MIT"
] | 1 | 2020-12-30T11:48:24.000Z | 2020-12-30T11:48:24.000Z | tools/chart_code_size.py | MakeItZone/circuitpython | 7f803c0b51c333210ed267502422ed7bb28b9be7 | [
"Unlicense",
"BSD-3-Clause",
"MIT-0",
"MIT"
] | 6 | 2021-05-12T20:45:46.000Z | 2021-12-27T04:51:56.000Z | # SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors)
#
# SPDX-License-Identifier: MIT
# This script renders a graph of the CircuitPython rom image.
# It takes the single elf file and uses objdump to get its contents.
import pygraphviz ... | 42.300654 | 234 | 0.536825 |
import pygraphviz as pgv
import click
import sh
objdump = sh.arm_none_eabi_objdump
def parse_hex(h):
return int("0x" + h, 0)
BAD_JUMPS = ["UNPREDICTABLE", "_etext"]
SPECIAL_NODE_COLORS = {
"main": "pink",
"exception_table": "green"
}
@click.command()
@click.argument("elf_filename")
def do_all_t... | true | true |
f7526930e2f1645f9120f01e16372af759c8eda2 | 5,707 | py | Python | src/pysdjango/homepage_app/scripts/homepage_app/test_alphavantage_crypto.py | NIAGroup/PyStockAnalyze-2019 | 49a92b3b9ff487295bb3a30a88f1ca388281a77f | [
"MIT"
] | 2 | 2019-03-21T04:42:23.000Z | 2019-04-05T23:06:06.000Z | src/pysdjango/homepage_app/scripts/homepage_app/test_alphavantage_crypto.py | NIAGroup/PyStockAnalyze | 49a92b3b9ff487295bb3a30a88f1ca388281a77f | [
"MIT"
] | 48 | 2019-02-17T20:51:39.000Z | 2019-03-12T21:40:04.000Z | src/pysdjango/homepage_app/scripts/homepage_app/test_alphavantage_crypto.py | NIAGroup/PyStockAnalyze | 49a92b3b9ff487295bb3a30a88f1ca388281a77f | [
"MIT"
] | 1 | 2019-02-17T20:47:07.000Z | 2019-02-17T20:47:07.000Z | from alpha_vantage.cryptocurrencies import CryptoCurrencies
import time as timer
import socket, requests
from bs4 import BeautifulSoup
from random import randint
'''
#### CryptoCurrencies Methods: ####
#### get_digital_currency_intraday, ####
#### get_digital_currency_daily, ... | 33.180233 | 111 | 0.663571 | from alpha_vantage.cryptocurrencies import CryptoCurrencies
import time as timer
import socket, requests
from bs4 import BeautifulSoup
from random import randint
def isBehindFirewall():
host_name = socket.gethostname()
host_ip = "-"+socket.gethostbyname(host_name)
nd("-10.") > -1:
return True
return False
class... | true | true |
f7526a214e3070af1abe0ab76c08dc7cc5f56c27 | 391 | py | Python | setup.py | kim-younghan/CompoundScalingSeg | 8fad8f03ac02f3613466572a542ae5b0f50ed067 | [
"CC0-1.0"
] | 2 | 2020-06-17T07:44:01.000Z | 2020-11-16T12:50:14.000Z | setup.py | kim-younghan/CompoundScalingSeg | 8fad8f03ac02f3613466572a542ae5b0f50ed067 | [
"CC0-1.0"
] | null | null | null | setup.py | kim-younghan/CompoundScalingSeg | 8fad8f03ac02f3613466572a542ae5b0f50ed067 | [
"CC0-1.0"
] | null | null | null | from setuptools import setup, find_packages
setup(
name = 'CompoundScalingSeg',
version = '1.1',
description = 'Experiment on compound scaling effects U-Net segmentation',
author = 'Younghan Kim',
author_email = 'godppkyh@mosqtech.com',
install_requires= [],
... | 32.583333 | 82 | 0.606138 | from setuptools import setup, find_packages
setup(
name = 'CompoundScalingSeg',
version = '1.1',
description = 'Experiment on compound scaling effects U-Net segmentation',
author = 'Younghan Kim',
author_email = 'godppkyh@mosqtech.com',
install_requires= [],
... | true | true |
f7526cb15c5d8823dc34787b95417e96189cfac0 | 854 | py | Python | tests/core/p2p-proto/test_peer_discovery.py | gsalgado/trinity | e35154226ffae471e625547027368e664ec5e422 | [
"MIT"
] | 1 | 2021-04-07T07:33:28.000Z | 2021-04-07T07:33:28.000Z | tests/core/p2p-proto/test_peer_discovery.py | gsalgado/trinity | e35154226ffae471e625547027368e664ec5e422 | [
"MIT"
] | null | null | null | tests/core/p2p-proto/test_peer_discovery.py | gsalgado/trinity | e35154226ffae471e625547027368e664ec5e422 | [
"MIT"
] | null | null | null | import pytest
from eth_enr.tools.factories import ENRFactory
from eth_utils import to_bytes
from eth.chains.ropsten import ROPSTEN_GENESIS_HEADER, ROPSTEN_VM_CONFIGURATION
from eth.db.atomic import AtomicDB
from eth.db.chain import ChainDB
from trinity.components.builtin.peer_discovery.component import generate_eth... | 34.16 | 98 | 0.823185 | import pytest
from eth_enr.tools.factories import ENRFactory
from eth_utils import to_bytes
from eth.chains.ropsten import ROPSTEN_GENESIS_HEADER, ROPSTEN_VM_CONFIGURATION
from eth.db.atomic import AtomicDB
from eth.db.chain import ChainDB
from trinity.components.builtin.peer_discovery.component import generate_eth... | true | true |
f7526e8488fb750f6b4c946df499eb4c7fb7a886 | 2,672 | py | Python | app/controllers/users/update.py | Brunoro811/api_dangels | 21c064eaa4f5009412dddc9676044d6cc08a5b65 | [
"MIT"
] | null | null | null | app/controllers/users/update.py | Brunoro811/api_dangels | 21c064eaa4f5009412dddc9676044d6cc08a5b65 | [
"MIT"
] | null | null | null | app/controllers/users/update.py | Brunoro811/api_dangels | 21c064eaa4f5009412dddc9676044d6cc08a5b65 | [
"MIT"
] | null | null | null | from flask import current_app
from http import HTTPStatus
from sqlalchemy.orm import Session
from sqlalchemy.orm.exc import NoResultFound
from app.controllers.exc.user_erros import (
BodyNoContent,
TypeSellerInvalid,
)
from app.models.user_completed.users_completed import UsersCompletedModel
from app.models... | 28.731183 | 74 | 0.621257 | from flask import current_app
from http import HTTPStatus
from sqlalchemy.orm import Session
from sqlalchemy.orm.exc import NoResultFound
from app.controllers.exc.user_erros import (
BodyNoContent,
TypeSellerInvalid,
)
from app.models.user_completed.users_completed import UsersCompletedModel
from app.models... | true | true |
f7526f1e25b33e8b54abedc4e16828e8286822c7 | 798 | py | Python | microtbs_rl/algorithms/baselines/enjoy_baseline_random.py | alex-petrenko/simple-reinforcement-learning | d0da1d9026d1f05e2552d08e56fbe58ad869fafd | [
"MIT"
] | 8 | 2018-03-05T05:13:39.000Z | 2021-02-27T03:12:05.000Z | microtbs_rl/algorithms/baselines/enjoy_baseline_random.py | alex-petrenko/simple-reinforcement-learning | d0da1d9026d1f05e2552d08e56fbe58ad869fafd | [
"MIT"
] | null | null | null | microtbs_rl/algorithms/baselines/enjoy_baseline_random.py | alex-petrenko/simple-reinforcement-learning | d0da1d9026d1f05e2552d08e56fbe58ad869fafd | [
"MIT"
] | 4 | 2018-09-04T04:44:26.000Z | 2021-07-22T06:34:51.000Z | """
Always handy to have a random agent.
If an RL agent performs significantly better than random, then it must be at least learning something.
"""
import gym
from microtbs_rl import envs
from microtbs_rl.algorithms.common import run_policy_loop
from microtbs_rl.algorithms.common.agent import AgentRandom
from mic... | 22.166667 | 102 | 0.754386 |
import gym
from microtbs_rl import envs
from microtbs_rl.algorithms.common import run_policy_loop
from microtbs_rl.algorithms.common.agent import AgentRandom
from microtbs_rl.utils.common_utils import *
logger = logging.getLogger(os.path.basename(__file__))
def enjoy(env_id, max_num_episodes=1000000, fps=6):
... | true | true |
f7526f374ec7bb8c0990fdae26f8db8e3ffc442b | 1,589 | py | Python | openbb_terminal/cryptocurrency/discovery/coinmarketcap_model.py | tehcoderer/GamestonkTerminal | 54a1b6f545a0016c576e9e00eef5c003d229dacf | [
"MIT"
] | 255 | 2022-03-29T16:43:51.000Z | 2022-03-31T23:57:08.000Z | openbb_terminal/cryptocurrency/discovery/coinmarketcap_model.py | tehcoderer/GamestonkTerminal | 54a1b6f545a0016c576e9e00eef5c003d229dacf | [
"MIT"
] | 14 | 2022-03-29T14:20:33.000Z | 2022-03-31T23:39:20.000Z | openbb_terminal/cryptocurrency/discovery/coinmarketcap_model.py | tehcoderer/GamestonkTerminal | 54a1b6f545a0016c576e9e00eef5c003d229dacf | [
"MIT"
] | 24 | 2022-03-29T15:28:56.000Z | 2022-03-31T23:54:15.000Z | """CoinMarketCap model"""
__docformat__ = "numpy"
import logging
import pandas as pd
from coinmarketcapapi import CoinMarketCapAPI, CoinMarketCapAPIError
import openbb_terminal.config_terminal as cfg
from openbb_terminal.decorators import log_start_end
from openbb_terminal.rich_config import console
logger = loggin... | 27.396552 | 85 | 0.611076 | __docformat__ = "numpy"
import logging
import pandas as pd
from coinmarketcapapi import CoinMarketCapAPI, CoinMarketCapAPIError
import openbb_terminal.config_terminal as cfg
from openbb_terminal.decorators import log_start_end
from openbb_terminal.rich_config import console
logger = logging.getLogger(__name__)
FIL... | true | true |
f7526fa6a349b2e15bd6948acd649767e9cdae7a | 900 | py | Python | test/UnitTest.py | Wenbo16/OpenSCAD-parser | f4231b8d7fb562d746a260d3a65fad442aa1c9fa | [
"MIT"
] | null | null | null | test/UnitTest.py | Wenbo16/OpenSCAD-parser | f4231b8d7fb562d746a260d3a65fad442aa1c9fa | [
"MIT"
] | null | null | null | test/UnitTest.py | Wenbo16/OpenSCAD-parser | f4231b8d7fb562d746a260d3a65fad442aa1c9fa | [
"MIT"
] | null | null | null | import unittest
class TestStringMethods(unittest.TestCase):
def test_upper(self):
self.assertEqual('foo'.upper(), 'FOO')
def test_isupper(self):
self.assertTrue('FOO'.isupper())
self.assertFalse('Foo'.isupper())
def test_split(self):
s = 'hello world'
self.assertE... | 32.142857 | 80 | 0.463333 | import unittest
class TestStringMethods(unittest.TestCase):
def test_upper(self):
self.assertEqual('foo'.upper(), 'FOO')
def test_isupper(self):
self.assertTrue('FOO'.isupper())
self.assertFalse('Foo'.isupper())
def test_split(self):
s = 'hello world'
self.assertE... | true | true |
f7527056991be8c0db55e9ebe99c7cd3992094e4 | 41,052 | py | Python | nssrc/com/citrix/netscaler/nitro/resource/config/gslb/gslbservice.py | guardicore/nitro-python | 5346a5086134aead80968f15a41ff527adaa0ec1 | [
"Apache-2.0"
] | null | null | null | nssrc/com/citrix/netscaler/nitro/resource/config/gslb/gslbservice.py | guardicore/nitro-python | 5346a5086134aead80968f15a41ff527adaa0ec1 | [
"Apache-2.0"
] | null | null | null | nssrc/com/citrix/netscaler/nitro/resource/config/gslb/gslbservice.py | guardicore/nitro-python | 5346a5086134aead80968f15a41ff527adaa0ec1 | [
"Apache-2.0"
] | null | null | null | #
# Copyright (c) 2021 Citrix Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 31.74942 | 446 | 0.721378 |
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_resource
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_response
from nssrc.com.citrix.netscaler.nitro.service.options import options
from nssrc.com.citrix.netscaler.nitro.exception.nitro_excepti... | true | true |
f75270677e8c28fb9ad0424edefc208dd54d9b12 | 9,625 | py | Python | rtlib/slash/__init__.py | tuna2134sub/rt-bot | 0daa8a5fd231ed35b76a2b25d12d3247e300d406 | [
"BSD-4-Clause"
] | null | null | null | rtlib/slash/__init__.py | tuna2134sub/rt-bot | 0daa8a5fd231ed35b76a2b25d12d3247e300d406 | [
"BSD-4-Clause"
] | null | null | null | rtlib/slash/__init__.py | tuna2134sub/rt-bot | 0daa8a5fd231ed35b76a2b25d12d3247e300d406 | [
"BSD-4-Clause"
] | null | null | null | # rtlib - Slash Command
from discord.ext import commands
import discord
from .types import (
ApplicationCommand as ApplicationCommandType, OptionType
)
from .application_command import ApplicationCommand
from typing import Type, List, Dict
from .executor import executor
from inspect import signature
... | 38.043478 | 96 | 0.512623 |
from discord.ext import commands
import discord
from .types import (
ApplicationCommand as ApplicationCommandType, OptionType
)
from .application_command import ApplicationCommand
from typing import Type, List, Dict
from .executor import executor
from inspect import signature
from .option import Opt... | true | true |
f752709cdd56bb37342f38f6da0a5d63877c2d7e | 243 | py | Python | pypis/asynchelper/asynchelper/__init__.py | darkarp/asyncloop | c49500e757ecdecff49fe839a64baced90261968 | [
"MIT"
] | null | null | null | pypis/asynchelper/asynchelper/__init__.py | darkarp/asyncloop | c49500e757ecdecff49fe839a64baced90261968 | [
"MIT"
] | 2 | 2021-04-10T20:51:28.000Z | 2021-04-10T21:11:55.000Z | pypis/asynchelper/asynchelper/__init__.py | darkarp/asyncloop | c49500e757ecdecff49fe839a64baced90261968 | [
"MIT"
] | 2 | 2021-04-10T16:23:56.000Z | 2021-04-10T21:05:33.000Z | """asynchelper - Allows execution of unlimited number of asynchronous tasks while limiting the amount of active concurrent ones."""
__version__ = '0.1.4'
__author__ = 'Mario Nascimento <mario@whitehathacking.tech>'
__all__ = ["TaskExecutor"]
| 40.5 | 131 | 0.773663 |
__version__ = '0.1.4'
__author__ = 'Mario Nascimento <mario@whitehathacking.tech>'
__all__ = ["TaskExecutor"]
| true | true |
f75270e0c6f0a3a1205a09de0a877df2c10fde8b | 684 | py | Python | conan_tests/test_regression/packages/bzip2_test.py | jgsogo/test | 724373ed2b3bf616431b1904e9af8b531c3843b0 | [
"MIT"
] | null | null | null | conan_tests/test_regression/packages/bzip2_test.py | jgsogo/test | 724373ed2b3bf616431b1904e9af8b531c3843b0 | [
"MIT"
] | null | null | null | conan_tests/test_regression/packages/bzip2_test.py | jgsogo/test | 724373ed2b3bf616431b1904e9af8b531c3843b0 | [
"MIT"
] | null | null | null | from conan_tests.test_regression.utils.base_exe import BaseExeTest, run, conan_create_command
class Bzip2Test(BaseExeTest):
libref = "bzip2/1.0.6@conan/stable"
librepo = "https://github.com/lasote/conan-bzip2.git"
branch = "release/1.0.6"
def setUp(self):
super(Bzip2Test, self).setUp()
... | 32.571429 | 93 | 0.649123 | from conan_tests.test_regression.utils.base_exe import BaseExeTest, run, conan_create_command
class Bzip2Test(BaseExeTest):
libref = "bzip2/1.0.6@conan/stable"
librepo = "https://github.com/lasote/conan-bzip2.git"
branch = "release/1.0.6"
def setUp(self):
super(Bzip2Test, self).setUp()
... | true | true |
f75270fd676204473594343f69e7995d0946504b | 3,708 | py | Python | mmcv/parallel/collate.py | techkang/mmcv | 333eb6a8f964f005d4c0f34c3214ac2036bb228c | [
"Apache-2.0"
] | null | null | null | mmcv/parallel/collate.py | techkang/mmcv | 333eb6a8f964f005d4c0f34c3214ac2036bb228c | [
"Apache-2.0"
] | null | null | null | mmcv/parallel/collate.py | techkang/mmcv | 333eb6a8f964f005d4c0f34c3214ac2036bb228c | [
"Apache-2.0"
] | null | null | null | # Copyright (c) OpenMMLab. All rights reserved.
from collections.abc import Mapping, Sequence
import torch
import torch.nn.functional as F
from torch.utils.data.dataloader import default_collate
from .data_container import DataContainer
def collate(batch, samples_per_gpu=1):
"""Puts each data field into a tenso... | 43.623529 | 83 | 0.526969 |
from collections.abc import Mapping, Sequence
import torch
import torch.nn.functional as F
from torch.utils.data.dataloader import default_collate
from .data_container import DataContainer
def collate(batch, samples_per_gpu=1):
if not isinstance(batch, Sequence):
raise TypeError(f'{batch.dtype} is not... | true | true |
f75271b283526f580e17ed7fc9db3f46c629dee8 | 259 | py | Python | A. Helpful Maths.py | rashidulhasanhridoy/Codeforces-Problem-Solve-with-Python-3 | 6ccc55fe66e17af1e43e8a1322d9a7df78a2235d | [
"Apache-2.0"
] | 1 | 2020-07-21T18:00:59.000Z | 2020-07-21T18:00:59.000Z | A. Helpful Maths.py | rashidulhasanhridoy/Codeforces-Problem-Solve-with-Python-3 | 6ccc55fe66e17af1e43e8a1322d9a7df78a2235d | [
"Apache-2.0"
] | null | null | null | A. Helpful Maths.py | rashidulhasanhridoy/Codeforces-Problem-Solve-with-Python-3 | 6ccc55fe66e17af1e43e8a1322d9a7df78a2235d | [
"Apache-2.0"
] | null | null | null | Numbers = []
count = 0
N = str(input(''))
for i in N:
if i != '+':
Numbers.append(i)
else:
count += 1
Numbers = sorted(Numbers)
for j in Numbers:
print(j, end = '')
if count != 0:
print('+', end = '')
count -= 1 | 18.5 | 28 | 0.46332 | Numbers = []
count = 0
N = str(input(''))
for i in N:
if i != '+':
Numbers.append(i)
else:
count += 1
Numbers = sorted(Numbers)
for j in Numbers:
print(j, end = '')
if count != 0:
print('+', end = '')
count -= 1 | true | true |
f75272a210c2e6f51a259d91c832f00dd65439ff | 39 | py | Python | molybdenum/__init__.py | mexposit/molybdenum | a8b86b9300868c553183ec921115678e838c2779 | [
"MIT"
] | 2 | 2022-02-28T08:45:46.000Z | 2022-03-11T02:30:18.000Z | molybdenum/__init__.py | mexposit/molybdenum | a8b86b9300868c553183ec921115678e838c2779 | [
"MIT"
] | 3 | 2021-12-08T09:07:11.000Z | 2021-12-08T18:27:06.000Z | molybdenum/__init__.py | mexposit/molybdenum | a8b86b9300868c553183ec921115678e838c2779 | [
"MIT"
] | null | null | null | from .molybdenum import MolybdenumModel | 39 | 39 | 0.897436 | from .molybdenum import MolybdenumModel | true | true |
f7527430b937354eac7d30677ba21624ea715bf0 | 3,653 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/pushover.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/pushover.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/pushover.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2012, Jim Richardson <weaselkeeper@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_vers... | 28.539063 | 101 | 0.635642 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = '''
---
module: pushover
short_description: Send notifications via U(h... | true | true |
f752749966bcf1e95471cb096f83168e44eaa5d3 | 1,002 | py | Python | lib/db.py | sbshrey/twitch-bot-tutorial | c3ea5da5381e083744d469cc4a0df4fa44af5dd0 | [
"BSD-3-Clause"
] | 27 | 2020-04-14T06:57:56.000Z | 2022-02-13T20:27:17.000Z | lib/db.py | sbshrey/twitch-bot-tutorial | c3ea5da5381e083744d469cc4a0df4fa44af5dd0 | [
"BSD-3-Clause"
] | 5 | 2020-02-21T02:21:18.000Z | 2021-05-03T18:06:53.000Z | lib/db.py | sbshrey/twitch-bot-tutorial | c3ea5da5381e083744d469cc4a0df4fa44af5dd0 | [
"BSD-3-Clause"
] | 19 | 2020-05-27T06:28:07.000Z | 2021-06-26T14:11:09.000Z | from sqlite3 import connect
cxn = connect("./files/database.db", check_same_thread=False)
cur = cxn.cursor()
def with_commit(func):
def inner(*args, **kwargs):
func(*args, **kwargs)
commit()
return inner
@with_commit
def build():
scriptexec("./files/script.sql")
def commit():
cxn.commit()
def close():
... | 17.275862 | 61 | 0.708583 | from sqlite3 import connect
cxn = connect("./files/database.db", check_same_thread=False)
cur = cxn.cursor()
def with_commit(func):
def inner(*args, **kwargs):
func(*args, **kwargs)
commit()
return inner
@with_commit
def build():
scriptexec("./files/script.sql")
def commit():
cxn.commit()
def close():
... | true | true |
f75275632389af237e21fcfd4cf4e861e115f6a9 | 227 | py | Python | tests/integration/cli/fxt.py | nickderobertis/flexlate | 81d6dbc2d87219a2a89266d6e8fb03310a24a3a1 | [
"MIT"
] | null | null | null | tests/integration/cli/fxt.py | nickderobertis/flexlate | 81d6dbc2d87219a2a89266d6e8fb03310a24a3a1 | [
"MIT"
] | 25 | 2021-12-05T18:57:53.000Z | 2022-03-29T13:45:47.000Z | tests/integration/cli/fxt.py | nickderobertis/flexlate | 81d6dbc2d87219a2a89266d6e8fb03310a24a3a1 | [
"MIT"
] | null | null | null | from functools import partial
from tests.integration.cli_stub import fxt as _fxt, ExceptionHandling
# Ignore exceptions so that we can test error codes instead
fxt = partial(_fxt, exception_handling=ExceptionHandling.IGNORE)
| 32.428571 | 69 | 0.832599 | from functools import partial
from tests.integration.cli_stub import fxt as _fxt, ExceptionHandling
fxt = partial(_fxt, exception_handling=ExceptionHandling.IGNORE)
| true | true |
f752765f813eb84045cc7947a910bc5ee4bb2deb | 348 | py | Python | corner detection.py | Tejas-Nanaware/Learning-OpenCV | 4956db7f7f90d9d4a44327aebc2f809e4d9b2ca3 | [
"MIT"
] | null | null | null | corner detection.py | Tejas-Nanaware/Learning-OpenCV | 4956db7f7f90d9d4a44327aebc2f809e4d9b2ca3 | [
"MIT"
] | 1 | 2017-06-14T10:32:10.000Z | 2017-06-14T10:32:10.000Z | corner detection.py | Tejas-Nanaware/Learning-OpenCV | 4956db7f7f90d9d4a44327aebc2f809e4d9b2ca3 | [
"MIT"
] | null | null | null | import cv2
import numpy as np
img = cv2.imread('corner detection.jpg')
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
gray = np.float32(gray)
corners = cv2.goodFeaturesToTrack(gray, 100, 0.01, 10)
corners = np.int0(corners)
for corner in corners:
x, y = corner.ravel()
cv2.circle(img, (x,y), 3, 255, -1)
cv2.imshow('... | 21.75 | 54 | 0.706897 | import cv2
import numpy as np
img = cv2.imread('corner detection.jpg')
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
gray = np.float32(gray)
corners = cv2.goodFeaturesToTrack(gray, 100, 0.01, 10)
corners = np.int0(corners)
for corner in corners:
x, y = corner.ravel()
cv2.circle(img, (x,y), 3, 255, -1)
cv2.imshow('... | true | true |
f7527791c8434d356137134e0a394160b1e0ed2c | 11,749 | py | Python | src/compas/geometry/primitives/polyline.py | funkchaser/compas | b58de8771484aa0c6068d43df78b1679503215de | [
"MIT"
] | 235 | 2017-11-07T07:33:22.000Z | 2022-03-25T16:20:00.000Z | src/compas/geometry/primitives/polyline.py | funkchaser/compas | b58de8771484aa0c6068d43df78b1679503215de | [
"MIT"
] | 770 | 2017-09-22T13:42:06.000Z | 2022-03-31T21:26:45.000Z | src/compas/geometry/primitives/polyline.py | funkchaser/compas | b58de8771484aa0c6068d43df78b1679503215de | [
"MIT"
] | 99 | 2017-11-06T23:15:28.000Z | 2022-03-25T16:05:36.000Z | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from compas.geometry import allclose
from compas.geometry import transform_points
from compas.geometry.predicates import is_point_on_line
from compas.geometry.primitives import Line
from compas.geometry.primit... | 29.594458 | 118 | 0.524811 | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from compas.geometry import allclose
from compas.geometry import transform_points
from compas.geometry.predicates import is_point_on_line
from compas.geometry.primitives import Line
from compas.geometry.primit... | true | true |
f7527795b623675b2520db00cf296ecdfb184a2d | 1,911 | py | Python | tests/test_mask_intensityd.py | Irme/MONAI | dc4bf661831b14f4231cb325cc1b15d38c1e406c | [
"Apache-2.0"
] | 3 | 2020-10-12T02:13:27.000Z | 2021-04-14T11:46:21.000Z | tests/test_mask_intensityd.py | JZK00/MONAI | 49e693c4e7df83dc1f8ab87349373de9263188a9 | [
"Apache-2.0"
] | 1 | 2020-09-17T12:41:51.000Z | 2020-09-29T15:20:37.000Z | tests/test_mask_intensityd.py | JZK00/MONAI | 49e693c4e7df83dc1f8ab87349373de9263188a9 | [
"Apache-2.0"
] | 1 | 2020-06-11T13:03:02.000Z | 2020-06-11T13:03:02.000Z | # Copyright 2020 MONAI Consortium
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, s... | 40.659574 | 115 | 0.569335 |
import unittest
import numpy as np
from parameterized import parameterized
from monai.transforms import MaskIntensityd
TEST_CASE_1 = [
{"keys": "img", "mask_data": np.array([[[0, 0, 0], [0, 1, 0], [0, 0, 0]]])},
{"img": np.array([[[1, 1, 1], [2, 2, 2], [3, 3, 3]], [[4, 4, 4], [5, 5, 5], [6, 6, 6]]... | true | true |
f7527837bf6f84667da928d740ff92e3bb98cf95 | 10,162 | py | Python | Graph/graph.py | suyash248/data_structures | 41a732cebf791ed63edbce10329251f03b763ccf | [
"Apache-2.0"
] | 7 | 2017-12-13T05:54:29.000Z | 2022-03-25T09:10:59.000Z | Graph/graph.py | suyash248/data_structures | 41a732cebf791ed63edbce10329251f03b763ccf | [
"Apache-2.0"
] | null | null | null | Graph/graph.py | suyash248/data_structures | 41a732cebf791ed63edbce10329251f03b763ccf | [
"Apache-2.0"
] | 4 | 2019-05-22T02:51:56.000Z | 2021-05-23T10:49:57.000Z | from __future__ import annotations
__author__ = "Suyash Soni"
__email__ = "suyash.soni248@gmail.com"
from _collections import defaultdict
from uuid import uuid4
from typing import TypeVar, Generic, List, Set, Tuple, Dict
T = TypeVar('T')
class Vertex(Generic[T]):
def __init__(self, data: T):
self._id_: ... | 37.498155 | 160 | 0.583547 | from __future__ import annotations
__author__ = "Suyash Soni"
__email__ = "suyash.soni248@gmail.com"
from _collections import defaultdict
from uuid import uuid4
from typing import TypeVar, Generic, List, Set, Tuple, Dict
T = TypeVar('T')
class Vertex(Generic[T]):
def __init__(self, data: T):
self._id_: ... | true | true |
f752788cdb2ff9dce16f2500f171f3d1b010ef50 | 2,069 | py | Python | backend/app/literature/routers/editor_router.py | alliance-genome/agr_literature_service | 2278316422d5c3ab65e21bb97d91e861e48853c5 | [
"MIT"
] | null | null | null | backend/app/literature/routers/editor_router.py | alliance-genome/agr_literature_service | 2278316422d5c3ab65e21bb97d91e861e48853c5 | [
"MIT"
] | 39 | 2021-10-18T17:02:49.000Z | 2022-03-28T20:56:24.000Z | backend/app/literature/routers/editor_router.py | alliance-genome/agr_literature_service | 2278316422d5c3ab65e21bb97d91e861e48853c5 | [
"MIT"
] | 1 | 2021-10-21T00:11:18.000Z | 2021-10-21T00:11:18.000Z | from sqlalchemy.orm import Session
from fastapi import APIRouter
from fastapi import Depends
from fastapi import status
from fastapi import Response
from fastapi import Security
from fastapi_okta import OktaUser
from literature import database
from literature.user import set_global_user_id
from literature.schemas ... | 26.87013 | 59 | 0.701788 | from sqlalchemy.orm import Session
from fastapi import APIRouter
from fastapi import Depends
from fastapi import status
from fastapi import Response
from fastapi import Security
from fastapi_okta import OktaUser
from literature import database
from literature.user import set_global_user_id
from literature.schemas ... | true | true |
f75278f3720faf2fcfcd8eb00242e5b77b14a8ab | 1,165 | py | Python | authlib/repo/provider/base_provider.py | jmrafael/Streamlit-Authentication | 208e9d8f116d25d420f41b6d01c13f063052805b | [
"MIT"
] | 25 | 2021-08-25T12:51:14.000Z | 2022-03-29T22:56:21.000Z | authlib/repo/provider/base_provider.py | jmrafael/Streamlit-Authentication | 208e9d8f116d25d420f41b6d01c13f063052805b | [
"MIT"
] | 6 | 2021-09-09T23:09:51.000Z | 2022-03-11T11:11:23.000Z | authlib/repo/provider/base_provider.py | jmrafael/Streamlit-Authentication | 208e9d8f116d25d420f41b6d01c13f063052805b | [
"MIT"
] | 7 | 2021-09-04T08:06:21.000Z | 2022-03-07T23:40:02.000Z | from abc import ABC, abstractmethod
from typing import List, Literal
class StorageProvider(ABC):
@abstractmethod
def __init__(self, allow_db_create=False, if_table_exists: Literal['ignore', 'recreate'] = 'ignore'):
pass
### MAIN INTERFACE ###
# Function args are the split parts of a typical db... | 29.125 | 105 | 0.63176 | from abc import ABC, abstractmethod
from typing import List, Literal
class StorageProvider(ABC):
@abstractmethod
def __init__(self, allow_db_create=False, if_table_exists: Literal['ignore', 'recreate'] = 'ignore'):
pass
thod
def close_database(self) -> None:
pass
@abstractmet... | true | true |
f7527a12c2c41a8f79e549ddb94c80e49d3d019a | 10,601 | py | Python | Board.py | wuemily2/csc290-tut104-mines2019 | 1f88a459cebfb9a165a88e7aa23d0dc07a22c4fe | [
"MIT"
] | null | null | null | Board.py | wuemily2/csc290-tut104-mines2019 | 1f88a459cebfb9a165a88e7aa23d0dc07a22c4fe | [
"MIT"
] | null | null | null | Board.py | wuemily2/csc290-tut104-mines2019 | 1f88a459cebfb9a165a88e7aa23d0dc07a22c4fe | [
"MIT"
] | 1 | 2019-12-19T19:28:08.000Z | 2019-12-19T19:28:08.000Z | from __future__ import annotations
from typing import List, Dict, Optional
from Tile import Tile
from EmptyTile import EmptyTile
from BombTile import BombTile
from NumberTile import NumberTile
from random import randint
import random
# random.seed(0)
class Board:
"""A class representing the state of the Mineswe... | 34.871711 | 80 | 0.554853 | from __future__ import annotations
from typing import List, Dict, Optional
from Tile import Tile
from EmptyTile import EmptyTile
from BombTile import BombTile
from NumberTile import NumberTile
from random import randint
import random
class Board:
_row_size: int
_col_size: int
_num_bombs: int
board:... | true | true |
f7527b50123b6843a044700e3bbd4e7326b2b9aa | 1,114 | py | Python | search_engine.py | lqzhou123/MasterDuelSimpleTranslateTool | f18e03259582e3c02e76fbe37d5f68314c11e674 | [
"MIT"
] | null | null | null | search_engine.py | lqzhou123/MasterDuelSimpleTranslateTool | f18e03259582e3c02e76fbe37d5f68314c11e674 | [
"MIT"
] | null | null | null | search_engine.py | lqzhou123/MasterDuelSimpleTranslateTool | f18e03259582e3c02e76fbe37d5f68314c11e674 | [
"MIT"
] | null | null | null | import master_duel_auto_scan_version as mda
from threading import Thread
def start():
"""method to start searching
"""
scan_card = Thread(target=mda.main)
scan_card.start()
def kill():
"""method to exit searching
"""
mda.status_change(False, False, True,False)
def paus... | 19.54386 | 59 | 0.602334 | import master_duel_auto_scan_version as mda
from threading import Thread
def start():
scan_card = Thread(target=mda.main)
scan_card.start()
def kill():
mda.status_change(False, False, True,False)
def pause():
mda.status_change(False, True, False,False)
def switch_mode():
md... | true | true |
f7527c98cf172cc1b114fc4569434debf5591c62 | 5,918 | py | Python | kubernetes/client/models/v2beta1_pods_metric_status.py | iguazio/python | c2684bb479d44a49a2010ec4ede5ffa7b17349dd | [
"Apache-2.0"
] | null | null | null | kubernetes/client/models/v2beta1_pods_metric_status.py | iguazio/python | c2684bb479d44a49a2010ec4ede5ffa7b17349dd | [
"Apache-2.0"
] | null | null | null | kubernetes/client/models/v2beta1_pods_metric_status.py | iguazio/python | c2684bb479d44a49a2010ec4ede5ffa7b17349dd | [
"Apache-2.0"
] | 1 | 2019-01-10T11:13:52.000Z | 2019-01-10T11:13:52.000Z | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.13.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re... | 31.989189 | 299 | 0.62538 |
from pprint import pformat
from six import iteritems
import re
class V2beta1PodsMetricStatus(object):
swagger_types = {
'current_average_value': 'str',
'metric_name': 'str',
'selector': 'V1LabelSelector'
}
attribute_map = {
'current_average_value': 'currentAverageVal... | true | true |
f7527c99f572b247b40e08c464910d0e16c10eaf | 411 | py | Python | backEnd/interestsProfile/migrations/0004_alter_algoidtouserid_mapping.py | arnavn101/Coterie | b4478f0e3cc799ce40f95a3711e0cdf18809a3e4 | [
"MIT"
] | null | null | null | backEnd/interestsProfile/migrations/0004_alter_algoidtouserid_mapping.py | arnavn101/Coterie | b4478f0e3cc799ce40f95a3711e0cdf18809a3e4 | [
"MIT"
] | null | null | null | backEnd/interestsProfile/migrations/0004_alter_algoidtouserid_mapping.py | arnavn101/Coterie | b4478f0e3cc799ce40f95a3711e0cdf18809a3e4 | [
"MIT"
] | 1 | 2021-11-07T12:57:53.000Z | 2021-11-07T12:57:53.000Z | # Generated by Django 3.2.9 on 2021-11-06 07:09
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('interestsProfile', '0003_alter_algoidtouserid_mapping'),
]
operations = [
migrations.AlterField(
model_name='algoidtouserid',
... | 21.631579 | 66 | 0.618005 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('interestsProfile', '0003_alter_algoidtouserid_mapping'),
]
operations = [
migrations.AlterField(
model_name='algoidtouserid',
name='mapping',
field=mod... | true | true |
f7527d7958a0ef252c14eb4ca88c24f363659c6e | 4,441 | py | Python | labour/models/alternative_signup_forms.py | jlaunonen/turska | fc6ec4e0ae50a823e931152ce8835098b96f5966 | [
"CC-BY-3.0"
] | null | null | null | labour/models/alternative_signup_forms.py | jlaunonen/turska | fc6ec4e0ae50a823e931152ce8835098b96f5966 | [
"CC-BY-3.0"
] | null | null | null | labour/models/alternative_signup_forms.py | jlaunonen/turska | fc6ec4e0ae50a823e931152ce8835098b96f5966 | [
"CC-BY-3.0"
] | null | null | null | # encoding: utf-8
from django.db import models
from django.utils.translation import ugettext_lazy as _
from core.utils import NONUNIQUE_SLUG_FIELD_PARAMS, is_within_period
class AlternativeSignupForm(models.Model):
"""
Most workers are registered using the default form. However, some workers are "special",
... | 35.528 | 123 | 0.709075 |
from django.db import models
from django.utils.translation import ugettext_lazy as _
from core.utils import NONUNIQUE_SLUG_FIELD_PARAMS, is_within_period
class AlternativeSignupForm(models.Model):
event = models.ForeignKey('core.Event', verbose_name=u'Tapahtuma')
slug = models.CharField(**NONUNIQUE_SLUG_... | true | true |
f7527d958ba6cf04966ca1eaa5d61b1dc2d77145 | 2,805 | py | Python | catalyst/metrics/accuracy.py | Ditwoo/catalyst | 3126390f9f679ebcfedbe01707b416678a2732ac | [
"Apache-2.0"
] | 1 | 2020-11-14T13:35:22.000Z | 2020-11-14T13:35:22.000Z | catalyst/metrics/accuracy.py | Ditwoo/catalyst | 3126390f9f679ebcfedbe01707b416678a2732ac | [
"Apache-2.0"
] | null | null | null | catalyst/metrics/accuracy.py | Ditwoo/catalyst | 3126390f9f679ebcfedbe01707b416678a2732ac | [
"Apache-2.0"
] | null | null | null | """
Various accuracy metrics:
* :func:`accuracy`
* :func:`multi_label_accuracy`
"""
from typing import Optional, Sequence, Union
import numpy as np
import torch
from catalyst.metrics.functional import process_multilabel_components
from catalyst.utils.torch import get_activation_fn
def accuracy(
outputs... | 28.917526 | 77 | 0.64492 | from typing import Optional, Sequence, Union
import numpy as np
import torch
from catalyst.metrics.functional import process_multilabel_components
from catalyst.utils.torch import get_activation_fn
def accuracy(
outputs: torch.Tensor,
targets: torch.Tensor,
topk: Sequence[int] = (1,),
activation: O... | true | true |
f7527f31353c0a8a56d68088f77fd4f1c5ebad02 | 1,280 | py | Python | layers/spadebn.py | ackness/GazeFlow | ca6b7d548571f85af84bdec77292758ab5d36449 | [
"MIT"
] | 12 | 2020-12-29T12:00:20.000Z | 2022-02-07T08:26:24.000Z | layers/spadebn.py | ackness/GazeFlow | ca6b7d548571f85af84bdec77292758ab5d36449 | [
"MIT"
] | 1 | 2022-02-12T11:26:20.000Z | 2022-02-12T11:26:28.000Z | layers/spadebn.py | ackness/GazeFlow | ca6b7d548571f85af84bdec77292758ab5d36449 | [
"MIT"
] | 2 | 2021-08-20T14:40:01.000Z | 2022-01-02T10:32:04.000Z | #!/usr/bin/env python3
import tensorflow as tf
from layers.spectral_normalization import SpectralNormalization
class SpadeBN(tf.keras.layers.Layer):
"""SPADE BatchNormalization
Sources:
https://towardsdatascience.com/implementing-spade-using-fastai-6ad86b94030a
"""
def __init__(self, widt... | 32 | 85 | 0.660938 |
import tensorflow as tf
from layers.spectral_normalization import SpectralNormalization
class SpadeBN(tf.keras.layers.Layer):
def __init__(self, width: int = 128, kernel_size=3, **kwargs):
self.bn = tf.keras.layers.experimental.SyncBatchNormalization()
self.conv0 = SpectralNormalization(
... | true | true |
f75280750e5f12106c4d3f973f8f5b65844cf248 | 1,769 | py | Python | Project-Directory/app1/views.py | RonBulaon/DockeredDjangoNginx | 21abb795ee0680122fb89df7adccc6830a6493c1 | [
"MIT"
] | null | null | null | Project-Directory/app1/views.py | RonBulaon/DockeredDjangoNginx | 21abb795ee0680122fb89df7adccc6830a6493c1 | [
"MIT"
] | null | null | null | Project-Directory/app1/views.py | RonBulaon/DockeredDjangoNginx | 21abb795ee0680122fb89df7adccc6830a6493c1 | [
"MIT"
] | null | null | null | # from typing_extensions import Required
from django.shortcuts import redirect, render
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.decorators import login_required
from django.contrib import messages
from .decorators import allowed_users, unauthenticated_user
from .models impor... | 31.589286 | 76 | 0.702092 |
from django.shortcuts import redirect, render
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.decorators import login_required
from django.contrib import messages
from .decorators import allowed_users, unauthenticated_user
from .models import SiteWide
def logoutUser(request):
... | true | true |
f75280fec929bfc2024be2003fcc9c5e7cb58a4a | 1,162 | py | Python | nzmath/plugins.py | turkeydonkey/nzmath3 | a48ae9efcf0d9ad1485c2e9863c948a7f1b20311 | [
"BSD-3-Clause"
] | 1 | 2021-05-26T19:22:17.000Z | 2021-05-26T19:22:17.000Z | nzmath/plugins.py | turkeydonkey/nzmath3 | a48ae9efcf0d9ad1485c2e9863c948a7f1b20311 | [
"BSD-3-Clause"
] | null | null | null | nzmath/plugins.py | turkeydonkey/nzmath3 | a48ae9efcf0d9ad1485c2e9863c948a7f1b20311 | [
"BSD-3-Clause"
] | null | null | null | """
plugins -- plug-in mechanism
Some function, such as floating point arithmetic, could have several
choices of modules. The 'plugins' module provides the mechanism to
choose one among these choices. One can *plug-in* one module or
another for the function.
Usage:
The choice among plug-in modules is made through nz... | 29.05 | 68 | 0.757315 | from nzmath.config import PLUGIN_MATH
MATH_PLUGIN_CHOICE = ('mpmath', None)
if PLUGIN_MATH == MATH_PLUGIN_CHOICE[0]:
from nzmath.plugin.math._mpmath import *
else:
from nzmath.plugin.math.default import *
_MATH = ['MATHMODULE', 'CMATHMODULE', 'FLOATTYPE', 'COMPLEXTYPE',
'CHECK_REAL_OR_COMPLEX',
... | true | true |
f75281722edbf5873ef258ae1b6daf1918559dba | 1,516 | py | Python | Obsolete_code/coordinate-filter.py | JorisJoBo/treedentifier | c60fe49cdfea7a7eb5ed2864fbe5d6fd131612d4 | [
"Apache-2.0"
] | 15 | 2018-01-31T21:49:04.000Z | 2022-01-31T02:29:23.000Z | Obsolete_code/coordinate-filter.py | JorisJoBo/treedentifier | c60fe49cdfea7a7eb5ed2864fbe5d6fd131612d4 | [
"Apache-2.0"
] | null | null | null | Obsolete_code/coordinate-filter.py | JorisJoBo/treedentifier | c60fe49cdfea7a7eb5ed2864fbe5d6fd131612d4 | [
"Apache-2.0"
] | 4 | 2018-07-29T15:45:46.000Z | 2022-02-16T18:56:02.000Z | """
Filters the RD-triangle coordinates from WKT to a min/max-x/y grid.
Call from commandline with the name of the file that is to be converted
as argument. This file should have a polygonID in the 2nd column (index 1)
and the actual WKT in the 6th column (index 5).
Returns a .csv file containing the polygon Id's and ... | 29.72549 | 76 | 0.6781 |
import numpy as np
import sys
filename = sys.argv[1]
trees = np.loadtxt(open(filename, 'rb'), dtype=str, delimiter=';')
raw_polys = []
polys = []
for line in trees:
raw_polys.append([line[1], line[5]])
for line in raw_polys:
if line not in polys:
polys.append(line)
indice = polys[0][1].find('('... | true | true |
f75281a60ecb0a4f75d015255b359a7d87c863bb | 779 | py | Python | 3.py | Terebellum/4-case | 0c5d53b3aed72d0cc81701a4f566830fa2d6c016 | [
"MIT"
] | null | null | null | 3.py | Terebellum/4-case | 0c5d53b3aed72d0cc81701a4f566830fa2d6c016 | [
"MIT"
] | null | null | null | 3.py | Terebellum/4-case | 0c5d53b3aed72d0cc81701a4f566830fa2d6c016 | [
"MIT"
] | null | null | null | # !/usr/bin/env python3
# -*- encoding: utf-8 -*-
if __name__ == "__main__":
# Ввод
s = []
for i in range(0, 10):
a = int(input())
s.append(a)
# Нахождение позиции наибольшего и наименьшего
a = s[0]
b = s[0]
for i in range(1, 10):
if (s[i] > a):
... | 21.638889 | 51 | 0.456996 |
if __name__ == "__main__":
s = []
for i in range(0, 10):
a = int(input())
s.append(a)
a = s[0]
b = s[0]
for i in range(1, 10):
if (s[i] > a):
posmax = i
a = s[i]
elif (s[i] < b):
posmin = i
... | true | true |
f7528304fc5b9e263f6935a6fc7fadd0fa4fa895 | 482 | py | Python | env/lib/python3.8/site-packages/plotly/validators/scattergeo/marker/_reversescale.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 76 | 2020-07-06T14:44:05.000Z | 2022-02-14T15:30:21.000Z | env/lib/python3.8/site-packages/plotly/validators/scattergeo/marker/_reversescale.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11 | 2020-08-09T02:30:14.000Z | 2022-03-12T00:50:14.000Z | env/lib/python3.8/site-packages/plotly/validators/scattergeo/marker/_reversescale.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11 | 2020-07-12T16:18:07.000Z | 2022-02-05T16:48:35.000Z | import _plotly_utils.basevalidators
class ReversescaleValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(
self, plotly_name="reversescale", parent_name="scattergeo.marker", **kwargs
):
super(ReversescaleValidator, self).__init__(
plotly_name=plotly_name,
... | 32.133333 | 83 | 0.651452 | import _plotly_utils.basevalidators
class ReversescaleValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(
self, plotly_name="reversescale", parent_name="scattergeo.marker", **kwargs
):
super(ReversescaleValidator, self).__init__(
plotly_name=plotly_name,
... | true | true |
f75283cf8d1be245fa360757f944cfbba20704fd | 2,244 | py | Python | cricket_db/test/test_parser_match.py | duahimanshu100/cricsheet-db | f25e365cc6597aa3eac80b87d9d29ed408b843ae | [
"MIT"
] | 2 | 2020-01-21T10:50:35.000Z | 2020-12-28T11:09:20.000Z | cricket_db/test/test_parser_match.py | duahimanshu100/cricsheet-db | f25e365cc6597aa3eac80b87d9d29ed408b843ae | [
"MIT"
] | null | null | null | cricket_db/test/test_parser_match.py | duahimanshu100/cricsheet-db | f25e365cc6597aa3eac80b87d9d29ed408b843ae | [
"MIT"
] | 2 | 2020-01-21T10:57:16.000Z | 2020-05-31T19:13:11.000Z | import unittest
from collections import OrderedDict
from cricket_db.parsers.match import MatchParser
MATCH_ID = 947147
class TestMatchParser(unittest.TestCase):
def setUp(self):
self.match_id = MATCH_ID
self.match_parser = MatchParser(self.match_id)
self.fixtures = [
OrderedDi... | 37.4 | 115 | 0.512478 | import unittest
from collections import OrderedDict
from cricket_db.parsers.match import MatchParser
MATCH_ID = 947147
class TestMatchParser(unittest.TestCase):
def setUp(self):
self.match_id = MATCH_ID
self.match_parser = MatchParser(self.match_id)
self.fixtures = [
OrderedDi... | true | true |
f7528450068b798e1dd972d51674f72650ceb20d | 1,649 | py | Python | sched.py | theclashingfritz/Cog-Invasion-Online-Dump | 2561abbacb3e2e288e06f3f04b935b5ed589c8f8 | [
"Apache-2.0"
] | 1 | 2020-03-12T16:44:10.000Z | 2020-03-12T16:44:10.000Z | sched.py | theclashingfritz/Cog-Invasion-Online-Dump | 2561abbacb3e2e288e06f3f04b935b5ed589c8f8 | [
"Apache-2.0"
] | null | null | null | sched.py | theclashingfritz/Cog-Invasion-Online-Dump | 2561abbacb3e2e288e06f3f04b935b5ed589c8f8 | [
"Apache-2.0"
] | null | null | null | # uncompyle6 version 3.2.4
# Python bytecode 2.7 (62211)
# Decompiled from: Python 2.7.15 (v2.7.15:ca079a3ea3, Apr 30 2018, 16:30:26) [MSC v.1500 64 bit (AMD64)]
# Embedded file name: sched
import heapq
from collections import namedtuple
__all__ = [
'scheduler']
Event = namedtuple('Event', 'time, priority, action, arg... | 29.981818 | 104 | 0.58399 |
import heapq
from collections import namedtuple
__all__ = [
'scheduler']
Event = namedtuple('Event', 'time, priority, action, argument')
class scheduler:
def __init__(self, timefunc, delayfunc):
self._queue = []
self.timefunc = timefunc
self.delayfunc = delayfunc
def enterabs(sel... | true | true |
f752845674c26214bf3d5d00aaba4581e39e6040 | 27,612 | py | Python | source/deepsecurity/api/policy_log_inspection_rule_details_api.py | felipecosta09/cloudone-workload-controltower-lifecycle | 7927c84d164058b034fc872701b5ee117641f4d1 | [
"Apache-2.0"
] | 1 | 2021-10-30T16:40:09.000Z | 2021-10-30T16:40:09.000Z | source/deepsecurity/api/policy_log_inspection_rule_details_api.py | felipecosta09/cloudone-workload-controltower-lifecycle | 7927c84d164058b034fc872701b5ee117641f4d1 | [
"Apache-2.0"
] | 1 | 2021-07-28T20:19:03.000Z | 2021-07-28T20:19:03.000Z | source/deepsecurity/api/policy_log_inspection_rule_details_api.py | felipecosta09/cloudone-workload-controltower-lifecycle | 7927c84d164058b034fc872701b5ee117641f4d1 | [
"Apache-2.0"
] | 1 | 2021-10-30T16:40:02.000Z | 2021-10-30T16:40:02.000Z | # coding: utf-8
"""
Trend Micro Deep Security API
Copyright 2018 - 2020 Trend Micro Incorporated.<br/>Get protected, stay secured, and keep informed with Trend Micro Deep Security's new RESTful API. Access system data and manage security configurations to automate your security workflows and integrate De... | 52.594286 | 311 | 0.649428 |
from __future__ import absolute_import
import re
import six
from deepsecurity.api_client import ApiClient
class PolicyLogInspectionRuleDetailsApi(object):
def __init__(self, api_client=None):
if api_client is None:
api_client = ApiClient()
self.api_client = a... | true | true |
f752848025bf2491551cfa293bd7509ecb06c8ad | 1,826 | py | Python | Leetcode/Python Solutions/Strings/StringToInteger.py | Mostofa-Najmus-Sakib/Applied-Algorithm | bc656fd655617407856e0ce45b68585fa81c5035 | [
"MIT"
] | 1 | 2020-01-06T02:21:56.000Z | 2020-01-06T02:21:56.000Z | Leetcode/Python Solutions/Strings/StringToInteger.py | Mostofa-Najmus-Sakib/Applied-Algorithm | bc656fd655617407856e0ce45b68585fa81c5035 | [
"MIT"
] | null | null | null | Leetcode/Python Solutions/Strings/StringToInteger.py | Mostofa-Najmus-Sakib/Applied-Algorithm | bc656fd655617407856e0ce45b68585fa81c5035 | [
"MIT"
] | 3 | 2021-02-22T17:41:01.000Z | 2022-01-13T05:03:19.000Z | """
LeetCode Problem: 8. String to Integer (atoi)
Link: https://leetcode.com/problems/string-to-integer-atoi/
Language: Python
Written by: Mostofa Adib Shakib
Time complexity: O(n)
Space Complexity: O(1)
"""
class Solution:
def myAtoi(self, string: str) -> int:
# This gets rid of any white spaces
... | 26.463768 | 87 | 0.457284 |
class Solution:
def myAtoi(self, string: str) -> int:
string = string.strip()
if len(string) == 0:
return 0
if len(string) == 1:
if string.isnumeric():
return int(string)
else:
return 0
... | true | true |
f752851c680dce4a3cfff8d2bfbe8aeef3397ce6 | 3,224 | py | Python | docs/_downloads/295945daa9a2749eebb39cf0af107ee2/polynomial_custom_function.py | woojinsong/PyTorch-tutorials-kr | 36fefd556f45c2b1f5db912793172c0369430fd4 | [
"BSD-3-Clause"
] | 221 | 2018-04-06T01:42:58.000Z | 2021-11-28T10:12:45.000Z | docs/_downloads/295945daa9a2749eebb39cf0af107ee2/polynomial_custom_function.py | woojinsong/PyTorch-tutorials-kr | 36fefd556f45c2b1f5db912793172c0369430fd4 | [
"BSD-3-Clause"
] | 280 | 2018-05-25T08:53:21.000Z | 2021-12-02T05:37:25.000Z | docs/_downloads/295945daa9a2749eebb39cf0af107ee2/polynomial_custom_function.py | woojinsong/PyTorch-tutorials-kr | 36fefd556f45c2b1f5db912793172c0369430fd4 | [
"BSD-3-Clause"
] | 181 | 2018-05-25T02:00:28.000Z | 2021-11-19T11:56:39.000Z | # -*- coding: utf-8 -*-
"""
PyTorch: 새 autograd Function 정의하기
----------------------------------------
:math:`y=\sin(x)` 을 예측할 수 있도록, :math:`-\pi` 부터 :math:`pi` 까지
유클리드 거리(Euclidean distance)를 최소화하도록 3차 다항식을 학습합니다.
다항식을 :math:`y=a+bx+cx^2+dx^3` 라고 쓰는 대신 :math:`y=a+b P_3(c+dx)` 로 다항식을 적겠습니다.
여기서 :math:`P_3(x)=\frac{1}{... | 30.704762 | 77 | 0.618176 |
import torch
import math
class LegendrePolynomial3(torch.autograd.Function):
@staticmethod
def forward(ctx, input):
ctx.save_for_backward(input)
return 0.5 * (5 * input ** 3 - 3 * input)
@staticmethod
def backward(ctx, grad_output):
input, = ctx.saved_tensors
return ... | true | true |
f7528584b9f0543301b2d64cc5b2fdf10022790e | 9,752 | py | Python | pyBannerGrab/bannergrab.py | sasha-kantoriz/py_banner_grabber | c92e35538b2c2787c08baefd2e49c3af55bde45d | [
"Apache-2.0"
] | 10 | 2019-06-04T20:15:57.000Z | 2021-09-05T20:14:05.000Z | pyBannerGrab/bannergrab.py | Warlockk/py_banner_grabber | c92e35538b2c2787c08baefd2e49c3af55bde45d | [
"Apache-2.0"
] | 3 | 2019-02-26T06:45:43.000Z | 2019-04-09T19:43:30.000Z | pyBannerGrab/bannergrab.py | Warlockk/py_banner_grabber | c92e35538b2c2787c08baefd2e49c3af55bde45d | [
"Apache-2.0"
] | 12 | 2019-02-26T06:32:59.000Z | 2021-12-13T11:54:00.000Z | #!/usr/bin/python
#
##################################################
######## Please Don't Remove Author Name #########
############### Thanks ###########################
##################################################
#
#
__author__='''
Suraj Singh
surajsinghbisht054@gmail.com
http://bitforestinfo.bl... | 34.217544 | 214 | 0.542453 |
threading.activeCount())==int(self.thread):
printingline="\r< IP : {} | Number of Threads : {} | Open Port Checking : {} | Open Ports Founded {} >".format(self.target,str(threading.activeCount()),str(i),str(len(self.store_open_ports)))
sys.stdout.write(printingline)
sy... | true | true |
f752874bc12e574e3534665d18168ad8f6e9c86f | 1,678 | py | Python | tests/util/test_util.py | takahi-i/pfm | 224ca961ca43f50bd877789e2d8659ae838d517f | [
"MIT"
] | 9 | 2018-01-06T05:44:43.000Z | 2020-06-24T00:15:16.000Z | tests/util/test_util.py | takahi-i/pfm | 224ca961ca43f50bd877789e2d8659ae838d517f | [
"MIT"
] | 27 | 2018-01-06T09:29:48.000Z | 2020-04-10T16:11:59.000Z | tests/util/test_util.py | takahi-i/pfm | 224ca961ca43f50bd877789e2d8659ae838d517f | [
"MIT"
] | 1 | 2018-01-09T01:33:42.000Z | 2018-01-09T01:33:42.000Z | import unittest
from pfm.util.util import create_ordered_2d_array_from_dict
from pfm.util.util import convert_dictionary_to_2d_array
from pfm.util.util import sort_body_order
from pfm.util.util import add_headers
import sys
py_version = sys.version_info[0]
HEADERS = ['name', 'local_port', 'login_user']
JSON_DATA = {... | 35.702128 | 71 | 0.631704 | import unittest
from pfm.util.util import create_ordered_2d_array_from_dict
from pfm.util.util import convert_dictionary_to_2d_array
from pfm.util.util import sort_body_order
from pfm.util.util import add_headers
import sys
py_version = sys.version_info[0]
HEADERS = ['name', 'local_port', 'login_user']
JSON_DATA = {... | true | true |
f75287ebecb424ef9c0c9d4ad10782411f41e382 | 3,708 | py | Python | scripts/indicator_experiment/calculate-fscores-from-aggregations.py | sarnthil/emotion-classification-roles | 1fdd3a8cbdac5ab2ad9598a101b763882df78280 | [
"MIT"
] | 1 | 2022-02-17T14:16:20.000Z | 2022-02-17T14:16:20.000Z | scripts/indicator_experiment/calculate-fscores-from-aggregations.py | sarnthil/emotion-classification-roles | 1fdd3a8cbdac5ab2ad9598a101b763882df78280 | [
"MIT"
] | null | null | null | scripts/indicator_experiment/calculate-fscores-from-aggregations.py | sarnthil/emotion-classification-roles | 1fdd3a8cbdac5ab2ad9598a101b763882df78280 | [
"MIT"
] | null | null | null | import json
from pathlib import Path
from collections import defaultdict, Counter
from sklearn.metrics import precision_recall_fscore_support
PRECISION_FALLBACK = RECALL_FALLBACK = 1
# dataset -> setting -> emotion -> measure -> score
results = {}
for dataset_path in Path("workdata/indicator-experiment/predictions"... | 35.314286 | 80 | 0.487864 | import json
from pathlib import Path
from collections import defaultdict, Counter
from sklearn.metrics import precision_recall_fscore_support
PRECISION_FALLBACK = RECALL_FALLBACK = 1
results = {}
for dataset_path in Path("workdata/indicator-experiment/predictions").glob("*"):
dataset = dataset_path.name
fo... | true | true |
f75288a75126d81fe346261324ecfaccabac5217 | 5,386 | py | Python | kubernetes/client/models/v1_network_policy_ingress_rule.py | iguazio/python | c2684bb479d44a49a2010ec4ede5ffa7b17349dd | [
"Apache-2.0"
] | null | null | null | kubernetes/client/models/v1_network_policy_ingress_rule.py | iguazio/python | c2684bb479d44a49a2010ec4ede5ffa7b17349dd | [
"Apache-2.0"
] | null | null | null | kubernetes/client/models/v1_network_policy_ingress_rule.py | iguazio/python | c2684bb479d44a49a2010ec4ede5ffa7b17349dd | [
"Apache-2.0"
] | 1 | 2019-01-10T11:13:52.000Z | 2019-01-10T11:13:52.000Z | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.13.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re... | 34.748387 | 395 | 0.621797 |
from pprint import pformat
from six import iteritems
import re
class V1NetworkPolicyIngressRule(object):
swagger_types = {
'_from': 'list[V1NetworkPolicyPeer]',
'ports': 'list[V1NetworkPolicyPort]'
}
attribute_map = {
'_from': 'from',
'ports': 'ports'
}
def ... | true | true |
f752899b389bff33c2cec31f1b01b364af094524 | 19,450 | py | Python | bluerov2_hmi/src/bluerov2_hmi/__init__.py | RikPi/bluerov2 | 811dcca43241221b918425cf8351219d183f4c03 | [
"Apache-2.0"
] | null | null | null | bluerov2_hmi/src/bluerov2_hmi/__init__.py | RikPi/bluerov2 | 811dcca43241221b918425cf8351219d183f4c03 | [
"Apache-2.0"
] | null | null | null | bluerov2_hmi/src/bluerov2_hmi/__init__.py | RikPi/bluerov2 | 811dcca43241221b918425cf8351219d183f4c03 | [
"Apache-2.0"
] | null | null | null | import rospy
import cv2
from cv_bridge import CvBridge, CvBridgeError
from sensor_msgs.msg import Range, BatteryState, CameraInfo, Temperature, NavSatFix, Image
from geometry_msgs.msg import PoseWithCovarianceStamped, PointStamped
from std_msgs.msg import Float64, Header
from mavros_msgs.msg import State
import numpy a... | 49.744246 | 234 | 0.603753 | import rospy
import cv2
from cv_bridge import CvBridge, CvBridgeError
from sensor_msgs.msg import Range, BatteryState, CameraInfo, Temperature, NavSatFix, Image
from geometry_msgs.msg import PoseWithCovarianceStamped, PointStamped
from std_msgs.msg import Float64, Header
from mavros_msgs.msg import State
import numpy a... | true | true |
f75289fbff57c286fe08b2abecaa91a6f2f36e24 | 44,041 | py | Python | tests/strategies/test_deepspeed_strategy.py | neptune-ml/pytorch-lightning | 3bcaed52454f3e6c3bce5513032e34302e5b1bb6 | [
"Apache-2.0"
] | null | null | null | tests/strategies/test_deepspeed_strategy.py | neptune-ml/pytorch-lightning | 3bcaed52454f3e6c3bce5513032e34302e5b1bb6 | [
"Apache-2.0"
] | null | null | null | tests/strategies/test_deepspeed_strategy.py | neptune-ml/pytorch-lightning | 3bcaed52454f3e6c3bce5513032e34302e5b1bb6 | [
"Apache-2.0"
] | null | null | null | import contextlib
import json
import logging
import os
from typing import Any, Dict, Optional
from unittest import mock
import pytest
import torch
import torch.nn.functional as F
from torch import nn, Tensor
from torch.optim import Optimizer
from torch.utils.data import DataLoader
from torchmetrics import Accuracy
fr... | 37.071549 | 119 | 0.695783 | import contextlib
import json
import logging
import os
from typing import Any, Dict, Optional
from unittest import mock
import pytest
import torch
import torch.nn.functional as F
from torch import nn, Tensor
from torch.optim import Optimizer
from torch.utils.data import DataLoader
from torchmetrics import Accuracy
fr... | true | true |
f7528c69a52be4994b75ecc1706c279051b253e7 | 7,914 | py | Python | backend/sports_betting_33417/settings.py | crowdbotics-apps/sports-betting-33417 | b0628a1bb1d153ac35cd11e57e6f1186337f36a4 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/sports_betting_33417/settings.py | crowdbotics-apps/sports-betting-33417 | b0628a1bb1d153ac35cd11e57e6f1186337f36a4 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/sports_betting_33417/settings.py | crowdbotics-apps/sports-betting-33417 | b0628a1bb1d153ac35cd11e57e6f1186337f36a4 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | """
Django settings for sports_betting_33417 project.
Generated by 'django-admin startproject' using Django 2.2.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
... | 30.438462 | 112 | 0.737301 |
import os
import io
import environ
import logging
import google.auth
from google.cloud import secretmanager
from google.auth.exceptions import DefaultCredentialsError
from google.api_core.exceptions import PermissionDenied
from modules.manifest import get_modules
BASE_DIR = os.path.dirname(os.path.dirname(os.path.ab... | true | true |
f7528cb18dbeffbf4365e0b76b10b59487df59fc | 6,190 | py | Python | custom_colormaps.py | groussea/custom_colormap | e92f88d1b5be18509fa6e6204387b10c74b4c8ad | [
"BSD-3-Clause"
] | null | null | null | custom_colormaps.py | groussea/custom_colormap | e92f88d1b5be18509fa6e6204387b10c74b4c8ad | [
"BSD-3-Clause"
] | null | null | null | custom_colormaps.py | groussea/custom_colormap | e92f88d1b5be18509fa6e6204387b10c74b4c8ad | [
"BSD-3-Clause"
] | null | null | null | """
NAME
Custom Colormaps for Matplotlib
PURPOSE
This program shows how to implement make_cmap which is a function that
generates a colorbar
PROGRAMMER(S)
Chris Slocum
Gauthier Rousseau
REVISION HISTORY
20130411 -- Initial version created
20140313 -- Small changes made and code posted online... | 38.6875 | 135 | 0.638449 | import numpy as np
def create_colormap(colors, position=None, bit=False, reverse=False, res=256, name='custom_colormap'):
from matplotlib.colors import LinearSegmentedColormap
if not isinstance(colors, np.ndarray):
colors = np.array(colors, dtype='f')
if reverse:
colors = colors[::-1]
... | true | true |
f7528dc0f7d14f1c6ec2e9b0c47b54a4f3069a95 | 184,606 | py | Python | python/ccxt/async_support/bybit.py | Crypto-Currency-Projects/ccxt | 8287748d2c8d8608095164259ad3d3c892056d7d | [
"MIT"
] | 3 | 2021-11-03T15:15:36.000Z | 2021-12-06T08:16:44.000Z | python/ccxt/async_support/bybit.py | Crypto-Currency-Projects/ccxt | 8287748d2c8d8608095164259ad3d3c892056d7d | [
"MIT"
] | null | null | null | python/ccxt/async_support/bybit.py | Crypto-Currency-Projects/ccxt | 8287748d2c8d8608095164259ad3d3c892056d7d | [
"MIT"
] | 1 | 2021-11-03T15:15:23.000Z | 2021-11-03T15:15:23.000Z | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.async_support.base.exchange import Exchange
import hashlib
import json
from ccxt.base.errors import ExchangeError
from ccxt.base.... | 44.429844 | 471 | 0.448236 |
rt.base.exchange import Exchange
import hashlib
import json
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationError
from ccxt.base.errors import PermissionDenied
from ccxt.base.errors import ArgumentsRequired
from ccxt.base.errors import BadRequest
from ccxt.base.errors import Ins... | true | true |
f7528efb357f8800aad34201e746c2dbc3462389 | 129 | py | Python | data_processing/libmesh/setup.py | vedanthpadigelwar/if-net | 81c3068a52c619cf6de800807226d3801cb4d057 | [
"Unlicense"
] | 209 | 2020-04-17T02:19:56.000Z | 2022-03-01T06:51:22.000Z | data_processing/libmesh/setup.py | vedanthpadigelwar/if-net | 81c3068a52c619cf6de800807226d3801cb4d057 | [
"Unlicense"
] | 39 | 2020-04-22T09:28:40.000Z | 2022-03-28T11:23:48.000Z | data_processing/libmesh/setup.py | vedanthpadigelwar/if-net | 81c3068a52c619cf6de800807226d3801cb4d057 | [
"Unlicense"
] | 45 | 2020-04-17T06:28:51.000Z | 2022-03-22T12:38:56.000Z | from setuptools import setup
from Cython.Build import cythonize
setup(name = 'libmesh',
ext_modules = cythonize("*.pyx"))
| 21.5 | 39 | 0.728682 | from setuptools import setup
from Cython.Build import cythonize
setup(name = 'libmesh',
ext_modules = cythonize("*.pyx"))
| true | true |
f7528f30dc541c11e2ab2226f7baea3efcdefece | 993 | py | Python | numerical_analysis/regression.py | irevenko/math-playground | 41887ba1bf723a092cc577e14cd8cfaee32ed3ba | [
"MIT"
] | 3 | 2021-02-19T16:46:23.000Z | 2021-03-25T13:19:01.000Z | numerical_analysis/regression.py | irevenko/labs-playground | 41887ba1bf723a092cc577e14cd8cfaee32ed3ba | [
"MIT"
] | null | null | null | numerical_analysis/regression.py | irevenko/labs-playground | 41887ba1bf723a092cc577e14cd8cfaee32ed3ba | [
"MIT"
] | null | null | null | from tabulate import tabulate
y = [46, 43, 41, 30, 35, 19, 37, 14, 2, 41, 45, 22, 5, 17]
x = [10, 13, 15, 25, 20, 35, 18, 40, 51, 15, 11, 32, 48, 37]
sum_x = sum(x)
sum_y = sum(y)
avg_x = sum(x) / len(x)
avg_y = sum(y) / len(y)
xy = [a * b for a,b in zip(x,y)]
sum_xy = sum(xy)
avg_xy = sum(xy) / len(xy)
x_squared = ... | 29.205882 | 79 | 0.565962 | from tabulate import tabulate
y = [46, 43, 41, 30, 35, 19, 37, 14, 2, 41, 45, 22, 5, 17]
x = [10, 13, 15, 25, 20, 35, 18, 40, 51, 15, 11, 32, 48, 37]
sum_x = sum(x)
sum_y = sum(y)
avg_x = sum(x) / len(x)
avg_y = sum(y) / len(y)
xy = [a * b for a,b in zip(x,y)]
sum_xy = sum(xy)
avg_xy = sum(xy) / len(xy)
x_squared = ... | true | true |
f7529039e67a6036b7982ee6935ab1ecfa596d92 | 9,390 | py | Python | exchangelib/transport.py | srinivas32/exchangelib | d10d26ae8ce891d346071a4a8c782c44cbbe4be0 | [
"BSD-2-Clause"
] | null | null | null | exchangelib/transport.py | srinivas32/exchangelib | d10d26ae8ce891d346071a4a8c782c44cbbe4be0 | [
"BSD-2-Clause"
] | null | null | null | exchangelib/transport.py | srinivas32/exchangelib | d10d26ae8ce891d346071a4a8c782c44cbbe4be0 | [
"BSD-2-Clause"
] | null | null | null | import logging
import time
import requests.auth
import requests_ntlm
import requests_oauthlib
from .errors import UnauthorizedError, TransportError
from .util import create_element, add_xml_child, xml_to_str, ns_translation, _may_retry_on_error, _back_off_if_needed, \
DummyResponse, CONNECTION_ERRORS
log = loggi... | 38.170732 | 120 | 0.655272 | import logging
import time
import requests.auth
import requests_ntlm
import requests_oauthlib
from .errors import UnauthorizedError, TransportError
from .util import create_element, add_xml_child, xml_to_str, ns_translation, _may_retry_on_error, _back_off_if_needed, \
DummyResponse, CONNECTION_ERRORS
log = loggi... | true | true |
f752904903b08852e778c27a35417f4e93605953 | 942 | py | Python | examples/export-firewall-config/export-firewall-config.py | ilanddev/python-sdk | 7f2036c398bc97ebee9664410b0f83e52b72d884 | [
"BSD-3-Clause"
] | 5 | 2016-02-06T01:08:56.000Z | 2019-02-08T15:07:16.000Z | examples/export-firewall-config/export-firewall-config.py | ilanddev/python-sdk | 7f2036c398bc97ebee9664410b0f83e52b72d884 | [
"BSD-3-Clause"
] | 8 | 2016-02-23T22:35:00.000Z | 2020-03-25T09:47:23.000Z | examples/export-firewall-config/export-firewall-config.py | ilanddev/python-sdk | 7f2036c398bc97ebee9664410b0f83e52b72d884 | [
"BSD-3-Clause"
] | 4 | 2017-05-17T16:10:10.000Z | 2022-03-31T20:16:25.000Z | import iland
import time
import json
CLIENT_ID = ''
CLIENT_SECRET = ''
USERNAME = ''
PASSWORD = ''
COMPANY_ID = ''
api = iland.Api(client_id=CLIENT_ID, client_secret=CLIENT_SECRET, username=USERNAME, password=PASSWORD)
def main():
export_edge_firewalls()
def export_edge_firewalls():
# Get all the edges for... | 26.914286 | 103 | 0.674098 | import iland
import time
import json
CLIENT_ID = ''
CLIENT_SECRET = ''
USERNAME = ''
PASSWORD = ''
COMPANY_ID = ''
api = iland.Api(client_id=CLIENT_ID, client_secret=CLIENT_SECRET, username=USERNAME, password=PASSWORD)
def main():
export_edge_firewalls()
def export_edge_firewalls():
edges = api.get('/... | true | true |
f752908eb82457eebf976bee2e8e0573517091ac | 915 | py | Python | Google IT Automation with Python/Google - Using Python to Interact with the Operating System/lab4.py | Akshayp1612/Courses- | 0c6bb5e93d0443b0c4de7df220df250b8a2e2b26 | [
"Apache-2.0"
] | 622 | 2018-07-17T09:05:41.000Z | 2022-03-29T02:57:02.000Z | Google IT Automation with Python/Google - Using Python to Interact with the Operating System/lab4.py | manish-saini/Courses- | 11bf16a3d17ca6c284225ef34cd2d24b821c267a | [
"Apache-2.0"
] | 21 | 2019-11-10T02:06:09.000Z | 2022-01-22T23:54:11.000Z | Google IT Automation with Python/Google - Using Python to Interact with the Operating System/lab4.py | manish-saini/Courses- | 11bf16a3d17ca6c284225ef34cd2d24b821c267a | [
"Apache-2.0"
] | 906 | 2018-07-17T09:05:43.000Z | 2022-03-31T12:55:49.000Z | #!/usr/bin/env python3
import sys
import os
import re
def error_search(log_file):
error = input("What is the error? ")
returned_errors = []
with open(log_file, mode='r',encoding='UTF-8') as file:
for log in file.readlines():
error_patterns = ["error"]
for i in range(len(error.split(... | 30.5 | 89 | 0.654645 |
import sys
import os
import re
def error_search(log_file):
error = input("What is the error? ")
returned_errors = []
with open(log_file, mode='r',encoding='UTF-8') as file:
for log in file.readlines():
error_patterns = ["error"]
for i in range(len(error.split(' '))):
error_... | true | true |
f75290a2ff7c54a00498e86d3f8742d6703d4a1c | 13,297 | py | Python | snake.py | ajbrining/snake | a74df51e974423f9b882dab327f5c8f42132b2d9 | [
"MIT"
] | 1 | 2021-04-26T07:45:10.000Z | 2021-04-26T07:45:10.000Z | snake.py | ajbrining/snake | a74df51e974423f9b882dab327f5c8f42132b2d9 | [
"MIT"
] | null | null | null | snake.py | ajbrining/snake | a74df51e974423f9b882dab327f5c8f42132b2d9 | [
"MIT"
] | null | null | null | """
Play the classic Snake game.
Classes:
Game
Functions:
reset()
move(direction) -> boolean
run()
"""
import pygame
from random import randint
class Game:
def __init__(self, graphics=True, starting_size=3):
"""
This class is everything you need to run the game.
If y... | 36.430137 | 81 | 0.514477 |
import pygame
from random import randint
class Game:
def __init__(self, graphics=True, starting_size=3):
self.COLUMNS = 16
self.ROWS = 16
self.MAX_SIZE = (self.COLUMNS * self.ROWS) - 1
self.GRAPHICS = graphics
self.STARTING_SIZE = starting_size
self.running = True... | true | true |
f75290b390440c6fd86d04487cfd2306e5c324af | 3,852 | py | Python | solarnet/models/segmenter.py | fedesigno/solar-panel-segmentation | 75856be3361bb4904387e6abc986627d1cc98ebb | [
"MIT"
] | null | null | null | solarnet/models/segmenter.py | fedesigno/solar-panel-segmentation | 75856be3361bb4904387e6abc986627d1cc98ebb | [
"MIT"
] | null | null | null | solarnet/models/segmenter.py | fedesigno/solar-panel-segmentation | 75856be3361bb4904387e6abc986627d1cc98ebb | [
"MIT"
] | null | null | null | import torch
from torch import nn
from typing import List
from .base import ResnetBase
class Segmenter(ResnetBase):
"""A ResNet34 U-Net model, as described in
https://github.com/fastai/fastai/blob/master/courses/dl2/carvana-unet-lrg.ipynb
Attributes:
imagenet_base: boolean, default: False
... | 36.685714 | 103 | 0.619159 | import torch
from torch import nn
from typing import List
from .base import ResnetBase
class Segmenter(ResnetBase):
def __init__(self, imagenet_base: bool = False) -> None:
super().__init__(imagenet_base=imagenet_base)
self.target_modules = [str(x) for x in [2, 4, 5, 6]]
self.hooks = s... | true | true |
f75290cf5654f2d3a709117d7df00b5ff902a0e9 | 489 | py | Python | CursoEmVideo/Exercicio015.py | LucasAlmeida0/Estudos | ae5b498c0bf3dee94f761a5fe49c77b0e270d483 | [
"MIT"
] | null | null | null | CursoEmVideo/Exercicio015.py | LucasAlmeida0/Estudos | ae5b498c0bf3dee94f761a5fe49c77b0e270d483 | [
"MIT"
] | null | null | null | CursoEmVideo/Exercicio015.py | LucasAlmeida0/Estudos | ae5b498c0bf3dee94f761a5fe49c77b0e270d483 | [
"MIT"
] | null | null | null | ''' 15 Escreva um programa que pergunte a quantidade de Km percorridos por um carro alugado e a quantidade de dias pelos quais ele foi alugado.
Calcule o preço a pagar, sabendo que o carro custa R$60 por dia e R$0,15 por Km rodado.'''
quantidade_de_km = float(input("Digite a quantidade de km percorridos: "))
quantid... | 54.333333 | 143 | 0.756646 |
quantidade_de_km = float(input("Digite a quantidade de km percorridos: "))
quantidade_de_dias = int(input("Digite a quantidade de dias pelos quais ele foi alugado: "))
print(f"Você deverá pagar R$ {quantidade_de_km*0.15 + quantidade_de_dias*60}")
| true | true |
f75291b7b8368f099802b4598bd85f7e517f03e3 | 936 | py | Python | app/user/views.py | maxblu/recipe-app-api | ee6ed323f73050d5ffd7499591754618a6d44f5e | [
"MIT"
] | null | null | null | app/user/views.py | maxblu/recipe-app-api | ee6ed323f73050d5ffd7499591754618a6d44f5e | [
"MIT"
] | null | null | null | app/user/views.py | maxblu/recipe-app-api | ee6ed323f73050d5ffd7499591754618a6d44f5e | [
"MIT"
] | null | null | null |
from rest_framework import generics, authentication, permissions
from rest_framework.authtoken.views import ObtainAuthToken
from rest_framework.settings import api_settings
from user.serializers import UserSerializer, AuthTokenSerializer
class CreateUserView(generics.CreateAPIView):
"""Create a new user in the ... | 30.193548 | 66 | 0.784188 |
from rest_framework import generics, authentication, permissions
from rest_framework.authtoken.views import ObtainAuthToken
from rest_framework.settings import api_settings
from user.serializers import UserSerializer, AuthTokenSerializer
class CreateUserView(generics.CreateAPIView):
serializer_class = UserSeria... | true | true |
f75292f32dbca832e1b1d1a6afe34906aff880d9 | 152,735 | py | Python | pandas/core/series.py | rajat315315/pandas | 2eec4f7cfa1c45671b9875062343521a53ae8b28 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | pandas/core/series.py | rajat315315/pandas | 2eec4f7cfa1c45671b9875062343521a53ae8b28 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | pandas/core/series.py | rajat315315/pandas | 2eec4f7cfa1c45671b9875062343521a53ae8b28 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | """
Data structure for 1-dimensional cross-sectional and time series data
"""
from __future__ import annotations
from io import StringIO
from shutil import get_terminal_size
from textwrap import dedent
from typing import (
IO,
TYPE_CHECKING,
Any,
Callable,
Hashable,
Iterable,
List,
Opti... | 30.571457 | 88 | 0.53291 | from __future__ import annotations
from io import StringIO
from shutil import get_terminal_size
from textwrap import dedent
from typing import (
IO,
TYPE_CHECKING,
Any,
Callable,
Hashable,
Iterable,
List,
Optional,
Tuple,
Type,
Union,
)
import warnings
import numpy as np
f... | true | true |
f752932a1061621d780dfec1eca57c3c4180dc4d | 20,551 | py | Python | log_complete_bcl2/model_797.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | log_complete_bcl2/model_797.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | log_complete_bcl2/model_797.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | # exported from PySB model 'model'
from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD
Model()
Monomer('Ligand', ['Receptor'])
Monomer('ParpU', ['C3A'])
Monomer('C8A', ['BidU', 'C3pro'])
Monomer('SmacM', ['BaxA'])
Monomer('BaxM', ['BidM', '... | 95.143519 | 798 | 0.804146 |
from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD
Model()
Monomer('Ligand', ['Receptor'])
Monomer('ParpU', ['C3A'])
Monomer('C8A', ['BidU', 'C3pro'])
Monomer('SmacM', ['BaxA'])
Monomer('BaxM', ['BidM', 'BaxA'])
Monomer('Apop', ['C3pro', ... | true | true |
f752942048a3cdf032e3e9182ab0f564c41d5056 | 449 | py | Python | data/scripts/templates/object/tangible/lair/brackaset/shared_lair_brackaset.py | obi-two/GameServer | 7d37024e2291a97d49522610cd8f1dbe5666afc2 | [
"MIT"
] | 20 | 2015-02-23T15:11:56.000Z | 2022-03-18T20:56:48.000Z | data/scripts/templates/object/tangible/lair/brackaset/shared_lair_brackaset.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | null | null | null | data/scripts/templates/object/tangible/lair/brackaset/shared_lair_brackaset.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | 20 | 2015-04-04T16:35:59.000Z | 2022-03-24T14:54:37.000Z | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/lair/brackaset/shared_lair_brackaset.iff"
result.attribute_template... | 26.411765 | 77 | 0.726058 | true | true | |
f75294bacf620749518b4e697e452b991572018f | 24,878 | py | Python | nncf/quantization/metrics.py | krodyush/nncf | 476a274a90a3f2f1ace7a4cb0c9d90d1ddeb7f6a | [
"Apache-2.0"
] | 1 | 2022-01-26T09:36:03.000Z | 2022-01-26T09:36:03.000Z | nncf/quantization/metrics.py | krodyush/nncf | 476a274a90a3f2f1ace7a4cb0c9d90d1ddeb7f6a | [
"Apache-2.0"
] | null | null | null | nncf/quantization/metrics.py | krodyush/nncf | 476a274a90a3f2f1ace7a4cb0c9d90d1ddeb7f6a | [
"Apache-2.0"
] | 1 | 2021-04-05T09:33:51.000Z | 2021-04-05T09:33:51.000Z | import numpy as np
import networkx as nx
from copy import deepcopy
from texttable import Texttable
from collections import deque
from nncf.quantization.layers import SymmetricQuantizer
from nncf.nncf_network import NNCFNetwork, NNCFGraph
from nncf.dynamic_graph.transform_graph import is_nncf_module
from nncf.quantizat... | 48.589844 | 116 | 0.660061 | import numpy as np
import networkx as nx
from copy import deepcopy
from texttable import Texttable
from collections import deque
from nncf.quantization.layers import SymmetricQuantizer
from nncf.nncf_network import NNCFNetwork, NNCFGraph
from nncf.dynamic_graph.transform_graph import is_nncf_module
from nncf.quantizat... | true | true |
f75294bbf4fdf96011432d987c87515c558f845e | 321 | py | Python | Exercices/Secao05/exercicio22.py | Guilt-tech/PythonExercices | e59bffae997a1974d3e3cdcfff7700afbed65e6e | [
"MIT"
] | null | null | null | Exercices/Secao05/exercicio22.py | Guilt-tech/PythonExercices | e59bffae997a1974d3e3cdcfff7700afbed65e6e | [
"MIT"
] | null | null | null | Exercices/Secao05/exercicio22.py | Guilt-tech/PythonExercices | e59bffae997a1974d3e3cdcfff7700afbed65e6e | [
"MIT"
] | null | null | null | print('Digite a idadde e o tempo de serviço, para podeer saber se pode ou não se aposentar')
idade = int(input("Idade: "))
tempo_servico = int(input('Tempo de serviço: '))
if idade >= 65 or tempo_servico >= 30 or idade >= 60 and tempo_servico >= 25:
print("Pode se aposentar")
else:
print('Não pode se aposentar'... | 45.857143 | 92 | 0.697819 | print('Digite a idadde e o tempo de serviço, para podeer saber se pode ou não se aposentar')
idade = int(input("Idade: "))
tempo_servico = int(input('Tempo de serviço: '))
if idade >= 65 or tempo_servico >= 30 or idade >= 60 and tempo_servico >= 25:
print("Pode se aposentar")
else:
print('Não pode se aposentar'... | true | true |
f7529572b2e67dcbd6f3a19428e47be6edd97398 | 189 | py | Python | bertmap/onto/__init__.py | KRR-Oxford/BERTMap | 26eb78288885b8749c5bd970d44fa0ec18c6f417 | [
"Apache-2.0"
] | 10 | 2021-12-07T09:09:18.000Z | 2022-03-28T22:54:25.000Z | bertmap/onto/__init__.py | KRR-Oxford/BERTMap | 26eb78288885b8749c5bd970d44fa0ec18c6f417 | [
"Apache-2.0"
] | null | null | null | bertmap/onto/__init__.py | KRR-Oxford/BERTMap | 26eb78288885b8749c5bd970d44fa0ec18c6f417 | [
"Apache-2.0"
] | 1 | 2022-03-24T09:39:36.000Z | 2022-03-24T09:39:36.000Z | from bertmap.onto.onto_text import OntoText
from bertmap.onto.onto_index import OntoInvertedIndex
from bertmap.onto.onto_box import OntoBox
from bertmap.onto.onto_eval import OntoEvaluator
| 37.8 | 53 | 0.873016 | from bertmap.onto.onto_text import OntoText
from bertmap.onto.onto_index import OntoInvertedIndex
from bertmap.onto.onto_box import OntoBox
from bertmap.onto.onto_eval import OntoEvaluator
| true | true |
f75297a16f32f0026cc198503ba79052478421ba | 3,727 | py | Python | generation/DCGAN/train.py | nyw-pathfinder/Deep-Learning-Bootcamp-with-PyTorch | 5bf2efd3f921dc95461026df8f105ff7a5822fb5 | [
"MIT"
] | 15 | 2019-03-16T10:00:15.000Z | 2021-10-04T10:30:26.000Z | generation/DCGAN/train.py | nyw-pathfinder/Deep-Learning-Bootcamp-with-PyTorch | 5bf2efd3f921dc95461026df8f105ff7a5822fb5 | [
"MIT"
] | null | null | null | generation/DCGAN/train.py | nyw-pathfinder/Deep-Learning-Bootcamp-with-PyTorch | 5bf2efd3f921dc95461026df8f105ff7a5822fb5 | [
"MIT"
] | 6 | 2019-04-13T02:13:43.000Z | 2019-10-05T02:22:55.000Z | if __name__ == '__main__':
import os
from torchvision.transforms import Compose, Normalize, Resize, ToTensor
from torch.utils.data import DataLoader
from models import Discriminator, Generator, weights_init
import torch
import torch.nn as nn
import matplotlib.pyplot as plt
from time impo... | 38.822917 | 109 | 0.611484 | if __name__ == '__main__':
import os
from torchvision.transforms import Compose, Normalize, Resize, ToTensor
from torch.utils.data import DataLoader
from models import Discriminator, Generator, weights_init
import torch
import torch.nn as nn
import matplotlib.pyplot as plt
from time impo... | true | true |
f7529962e2b12f1a4afece4374d9104c414cf76e | 612 | py | Python | fixme/routing/get_route_from_steps_diagonal.py | jorgepadilla19/gdsfactory | 68e1c18257a75d4418279851baea417c8899a165 | [
"MIT"
] | null | null | null | fixme/routing/get_route_from_steps_diagonal.py | jorgepadilla19/gdsfactory | 68e1c18257a75d4418279851baea417c8899a165 | [
"MIT"
] | null | null | null | fixme/routing/get_route_from_steps_diagonal.py | jorgepadilla19/gdsfactory | 68e1c18257a75d4418279851baea417c8899a165 | [
"MIT"
] | null | null | null | """
FIXME, shall we allow diagonal route for electrical connections?
"""
if __name__ == "__main__":
import gdsfactory as gf
c = gf.Component("pads_route_from_steps")
pt = c << gf.components.pad_array(orientation=270, columns=3)
pb = c << gf.components.pad_array(orientation=90, columns=3)
pt.move(... | 25.5 | 65 | 0.614379 |
if __name__ == "__main__":
import gdsfactory as gf
c = gf.Component("pads_route_from_steps")
pt = c << gf.components.pad_array(orientation=270, columns=3)
pb = c << gf.components.pad_array(orientation=90, columns=3)
pt.move((100, 200))
route = gf.routing.get_route_from_steps(
pt.ports[... | true | true |
f75299883193578c9a7ad2bd035e4fd02666dd7a | 2,658 | py | Python | recipes/libdwarf/all/conanfile.py | dpronin/conan-center-index | 5c6e41a618097d04e731c9831118a51dcb39ab3f | [
"MIT"
] | 1 | 2021-11-11T03:07:13.000Z | 2021-11-11T03:07:13.000Z | recipes/libdwarf/all/conanfile.py | dpronin/conan-center-index | 5c6e41a618097d04e731c9831118a51dcb39ab3f | [
"MIT"
] | 1 | 2021-11-22T13:54:48.000Z | 2021-11-22T14:09:45.000Z | recipes/libdwarf/all/conanfile.py | dpronin/conan-center-index | 5c6e41a618097d04e731c9831118a51dcb39ab3f | [
"MIT"
] | null | null | null | from conans import ConanFile, CMake, tools
import functools
import os
required_conan_version = ">=1.33.0"
class LibdwarfConan(ConanFile):
name = "libdwarf"
description = "A library and a set of command-line tools for reading and writing DWARF2"
topics = ("libdwarf", "dwarf2", "debugging", "dwarf")
ur... | 31.270588 | 106 | 0.631678 | from conans import ConanFile, CMake, tools
import functools
import os
required_conan_version = ">=1.33.0"
class LibdwarfConan(ConanFile):
name = "libdwarf"
description = "A library and a set of command-line tools for reading and writing DWARF2"
topics = ("libdwarf", "dwarf2", "debugging", "dwarf")
ur... | true | true |
f7529c0300df36f3452a1d0984a2b8e5e476c464 | 4,410 | py | Python | core/utils/flow_viz.py | rioyokotalab/RAFT | d718fe86d11f8ab0d4d6d0b0b5c45fa029104444 | [
"BSD-3-Clause"
] | null | null | null | core/utils/flow_viz.py | rioyokotalab/RAFT | d718fe86d11f8ab0d4d6d0b0b5c45fa029104444 | [
"BSD-3-Clause"
] | null | null | null | core/utils/flow_viz.py | rioyokotalab/RAFT | d718fe86d11f8ab0d4d6d0b0b5c45fa029104444 | [
"BSD-3-Clause"
] | null | null | null | # Flow visualization code
# used from https://github.com/tomrunia/OpticalFlow_Visualization
# MIT License
#
# Copyright (c) 2018 Tom Runia
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software w... | 32.666667 | 88 | 0.613379 |
import numpy as np
def make_colorwheel():
RY = 15
YG = 6
GC = 4
CB = 11
BM = 13
MR = 6
ncols = RY + YG + GC + CB + BM + MR
colorwheel = np.zeros((ncols, 3))
col = 0
colorwheel[0:RY, 0] = 255
colorwheel[0:RY, 1] = np.floor(255 * np.arange(0, RY) / RY... | true | true |
f7529c1cda7df6a10d75d62cad3b470910c470bf | 5,849 | py | Python | tractseg/models/UNet_Pytorch_DeepSup.py | magreiner/TractSeg | 5ac5278fc3a6d3262f9f06924dbdde01b399ccf6 | [
"Apache-2.0"
] | null | null | null | tractseg/models/UNet_Pytorch_DeepSup.py | magreiner/TractSeg | 5ac5278fc3a6d3262f9f06924dbdde01b399ccf6 | [
"Apache-2.0"
] | null | null | null | tractseg/models/UNet_Pytorch_DeepSup.py | magreiner/TractSeg | 5ac5278fc3a6d3262f9f06924dbdde01b399ccf6 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Division of Medical Image Computing, German Cancer Research Center (DKFZ)
#
# 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
#... | 40.061644 | 167 | 0.675158 |
import os
import glob
from os.path import join
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.optim import Adamax
from torch.optim import Adam
import torch.optim.lr_scheduler as lr_scheduler
from torch.autograd import Variable
from tractseg.libs.PytorchUt... | true | true |
f7529c48485cafd403a29715f05d59b18b67d09d | 773 | py | Python | 0x0B-python-input_output/10-student.py | malu17/alx-higher_level_programming | 75a24d98c51116b737f339697c75855e34254d3a | [
"MIT"
] | null | null | null | 0x0B-python-input_output/10-student.py | malu17/alx-higher_level_programming | 75a24d98c51116b737f339697c75855e34254d3a | [
"MIT"
] | null | null | null | 0x0B-python-input_output/10-student.py | malu17/alx-higher_level_programming | 75a24d98c51116b737f339697c75855e34254d3a | [
"MIT"
] | null | null | null | #!/usr/bin/python3
"""Student module.
Contains a Student class and some methods.
"""
class Student():
"""Defines a Student."""
def __init__(self, first_name, last_name, age):
"""Sets the necessary attributes for the Student object.
Args:
first_name (str): first name of the stude... | 27.607143 | 74 | 0.605433 |
class Student():
def __init__(self, first_name, last_name, age):
self.first_name = first_name
self.last_name = last_name
self.age = age
def to_json(self, attrs=None):
if attrs is not None:
return {k: v for k, v in self.__dict__.items() if k in attrs}
retu... | true | true |
f7529fe9b68d5251d23b5ace495524fda75c1b7b | 7,517 | py | Python | kenlm_training/cc_net/flat_hash_set.py | ruinunca/data_tooling | 297e1f8c2898d00b523ccafb7bdd19c6d6aac9ff | [
"Apache-2.0"
] | 435 | 2019-11-04T22:35:50.000Z | 2022-03-29T20:15:07.000Z | kenlm_training/cc_net/flat_hash_set.py | ruinunca/data_tooling | 297e1f8c2898d00b523ccafb7bdd19c6d6aac9ff | [
"Apache-2.0"
] | 331 | 2021-11-02T00:30:56.000Z | 2022-03-08T16:48:13.000Z | kenlm_training/cc_net/flat_hash_set.py | ruinunca/data_tooling | 297e1f8c2898d00b523ccafb7bdd19c6d6aac9ff | [
"Apache-2.0"
] | 66 | 2019-11-06T01:28:12.000Z | 2022-03-01T09:18:32.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 sys
import time
import warnings
from typing import Iterable, Iterator, Sequence, Sized, Tuple, Type
import numpy as np
HASH_TYPE: T... | 30.310484 | 90 | 0.598111 |
import sys
import time
import warnings
from typing import Iterable, Iterator, Sequence, Sized, Tuple, Type
import numpy as np
HASH_TYPE: Type[np.uint64] = np.uint64
GETPY_WARNING = False
class AbstractDedupHashSet(Sized, Iterable[np.uint64]):
dtype: Type[np.uint64] = HASH_TYPE
def __repr__(self):
... | true | true |
f752a26a48d74e9686f9741934cdb49e67e4fde8 | 453 | py | Python | waiting/src/lib/mine/cert/bin/helper/Python/write-BASH.py | rdw20170120/workstation | ed19aa930a83885c2a8cb58eb0bb5afe58f95df3 | [
"MIT"
] | null | null | null | waiting/src/lib/mine/cert/bin/helper/Python/write-BASH.py | rdw20170120/workstation | ed19aa930a83885c2a8cb58eb0bb5afe58f95df3 | [
"MIT"
] | 2 | 2021-04-06T18:07:32.000Z | 2021-06-02T01:50:40.000Z | waiting/src/lib/mine/cert/bin/helper/Python/write-BASH.py | rdw20170120/workstation | ed19aa930a83885c2a8cb58eb0bb5afe58f95df3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import sys
from my_configuration import *
from my_instruction import *
from webpage import Html5
def main():
css_class = "support"
page = Html5(css_class, "HowTo use Bash")
page.add(
htmltags.p[
"TODO: Describe how to use Bash command-line completion, editing, a... | 17.423077 | 91 | 0.640177 |
import sys
from my_configuration import *
from my_instruction import *
from webpage import Html5
def main():
css_class = "support"
page = Html5(css_class, "HowTo use Bash")
page.add(
htmltags.p[
"TODO: Describe how to use Bash command-line completion, editing, and history",
... | true | true |
f752a2d047d66c4ed1cbdd79376f0d486d98a66d | 4,862 | py | Python | ifstat/display/sessions.py | aviramc/ifstat | 51285c387d5821794b2bdbd4e73d8396ab916baf | [
"Apache-2.0"
] | null | null | null | ifstat/display/sessions.py | aviramc/ifstat | 51285c387d5821794b2bdbd4e73d8396ab916baf | [
"Apache-2.0"
] | null | null | null | ifstat/display/sessions.py | aviramc/ifstat | 51285c387d5821794b2bdbd4e73d8396ab916baf | [
"Apache-2.0"
] | null | null | null | import curses
from itertools import islice, izip
from .pad_display_manager import PadDisplayManager
from .rate import get_rate_string
SESSIONS_HEADER = "| Idx | Type | Details | RX Rate | TX Rate | Activity Time "
SESSIONS_BORDER = "+-----+------+-------------... | 39.852459 | 137 | 0.526532 | import curses
from itertools import islice, izip
from .pad_display_manager import PadDisplayManager
from .rate import get_rate_string
SESSIONS_HEADER = "| Idx | Type | Details | RX Rate | TX Rate | Activity Time "
SESSIONS_BORDER = "+-----+------+-------------... | true | true |
f752a4b687ddfd7d3eb3216866dcda2583f688ef | 3,238 | py | Python | igibson/__init__.py | mamadbiabon/iGibson | d416a470240eb7ad86e04fee475ae4bd67263a7c | [
"MIT"
] | null | null | null | igibson/__init__.py | mamadbiabon/iGibson | d416a470240eb7ad86e04fee475ae4bd67263a7c | [
"MIT"
] | null | null | null | igibson/__init__.py | mamadbiabon/iGibson | d416a470240eb7ad86e04fee475ae4bd67263a7c | [
"MIT"
] | null | null | null | import logging
import os
import yaml
__version__ = "2.0.5"
logging.getLogger().setLevel(logging.INFO)
with open(os.path.join(os.path.dirname(os.path.realpath(__file__)), "global_config.yaml")) as f:
global_config = yaml.load(f, Loader=yaml.FullLoader)
# can override assets_path and dataset_path from environmen... | 40.475 | 114 | 0.78042 | import logging
import os
import yaml
__version__ = "2.0.5"
logging.getLogger().setLevel(logging.INFO)
with open(os.path.join(os.path.dirname(os.path.realpath(__file__)), "global_config.yaml")) as f:
global_config = yaml.load(f, Loader=yaml.FullLoader)
if "GIBSON_ASSETS_PATH" in os.environ:
assets_path = o... | true | true |
f752a63c30482ce83b1c2f74fb8db411227da35b | 700 | py | Python | pyblock/utils.py | EmuMan/pyblock | d35eaf68ff49fec7423d34b95d919b1a09af3b3f | [
"MIT"
] | null | null | null | pyblock/utils.py | EmuMan/pyblock | d35eaf68ff49fec7423d34b95d919b1a09af3b3f | [
"MIT"
] | null | null | null | pyblock/utils.py | EmuMan/pyblock | d35eaf68ff49fec7423d34b95d919b1a09af3b3f | [
"MIT"
] | null | null | null | import io
import base64
import requests
from nbt import nbt
from .errors import *
from .errors import _get_response_exception
def decode_item_bytes(item_bytes: bytes) -> nbt.NBTFile:
return nbt.NBTFile(fileobj=io.BytesIO(base64.b64decode(item_bytes)))
def request_endpoint(endpoint: str, args: dict[str, str] | N... | 33.333333 | 88 | 0.728571 | import io
import base64
import requests
from nbt import nbt
from .errors import *
from .errors import _get_response_exception
def decode_item_bytes(item_bytes: bytes) -> nbt.NBTFile:
return nbt.NBTFile(fileobj=io.BytesIO(base64.b64decode(item_bytes)))
def request_endpoint(endpoint: str, args: dict[str, str] | N... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.