hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1758573408b48c960d96607c1e824d020a31eb6d | 1,598 | py | Python | gitlab/tests/conftest.py | mchelen-gov/integrations-core | 81281600b3cc7025a7a32148c59620c9592a564f | [
"BSD-3-Clause"
] | 663 | 2016-08-23T05:23:45.000Z | 2022-03-29T00:37:23.000Z | gitlab/tests/conftest.py | mchelen-gov/integrations-core | 81281600b3cc7025a7a32148c59620c9592a564f | [
"BSD-3-Clause"
] | 6,642 | 2016-06-09T16:29:20.000Z | 2022-03-31T22:24:09.000Z | gitlab/tests/conftest.py | mchelen-gov/integrations-core | 81281600b3cc7025a7a32148c59620c9592a564f | [
"BSD-3-Clause"
] | 1,222 | 2017-01-27T15:51:38.000Z | 2022-03-31T18:17:51.000Z | # (C) Datadog, Inc. 2018-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
| 24.96875 | 118 | 0.670213 | # (C) Datadog, Inc. 2018-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import os
from time import sleep
import mock
import pytest
import requests
from datadog_checks.dev import docker_run
from datadog_checks.dev.conditions import CheckEndpoints
from .common import (
C... | 0 | 1,080 | 0 | 0 | 0 | 0 | 0 | 175 | 226 |
cbb523c0d9f5484b703a5024747671143ddddb6c | 619 | py | Python | backend/event_kiosk/event_kiosk/kiosks/migrations/0004_auto_20160516_1510.py | DesjardinsLab/event-kiosk | f5407085963d4fdf3969818cb66c40253b1345ac | [
"MIT"
] | 8 | 2016-01-29T22:39:25.000Z | 2017-02-17T17:35:18.000Z | backend/event_kiosk/event_kiosk/kiosks/migrations/0004_auto_20160516_1510.py | DesjardinsLab/event-kiosk | f5407085963d4fdf3969818cb66c40253b1345ac | [
"MIT"
] | 17 | 2016-01-28T15:20:47.000Z | 2017-08-08T19:25:25.000Z | backend/event_kiosk/event_kiosk/kiosks/migrations/0004_auto_20160516_1510.py | DesjardinsLab/event-kiosk | f5407085963d4fdf3969818cb66c40253b1345ac | [
"MIT"
] | 3 | 2016-03-26T19:45:13.000Z | 2021-07-30T12:20:36.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-05-16 15:10
from __future__ import unicode_literals
| 28.136364 | 153 | 0.686591 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-05-16 15:10
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('kiosks', '0003_auto_20160516_1214'),
]
operations =... | 0 | 0 | 0 | 408 | 0 | 0 | 0 | 30 | 68 |
b267ee7b6f54b4f8be49dbc00bd37083fbb68d0c | 998 | py | Python | start.py | TrixiS/web-bot | 523d02deb30993eb8ab5071ad78111719becd7c7 | [
"MIT"
] | null | null | null | start.py | TrixiS/web-bot | 523d02deb30993eb8ab5071ad78111719becd7c7 | [
"MIT"
] | null | null | null | start.py | TrixiS/web-bot | 523d02deb30993eb8ab5071ad78111719becd7c7 | [
"MIT"
] | null | null | null | import os
import traceback
import asyncio
from scripts import install
if __name__ == "__main__":
loop = asyncio.get_event_loop()
try:
loop.run_until_complete(main())
except KeyboardInterrupt:
pass
except Exception as e:
traceback.print_exception(type(e), e, e.__traceback__)
... | 21.234043 | 98 | 0.641283 | import os
import traceback
import logging
import asyncio
import argparse
from scripts import install
from bot import root_path
async def main():
parser = argparse.ArgumentParser()
parser.add_argument("--no-app", action="store_true")
parser.add_argument("--no-deps", action="store_true")
args = parser... | 0 | 0 | 538 | 0 | 0 | 0 | 0 | -9 | 89 |
41f6d8358cc618d99a2af966532bb9242e5d7d1b | 17,490 | py | Python | fiducial.py | linuxlizard/q60 | dd0cf8a556584beb816b04c6a4913f19cb1142d1 | [
"Apache-2.0"
] | null | null | null | fiducial.py | linuxlizard/q60 | dd0cf8a556584beb816b04c6a4913f19cb1142d1 | [
"Apache-2.0"
] | null | null | null | fiducial.py | linuxlizard/q60 | dd0cf8a556584beb816b04c6a4913f19cb1142d1 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Find fiducials in Q60
#
# davep 30-oct-2013
#import matplotlib.pyplot as plt
FIDUCIAL_WIDTH = 40
STATE_INIT=0
STATE_SEEK_NEGATIVE_EDGE=1 # large negative difference
STATE_SEEK_POSITIVE_EDGE=2 # large positive difference
STATE_SEEK_FLAT=3 # small or no difference
STATE_SEEK_POSITIV... | 39.391892 | 94 | 0.563808 | #!/usr/bin/env python
# Find fiducials in Q60
#
# davep 30-oct-2013
import sys
import numpy as np
import logging
import pickle
import math
import itertools
import Image
import ImageDraw
from scipy.cluster.vq import kmeans,vq
import scipy.ndimage.filters
#import matplotlib.pyplot as plt
import imtools
FIDUCIAL_WIDTH... | 0 | 0 | 0 | 0 | 0 | 15,696 | 0 | -41 | 451 |
e07bae03b3c893d65c544345a56b5b9116d0e77a | 9,993 | py | Python | Main.py | BrunoSG2301/ProjectDenki | 759c5edf5c5318e2c06a67a5249f48c92290c070 | [
"MIT"
] | null | null | null | Main.py | BrunoSG2301/ProjectDenki | 759c5edf5c5318e2c06a67a5249f48c92290c070 | [
"MIT"
] | null | null | null | Main.py | BrunoSG2301/ProjectDenki | 759c5edf5c5318e2c06a67a5249f48c92290c070 | [
"MIT"
] | null | null | null | import time
import os
import sys
import signal
import pyttsx3
from gpiozero import Button
from Media_player import Media_player as MP
aion = Button(18)
runner = None
engine = pyttsx3.init()
engine.setProperty('voice','english_rp+f4')
signal.signal(signal.SIGINT, signal_handler)
if __name__ == '__main__':
MP("ini... | 46.915493 | 153 | 0.41419 | import serial
import time
import os
import sys, getopt
import signal
import time
import pygame
import os
import pyttsx3
from DT import DT, DT_voice
from datetime import date
from Weather import Weather , Weather_voice
from RPi import GPIO
from gpiozero import Button
from time import sleep
from Media_player import Medi... | 0 | 0 | 0 | 0 | 0 | 9,310 | 0 | 36 | 288 |
f8ec85ecc7addd67ebb5f22abbdb32538ce59999 | 7,074 | py | Python | software/authbox/api.py | thvortex/makerspace-auth | 1ab1c6b3f0af300baddc82800555fde273c81d8f | [
"Apache-2.0"
] | 54 | 2017-03-27T15:07:20.000Z | 2021-07-17T21:18:39.000Z | software/authbox/api.py | thvortex/makerspace-auth | 1ab1c6b3f0af300baddc82800555fde273c81d8f | [
"Apache-2.0"
] | 32 | 2017-05-01T16:24:00.000Z | 2020-10-30T17:22:08.000Z | software/authbox/api.py | thvortex/makerspace-auth | 1ab1c6b3f0af300baddc82800555fde273c81d8f | [
"Apache-2.0"
] | 23 | 2017-02-18T00:06:48.000Z | 2021-10-13T12:07:51.000Z | # Copyright 2017-2018 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 33.056075 | 90 | 0.625813 | # Copyright 2017-2018 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 0 | 0 | 0 | 4,505 | 412 | 313 | 0 | -20 | 341 |
138188d02da022effa84de201b9c272137d16c22 | 767 | py | Python | old/2016-07-07/DNA_utilities_goncalo.py | BjornFJohansson/An-Hour-of-Python | 8504967664007df580b91733d8e9d404621419a6 | [
"BSD-2-Clause"
] | null | null | null | old/2016-07-07/DNA_utilities_goncalo.py | BjornFJohansson/An-Hour-of-Python | 8504967664007df580b91733d8e9d404621419a6 | [
"BSD-2-Clause"
] | 2 | 2021-10-08T10:12:26.000Z | 2021-11-10T15:27:18.000Z | old/2016-07-07/DNA_utilities_goncalo.py | BjornFJohansson/An-Hour-of-Python | 8504967664007df580b91733d8e9d404621419a6 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 6 08:20:35 2016
@author: Gonalo
"""
if __name__ is "__main__":
seq = raw_input('What is your seq?')
print 'Complement- ' + complement(seq)
print'Complement reverse- ' + complement_reverse(seq) | 19.666667 | 57 | 0.46545 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 6 08:20:35 2016
@author: Gonçalo
"""
def complement(seq):
ns=""
for i in seq:
if i=="a":
ns=ns+"t"
elif i=="t":
ns=ns+"a"
elif i=="c":
ns=ns+"g"
elif i=="g":
ns=n... | 2 | 0 | 0 | 0 | 0 | 443 | 0 | 0 | 46 |
6737e97f8b76f2ae1b594fc85e020dbdb60dd28b | 379 | py | Python | src/distance_computer.py | magusverma/mrta | 4320d2378506b2a72082c5600483356886b4e3a1 | [
"MIT"
] | null | null | null | src/distance_computer.py | magusverma/mrta | 4320d2378506b2a72082c5600483356886b4e3a1 | [
"MIT"
] | null | null | null | src/distance_computer.py | magusverma/mrta | 4320d2378506b2a72082c5600483356886b4e3a1 | [
"MIT"
] | null | null | null |
dx([[0, 17],[12, 1]], [[], [[5, 3], [12, 8]]])
dx([[0, 17],[12, 1]], [[[5, 3]], [[12, 8]]])
dx([[0, 10],[12, 8]], [[], [[5, 3], [12, 8]]])
dx([[0, 10],[12, 8]], [[[5, 3]], [[12, 8]]])
| 25.266667 | 46 | 0.385224 | def dx(a,b):
# a something like [[0, 17][12, 1]]
# b something like [[], [[5, 3], [12, 8]]]
d = 0
for i,r in enumerate(a):
for t in b[i]:
d += abs(r[0]-t[0]) + abs(r[1]-t[1])
print d
dx([[0, 17],[12, 1]], [[], [[5, 3], [12, 8]]])
dx([[0, 17],[12, 1]], [[[5, 3]], [[12, 8]]])
dx([[0, 10],[12, 8]], [[], [[5, 3... | 0 | 0 | 0 | 0 | 0 | 171 | 0 | 0 | 22 |
ca37206120e3b725f50dd2d2f5d0e087cb326fa3 | 1,835 | py | Python | microcosm_resourcesync/tests/test_toposort.py | globality-corp/microcosm-resourcesync | a7c8f9e2f60e27ac7368e00e5c646d74006afcfb | [
"Apache-2.0"
] | null | null | null | microcosm_resourcesync/tests/test_toposort.py | globality-corp/microcosm-resourcesync | a7c8f9e2f60e27ac7368e00e5c646d74006afcfb | [
"Apache-2.0"
] | 8 | 2017-02-02T20:01:53.000Z | 2019-11-08T11:42:34.000Z | microcosm_resourcesync/tests/test_toposort.py | globality-corp/microcosm-resourcesync | a7c8f9e2f60e27ac7368e00e5c646d74006afcfb | [
"Apache-2.0"
] | 1 | 2019-03-17T03:46:33.000Z | 2019-03-17T03:46:33.000Z | """
Toposort test.
"""
from random import shuffle
from microcosm_resourcesync.schemas import SimpleSchema
resources = [
SimpleSchema(
id=1,
type="parent",
uri="http://example.com/parent/1",
),
SimpleSchema(
id=2,
type="child",
uri="http://example.com/child... | 19.731183 | 55 | 0.498638 | """
Toposort test.
"""
from random import shuffle
from hamcrest import assert_that, contains
from microcosm_resourcesync.schemas import SimpleSchema
from microcosm_resourcesync.toposort import toposorted
resources = [
SimpleSchema(
id=1,
type="parent",
uri="http://example.com/parent/1",... | 0 | 0 | 0 | 0 | 0 | 274 | 0 | 54 | 68 |
b4c9e2005cd8b63bd1b9a7bd5f2cd6caf9c17df6 | 5,863 | py | Python | scripts/spotify-dl.py | joamatab/dotfiles | abbaa1127e0a26df7bee3b0af4896ee16c509353 | [
"MIT"
] | 3 | 2020-10-04T15:54:38.000Z | 2021-04-13T19:15:38.000Z | scripts/spotify-dl.py | joamatab/dotfiles | abbaa1127e0a26df7bee3b0af4896ee16c509353 | [
"MIT"
] | null | null | null | scripts/spotify-dl.py | joamatab/dotfiles | abbaa1127e0a26df7bee3b0af4896ee16c509353 | [
"MIT"
] | null | null | null | #!/usr/bin/python
#from googleapiclient.discovery import build
#from apiclient.errors import HttpError
#from oauth2client.tools import argparser
import urllib
import urllib2
from bs4 import BeautifulSoup
import argparse
#import spotify
import json
from StringIO import StringIO
import subprocess
import traceback
RED ... | 35.75 | 232 | 0.646256 | #!/usr/bin/python
#from googleapiclient.discovery import build
#from apiclient.errors import HttpError
#from oauth2client.tools import argparser
import urllib
import urllib2
from bs4 import BeautifulSoup
import argparse
#import spotify
import json
from StringIO import StringIO
import subprocess
import traceback
RED ... | 0 | 0 | 0 | 0 | 0 | 1,670 | 0 | 0 | 46 |
22d3ed611129be01c1cfc6eecbb4046950da4edf | 831 | py | Python | task/yuhun.py | Mrli2016/easy-game | 1e46eb36cf94579dcadc731caeda402d732ba82c | [
"MIT"
] | null | null | null | task/yuhun.py | Mrli2016/easy-game | 1e46eb36cf94579dcadc731caeda402d732ba82c | [
"MIT"
] | null | null | null | task/yuhun.py | Mrli2016/easy-game | 1e46eb36cf94579dcadc731caeda402d732ba82c | [
"MIT"
] | null | null | null | """
"""
| 26.806452 | 99 | 0.619735 | """
御魂
"""
import os
from task.AutoRobot import Robot
from util.tools import YuhunPos
class Yuhun(Robot):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.task_name = "自动御魂"
self.yuhun_single_mode = False
self.yuhun_fight_btn = "fight.png"
def pre_... | 147 | 0 | 0 | 673 | 0 | 0 | 0 | 9 | 90 |
431674efcb3dfa40251bd8bc3d9f2b12a4efd1b2 | 3,305 | py | Python | features/steps/behave_select_files_steps.py | pi-sjp/behave-parallel | 35e745828f9fd6c796a8980104a277a0028070cb | [
"BSD-2-Clause"
] | 5 | 2019-01-15T18:49:16.000Z | 2020-02-21T20:24:39.000Z | features/steps/behave_select_files_steps.py | pi-sjp/behave-parallel | 35e745828f9fd6c796a8980104a277a0028070cb | [
"BSD-2-Clause"
] | 6 | 2019-04-26T19:34:34.000Z | 2020-06-03T21:49:13.000Z | features/steps/behave_select_files_steps.py | pi-sjp/behave-parallel | 35e745828f9fd6c796a8980104a277a0028070cb | [
"BSD-2-Clause"
] | 9 | 2019-04-23T19:43:41.000Z | 2020-05-12T09:17:27.000Z | # -*- coding: utf-8 -*-
"""
Provides step definitions that test how the behave runner selects feature files.
EXAMPLE:
Given behave has the following feature fileset:
'''
features/alice.feature
features/bob.feature
features/barbi.feature
'''
When behave includes feature files with ... | 39.345238 | 80 | 0.675643 | # -*- coding: utf-8 -*-
"""
Provides step definitions that test how the behave runner selects feature files.
EXAMPLE:
Given behave has the following feature fileset:
'''
features/alice.feature
features/bob.feature
features/barbi.feature
'''
When behave includes feature files with ... | 0 | 1,569 | 0 | 493 | 0 | 0 | 0 | 40 | 291 |
03e9ebca29bc960a7a47af226f39a47af20a7963 | 1,365 | py | Python | tests/test_check.py | mercadona/postoffice_django | a7fa69bac93ca9ee5776974249f6291b1e18fe77 | [
"Apache-2.0"
] | 1 | 2020-11-23T11:13:25.000Z | 2020-11-23T11:13:25.000Z | tests/test_check.py | mercadona/postoffice_django | a7fa69bac93ca9ee5776974249f6291b1e18fe77 | [
"Apache-2.0"
] | 25 | 2020-01-29T10:35:01.000Z | 2021-03-02T12:41:56.000Z | tests/test_check.py | mercadona/postoffice_django | a7fa69bac93ca9ee5776974249f6291b1e18fe77 | [
"Apache-2.0"
] | null | null | null | from django.conf import settings
POSTOFFICE_URL = settings.POSTOFFICE['URL']
| 31.022727 | 79 | 0.699634 | import json
from unittest.mock import patch
import requests
import responses
from django.conf import settings
from postoffice_django import checks
POSTOFFICE_URL = settings.POSTOFFICE['URL']
class TestPostOfficeHealth:
def test_returns_true_when_postoffice_is_ok(self):
responses.add(responses.GET, f'{P... | 0 | 393 | 0 | 754 | 0 | 0 | 0 | 4 | 135 |
9113321be1f80d58cf7b3667087540af7dd0a286 | 10,285 | py | Python | norsu/main.py | Valeria1235/norsu | 7723b61063fa97e62fc9083e9bb754a7c2a87a5e | [
"MIT"
] | 7 | 2018-05-21T18:34:43.000Z | 2021-06-30T03:33:01.000Z | norsu/main.py | Valeria1235/norsu | 7723b61063fa97e62fc9083e9bb754a7c2a87a5e | [
"MIT"
] | 1 | 2018-09-19T11:48:38.000Z | 2018-09-26T17:20:56.000Z | norsu/main.py | Valeria1235/norsu | 7723b61063fa97e62fc9083e9bb754a7c2a87a5e | [
"MIT"
] | 3 | 2018-05-24T14:14:00.000Z | 2019-12-25T15:51:26.000Z |
def split_args_extra(args):
"""
Separate main args from auxiliary ones.
"""
try:
i = args.index('--')
return args[:i], args[i + 1:]
except ValueError:
return args, []
| 32.140625 | 108 | 0.648128 | import argparse
import os
import sys
import subprocess
from shutil import rmtree
from . import __version__
from .argparse_actions import ShlexSplitAction
from .config import NORSU_DIR, WORK_DIR, CONFIG
from .exceptions import Error
from .extension import Extension
from .git import find_relevant_refs
from .terminal im... | 0 | 0 | 0 | 0 | 0 | 9,276 | 0 | 219 | 565 |
723fbed1f180f3d2aee31fc324f8aaba7b3e186c | 2,508 | py | Python | meerkat_auth/__init__.py | fjelltopp/meerkat_auth | 590f8971ade096366635b5cc129fc6ed98119f14 | [
"MIT"
] | null | null | null | meerkat_auth/__init__.py | fjelltopp/meerkat_auth | 590f8971ade096366635b5cc129fc6ed98119f14 | [
"MIT"
] | 5 | 2020-10-05T13:04:19.000Z | 2021-09-30T11:00:12.000Z | meerkat_auth/__init__.py | fjelltopp/meerkat_auth | 590f8971ade096366635b5cc129fc6ed98119f14 | [
"MIT"
] | null | null | null | """
meerkat_auth.py
Registering root Flask app services for the Meerkat Authentication module.
"""
from flask import Flask
from flask_babel import Babel
from raven.contrib.flask import Sentry
import os
# Create the Flask app
app = Flask(__name__)
babel = Babel(app)
config_object = os.getenv('CONFIG_OBJECT', 'meerkat_... | 27.26087 | 76 | 0.739633 | """
meerkat_auth.py
Registering root Flask app services for the Meerkat Authentication module.
"""
from flask import Flask, abort, g, redirect, render_template
from flask_babel import Babel
from raven.contrib.flask import Sentry
import os
# Create the Flask app
app = Flask(__name__)
babel = Babel(app)
config_object =... | 0 | 1,251 | 0 | 0 | 0 | 0 | 0 | 37 | 135 |
b9260685af65e0af19b48bfe9409597c5e0f5f84 | 2,214 | py | Python | conftest.py | jbma/Flask-Resize | 3a4513b506375c5bdaedb121cd9b2e4fc6dfb765 | [
"BSD-2-Clause-FreeBSD"
] | 38 | 2015-02-22T18:34:47.000Z | 2021-11-03T11:51:06.000Z | conftest.py | jbma/Flask-Resize | 3a4513b506375c5bdaedb121cd9b2e4fc6dfb765 | [
"BSD-2-Clause-FreeBSD"
] | 22 | 2015-02-06T12:34:46.000Z | 2020-08-12T15:26:09.000Z | conftest.py | jbma/Flask-Resize | 3a4513b506375c5bdaedb121cd9b2e4fc6dfb765 | [
"BSD-2-Clause-FreeBSD"
] | 12 | 2015-01-09T18:02:37.000Z | 2020-08-27T20:31:40.000Z | import logging
import os
import flask_resize
logging.basicConfig(format='%(levelname)s:%(name)s:%(thread)d:%(message)s')
log_level = os.environ.get('RESIZE_LOG_LEVEL', 'error')
flask_resize.logger.setLevel(getattr(logging, log_level.upper()))
| 22.591837 | 75 | 0.669828 | import logging
import os
import uuid
import pytest
from PIL import Image
import flask_resize
from flask_resize import _compat, resizing
logging.basicConfig(format='%(levelname)s:%(name)s:%(thread)d:%(message)s')
log_level = os.environ.get('RESIZE_LOG_LEVEL', 'error')
flask_resize.logger.setLevel(getattr(logging, lo... | 0 | 1,508 | 0 | 0 | 0 | 128 | 0 | 3 | 319 |
f6daea7d4950257b140f15bf74639fbf49e87e1a | 30,077 | py | Python | research/fivo/experimental/bounds.py | vincentcheny/models | afb1a59fc1bc792ac72d1a3e22e2469020529788 | [
"Apache-2.0"
] | 1 | 2019-09-11T09:41:11.000Z | 2019-09-11T09:41:11.000Z | research/fivo/experimental/bounds.py | vincentcheny/models | afb1a59fc1bc792ac72d1a3e22e2469020529788 | [
"Apache-2.0"
] | null | null | null | research/fivo/experimental/bounds.py | vincentcheny/models | afb1a59fc1bc792ac72d1a3e22e2469020529788 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The TensorFlow Authors All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | 44.624629 | 105 | 0.650364 | # Copyright 2018 The TensorFlow Authors All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0583394d3d601c00030288f8e04d5ad3d66f6552 | 68 | py | Python | OurTasks/02/03/03.py | nakov/Python-Course-SoftUni | b6036064c259adbdae4e2d87b67230b9cf9ddefc | [
"MIT"
] | 6 | 2017-06-09T17:45:28.000Z | 2020-03-31T11:59:39.000Z | OurTasks/02/03/03.py | nakov/Python-Course-SoftUni | b6036064c259adbdae4e2d87b67230b9cf9ddefc | [
"MIT"
] | null | null | null | OurTasks/02/03/03.py | nakov/Python-Course-SoftUni | b6036064c259adbdae4e2d87b67230b9cf9ddefc | [
"MIT"
] | 1 | 2019-07-02T11:26:00.000Z | 2019-07-02T11:26:00.000Z | num = int (input ())
print (str (num % 35 == 0) + " " + str (num))
| 17 | 45 | 0.455882 | num = int (input ())
print (str (num % 35 == 0) + " " + str (num))
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
622a2011c9b4c9aaec6b19ee205629ffb3b76620 | 402 | py | Python | Ex0032/ex0032.py | Rodrigo-Antonio-Silva/ExerciciosPythonCursoemVideo | 3b2d68094dd5d60f0e45a75590eb2be9be030640 | [
"MIT"
] | null | null | null | Ex0032/ex0032.py | Rodrigo-Antonio-Silva/ExerciciosPythonCursoemVideo | 3b2d68094dd5d60f0e45a75590eb2be9be030640 | [
"MIT"
] | null | null | null | Ex0032/ex0032.py | Rodrigo-Antonio-Silva/ExerciciosPythonCursoemVideo | 3b2d68094dd5d60f0e45a75590eb2be9be030640 | [
"MIT"
] | null | null | null | #coding utf-8
#cdigo que verifica se o ano sugerido pelo usurio bisexto.
from datetime import date
a = int(input('Que ano quer analisar? Coloque 0 para analisar o nmero atual: '))
if a == 0:
a = date.today().year
if a % 4 == 0 and a % 100 != 0 or a % 400 == 0:
print('O ano \33[34m{}\33[m Bissexto.'.for... | 36.545455 | 82 | 0.626866 | #coding utf-8
#código que verifica se o ano sugerido pelo usuário é bisexto.
from datetime import date
a = int(input('Que ano quer analisar? Coloque 0 para analisar o número atual: '))
if a == 0:
a = date.today().year
if a % 4 == 0 and a % 100 != 0 or a % 400 == 0:
print('O ano \33[34m{}\33[m é Bissexto.... | 14 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7328fbd04972556b443a0a156690db4bce4f6365 | 16,720 | py | Python | compiler/expr_visitor.py | ralic/grumpy3 | a471f7ba64167d5812c0f6701380f9f71fa937c3 | [
"Apache-2.0"
] | null | null | null | compiler/expr_visitor.py | ralic/grumpy3 | a471f7ba64167d5812c0f6701380f9f71fa937c3 | [
"Apache-2.0"
] | null | null | null | compiler/expr_visitor.py | ralic/grumpy3 | a471f7ba64167d5812c0f6701380f9f71fa937c3 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 38.883721 | 116 | 0.612022 | # coding=utf-8
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 198 | 0 | 0 | 15,747 | 0 | 0 | 0 | 46 | 157 |
023dc98450916fa2f8376c9203f7444965e16b2b | 1,626 | py | Python | gui/rbgui.py | hazelnusse/robot.bicycle | b8d7c67290497577c96167dac123765efc4e08f8 | [
"BSD-2-Clause"
] | 9 | 2016-01-14T14:58:27.000Z | 2021-03-23T16:45:17.000Z | gui/rbgui.py | hazelnusse/robot.bicycle | b8d7c67290497577c96167dac123765efc4e08f8 | [
"BSD-2-Clause"
] | null | null | null | gui/rbgui.py | hazelnusse/robot.bicycle | b8d7c67290497577c96167dac123765efc4e08f8 | [
"BSD-2-Clause"
] | 1 | 2019-11-28T15:28:46.000Z | 2019-11-28T15:28:46.000Z | #!/usr/bin/env python3
"""
Robot Bicycle GUI.
Barebones GUI allows user to run common shell commands with buttons.
Oliver Lee (oliverzlee@gmail.com)
5 December 2012
"""
if __name__ == '__main__':
main()
| 23.565217 | 68 | 0.645756 | #!/usr/bin/env python3
"""
Robot Bicycle GUI.
Barebones GUI allows user to run common shell commands with buttons.
Oliver Lee (oliverzlee@gmail.com)
5 December 2012
"""
import sys
from PyQt4 import QtGui, QtCore
from rbg_shell import *
from rbg_widgets import *
from rbg_button_page import ButtonPage
from rbg_plo... | 0 | 0 | 0 | 1,045 | 0 | 126 | 0 | 35 | 189 |
3d520e449db45388125c1a3f5e3dd88c14b53b71 | 2,427 | py | Python | src/sage/algebras/lie_conformal_algebras/examples.py | hsm207/sage | 020bd59ec28717bfab9af44d2231c53da1ff99f1 | [
"BSL-1.0"
] | 1,742 | 2015-01-04T07:06:13.000Z | 2022-03-30T11:32:52.000Z | src/sage/algebras/lie_conformal_algebras/examples.py | hsm207/sage | 020bd59ec28717bfab9af44d2231c53da1ff99f1 | [
"BSL-1.0"
] | 66 | 2015-03-19T19:17:24.000Z | 2022-03-16T11:59:30.000Z | src/sage/algebras/lie_conformal_algebras/examples.py | dimpase/sage | 468f23815ade42a2192b0a9cd378de8fdc594dcd | [
"BSL-1.0"
] | 495 | 2015-01-10T10:23:18.000Z | 2022-03-24T22:06:11.000Z | r"""
Examples of Lie Conformal Algebras
We implement the following examples of Lie conformal algebras:
- :mod:`Abelian Lie conformal algebra<.abelian_lie_conformal_algebra>`
- :mod:`Affine Lie conformal algebra<.affine_lie_conformal_algebra>`
- :mod:`Bosonic Ghosts<.bosonic_ghosts_lie_conformal_algebra>`
- :mod:`Ferm... | 44.944444 | 105 | 0.782859 | r"""
Examples of Lie Conformal Algebras
We implement the following examples of Lie conformal algebras:
- :mod:`Abelian Lie conformal algebra<.abelian_lie_conformal_algebra>`
- :mod:`Affine Lie conformal algebra<.affine_lie_conformal_algebra>`
- :mod:`Bosonic Ghosts<.bosonic_ghosts_lie_conformal_algebra>`
- :mod:`Ferm... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
18257928661db39b9a519119fdcbee30cb8fff72 | 1,387 | py | Python | modules/arp_monitor.py | Lola224/hakkuframework | b9b87457a24df34f00ceece4928679c6d6b52f59 | [
"MIT"
] | 250 | 2016-12-29T02:43:04.000Z | 2022-03-31T05:51:23.000Z | modules/arp_monitor.py | Lola224/hakkuframework | b9b87457a24df34f00ceece4928679c6d6b52f59 | [
"MIT"
] | 2 | 2017-08-08T06:22:10.000Z | 2021-05-22T01:59:43.000Z | modules/arp_monitor.py | Lola224/hakkuframework | b9b87457a24df34f00ceece4928679c6d6b52f59 | [
"MIT"
] | 86 | 2016-12-29T06:39:34.000Z | 2021-12-12T20:07:39.000Z | # Copyright (C) 2015 2021 Noa-Emil Nissinen (4shadoww)
conf = {
"name": "arp_monitor", # Module's name (should be same as file name)
"version": "1.0", # Module version
"shortdesc": "arp packet monitor", # Short description
"github": "4shadoww", # Author's github
"author": "4shadoww", # Author
... | 33.02381 | 120 | 0.66186 | # Copyright (C) 2015 – 2021 Noa-Emil Nissinen (4shadoww)
from core.hakkuframework import *
import scapy.all as scapy
conf = {
"name": "arp_monitor", # Module's name (should be same as file name)
"version": "1.0", # Module version
"shortdesc": "arp packet monitor", # Short description
"github": "4shado... | 3 | 0 | 0 | 0 | 0 | 447 | 0 | 16 | 90 |
84364ddaa36bf4622ee9d5866d383f405533097a | 4,229 | py | Python | GUI/Eqpt/ui.py | DreamSilverFox/MapleData | 0ca8c52c92b0ad37d63675ffc5a4cef5a8de9c9c | [
"MIT"
] | null | null | null | GUI/Eqpt/ui.py | DreamSilverFox/MapleData | 0ca8c52c92b0ad37d63675ffc5a4cef5a8de9c9c | [
"MIT"
] | null | null | null | GUI/Eqpt/ui.py | DreamSilverFox/MapleData | 0ca8c52c92b0ad37d63675ffc5a4cef5a8de9c9c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
| 82.921569 | 177 | 0.573422 | # -*- coding: utf-8 -*-
import PySimpleGUI as sg
from GUI.key import eqpt
def eqpt_ui():
frame_layout_e_p = [
[sg.Text('HP', size=(5, 0), font='Any 12', key=eqpt['text']['hp']), sg.Input(key=eqpt['data']['hp'], size=(8, 0), font='Any 12', enable_events=True),
sg.Text('MP', size=(5, 0), font='Any ... | 18 | 0 | 0 | 0 | 0 | 4,124 | 0 | 6 | 67 |
07a6ff2b9661ebf2379c65c6b767e3e6f92f2cc3 | 2,379 | py | Python | carla_rllib/Training_Evaluation/train_model.py | TinaMenke/Deep-Reinforcement-Learning | 8ab0894b92e1f994802a218002021ee075c405bf | [
"MIT"
] | 6 | 2020-03-22T09:39:30.000Z | 2021-04-12T12:01:44.000Z | carla_rllib/Training_Evaluation/train_model.py | ptrckhmmr/Deep-Reinforcement-Learning | 6d295d22e4dc75780a49d64a15c1b67c561b0f8a | [
"MIT"
] | 9 | 2020-09-25T22:35:07.000Z | 2022-03-12T00:20:21.000Z | carla_rllib/Training_Evaluation/train_model.py | ptrckhmmr/Deep-Reinforcement-Learning | 6d295d22e4dc75780a49d64a15c1b67c561b0f8a | [
"MIT"
] | 2 | 2020-12-20T12:59:14.000Z | 2021-05-25T06:28:50.000Z | import os
import carla_rllib
import numpy as np
import gym
import argparse
import json
from carla_rllib.environments.carla_envs.config import parse_json
from stable_baselines.common.vec_env import DummyVecEnv
from stable_baselines.ddpg.noise import OrnsteinUhlenbeckActionNoise
from stable_baselines import PPO2
# defi... | 33.985714 | 123 | 0.636822 | import os
import carla_rllib
import numpy as np
import pandas as pd
import gym
import argparse
import json
from carla_rllib.environments.carla_envs.config import parse_json
from stable_baselines.common.policies import CnnPolicy
from stable_baselines.common.vec_env import DummyVecEnv
from stable_baselines.common.vec_env... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 218 | 88 |
4ef0dde4a590e5f811cfabadd5f1dcb5ae936d86 | 1,969 | py | Python | caesure/verifyd.py | samrushing/caesure | 11c17a33148cb352681039bd4b8468ba113df2c1 | [
"BSD-2-Clause"
] | 87 | 2015-01-12T11:00:36.000Z | 2021-12-29T13:24:18.000Z | caesure/verifyd.py | darrynsmith-git/caesure | 11c17a33148cb352681039bd4b8468ba113df2c1 | [
"BSD-2-Clause"
] | 4 | 2015-04-28T05:55:22.000Z | 2018-11-14T21:03:45.000Z | caesure/verifyd.py | darrynsmith-git/caesure | 11c17a33148cb352681039bd4b8468ba113df2c1 | [
"BSD-2-Clause"
] | 38 | 2015-02-04T17:45:29.000Z | 2021-08-18T12:09:53.000Z | # -*- Mode: Python; indent-tabs-mode: nil -*-
import argparse
import coro
W = coro.write_stderr
G = GlobalState()
p = argparse.ArgumentParser()
p.add_argument ('-b', '--base', help='data directory', default='/usr/local/caesure', metavar='PATH')
p.add_argument ('-f', '--file', help='server socket filename', default=... | 28.128571 | 102 | 0.521077 | # -*- Mode: Python; indent-tabs-mode: nil -*-
import argparse
import os
import coro
import struct
from caesure.bitcoin import TX
from coro.asn1.python import encode, decode
W = coro.write_stderr
def serve (G):
path = os.path.join (G.args.base, G.args.file)
s = coro.sock (coro.AF.UNIX, coro.SOCK.STREAM)
t... | 0 | 0 | 0 | 6 | 0 | 1,364 | 0 | 11 | 165 |
ee0d16a9f58c24442cddc9ad552fa5e2b07bc3b8 | 1,812 | py | Python | tests/test_int_vs_long.py | roguextech/OpenRocket-pyjnius | 1692c95099ca8eaf652ac24dbbcbf4eb08d8191f | [
"MIT"
] | 908 | 2015-01-03T03:24:43.000Z | 2022-03-29T14:05:16.000Z | tests/test_int_vs_long.py | roguextech/OpenRocket-pyjnius | 1692c95099ca8eaf652ac24dbbcbf4eb08d8191f | [
"MIT"
] | 465 | 2015-01-03T19:13:21.000Z | 2022-03-15T23:32:23.000Z | tests/test_int_vs_long.py | roguextech/OpenRocket-pyjnius | 1692c95099ca8eaf652ac24dbbcbf4eb08d8191f | [
"MIT"
] | 244 | 2015-01-02T22:41:35.000Z | 2022-03-12T13:16:30.000Z | from __future__ import absolute_import, unicode_literals
import unittest
if __name__ == '__main__':
unittest.main()
| 30.711864 | 71 | 0.64404 | from __future__ import absolute_import, unicode_literals
import unittest
from jnius import autoclass, cast, PythonJavaClass, java_method
class _TestImplemIterator(PythonJavaClass):
__javainterfaces__ = ['java/util/ListIterator']
class _TestImplem(PythonJavaClass):
__javainterfaces__ = ['java/util/List']
... | 0 | 282 | 0 | 1,272 | 0 | 0 | 0 | 42 | 91 |
bedf2d98db3e9e3610f2ddb50d6d166ff396eb5c | 571 | py | Python | group_counts_bargraph.py | kaclark/DHS_intergenic_analysis | 5ae1dc1c257ae9dc0e001e07402bebd8e31f0f60 | [
"MIT"
] | null | null | null | group_counts_bargraph.py | kaclark/DHS_intergenic_analysis | 5ae1dc1c257ae9dc0e001e07402bebd8e31f0f60 | [
"MIT"
] | null | null | null | group_counts_bargraph.py | kaclark/DHS_intergenic_analysis | 5ae1dc1c257ae9dc0e001e07402bebd8e31f0f60 | [
"MIT"
] | null | null | null | # libraries
import numpy as np
import matplotlib.pyplot as plt
# Fake dataset
height = [12, 6, 2, 24, 18, 19, 3, 44, 58, 42, 299, 85, 3007]
bars = ('all', '1:2:8', '1:4', '1:4:8', '1:8', '1', '2:4', '2:4:8', '2', '4:8', '4', '8')
y_pos = np.arange(len(bars))
# Create bars and choose color
plt.bar(y_pos, height, col... | 21.961538 | 89 | 0.623468 | # libraries
import numpy as np
import matplotlib.pyplot as plt
# Fake dataset
height = [12, 6, 2, 24, 18, 19, 3, 44, 58, 42, 299, 85, 3007]
bars = ('all', '1:2:8', '1:4', '1:4:8', '1:8', '1', '2:4', '2:4:8', '2', '4:8', '4', '8')
y_pos = np.arange(len(bars))
# Create bars and choose color
plt.bar(y_pos, height, col... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1f3eff5b80bd67b090192e185b4b0a11c60d8fe0 | 1,873 | py | Python | checklines/main.py | iRyukizo/check_lines | 1fbf2e335fd6cccb37bab3bf9a4dee184d1ce786 | [
"MIT"
] | 4 | 2020-10-28T08:58:55.000Z | 2020-11-27T12:35:32.000Z | checklines/main.py | iRyukizo/check_lines | 1fbf2e335fd6cccb37bab3bf9a4dee184d1ce786 | [
"MIT"
] | 4 | 2020-10-27T03:41:21.000Z | 2020-11-03T22:16:55.000Z | checklines/main.py | iRyukizo/check_lines | 1fbf2e335fd6cccb37bab3bf9a4dee184d1ce786 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
__version__ = '0.3.1'
__modified__ = ("2021", "02", "01")
__author__ = "Hugo 'iRyukizo' MOREAU"
__maintainer__ = "Hugo 'iRyukizo' MOREAU"
__status__ = "Production"
import argparse
from . import info, precommit
def parse():
"""Parse all options and files.
:returns: args
"""
par... | 36.72549 | 78 | 0.608649 | #!/usr/bin/env python3
__version__ = '0.3.1'
__modified__ = ("2021", "02", "01")
__author__ = "Hugo 'iRyukizo' MOREAU"
__maintainer__ = "Hugo 'iRyukizo' MOREAU"
__status__ = "Production"
import argparse
from . import info, precommit
def parse():
"""Parse all options and files.
:returns: args
"""
par... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c3cc43a6dee7c664b879bca0919f0fd9256edaa6 | 1,055 | py | Python | tests/data/readme_expected.py | shimont/awesome-aws | 2f30f7ecf7e9785882a6e4f20020f5dd374a821a | [
"CC-BY-4.0"
] | 10,815 | 2015-10-12T12:08:36.000Z | 2022-03-31T15:58:52.000Z | tests/data/readme_expected.py | shimont/awesome-aws | 2f30f7ecf7e9785882a6e4f20020f5dd374a821a | [
"CC-BY-4.0"
] | 176 | 2015-10-12T17:44:16.000Z | 2022-02-16T13:53:30.000Z | tests/data/readme_expected.py | shimont/awesome-aws | 2f30f7ecf7e9785882a6e4f20020f5dd374a821a | [
"CC-BY-4.0"
] | 1,529 | 2015-10-12T15:23:27.000Z | 2022-03-28T13:28:55.000Z | # coding: utf-8
# Copyright 2015 Donne Martin. All Rights Reserved.
#
# Creative Commons Attribution 4.0 International License (CC BY 4.0)
# http://creativecommons.org/licenses/by/4.0/
readme_expected = [
'## The Fiery Meter of AWSome\n',
'* [user/foo](https://github.com/user/foo) - desc\n',
'* [user/bar ... | 47.954545 | 94 | 0.63981 | # coding: utf-8
# Copyright 2015 Donne Martin. All Rights Reserved.
#
# Creative Commons Attribution 4.0 International License (CC BY 4.0)
# http://creativecommons.org/licenses/by/4.0/
readme_expected = [
'## The Fiery Meter of AWSome\n',
'* [user/foo](https://github.com/user/foo) - desc\n',
'* [user/bar ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f9aacbea6952ae55ef8b39b9f5f88441639ab198 | 184 | py | Python | curso-em-video/ex025.py | Luanlpg/jesonel | 3e2011ff13fee7f10decc8135d488b50ab50cbbc | [
"MIT"
] | null | null | null | curso-em-video/ex025.py | Luanlpg/jesonel | 3e2011ff13fee7f10decc8135d488b50ab50cbbc | [
"MIT"
] | null | null | null | curso-em-video/ex025.py | Luanlpg/jesonel | 3e2011ff13fee7f10decc8135d488b50ab50cbbc | [
"MIT"
] | null | null | null | cidade = input('Digite sua cidade: ')
print('Santo' in cidade.split()[0])
if cidade.split()[0] == 'Santo':
print('Tem Santo no nome')
else:
print('Nao tem Santo no nome')
| 15.333333 | 37 | 0.619565 | cidade = input('Digite sua cidade: ')
print('Santo' in cidade.split()[0])
if cidade.split()[0] == 'Santo':
print('Tem Santo no nome')
else:
print('Nao tem Santo no nome')
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
560b0a9225a81a0e74086513233ab7575580c232 | 2,587 | py | Python | triplinker/journeys/tests.py | GonnaFlyMethod/triplinker | f4189e499ad48fd9102dd2211a8884078136eae9 | [
"MIT"
] | null | null | null | triplinker/journeys/tests.py | GonnaFlyMethod/triplinker | f4189e499ad48fd9102dd2211a8884078136eae9 | [
"MIT"
] | null | null | null | triplinker/journeys/tests.py | GonnaFlyMethod/triplinker | f4189e499ad48fd9102dd2211a8884078136eae9 | [
"MIT"
] | null | null | null | # Django modules.
# !Triplinker modules:
# Another apps modules.
# Current app modules.
| 38.61194 | 80 | 0.626981 | # Django modules.
from django.urls import reverse
from django.test import TestCase, Client
# !Triplinker modules:
# Another apps modules.
from accounts.models.TLAccount_frequest import TLAccount
from trip_places.models import Place
# Current app modules.
from .models import Journey, Participant
class TestJourneysV... | 0 | 0 | 0 | 2,264 | 0 | 0 | 0 | 98 | 133 |
c5896d6ea25171d040ceea383949f64f2d46e064 | 687 | pyde | Python | sketches/sinecosine/sinecosine.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/sinecosine/sinecosine.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/sinecosine/sinecosine.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | # Sinus und Cosinus | 19.083333 | 34 | 0.489083 | # Sinus und Cosinus
import math
def setup():
global a, b, co
a = b = co = 0
size(500, 400)
background(255)
colorMode(HSB, 100)
strokeWeight(3)
frameRate(30)
def draw():
global a, b, co
x0 = math.sin(a)*(width-20)/2
y0 = math.cos(a)*(height-20)/2
x1 = math.sin(b)*(width... | 0 | 0 | 0 | 0 | 0 | 610 | 0 | -10 | 68 |
2eef44398d5d29f730f7163c9500313286eb7843 | 5,475 | py | Python | fairnr/modules/linear.py | lingjie0206/NSVF | 1f3eefc4408c8673bc7b3c0208e861e0de90deb0 | [
"MIT"
] | 1 | 2021-07-29T15:13:56.000Z | 2021-07-29T15:13:56.000Z | fairnr/modules/linear.py | lingjie0206/NSVF | 1f3eefc4408c8673bc7b3c0208e861e0de90deb0 | [
"MIT"
] | null | null | null | fairnr/modules/linear.py | lingjie0206/NSVF | 1f3eefc4408c8673bc7b3c0208e861e0de90deb0 | [
"MIT"
] | null | null | null | # 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 torch.nn as nn
| 31.831395 | 125 | 0.605114 | # 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 math
import torch
import torch.nn as nn
import torch.nn.functional as F
from fairseq.modules import LayerNorm
from fairseq.utils impor... | 0 | 0 | 0 | 4,584 | 0 | 379 | 0 | 29 | 274 |
80785349bd512737005eabd1247ba002964d3d8f | 6,811 | py | Python | keyhandler.py | egriffith/AWSKeyHandler | 9dbe1068440f801a7c522f7fd212bebef1af2a65 | [
"MIT"
] | null | null | null | keyhandler.py | egriffith/AWSKeyHandler | 9dbe1068440f801a7c522f7fd212bebef1af2a65 | [
"MIT"
] | null | null | null | keyhandler.py | egriffith/AWSKeyHandler | 9dbe1068440f801a7c522f7fd212bebef1af2a65 | [
"MIT"
] | null | null | null | #! /usr/bin/env python3
import sys
if __name__ == "__main__":
main(sys.argv[1:])
| 38.050279 | 145 | 0.550286 | #! /usr/bin/env python3
import sys
from os.path import expanduser
import argparse
import boto3
import botocore
def printDebug(action, publicKeyName, publicKeyText, regionList, debug, dryRun, credProfile):
return 0
def buildArgParser(argv):
parser = argparse.ArgumentParser(description="Upload, delete, or lis... | 0 | 0 | 0 | 0 | 0 | 6,456 | 0 | -12 | 272 |
8e403b08c350d0063cd50887f4dc2c3176a29c6b | 2,920 | py | Python | local_interpret_CNN.py | Lukeming-tsinghua/Interpretable-NN-for-IBD-diagnosis | 5fb0fae774e010cdd6b63ff487a4528f0397647d | [
"MIT"
] | null | null | null | local_interpret_CNN.py | Lukeming-tsinghua/Interpretable-NN-for-IBD-diagnosis | 5fb0fae774e010cdd6b63ff487a4528f0397647d | [
"MIT"
] | null | null | null | local_interpret_CNN.py | Lukeming-tsinghua/Interpretable-NN-for-IBD-diagnosis | 5fb0fae774e010cdd6b63ff487a4528f0397647d | [
"MIT"
] | null | null | null | import os
import torch
import torchtext
import torch.nn as nn
from data import DataIterator
from collections import namedtuple
import joblib
from captum.attr import LayerIntegratedGradients, TokenReferenceBase
from tqdm import tqdm
from config import ConfigBinaryClassification
if __name__ == "__main__":
cfg = Co... | 36.049383 | 101 | 0.678767 | import os
import torch
import torchtext
import torchtext.data
import torch.nn as nn
import torch.nn.functional as F
from model import CNN
from data import DataIterator
from collections import namedtuple
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.cluster import KMeans
import joblib
from ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 87 | 201 |
599b8727acedbadbcddfb077e6e58e7b68ecb0c7 | 8,706 | py | Python | wfexs_backend/fetchers/drs.py | inab/WES-backend | f260476e782edb52d168703d2c666daf56d48de3 | [
"Apache-2.0"
] | null | null | null | wfexs_backend/fetchers/drs.py | inab/WES-backend | f260476e782edb52d168703d2c666daf56d48de3 | [
"Apache-2.0"
] | null | null | null | wfexs_backend/fetchers/drs.py | inab/WES-backend | f260476e782edb52d168703d2c666daf56d48de3 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2020-2022 Barcelona Supercomputing Center (BSC), Spain
#
# 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.or... | 41.260664 | 169 | 0.641512 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2020-2022 Barcelona Supercomputing Center (BSC), Spain
#
# 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.or... | 0 | 0 | 0 | 0 | 0 | 7,028 | 0 | 212 | 230 |
3f2f5fda0378dc7a8b70390f995629b14b5de929 | 12,155 | py | Python | hydamo_validation/datamodel.py | HetWaterschapshuis/HyDAMOValidatieModule | c0b908461fd1a4a595812fbd7365c244ec8b0c38 | [
"MIT"
] | 1 | 2021-12-10T18:40:59.000Z | 2021-12-10T18:40:59.000Z | hydamo_validation/datamodel.py | HetWaterschapshuis/HyDAMOValidatieModule | c0b908461fd1a4a595812fbd7365c244ec8b0c38 | [
"MIT"
] | 7 | 2022-01-10T09:29:36.000Z | 2022-03-17T19:57:28.000Z | hydamo_validation/datamodel.py | HetWaterschapshuis/HyDAMOValidatieModule | c0b908461fd1a4a595812fbd7365c244ec8b0c38 | [
"MIT"
] | 3 | 2021-12-09T18:55:56.000Z | 2022-02-11T13:49:28.000Z | """HyDAMO datamodel for ValidatieTool."""
import fiona
from typing import List, Dict
from shapely.geometry import LineString, MultiLineString, Point, Polygon, MultiPolygon
import warnings
warnings.filterwarnings("ignore", category=UserWarning)
warnings.filterwarnings("ignore", category=RuntimeWarning)
warnings.filterw... | 30.463659 | 102 | 0.540765 | """HyDAMO datamodel for ValidatieTool."""
import geopandas as gpd
import fiona
from typing import List, Dict, Literal
import re
import json
from shapely.geometry import LineString, MultiLineString, Point, Polygon, MultiPolygon
import numpy as np
from pathlib import Path
import warnings
import logging
from hydamo_valid... | 0 | 0 | 0 | 9,524 | 0 | 0 | 0 | -1 | 201 |
93ca28d3dd8f2707ac073279144d918e3ab0e3e9 | 196 | py | Python | src/carts/urls.py | itsmeabhi/Ecommerce | ca5ebd7f0cb27073e8e99cecc5e3f6818190f625 | [
"bzip2-1.0.6"
] | null | null | null | src/carts/urls.py | itsmeabhi/Ecommerce | ca5ebd7f0cb27073e8e99cecc5e3f6818190f625 | [
"bzip2-1.0.6"
] | null | null | null | src/carts/urls.py | itsmeabhi/Ecommerce | ca5ebd7f0cb27073e8e99cecc5e3f6818190f625 | [
"bzip2-1.0.6"
] | null | null | null | from django.urls import path
from .views import cart_home
app_name = 'carts' # Required for namespace in path for URLS reverse routing.
urlpatterns = [
path('', cart_home, name='cart'),
]
| 19.6 | 78 | 0.714286 | from django.urls import path
from .views import cart_home
app_name = 'carts' # Required for namespace in path for URLS reverse routing.
urlpatterns = [
path('', cart_home, name='cart'),
]
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
16d909d497e244a4ba3271c24126d8dc035958b4 | 2,432 | py | Python | src/elicznik/elicznik.py | mlesniew/elicznik | fdec5f26a3aadde94e15f1783eef74b18426099d | [
"MIT"
] | null | null | null | src/elicznik/elicznik.py | mlesniew/elicznik | fdec5f26a3aadde94e15f1783eef74b18426099d | [
"MIT"
] | 1 | 2022-01-29T09:52:19.000Z | 2022-01-29T09:52:19.000Z | src/elicznik/elicznik.py | mlesniew/elicznik | fdec5f26a3aadde94e15f1783eef74b18426099d | [
"MIT"
] | 2 | 2022-01-29T05:50:52.000Z | 2022-03-30T14:04:18.000Z | #!/usr/bin/env python3
| 34.742857 | 117 | 0.570313 | #!/usr/bin/env python3
import datetime
from .session import Session
class ELicznik:
LOGIN_URL = "https://logowanie.tauron-dystrybucja.pl/login"
CHART_URL = "https://elicznik.tauron-dystrybucja.pl/index/charts"
def __init__(self, username, password):
self.username = username
self.passwor... | 0 | 539 | 0 | 1,799 | 0 | 0 | 0 | 1 | 69 |
3066549eb71290d722fe5194c853f62c321f8ca8 | 1,122 | py | Python | tests/test_operator.py | cariad/smokestack | c1f75e1708368e5a9cd8357025b8c20352158ae7 | [
"MIT"
] | null | null | null | tests/test_operator.py | cariad/smokestack | c1f75e1708368e5a9cd8357025b8c20352158ae7 | [
"MIT"
] | 12 | 2021-10-12T08:32:50.000Z | 2021-12-26T09:43:56.000Z | tests/test_operator.py | cariad/smokestack | c1f75e1708368e5a9cd8357025b8c20352158ae7 | [
"MIT"
] | null | null | null | from logging import getLogger
getLogger("smokestack").setLevel("DEBUG")
| 21.169811 | 75 | 0.684492 | from logging import getLogger
from mock import ANY, Mock
from mock.mock import patch
from smokestack.operator import Operator
from smokestack.types import Operation, OperationResult
from tests.mocks import NoNeedsStack
getLogger("smokestack").setLevel("DEBUG")
def test_run() -> None:
operation = Operation(exec... | 0 | 0 | 0 | 0 | 0 | 834 | 0 | 79 | 135 |
f247532acd05bea155eb751ea21b0c1d5ed27839 | 12,642 | py | Python | src/mrprocess/model.py | zhengp0/mrprocess | 7f3dc977f003ed1a24c22d82e932f7106f169441 | [
"BSD-2-Clause"
] | null | null | null | src/mrprocess/model.py | zhengp0/mrprocess | 7f3dc977f003ed1a24c22d82e932f7106f169441 | [
"BSD-2-Clause"
] | null | null | null | src/mrprocess/model.py | zhengp0/mrprocess | 7f3dc977f003ed1a24c22d82e932f7106f169441 | [
"BSD-2-Clause"
] | null | null | null | """
Model of the process, currently includes
- signal model
- linear model
"""
| 40.389776 | 112 | 0.624268 | """
Model of the process, currently includes
- signal model
- linear model
"""
import os
from typing import List, Tuple, Union
from dataclasses import dataclass
from pathlib import Path
import dill
import numpy as np
import matplotlib.pyplot as plt
from .utils import read_csv, read_yaml
from mrtool import MRData, Linea... | 0 | 553 | 0 | 11,401 | 0 | 180 | 0 | 113 | 312 |
92f271048d1554802eaf33667830fdf005ef2738 | 204 | py | Python | zeropush/apps.py | theskumar/django-zeropush | 0970b037e4a8b2af9d325381951c0b72eccf1aeb | [
"BSD-3-Clause"
] | 1 | 2015-04-30T19:53:56.000Z | 2015-04-30T19:53:56.000Z | zeropush/apps.py | theskumar/django-zeropush | 0970b037e4a8b2af9d325381951c0b72eccf1aeb | [
"BSD-3-Clause"
] | 1 | 2015-05-11T13:32:06.000Z | 2015-05-11T13:32:06.000Z | zeropush/apps.py | theskumar/django-zeropush-reflux | 0970b037e4a8b2af9d325381951c0b72eccf1aeb | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Third Party Stuff
| 15.692308 | 35 | 0.651961 | # -*- coding: utf-8 -*-
# Third Party Stuff
from django.apps import AppConfig
class ZeroPushAppConfig(AppConfig):
name = "zeropush"
verbose_name = "ZeroPush"
def ready(self):
pass
| 0 | 0 | 0 | 101 | 0 | 0 | 0 | 12 | 45 |
766dc83cd9d5229e8ca70c40a8aa743cf8aec5c2 | 461 | py | Python | week5/lecture9/exercise3.py | nobodysshadow/edX_MITx_6.00.1x | d2e5ab0bd9951153ddc5fa09f01425c54854178e | [
"MIT"
] | null | null | null | week5/lecture9/exercise3.py | nobodysshadow/edX_MITx_6.00.1x | d2e5ab0bd9951153ddc5fa09f01425c54854178e | [
"MIT"
] | null | null | null | week5/lecture9/exercise3.py | nobodysshadow/edX_MITx_6.00.1x | d2e5ab0bd9951153ddc5fa09f01425c54854178e | [
"MIT"
] | null | null | null |
X = 7
Y = 8
# w1 = Weird(X, Y)
# print(w1.getX())
# print(w1.getY())
w2 = Wild(X, Y)
print(w2.getX())
print(w2.getY())
| 16.464286 | 30 | 0.507592 | class Weird(object):
def __init__(self, x, y):
self.y = y
self.x = x
def getX(self):
return x
def getY(self):
return y
class Wild(object):
def __init__(self, x, y):
self.y = y
self.x = x
def getX(self):
return self.x
def getY(self):
... | 0 | 0 | 0 | 295 | 0 | 0 | 0 | 0 | 45 |
b4101521f70e4d800579b30572cdd4ae34c341a5 | 2,077 | py | Python | Solutions/problem61.py | WalrusCow/euler | b5bfa67c87c7043f521cde32e7212c0fffdbacd9 | [
"MIT"
] | null | null | null | Solutions/problem61.py | WalrusCow/euler | b5bfa67c87c7043f521cde32e7212c0fffdbacd9 | [
"MIT"
] | null | null | null | Solutions/problem61.py | WalrusCow/euler | b5bfa67c87c7043f521cde32e7212c0fffdbacd9 | [
"MIT"
] | null | null | null | from collections import defaultdict
if __name__ == '__main__':
poly_funs = [triangle, square, pentagon, hexagon, heptagon, octagon]
poly_values = defaultdict(lambda: defaultdict(set))
for poly_num, poly_fun in enumerate(poly_funs, start=3):
for n in range(1, 10000):
val = poly_... | 27.693333 | 75 | 0.569571 | from collections import defaultdict
def triangle(n):
return int((n * (n + 1)) / 2)
def square(n):
return n * n
def pentagon(n):
return int((n * (3 * n - 1)) / 2)
def hexagon(n):
return n * (2 * n - 1)
def heptagon(n):
return int((n * (5 * n - 3)) / 2)
def octagon(n):
return n * (3 * ... | 0 | 0 | 0 | 0 | 0 | 1,021 | 0 | 0 | 184 |
e6c6c5ab15fba7db8b39c3f2009ab4448ca46d00 | 6,911 | py | Python | sentiment2.py | jammmo/OptimusPrime | 06712d55b6bb284d646f7af56b1a2fa9575d8cc9 | [
"MIT"
] | 1 | 2019-01-19T02:06:33.000Z | 2019-01-19T02:06:33.000Z | sentiment2.py | jammmo/OptimusPrime | 06712d55b6bb284d646f7af56b1a2fa9575d8cc9 | [
"MIT"
] | null | null | null | sentiment2.py | jammmo/OptimusPrime | 06712d55b6bb284d646f7af56b1a2fa9575d8cc9 | [
"MIT"
] | null | null | null | # coding: utf-8
# 1. determine if sentence is negative (d)
# - use POS Tagging for each word
# - get POS tag
# - check the negative sentiment score based off the pos
# - return the relevant words to be cross referenced in the database
# 2. find relevant quotes
# - find quotes that are simil... | 28.557851 | 84 | 0.552742 | # coding: utf-8
# 1. determine if sentence is negative (d)
# - use POS Tagging for each word
# - get POS tag
# - check the negative sentiment score based off the pos
# - return the relevant words to be cross referenced in the database
# 2. find relevant quotes
# - find quotes that are simil... | 0 | 0 | 0 | 0 | 0 | 1,915 | 0 | 1 | 117 |
101efbfc999a82bc83529b3e37a43285bd511176 | 1,294 | py | Python | vscode/test-projects/python/app.py | gifhuppp/codestream | 02cebeb7122b50817baf066db36faee830c7a18f | [
"Apache-2.0"
] | null | null | null | vscode/test-projects/python/app.py | gifhuppp/codestream | 02cebeb7122b50817baf066db36faee830c7a18f | [
"Apache-2.0"
] | 19 | 2022-01-26T23:33:48.000Z | 2022-03-30T05:52:03.000Z | vscode/test-projects/python/app.py | gifhuppp/codestream | 02cebeb7122b50817baf066db36faee830c7a18f | [
"Apache-2.0"
] | null | null | null | from flask import Flask
app = Flask(__name__)
con = None
| 18.753623 | 77 | 0.660742 | import requests
from flask import Flask
from newrelic.agent import FunctionTraceWrapper, function_trace
from . import db
app = Flask(__name__)
con = None
class MyClass(object):
@function_trace()
def my_method(self):
return 1
@app.route("/")
def hello_world():
call_me() # Maybe
MyClass().m... | 0 | 794 | 0 | 1 | 0 | 101 | 0 | 31 | 300 |
810eb0d6563f4282c1c7ee681f3f9963229bb8a6 | 5,166 | py | Python | src/waresys-reader-rfid/reader_rfid/__main__.py | kohlicekjan/waresys | 22c842a953c0712ead540265a77327aff13bb1f7 | [
"BSD-3-Clause"
] | 7 | 2019-12-06T15:32:50.000Z | 2021-03-07T09:11:33.000Z | src/waresys-reader-rfid/reader_rfid/__main__.py | RaminMammadzada/waresys | 22c842a953c0712ead540265a77327aff13bb1f7 | [
"BSD-3-Clause"
] | 1 | 2019-03-14T21:34:11.000Z | 2020-12-31T13:03:59.000Z | src/waresys-reader-rfid/reader_rfid/__main__.py | kohlicekjan/BPINI | 22c842a953c0712ead540265a77327aff13bb1f7 | [
"BSD-3-Clause"
] | 3 | 2020-02-14T13:24:04.000Z | 2020-10-26T07:41:28.000Z | import logging
import json
# from threading import Thread
import led_rgb
def message_led(client, userdata, msg):
""" zpracovv zprvy na tma /led """
data = json.loads(msg.payload.decode("utf-8"))
try:
# kontrola formatu zprvy
if set(("color", "blink")).issubset(data):
color =... | 26.90625 | 87 | 0.587108 | import argparse
import logging
import json
import time
import sys
# from threading import Thread
import paho.mqtt.client as mqtt
import rc522
import led_rgb
import utils
from __init__ import (
__version__,
APP_NAME,
HOST,
PORT,
LED_PINS,
MQTT_TOPIC,
LOG_FILE,
LOG_FORMAT,
)
def messag... | 60 | 0 | 0 | 0 | 0 | 3,869 | 0 | 79 | 293 |
2afb0a4e4a66cd2bba965b40a736e5e2dccb28e5 | 6,560 | py | Python | Filters/Modeling/Testing/Python/TestCookieCutter4.py | LongerVisionUSA/VTK | 1170774b6611c71b95c28bb821d51c2c18ff091f | [
"BSD-3-Clause"
] | 1 | 2019-05-31T14:00:53.000Z | 2019-05-31T14:00:53.000Z | Filters/Modeling/Testing/Python/TestCookieCutter4.py | LongerVisionUSA/VTK | 1170774b6611c71b95c28bb821d51c2c18ff091f | [
"BSD-3-Clause"
] | null | null | null | Filters/Modeling/Testing/Python/TestCookieCutter4.py | LongerVisionUSA/VTK | 1170774b6611c71b95c28bb821d51c2c18ff091f | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import vtk
# Test the processing of point and cell data with vtkCookieCutter
#
# Control the size of the test
res = 101
cylRes = 20
# Control the coloring of the data
coloring = 1
# The orientation of the plane
normal = [0.1,1,0.8]
# Create a pipeline that cuts a volume to create a plane. Thi... | 27.563025 | 77 | 0.798171 | #!/usr/bin/env python
import vtk
# Test the processing of point and cell data with vtkCookieCutter
#
# Control the size of the test
res = 101
cylRes = 20
# Control the coloring of the data
coloring = 1
# The orientation of the plane
normal = [0.1,1,0.8]
# Create a pipeline that cuts a volume to create a plane. Thi... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b84d657bc9c5e4993251ee1cdd8d7e21a2167054 | 27 | py | Python | lib/db/__init__.py | NileshS236/discord.py-bot | 93cab655d135409d78f4e68910fe8d8a1cdac0d0 | [
"MIT"
] | null | null | null | lib/db/__init__.py | NileshS236/discord.py-bot | 93cab655d135409d78f4e68910fe8d8a1cdac0d0 | [
"MIT"
] | null | null | null | lib/db/__init__.py | NileshS236/discord.py-bot | 93cab655d135409d78f4e68910fe8d8a1cdac0d0 | [
"MIT"
] | null | null | null | from . import db
db.build() | 13.5 | 16 | 0.703704 | from . import db
db.build() | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
25e7520bb30f15c6e36831c69b9cf79e8cecba5b | 11,125 | py | Python | march_madness/source/add_info.py | lucabasa/kaggle_competitions | 15296375dc303218093aa576533fb809a4540bb8 | [
"Apache-2.0"
] | 1 | 2021-01-31T19:33:30.000Z | 2021-01-31T19:33:30.000Z | march_madness/source/add_info.py | lucabasa/kaggle_competitions | 15296375dc303218093aa576533fb809a4540bb8 | [
"Apache-2.0"
] | 4 | 2021-08-23T21:00:16.000Z | 2021-08-23T21:07:45.000Z | march_madness/source/add_info.py | lucabasa/kaggle_competitions | 15296375dc303218093aa576533fb809a4540bb8 | [
"Apache-2.0"
] | null | null | null | __author__ = 'lucabasa'
__version__ = '1.0.0'
__status__ = 'development'
import pandas as pd
import numpy as np
import statsmodels.api as sm
def big_wins(data, rank_loc=None):
'''
If Rank is available, use it to display a win against a top team or an upset
Either way, add win in overtime and away from... | 40.162455 | 113 | 0.571146 | __author__ = 'lucabasa'
__version__ = '1.0.0'
__status__ = 'development'
import pandas as pd
import numpy as np
import statsmodels.api as sm
def big_wins(data, rank_loc=None):
'''
If Rank is available, use it to display a win against a top team or an upset
Either way, add win in overtime and away from... | 0 | 0 | 0 | 0 | 0 | 426 | 0 | 0 | 23 |
e6eb7b75e532052ce99e25d15505c103a3e120bf | 1,344 | py | Python | src/my_package/factory.py | ShiNik/wiki_ml | 3d4aed486f405aff6aae6066fddb213866ca8cfc | [
"MIT"
] | 1 | 2021-03-18T17:16:48.000Z | 2021-03-18T17:16:48.000Z | src/my_package/factory.py | ShiNik/wiki_ml | 3d4aed486f405aff6aae6066fddb213866ca8cfc | [
"MIT"
] | 3 | 2020-02-03T03:10:39.000Z | 2020-02-03T04:01:03.000Z | src/my_package/factory.py | ShiNik/wiki_ml | 3d4aed486f405aff6aae6066fddb213866ca8cfc | [
"MIT"
] | null | null | null | # user define imports
| 40.727273 | 119 | 0.667411 | # user define imports
from my_package import parser as prs
class ParserGenerator:
def __init__(self, parser_types_to_generate):
if not isinstance(parser_types_to_generate, list):
raise AssertionError("parser_types_to_generate should be provided as a list")
if len(parser_types_t... | 0 | 0 | 0 | 1,256 | 0 | 0 | 0 | 15 | 48 |
496b68d0dcba0257914a31cec971e2aaa044afa0 | 6,632 | py | Python | poet/publisher.py | sdispater/poet | 5a07ee95e546ab6460bde43bf59837120e17dfa5 | [
"MIT"
] | 367 | 2017-04-01T15:10:04.000Z | 2021-12-23T18:26:03.000Z | poet/publisher.py | sdispater/poet | 5a07ee95e546ab6460bde43bf59837120e17dfa5 | [
"MIT"
] | 22 | 2017-04-13T15:39:02.000Z | 2017-10-05T14:55:26.000Z | poet/publisher.py | sdispater/poet | 5a07ee95e546ab6460bde43bf59837120e17dfa5 | [
"MIT"
] | 16 | 2017-04-14T08:19:48.000Z | 2019-07-21T13:34:12.000Z | # -*- coding: utf-8 -*-
| 33.326633 | 95 | 0.574487 | # -*- coding: utf-8 -*-
import os
import twine.utils
from twine.commands.upload import find_dists, skip_upload
from twine.repository import Repository as BaseRepository
from twine.exceptions import PackageNotFound, RedirectDetected
from twine.package import PackageFile
from requests_toolbelt.multipart import (
Mu... | 0 | 0 | 0 | 6,222 | 0 | 0 | 0 | 182 | 202 |
bdee6bc2998be60b2ee47915d7ad4d99edd96415 | 112 | py | Python | config.py | ngoquanghuy99/Sentiment-classificatioin-of-Amazon-fine-food-reviews | 028603f498f6d77242c0b0f6f05ebd395b139e68 | [
"MIT"
] | 15 | 2020-10-28T00:33:49.000Z | 2022-02-01T12:26:22.000Z | config.py | ngoquanghuy99/Sentiment-classificatioin-of-Amazon-fine-food-reviews | 028603f498f6d77242c0b0f6f05ebd395b139e68 | [
"MIT"
] | null | null | null | config.py | ngoquanghuy99/Sentiment-classificatioin-of-Amazon-fine-food-reviews | 028603f498f6d77242c0b0f6f05ebd395b139e68 | [
"MIT"
] | 1 | 2021-03-06T04:01:02.000Z | 2021-03-06T04:01:02.000Z | top_words = 50000
embedding_dim = 100
max_length = 150
trunc_type = 'post'
padd_type = 'post'
oov_tok = '<OOV>'
| 16 | 19 | 0.714286 | top_words = 50000
embedding_dim = 100
max_length = 150
trunc_type = 'post'
padd_type = 'post'
oov_tok = '<OOV>'
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0ba178c11c0f474d4f1a50c2a2930dd105c0d220 | 739 | py | Python | pyeit/mesh/plot/simconv.py | haribalankumar/pyEIT | cd559873085218487435957bbf9df9c72b4edcb3 | [
"BSD-3-Clause"
] | 16 | 2018-03-29T18:55:43.000Z | 2021-11-05T04:37:31.000Z | pyeit/mesh/plot/simconv.py | FKShi/pyEIT | 82443e064df54cea1c7959fa70f56b4ed35c10a3 | [
"BSD-3-Clause"
] | 1 | 2019-07-01T09:15:12.000Z | 2019-07-01T09:15:12.000Z | pyeit/mesh/plot/simconv.py | FKShi/pyEIT | 82443e064df54cea1c7959fa70f56b4ed35c10a3 | [
"BSD-3-Clause"
] | 11 | 2018-10-07T20:31:48.000Z | 2021-05-12T10:17:17.000Z | # -*- coding: utf-8 -*-
# pylint: disable=no-member, invalid-name
""" common function for simplex """
from itertools import combinations
import numpy as np
def sim_conv(simplex, n=3):
""" simplex to any dimension """
v = [list(combinations(sim, n)) for sim in simplex]
# change to (num_of_points x n)
... | 27.37037 | 69 | 0.664411 | # -*- coding: utf-8 -*-
# pylint: disable=no-member, invalid-name
""" common function for simplex """
from itertools import combinations
import numpy as np
def sim_conv(simplex, n=3):
""" simplex to any dimension """
v = [list(combinations(sim, n)) for sim in simplex]
# change to (num_of_points x n)
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
14ebd3e75a9664221c024d1d3a255770b257af3d | 1,611 | py | Python | Greyatom-Project/code.py | uprateek77/greyatom-python-for-data-science | 3dc9a224d5556e8e6562d4ad95ac8a22eb67a081 | [
"MIT"
] | null | null | null | Greyatom-Project/code.py | uprateek77/greyatom-python-for-data-science | 3dc9a224d5556e8e6562d4ad95ac8a22eb67a081 | [
"MIT"
] | null | null | null | Greyatom-Project/code.py | uprateek77/greyatom-python-for-data-science | 3dc9a224d5556e8e6562d4ad95ac8a22eb67a081 | [
"MIT"
] | null | null | null | # --------------
# Importing header files
import numpy as np
import warnings
warnings.filterwarnings('ignore')
#New record
new_record=[[50, 9, 4, 1, 0, 0, 40, 0]]
#Reading file
data = np.genfromtxt(path, delimiter=",", skip_header=1)
#Code starts here
#Step:1
census = np.concatenate([data,new_re... | 21.197368 | 58 | 0.672874 | # --------------
# Importing header files
import numpy as np
import warnings
warnings.filterwarnings('ignore')
#New record
new_record=[[50, 9, 4, 1, 0, 0, 40, 0]]
#Reading file
data = np.genfromtxt(path, delimiter=",", skip_header=1)
#Code starts here
#Step:1
census = np.concatenate([data,new_re... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4cd01e5be74a8b6f576962da343d7b76930159af | 4,222 | py | Python | leetcode_python/String/multiply-strings.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | 18 | 2019-08-01T07:45:02.000Z | 2022-03-31T18:05:44.000Z | leetcode_python/String/multiply-strings.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | null | null | null | leetcode_python/String/multiply-strings.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | 15 | 2019-12-29T08:46:20.000Z | 2022-03-08T14:14:05.000Z | # V0
# V0'
# AGAIN
# class Solution(object):
# def multiply(self, num1, num2):
# """
# :type num1: str
# :type num2: str
# :rtype: str
# """
# num1, num2 = num1[::-1], num2[::-1]
# res = [0] * (len(num1) + len(num2))
# for i in range(len(num1)):
# ... | 26.3875 | 79 | 0.451919 | # V0
class Solution(object):
def multiply(self, num1, num2):
"""
:type num1: str
:type num2: str
:rtype: str
"""
if num1 == '0' or num2 == '0':
return '0'
ans = 0
for i, n1 in enumerate(num2[::-1]):
plus = 0
curr = 0... | 0 | 0 | 0 | 2,714 | 0 | 0 | 0 | 0 | 132 |
0acfe3690f6d778c5da24fe1313cea092c7975dc | 4,957 | py | Python | models/object_detection/model_templates/vehicle-detection/vehicle-detection-0200/model.py | dqawami/openvino_training_extensions | dddda1dfd651eaae2d59cecda84275b1b03bd0ad | [
"Apache-2.0"
] | 256 | 2020-09-09T03:27:57.000Z | 2022-03-30T10:06:06.000Z | models/object_detection/model_templates/vehicle-detection/vehicle-detection-0200/model.py | dqawami/openvino_training_extensions | dddda1dfd651eaae2d59cecda84275b1b03bd0ad | [
"Apache-2.0"
] | 604 | 2020-09-08T12:29:49.000Z | 2022-03-31T21:51:08.000Z | models/object_detection/model_templates/vehicle-detection/vehicle-detection-0200/model.py | dqawami/openvino_training_extensions | dddda1dfd651eaae2d59cecda84275b1b03bd0ad | [
"Apache-2.0"
] | 160 | 2020-09-09T14:06:07.000Z | 2022-03-30T14:50:48.000Z | # model settings
input_size = 256
image_width, image_height = input_size, input_size
width_mult = 1.0
model = dict(
type='SingleStageDetector',
backbone=dict(
type='mobilenetv2_w1',
out_indices=(4, 5),
frozen_stages=-1,
norm_eval=False,
pretrained=True
),
neck=Non... | 30.78882 | 99 | 0.589066 | # model settings
input_size = 256
image_width, image_height = input_size, input_size
width_mult = 1.0
model = dict(
type='SingleStageDetector',
backbone=dict(
type='mobilenetv2_w1',
out_indices=(4, 5),
frozen_stages=-1,
norm_eval=False,
pretrained=True
),
neck=Non... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2b6255a2dc2945175f73bc1929e1aa3538da1e9b | 490 | py | Python | Chapter14/netconf/config_cisco_int_desc.py | MichaelRW/Python-for-Geeks | a111f61f1a0b077fc0524431e1ccefd9214d5c53 | [
"MIT"
] | 31 | 2020-08-10T22:37:41.000Z | 2022-03-09T21:35:56.000Z | Chapter14/netconf/config_cisco_int_desc.py | MichaelRW/Python-for-Geeks | a111f61f1a0b077fc0524431e1ccefd9214d5c53 | [
"MIT"
] | null | null | null | Chapter14/netconf/config_cisco_int_desc.py | MichaelRW/Python-for-Geeks | a111f61f1a0b077fc0524431e1ccefd9214d5c53 | [
"MIT"
] | 21 | 2020-08-10T22:37:44.000Z | 2022-03-07T07:26:28.000Z | from ncclient import manager
nc_template = open("config-template.xml").read()
nc_payload = nc_template.\
format(int_name='Loopback0',
int_desc="Configured by NETCONF")
with manager.connect(host='172.16.2.34', username='root',
password='xxxx', hostkey_... | 32.666667 | 71 | 0.644898 | from ncclient import manager
nc_template = open("config-template.xml").read()
nc_payload = nc_template.\
format(int_name='Loopback0',
int_desc="Configured by NETCONF")
with manager.connect(host='172.16.2.34', username='root',
password='xxxx', hostkey_... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
df29210711119d48d98c1364325d1468c7b62e18 | 1,333 | py | Python | tsn/model/backbones/mobilenet.py | ZJCV/TSM | 179c0f323ef2f9888fa5580d72db0df75293087b | [
"Apache-2.0"
] | 13 | 2020-11-07T08:53:49.000Z | 2021-12-29T02:48:20.000Z | tsn/model/backbones/mobilenet.py | ZJCV/TSM | 179c0f323ef2f9888fa5580d72db0df75293087b | [
"Apache-2.0"
] | 1 | 2020-11-07T08:57:04.000Z | 2021-03-25T11:32:52.000Z | tsn/model/backbones/mobilenet.py | ZJCV/TSM | 179c0f323ef2f9888fa5580d72db0df75293087b | [
"Apache-2.0"
] | 2 | 2021-09-24T13:26:44.000Z | 2021-11-14T13:43:32.000Z | # -*- coding: utf-8 -*-
"""
@date: 2020/11/4 4:45
@file: mobilenet.py
@author: zj
@description:
"""
import torchvision.models as models
from torchvision.models.utils import load_state_dict_from_url
from .. import registry
model_urls = {
'mobilenet_v2': 'https://download.pytorch.org/models/mobilenet_v2-b0353104... | 30.295455 | 99 | 0.684171 | # -*- coding: utf-8 -*-
"""
@date: 2020/11/4 下午4:45
@file: mobilenet.py
@author: zj
@description:
"""
import torchvision.models as models
from torchvision.models.utils import load_state_dict_from_url
from .. import registry
model_urls = {
'mobilenet_v2': 'https://download.pytorch.org/models/mobilenet_v2-b03531... | 6 | 231 | 0 | 0 | 0 | 0 | 0 | 0 | 23 |
b971d123dcfe5f79589799cfed38aab65c8511dd | 5,272 | py | Python | MedImageDataSet.py | ramesh152/SegmentationExperiment | b52dbc57759c086155e79c6621e6d25a4db0e974 | [
"Apache-2.0"
] | 2 | 2019-06-12T13:53:00.000Z | 2020-04-29T13:11:12.000Z | MedImageDataSet.py | ramesh152/SegmentationExperiment | b52dbc57759c086155e79c6621e6d25a4db0e974 | [
"Apache-2.0"
] | 1 | 2019-12-10T12:23:06.000Z | 2019-12-10T12:23:06.000Z | MedImageDataSet.py | ramesh152/SegmentationExperiment | b52dbc57759c086155e79c6621e6d25a4db0e974 | [
"Apache-2.0"
] | 1 | 2020-08-05T18:12:24.000Z | 2020-08-05T18:12:24.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# 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
#
# ... | 34.684211 | 213 | 0.652124 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# 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
#
# ... | 0 | 0 | 0 | 2,792 | 0 | 1,484 | 0 | 52 | 227 |
e5f9bac8539f1e3a86f58009175c6c2b925a429d | 159 | py | Python | Introduction/two-way-decition.py | Tijanif/hackerrankPyt | 084c5a55307a995a73d579d7d29d57a60f042acb | [
"MIT"
] | null | null | null | Introduction/two-way-decition.py | Tijanif/hackerrankPyt | 084c5a55307a995a73d579d7d29d57a60f042acb | [
"MIT"
] | null | null | null | Introduction/two-way-decition.py | Tijanif/hackerrankPyt | 084c5a55307a995a73d579d7d29d57a60f042acb | [
"MIT"
] | null | null | null | x = 4
if x > 2 :
print('Bigger than 2') #this block will be printed
else :
print('Smaller than 2') # this block will not be printed
print("All Done") | 22.714286 | 60 | 0.641509 | x = 4
if x > 2 :
print('Bigger than 2') #this block will be printed
else :
print('Smaller than 2') # this block will not be printed
print("All Done") | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c872f3a07a858ee8b0e6f7eefa26f1136c6d51a5 | 12,251 | py | Python | sim.py | lordofhyphens/cpp-pysim | ac7532ab781cffe447e7e50bd2cd3d80c619eb0e | [
"MIT"
] | null | null | null | sim.py | lordofhyphens/cpp-pysim | ac7532ab781cffe447e7e50bd2cd3d80c619eb0e | [
"MIT"
] | null | null | null | sim.py | lordofhyphens/cpp-pysim | ac7532ab781cffe447e7e50bd2cd3d80c619eb0e | [
"MIT"
] | null | null | null | # Copyright (c) 2016 Joseph Lenox
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distr... | 37.579755 | 242 | 0.570729 | # Copyright (c) 2016 Joseph Lenox
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distr... | 0 | 0 | 0 | 7,404 | 0 | 1,836 | 0 | 0 | 137 |
e8a64a7b167d38e1b25f32af12e4db083a8edc8d | 791 | py | Python | Beginner/Day4/functionsdemo2.py | vishipayyallore/LearningPython_2019 | f72d5af61ad96721442b7ebfc33518c2a879eb64 | [
"MIT"
] | null | null | null | Beginner/Day4/functionsdemo2.py | vishipayyallore/LearningPython_2019 | f72d5af61ad96721442b7ebfc33518c2a879eb64 | [
"MIT"
] | null | null | null | Beginner/Day4/functionsdemo2.py | vishipayyallore/LearningPython_2019 | f72d5af61ad96721442b7ebfc33518c2a879eb64 | [
"MIT"
] | null | null | null |
id = 100
name = 'Mohd Hafeez'
subjects = [1, 2, 3, 4]
print(f'(Outside modify_values) Id= {id}, Name= {name}, Subjects= {subjects}')
modify_values(id, name, subjects)
print(f'(Outside modify_values) Id= {id}, Name= {name}, Subjects= {subjects}')
subjects = [1, 2, 3, 4]
modify_values_v2(id, name, subjects[:]) # Se... | 24.71875 | 81 | 0.646018 |
def modify_values(id, name, subjects):
id = 102
name = 'Rajesh Agarwal'
subjects[0] = -101
print(f'(Inside modify_values) Id= {id}, Name= {name}, Subjects= {subjects}')
def modify_values_v2(id, name, subjects):
id = 102
name = 'Rajesh Agarwal'
subjects[0] = -101
print(f'(Inside modi... | 0 | 0 | 0 | 0 | 0 | 331 | 0 | 0 | 46 |
58360ac30e5cbb2d44d741dd5ffc8e6d2a32bc97 | 1,500 | py | Python | libs/ConfigManager.py | Nakou/MARVIN | b3d409c5a76621730529dbce615f4c8005d8b2a6 | [
"MIT"
] | null | null | null | libs/ConfigManager.py | Nakou/MARVIN | b3d409c5a76621730529dbce615f4c8005d8b2a6 | [
"MIT"
] | null | null | null | libs/ConfigManager.py | Nakou/MARVIN | b3d409c5a76621730529dbce615f4c8005d8b2a6 | [
"MIT"
] | null | null | null |
configparser = __import__('configparser')
confDir = "etc/"
mainConfFileName = "generalconf.ini"
config = configparser.ConfigParser()
| 33.333333 | 81 | 0.606667 | import os
from libs import NakLogger
configparser = __import__('configparser')
confDir = "etc/"
mainConfFileName = "generalconf.ini"
config = configparser.ConfigParser()
def loadConf():
if (os.path.isfile(confDir + mainConfFileName) == False):
#GenerateDefaultConf
NakLogger.warn("No confFile, gene... | 0 | 0 | 0 | 0 | 0 | 1,260 | 0 | -7 | 113 |
5bc670953ef7306dcff0a738a8a35448638eb150 | 1,305 | py | Python | setup.py | TheReaper62/GSpread-Plus | f4d15fb6a1ba038ba944d372d608b4681275f8b0 | [
"MIT"
] | null | null | null | setup.py | TheReaper62/GSpread-Plus | f4d15fb6a1ba038ba944d372d608b4681275f8b0 | [
"MIT"
] | null | null | null | setup.py | TheReaper62/GSpread-Plus | f4d15fb6a1ba038ba944d372d608b4681275f8b0 | [
"MIT"
] | null | null | null | from distutils.core import setup
setup(
name = 'GSpreadPlus',
packages = ['GSpreadPlus'],
version = '0.3.1',
license='MIT',
description = 'Specific Use Cases for Gspread Wrapper',
author = 'FishballNoodles',
author_email = 'joelkhorxw@gmail.com',
url = 'https://github.com/TheReaper62/GSp... | 46.607143 | 326 | 0.661303 | from distutils.core import setup
setup(
name = 'GSpreadPlus',
packages = ['GSpreadPlus'],
version = '0.3.1',
license='MIT',
description = 'Specific Use Cases for Gspread Wrapper',
author = 'FishballNoodles',
author_email = 'joelkhorxw@gmail.com',
url = 'https://github.com/TheReaper62/GSp... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4c25e0b8e708fccb0cac0cd9bc056d2f92b9b792 | 3,948 | py | Python | env/lib/python3.6/site-packages/django_coverage/utils/coverage_report/templates/default_module_index.py | anthowen/duplify | 846d01c1b21230937fdf0281b0cf8c0b08a8c24e | [
"MIT"
] | 23 | 2015-04-08T15:19:41.000Z | 2021-05-10T06:17:33.000Z | env/lib/python3.6/site-packages/django_coverage/utils/coverage_report/templates/default_module_index.py | anthowen/duplify | 846d01c1b21230937fdf0281b0cf8c0b08a8c24e | [
"MIT"
] | 1 | 2022-02-10T12:33:20.000Z | 2022-02-10T12:41:51.000Z | env/lib/python3.6/site-packages/django_coverage/utils/coverage_report/templates/default_module_index.py | anthowen/duplify | 846d01c1b21230937fdf0281b0cf8c0b08a8c24e | [
"MIT"
] | 16 | 2015-03-06T21:34:57.000Z | 2018-03-14T16:23:56.000Z | """
Copyright 2009 55 Minutes (http://www.55minutes.com)
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 t... | 20.040609 | 109 | 0.532675 | """
Copyright 2009 55 Minutes (http://www.55minutes.com)
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 t... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
63e7ff2a6589b7ce46c8e4907840f500468c6dab | 102 | py | Python | scrapli_scp/__init__.py | viktorkertesz/scrapli_scp | 68221c20c0a7fdb4509a3e7f01e410a4a3b65ed0 | [
"MIT"
] | null | null | null | scrapli_scp/__init__.py | viktorkertesz/scrapli_scp | 68221c20c0a7fdb4509a3e7f01e410a4a3b65ed0 | [
"MIT"
] | null | null | null | scrapli_scp/__init__.py | viktorkertesz/scrapli_scp | 68221c20c0a7fdb4509a3e7f01e410a4a3b65ed0 | [
"MIT"
] | null | null | null | """scrapli_scp"""
from scrapli_scp.factory import AsyncSrapliSCP
__all__ = (
"AsyncSrapliSCP",
)
| 14.571429 | 46 | 0.72549 | """scrapli_scp"""
from scrapli_scp.factory import AsyncSrapliSCP
__all__ = (
"AsyncSrapliSCP",
)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
337e13c0ad3956458fb5748ec18dedaa14e4ed27 | 74 | py | Python | subrepos/bdsim/rlc_experiment.py | CallumJHays/ubdsim | 1944461b95d356dc4892e154fd55228280ee52b1 | [
"MIT"
] | 1 | 2021-06-20T08:49:42.000Z | 2021-06-20T08:49:42.000Z | subrepos/bdsim/rlc_experiment.py | CallumJHays/ubdsim_realtime | 1944461b95d356dc4892e154fd55228280ee52b1 | [
"MIT"
] | null | null | null | subrepos/bdsim/rlc_experiment.py | CallumJHays/ubdsim_realtime | 1944461b95d356dc4892e154fd55228280ee52b1 | [
"MIT"
] | null | null | null | from bdsim import BDSim
bd = BDSim().blockdiagram() | 18.5 | 27 | 0.797297 | from bdsim import BDSim
import bdsim_realtime
bd = BDSim().blockdiagram() | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 22 |
f04420b07f64fafe67a77b3648ba8ede575f3849 | 595 | py | Python | interview/leetcode/symmetric_tree.py | topliceanu/learn | 6f4bb19fffb7b2baa88f047409075d5765ee6308 | [
"MIT"
] | 24 | 2016-03-21T07:53:54.000Z | 2020-06-29T12:16:36.000Z | interview/leetcode/symmetric_tree.py | topliceanu/learn | 6f4bb19fffb7b2baa88f047409075d5765ee6308 | [
"MIT"
] | 5 | 2015-09-29T17:12:36.000Z | 2020-03-26T20:51:56.000Z | interview/leetcode/symmetric_tree.py | topliceanu/learn | 6f4bb19fffb7b2baa88f047409075d5765ee6308 | [
"MIT"
] | 12 | 2016-05-24T16:48:32.000Z | 2020-10-02T12:22:09.000Z | # -*- coding: utf-8 -*-
# Source: https://leetcode.com/problems/symmetric-tree/
| 27.045455 | 55 | 0.638655 | # -*- coding: utf-8 -*-
# Source: https://leetcode.com/problems/symmetric-tree/
class TreeNode:
def __init__(self, val=0, left=None, right=None):
self.val = val
self.left = left
self.right = right
def rec_is_symmetric(node1, node2):
if node1 == None and node2 == None:
return T... | 0 | 0 | 0 | 123 | 0 | 322 | 0 | 0 | 69 |
a7d7fc02dfe240777f9be5d30e07c31e32586f78 | 2,774 | py | Python | venv/Lib/site-packages/pylint/testutils/unittest_linter.py | AnxhelaMehmetaj/is219_flask | 1e88579f14a96c9826e9452b3c7f8e6477577ef7 | [
"BSD-3-Clause"
] | null | null | null | venv/Lib/site-packages/pylint/testutils/unittest_linter.py | AnxhelaMehmetaj/is219_flask | 1e88579f14a96c9826e9452b3c7f8e6477577ef7 | [
"BSD-3-Clause"
] | null | null | null | venv/Lib/site-packages/pylint/testutils/unittest_linter.py | AnxhelaMehmetaj/is219_flask | 1e88579f14a96c9826e9452b3c7f8e6477577ef7 | [
"BSD-3-Clause"
] | null | null | null | # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE
# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt
| 31.168539 | 80 | 0.575703 | # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE
# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt
from typing import Any, Optional
from astroid import nodes
from pylint.interfaces import UNDEFIN... | 0 | 132 | 0 | 2,138 | 0 | 0 | 0 | 124 | 158 |
1177ce89b6b65624f1d2a94c0096d2fa81cce6ec | 2,626 | py | Python | data_processing/pose_extraction/extraction_processing.py | bioengstrom/master-thesis | 7343a2d20c44b4e6fb85f9d457a9ef4746f6a124 | [
"MIT"
] | null | null | null | data_processing/pose_extraction/extraction_processing.py | bioengstrom/master-thesis | 7343a2d20c44b4e6fb85f9d457a9ef4746f6a124 | [
"MIT"
] | null | null | null | data_processing/pose_extraction/extraction_processing.py | bioengstrom/master-thesis | 7343a2d20c44b4e6fb85f9d457a9ef4746f6a124 | [
"MIT"
] | null | null | null | import numpy as np
from .openpose_extraction import extract_poses # Only for testing in main function
def filter_skeleton_to_xy(skeleton):
"""
Filters the skeleton's keypoints from (x, y, c) to (x, y).
Where x, y are the 2D coordinates and c is the confidence
"""
skeleton = np.array(skeleton, ... | 28.543478 | 119 | 0.692308 | import numpy as np
import math
from .openpose_extraction import extract_poses # Only for testing in main function
from helpers.paths import OP_SAVE_PATH
from helpers import write_to_json
def save_processed_poses(poses, file_name):
json_name = OP_SAVE_PATH + "/{}.json".format(file_name)
write_to_json(poses, ... | 0 | 0 | 0 | 0 | 0 | 153 | 0 | 19 | 112 |
055b6ffd0fca9397892a520d875377fb1025ce71 | 4,472 | py | Python | nozomi/helpers.py | dEN5-tech/python-nozomi | 86b60eef52be75a325bb5fb83b48e37816f892fc | [
"MIT"
] | 8 | 2020-06-03T21:55:40.000Z | 2021-12-14T23:05:39.000Z | nozomi/helpers.py | dEN5-tech/python-nozomi | 86b60eef52be75a325bb5fb83b48e37816f892fc | [
"MIT"
] | 7 | 2019-11-07T09:01:17.000Z | 2021-06-02T00:37:45.000Z | nozomi/helpers.py | dEN5-tech/python-nozomi | 86b60eef52be75a325bb5fb83b48e37816f892fc | [
"MIT"
] | 4 | 2020-10-17T12:03:14.000Z | 2021-11-01T14:16:06.000Z | """Helper functions for creating paths and input normalization.
Primarily used by the nozomi API functions for generating the appropriate paths to files, and
ensuring that queries are made in a particular format used by the website.
If this package grows more complex, the functionality can be divided in a more manner... | 29.813333 | 99 | 0.668157 | """Helper functions for creating paths and input normalization.
Primarily used by the nozomi API functions for generating the appropriate paths to files, and
ensuring that queries are made in a particular format used by the website.
If this package grows more complex, the functionality can be divided in a more manner... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
03675535f7ac0e2da207452c93e337958bf68ba0 | 5,612 | py | Python | utils/intrinsic_dimension_estimator.py | t-aritake/ancestral_atom_learning | 1af3451058f31dfdd28289bb05e90bb2ec1d9e5d | [
"MIT"
] | null | null | null | utils/intrinsic_dimension_estimator.py | t-aritake/ancestral_atom_learning | 1af3451058f31dfdd28289bb05e90bb2ec1d9e5d | [
"MIT"
] | null | null | null | utils/intrinsic_dimension_estimator.py | t-aritake/ancestral_atom_learning | 1af3451058f31dfdd28289bb05e90bb2ec1d9e5d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import numpy
import scipy.cluster.hierarchy
#
#
#
# annotated distance
def cluster_dimension(D):
'''
Parameters
----------
D : numpy.array
1d array of pairwise distance matrix of all items
The form should be same as the returned value of scipy.spatial.d... | 30.172043 | 129 | 0.585531 | # -*- coding: utf-8 -*-
import numpy
import scipy.cluster.hierarchy
# 二分木みたいにルートから追加できないのがちょっと面倒.
# あとで見直す?
class Node(object):
''' class to construct clustering tree'''
def __init__(self):
self.data = None
self.left = None
self.right = None
self.annotated_distance = None
# 全... | 453 | 0 | 0 | 183 | 568 | 1,193 | 0 | 7 | 115 |
ebc3e70f5de949eadc4bd8f653e40b8a1732727a | 1,253 | py | Python | src/wishlist/models.py | junaidq1/greendot | cd9e7791523317d759e0f5f9cf544deff34a8c79 | [
"MIT"
] | null | null | null | src/wishlist/models.py | junaidq1/greendot | cd9e7791523317d759e0f5f9cf544deff34a8c79 | [
"MIT"
] | null | null | null | src/wishlist/models.py | junaidq1/greendot | cd9e7791523317d759e0f5f9cf544deff34a8c79 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
# Create your models here. | 29.833333 | 91 | 0.785315 | from __future__ import unicode_literals
from django.db import models
from django.conf import settings
from django.contrib.auth.models import User
from django.db.models.signals import post_save
from django.core.validators import MaxValueValidator, MinValueValidator, MinLengthValidator
# Create your models here.
class... | 0 | 0 | 0 | 894 | 0 | 0 | 0 | 135 | 156 |
11b858da15c051e26cd7edcf7e075e71247c4913 | 353 | py | Python | {{ cookiecutter.package }}/_source/cli.py | rossmacarthur/pypackage | ef25312ade624f9983d471891c8da8f1576bf573 | [
"MIT"
] | 2 | 2018-09-19T06:39:12.000Z | 2019-04-04T16:41:48.000Z | {{ cookiecutter.package }}/_source/cli.py | rossmacarthur/pypackage | ef25312ade624f9983d471891c8da8f1576bf573 | [
"MIT"
] | null | null | null | {{ cookiecutter.package }}/_source/cli.py | rossmacarthur/pypackage | ef25312ade624f9983d471891c8da8f1576bf573 | [
"MIT"
] | null | null | null | """
Console script for {{ cookiecutter.name }}.
"""
| 16.045455 | 60 | 0.575071 | """
Console script for {{ cookiecutter.name }}.
"""
import click
@click.group(
context_settings={'help_option_names': ['-h', '--help']}
)
@click.version_option(
None,
'-v', '--version',
prog_name='{{ cookiecutter.package }}',
message='%(prog)s %(version)s'
)
def cli():
"""
{{ cookiecutter... | 0 | 263 | 0 | 0 | 0 | 0 | 0 | -9 | 46 |
bd7beba31a2a6a6de3d163ed62494568e18e12a5 | 620 | py | Python | C/views.py | subhrangshu/django-backend-demo | 43ac5dbe1566e95eaf0fa5f5562b88bfb3036820 | [
"Apache-2.0"
] | null | null | null | C/views.py | subhrangshu/django-backend-demo | 43ac5dbe1566e95eaf0fa5f5562b88bfb3036820 | [
"Apache-2.0"
] | null | null | null | C/views.py | subhrangshu/django-backend-demo | 43ac5dbe1566e95eaf0fa5f5562b88bfb3036820 | [
"Apache-2.0"
] | 1 | 2020-11-24T08:47:37.000Z | 2020-11-24T08:47:37.000Z |
# Create your views here. | 25.833333 | 117 | 0.646774 | from django.http import HttpResponse
from django.shortcuts import render
# Create your views here.
from C.models import C_Database_Model_ORM_Schema
import json
def ViewsC(request):
#Access models from here
data = list(C_Database_Model_ORM_Schema.objects.filter(id=1).values(
"test1",
"test2",
... | 0 | 0 | 0 | 0 | 0 | 437 | 0 | 46 | 111 |
3b74da489fd63f8282977606c72327f56d87cdfe | 6,689 | py | Python | im2mesh/config.py | taconite/PTF | a8789c9f752aea2944c2a75e04cc2aa21c7e4a00 | [
"MIT"
] | 62 | 2021-04-13T18:58:22.000Z | 2022-03-30T02:45:50.000Z | im2mesh/config.py | taconite/PTF | a8789c9f752aea2944c2a75e04cc2aa21c7e4a00 | [
"MIT"
] | 9 | 2021-06-05T06:26:39.000Z | 2022-03-19T12:39:18.000Z | im2mesh/config.py | taconite/PTF | a8789c9f752aea2944c2a75e04cc2aa21c7e4a00 | [
"MIT"
] | 5 | 2021-06-03T04:26:50.000Z | 2022-01-27T11:28:06.000Z | import yaml
from im2mesh import data
from im2mesh import ptf
method_dict = {
'ptf': ptf,
}
# General config
def load_config(path, default_path=None):
''' Loads config file.
Args:
path (str): path to config file
default_path (bool): whether to use default path
'''
# Load configurat... | 33.113861 | 99 | 0.636717 | import yaml
from im2mesh import data
from im2mesh import ptf
method_dict = {
'ptf': ptf,
}
# General config
def load_config(path, default_path=None):
''' Loads config file.
Args:
path (str): path to config file
default_path (bool): whether to use default path
'''
# Load configurat... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e7e5c98913dc8cbaddb166556431d8fb0b9a771b | 1,170 | py | Python | finance/urls.py | jrmanrique/ekalay-finance | edd1787e05e2f1af73e52bbfc85af15d3e542331 | [
"MIT"
] | null | null | null | finance/urls.py | jrmanrique/ekalay-finance | edd1787e05e2f1af73e52bbfc85af15d3e542331 | [
"MIT"
] | null | null | null | finance/urls.py | jrmanrique/ekalay-finance | edd1787e05e2f1af73e52bbfc85af15d3e542331 | [
"MIT"
] | null | null | null | from django.conf.urls import url
from . import views
urlpatterns = [
# /finance/
url(r'^$', views.index, name='index'),
url(r'^view/$', views.index, name='view'),
url(r'^add/$', views.FlowAdd.as_view(), name='add'),
url(r'^statement/$', views.statement, name='statement'),
# /finance/inflows/
... | 41.785714 | 112 | 0.605983 | from django.conf.urls import url
from . import views
urlpatterns = [
# /finance/
url(r'^$', views.index, name='index'),
url(r'^view/$', views.index, name='view'),
url(r'^add/$', views.FlowAdd.as_view(), name='add'),
url(r'^statement/$', views.statement, name='statement'),
# /finance/inflows/
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d281d0ad946b9b443b80867e81d2f5a2ab80b35f | 6,401 | py | Python | cpc/mixout.py | HugoLaurencon/CPC_audio | c5b09981d0aa883fd507b8fe5593f66491322fa0 | [
"MIT"
] | null | null | null | cpc/mixout.py | HugoLaurencon/CPC_audio | c5b09981d0aa883fd507b8fe5593f66491322fa0 | [
"MIT"
] | null | null | null | cpc/mixout.py | HugoLaurencon/CPC_audio | c5b09981d0aa883fd507b8fe5593f66491322fa0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
Example of a generic Mixout implementation. (Lee et al., 2019).
https://arxiv.org/abs/1909.11299
Implementation by Stephen Roller (https://stephenroller.com).
Updated 2020-02-10 to include 1/(1 - p) correction term. Thanks to
Cheolhyoung Lee for making this correction.
Example output:
$ pyth... | 33.689474 | 122 | 0.619591 | #!/usr/bin/env python3
"""
Example of a generic Mixout implementation. (Lee et al., 2019).
https://arxiv.org/abs/1909.11299
Implementation by Stephen Roller (https://stephenroller.com).
Updated 2020-02-10 to include 1/(1 - p) correction term. Thanks to
Cheolhyoung Lee for making this correction.
Example output:
$ pyth... | 0 | 0 | 0 | 0 | 0 | 2,586 | 0 | 14 | 199 |
a654d8abf3acadbac4a396d16a420cd81db77e79 | 1,988 | py | Python | app/pipelines/load_data/load_ecommerce_data/__init__.py | mediaimprove/mara-example-project-1 | d1cab4cf079e78a4c0f73edac73200fac4112f34 | [
"MIT"
] | 22 | 2020-10-07T21:32:07.000Z | 2022-03-21T19:21:36.000Z | app/pipelines/load_data/load_ecommerce_data/__init__.py | mediaimprove/mara-example-project-1 | d1cab4cf079e78a4c0f73edac73200fac4112f34 | [
"MIT"
] | 4 | 2020-07-16T15:22:46.000Z | 2020-10-28T15:18:32.000Z | app/pipelines/load_data/load_ecommerce_data/__init__.py | mediaimprove/mara-example-project-1 | d1cab4cf079e78a4c0f73edac73200fac4112f34 | [
"MIT"
] | 4 | 2020-10-08T10:30:04.000Z | 2022-03-19T09:21:51.000Z | import pathlib
from mara_pipelines.commands.sql import ExecuteSQL, Copy
from mara_pipelines.pipelines import Pipeline, Task
pipeline = Pipeline(
id="load_ecommerce_data",
description="Jobs related with loading e-commerce data from the backend database",
max_number_of_parallel_tasks=5,
base_path=pathli... | 33.694915 | 108 | 0.610161 | import pathlib
from mara_pipelines.commands.sql import ExecuteSQL, Copy
from mara_pipelines.pipelines import Pipeline, Task
pipeline = Pipeline(
id="load_ecommerce_data",
description="Jobs related with loading e-commerce data from the backend database",
max_number_of_parallel_tasks=5,
base_path=pathli... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
be745d5d89aa40ead6c7f01eba00b9b58642342f | 152 | py | Python | src/asyncio_/basic_async_to_sync.py | janaSunrise/useful-python-snippets | f03285b8f0b44f87326ca982129dab80a18697f5 | [
"Apache-2.0"
] | 1 | 2021-03-15T16:48:05.000Z | 2021-03-15T16:48:05.000Z | src/asyncio_/basic_async_to_sync.py | janaSunrise/useful-python-snippets | f03285b8f0b44f87326ca982129dab80a18697f5 | [
"Apache-2.0"
] | null | null | null | src/asyncio_/basic_async_to_sync.py | janaSunrise/useful-python-snippets | f03285b8f0b44f87326ca982129dab80a18697f5 | [
"Apache-2.0"
] | null | null | null | import asyncio
# Running the async function as sync
asyncio.get_event_loop().run_until_complete(test())
| 15.2 | 51 | 0.730263 | import asyncio
async def test() -> str:
return "Hello"
# Running the async function as sync
asyncio.get_event_loop().run_until_complete(test())
| 0 | 0 | 22 | 0 | 0 | 0 | 0 | 0 | 23 |
c3c899d319bef47bf3adffe6c9d643f9ac8ee6e6 | 1,099 | py | Python | openre/agent/domain/action/utils.py | openre/openre | c5969df92cac83bdafd049e1c0a3bcf56b51223a | [
"MIT"
] | null | null | null | openre/agent/domain/action/utils.py | openre/openre | c5969df92cac83bdafd049e1c0a3bcf56b51223a | [
"MIT"
] | null | null | null | openre/agent/domain/action/utils.py | openre/openre | c5969df92cac83bdafd049e1c0a3bcf56b51223a | [
"MIT"
] | 1 | 2016-02-14T11:20:57.000Z | 2016-02-14T11:20:57.000Z | # -*- coding: utf-8 -*-
| 23.891304 | 78 | 0.621474 | # -*- coding: utf-8 -*-
from openre.agent.decorators import action
import time
@action(namespace='domain')
def ping(event):
return 'pong'
@action(namespace='domain')
def exception(event):
raise Exception('Test exception')
@action(namespace='domain')
def check_args(event, *args, **kwargs):
return {'args'... | 0 | 878 | 0 | 0 | 0 | 0 | 0 | 11 | 183 |
bebbd8a3615e01a0da913605569c059e17677b4c | 3,862 | py | Python | character_data.py | evanmiltenburg/Dutch-checker | 84b6f0bcf007aba09ea69e7ef26ec0a697bf9fc5 | [
"Apache-2.0"
] | null | null | null | character_data.py | evanmiltenburg/Dutch-checker | 84b6f0bcf007aba09ea69e7ef26ec0a697bf9fc5 | [
"Apache-2.0"
] | 1 | 2017-06-27T11:41:52.000Z | 2017-06-27T14:34:23.000Z | character_data.py | evanmiltenburg/Dutch-checker | 84b6f0bcf007aba09ea69e7ef26ec0a697bf9fc5 | [
"Apache-2.0"
] | null | null | null | """
This is where the magic happens! This file has all definitions for data prep which
char_lstm.py and use_model.py can use. This file is not supposed to be run by itself,
but you can import it to make use of everything defined below.
"""
import random
import string
import numpy as np
random.seed(123456789)
TABLE = ... | 35.109091 | 96 | 0.712325 | """
This is where the magic happens! This file has all definitions for data prep which
char_lstm.py and use_model.py can use. This file is not supposed to be run by itself,
but you can import it to make use of everything defined below.
"""
import random
import string
from collections import Counter
from math import ce... | 0 | 0 | 0 | 0 | 433 | 131 | 0 | 10 | 113 |
3a0f41f9126f81a597c206a07135457efbb8cd31 | 3,321 | py | Python | src/features/build_feature_SIR.py | panwesha/eds | af7a098c2a0502db00dd01c97f46d88f66551c7d | [
"FTL"
] | null | null | null | src/features/build_feature_SIR.py | panwesha/eds | af7a098c2a0502db00dd01c97f46d88f66551c7d | [
"FTL"
] | null | null | null | src/features/build_feature_SIR.py | panwesha/eds | af7a098c2a0502db00dd01c97f46d88f66551c7d | [
"FTL"
] | null | null | null | import pandas as pd
import numpy as np
from datetime import datetime
%matplotlib inline
import matplotlib as mpl
import matplotlib.pyplot as plt
import seaborn as sns
from scipy import optimize
from scipy import integrate
mpl.rcParams['figure.figsize'] = (16, 9)
pd.set_option('display.max_rows', 500)
pd.set_option('... | 27.221311 | 124 | 0.678109 | import pandas as pd
import numpy as np
from datetime import datetime
%matplotlib inline
import matplotlib as mpl
import matplotlib.pyplot as plt
import seaborn as sns
from scipy import optimize
from scipy import integrate
mpl.rcParams['figure.figsize'] = (16, 9)
pd.set_option('display.max_rows', 500)
pd.set_option('... | 0 | 0 | 0 | 0 | 0 | 2,129 | 0 | 0 | 23 |
8259ad7e692d627bff5b944ac366f1398ba3a61a | 5,877 | py | Python | openai_ros/openai_ros/src/openai_ros/task_envs/cartpole_stay_up/stay_up.py | karim174/brain-computer-interface-and-vision-based-autonomous-agent-for-shared-control-over-robotic-arm | d099cad43bfb98261c2571991f4e163d444b62b4 | [
"MIT"
] | 2 | 2019-02-28T01:47:23.000Z | 2021-04-10T14:37:46.000Z | openai_ros/openai_ros/src/openai_ros/task_envs/cartpole_stay_up/stay_up.py | karim174/brain-computer-interface-and-vision-based-autonomous-agent-for-shared-control-over-robotic-arm | d099cad43bfb98261c2571991f4e163d444b62b4 | [
"MIT"
] | null | null | null | openai_ros/openai_ros/src/openai_ros/task_envs/cartpole_stay_up/stay_up.py | karim174/brain-computer-interface-and-vision-based-autonomous-agent-for-shared-control-over-robotic-arm | d099cad43bfb98261c2571991f4e163d444b62b4 | [
"MIT"
] | null | null | null | from gym.envs.registration import register
# The path is __init__.py of openai_ros, where we import the MovingCubeOneDiskWalkEnv directly
register(
id='CartPoleStayUp-v0',
entry_point='openai_ros:task_envs.cartpole_stay_up.stay_up.CartPoleStayUpEnv',
timestep_limit=1000,
)
| 38.664474 | 230 | 0.603029 | from gym import utils
from openai_ros.robot_envs import cartpole_env
from gym.envs.registration import register
from gym import error, spaces
import rospy
import math
import numpy as np
# The path is __init__.py of openai_ros, where we import the MovingCubeOneDiskWalkEnv directly
register(
id='CartPoleStayUp-v... | 0 | 0 | 0 | 5,408 | 0 | 0 | 0 | 11 | 155 |
eee12eca4b121670d41db77661696f70326274ce | 538,808 | py | Python | pictures_missing_4.py | darabos/pyweek-lightswitch | b02104e781b204129f50bb29882057504da264f3 | [
"Unlicense"
] | 1 | 2015-01-15T18:00:24.000Z | 2015-01-15T18:00:24.000Z | pictures_missing_4.py | darabos/pyweek-lightswitch | b02104e781b204129f50bb29882057504da264f3 | [
"Unlicense"
] | null | null | null | pictures_missing_4.py | darabos/pyweek-lightswitch | b02104e781b204129f50bb29882057504da264f3 | [
"Unlicense"
] | null | null | null | import collections
P = collections.namedtuple('P', 'time x y pressure')
# time is in milliseconds, pressure goes from 0 to 1000.
words = {
'kid': [
[P(0,237,265,90), P(27,234,264,141), P(29,230,264,172), P(31,229,264,270), P(40,227,264,298), P(54,226,264,321), P(55,224,264,345), P(63,223,264,356), P(67,221,263,38... | 2,263.89916 | 25,544 | 0.66909 | import collections
P = collections.namedtuple('P', 'time x y pressure')
# time is in milliseconds, pressure goes from 0 to 1000.
words = {
'kid': [
[P(0,237,265,90), P(27,234,264,141), P(29,230,264,172), P(31,229,264,270), P(40,227,264,298), P(54,226,264,321), P(55,224,264,345), P(63,223,264,356), P(67,221,263,38... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ab027378a15fe3ee7e84ab3fc272b52932c730f0 | 1,049 | py | Python | Gathered CTF writeups/ptr-yudai-writeups/2019/Security_Fest_2019/Halleb3rry/solve.py | mihaid-b/CyberSakura | f60e6b6bfd6898c69b84424b080090ae98f8076c | [
"MIT"
] | 1 | 2022-03-27T06:00:41.000Z | 2022-03-27T06:00:41.000Z | Gathered CTF writeups/ptr-yudai-writeups/2019/Security_Fest_2019/Halleb3rry/solve.py | mihaid-b/CyberSakura | f60e6b6bfd6898c69b84424b080090ae98f8076c | [
"MIT"
] | null | null | null | Gathered CTF writeups/ptr-yudai-writeups/2019/Security_Fest_2019/Halleb3rry/solve.py | mihaid-b/CyberSakura | f60e6b6bfd6898c69b84424b080090ae98f8076c | [
"MIT"
] | 1 | 2022-03-27T06:01:42.000Z | 2022-03-27T06:01:42.000Z |
libc = ELF("./libc.so.6")
elf = ELF("./pwn")
sock = Process("./pwn")
main_arena = 0x3ebc40
delta = 1168
# Name
sock.recvuntil("name: ")
sock.sendline("taro")
# Chunk overlap
alloc(0x18, "B" * 0x18)
delete() # push to tcache
alloc(0x28, "A" * 0x28)
delete()
alloc(0x18, "B" * 0x18)
edit(0x18, 0x01) # 0x31 --> 0x01
edi... | 20.173077 | 42 | 0.614871 | from ptrlib import *
def alloc(size, data):
sock.recvuntil("> ")
sock.sendline("1")
sock.recvuntil("size: ")
sock.sendline(str(size))
sock.recvuntil("data: ")
sock.send(data)
def edit(index, byte):
sock.recvuntil("> ")
sock.sendline("2")
sock.recvuntil("index: ")
sock.sendline(... | 0 | 0 | 0 | 0 | 0 | 469 | 0 | -1 | 114 |
ac9e0ebe952951931242a472261defdd9b43de5f | 3,754 | py | Python | grpclib_example/protobuf_out/ping_service_pb.py | eIGato/protox | bb7392176d85e7303b3216f2775eef9bff8a9ff2 | [
"MIT"
] | 5 | 2020-02-09T16:30:23.000Z | 2021-03-11T08:24:45.000Z | grpclib_example/protobuf_out/ping_service_pb.py | eIGato/protox | bb7392176d85e7303b3216f2775eef9bff8a9ff2 | [
"MIT"
] | 1 | 2021-03-11T08:36:38.000Z | 2021-03-11T08:36:38.000Z | grpclib_example/protobuf_out/ping_service_pb.py | eIGato/protox | bb7392176d85e7303b3216f2775eef9bff8a9ff2 | [
"MIT"
] | 1 | 2020-11-17T07:39:34.000Z | 2020-11-17T07:39:34.000Z | # Generated by protox. DO NOT EDIT!
# source: ping_service.proto
import protox
FILE_DESCRIPTOR = protox.FileDescriptorProto.from_bytes(b'\n\x12ping_service.proto"\'\n\x0bPingRequest\x12\x18\n\x07counter\x18\x01 \x02(\x04R\x07counter"s\n\x0cPingResponse\x12,\n\x06status\x18\x01 \x02(\x0e2\x14.PingResponse.StatusR\x... | 57.753846 | 2,147 | 0.709377 | # Generated by protox. DO NOT EDIT!
# source: ping_service.proto
from enum import IntEnum
import protox
class PingRequest(protox.Message):
counter: int
def __init__(
self,
*,
counter: int = None,
):
super().__init__(
counter=counter,
)
class PingResp... | 0 | 0 | 0 | 519 | 0 | 0 | 0 | 3 | 68 |
dd9aa90f9b9261c295afff0bef1b2de2f889f96b | 279 | py | Python | allhub/search/__init__.py | srinivasreddy/allhub | ff20858c9984da5c4edd5043c39eed3b6d5d693d | [
"Apache-2.0"
] | 2 | 2019-10-07T15:46:33.000Z | 2019-11-26T04:30:39.000Z | allhub/search/__init__.py | srinivasreddy/allhub | ff20858c9984da5c4edd5043c39eed3b6d5d693d | [
"Apache-2.0"
] | 1 | 2020-03-09T14:44:04.000Z | 2020-03-09T14:44:04.000Z | allhub/search/__init__.py | srinivasreddy/allhub | ff20858c9984da5c4edd5043c39eed3b6d5d693d | [
"Apache-2.0"
] | 2 | 2019-10-08T05:22:37.000Z | 2019-10-08T06:20:47.000Z | # flake8: NOQA
| 15.5 | 57 | 0.698925 | # flake8: NOQA
from .search import (
Order,
LabelSort,
CodeSort,
CommitSort,
IssueSort,
RepoSort,
UserSort,
SearchMixin as _SearchMixin,
)
from allhub.util import ConflictCheck
class SearchMixin(_SearchMixin, metaclass=ConflictCheck):
pass
| 0 | 0 | 0 | 45 | 0 | 0 | 0 | 150 | 68 |
add475dc379f90560c86d41aa76cca9fc3bb3f79 | 2,461 | py | Python | celery_manager/static_precompiler/management/commands/static_precompiler_watch.py | churchlab/millstone | ddb5d003a5b8a7675e5a56bafd5c432d9642b473 | [
"MIT"
] | 45 | 2015-09-30T14:55:33.000Z | 2021-06-28T02:33:30.000Z | celery_manager/static_precompiler/management/commands/static_precompiler_watch.py | churchlab/millstone | ddb5d003a5b8a7675e5a56bafd5c432d9642b473 | [
"MIT"
] | 261 | 2015-06-03T20:41:56.000Z | 2022-03-07T08:46:10.000Z | celery_manager/static_precompiler/management/commands/static_precompiler_watch.py | churchlab/millstone | ddb5d003a5b8a7675e5a56bafd5c432d9642b473 | [
"MIT"
] | 22 | 2015-06-04T20:43:10.000Z | 2022-02-27T08:27:34.000Z | # coding: utf-8
| 33.712329 | 95 | 0.600975 | # coding: utf-8
from django.core.management.base import NoArgsCommand
from static_precompiler.exceptions import StaticCompilationError
from static_precompiler.settings import STATIC_ROOT
from static_precompiler.utils import get_compilers
from watchdog.events import FileSystemEventHandler
from watchdog.observers import ... | 0 | 0 | 0 | 2,062 | 0 | 0 | 0 | 159 | 222 |
59b1ac96cc8f1d1cbc4f2aa30499ed39630bb8cd | 357 | py | Python | sandbox/src1/tutorial/nearest.py | sniemi/SamPy | e048756feca67197cf5f995afd7d75d8286e017b | [
"BSD-2-Clause"
] | 5 | 2016-05-28T14:12:28.000Z | 2021-04-22T10:23:12.000Z | sandbox/src1/tutorial/nearest.py | sniemi/SamPy | e048756feca67197cf5f995afd7d75d8286e017b | [
"BSD-2-Clause"
] | null | null | null | sandbox/src1/tutorial/nearest.py | sniemi/SamPy | e048756feca67197cf5f995afd7d75d8286e017b | [
"BSD-2-Clause"
] | 2 | 2015-07-13T10:04:10.000Z | 2021-04-22T10:23:23.000Z | x = array([1.1, 1.8, 7.3, 3.4])
y = array([2.3, 9.3, 1.5, 5.7])
deltax = x - reshape(x, len(x),1)
deltay = y - reshape(y, (len(y),1))
print deltax
dist = sqrt(deltax**2 + deltay**2)
dist = dist + identity(len(x))*dist.max() # eliminate self matching
print dist
print argmin(dist) # prints closest point corresponding ... | 22.3125 | 70 | 0.644258 | from numpy import *
x = array([1.1, 1.8, 7.3, 3.4])
y = array([2.3, 9.3, 1.5, 5.7])
deltax = x - reshape(x, len(x),1)
deltay = y - reshape(y, (len(y),1))
print deltax
dist = sqrt(deltax**2 + deltay**2)
dist = dist + identity(len(x))*dist.max() # eliminate self matching
print dist
print argmin(dist) # prints closest ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -2 | 22 |
62242b0c162c832b6a9f3355d6c0c8ea17a103e2 | 13,787 | py | Python | src/hooks/post-commit.py | jouvin/scdb | 2e367a79c2f0ece59d30fe46d0a586a6d69b72d5 | [
"Apache-2.0"
] | 1 | 2015-02-12T11:19:18.000Z | 2015-02-12T11:19:18.000Z | src/hooks/post-commit.py | jouvin/scdb | 2e367a79c2f0ece59d30fe46d0a586a6d69b72d5 | [
"Apache-2.0"
] | 12 | 2015-01-09T13:47:08.000Z | 2022-03-23T22:26:17.000Z | src/hooks/post-commit.py | jouvin/scdb | 2e367a79c2f0ece59d30fe46d0a586a6d69b72d5 | [
"Apache-2.0"
] | 4 | 2015-02-12T11:19:33.000Z | 2018-04-05T11:52:50.000Z | #!/usr/bin/python
"""
SVN POST-COMMIT HOOK
Arguments:
[1] REPOS-PATH (the path to this repository)
[2] REV (the number of the revision just committed)
This script uses pysvn API to SVN to access the SVN repository.
"""
__version__ = "1.0.3"
__author__ = "Michel Jouvin <jouvin@lal.in2p3.fr>"
import... | 36.667553 | 151 | 0.725393 | #!/usr/bin/python
"""
SVN POST-COMMIT HOOK
Arguments:
[1] REPOS-PATH (the path to this repository)
[2] REV (the number of the revision just committed)
This script uses pysvn API to SVN to access the SVN repository.
"""
__version__ = "1.0.3"
__author__ = "Michel Jouvin <jouvin@lal.in2p3.fr>"
import... | 0 | 0 | 0 | 1,239 | 0 | 174 | 0 | 3 | 90 |
58c3d5c789cb9bfd57980ee1f76f205c9e585db5 | 1,624 | py | Python | qcelemental/models/common_models.py | laurennk/QCElemental | fd6e008da0f2885109f99eb518ee165f9dd7d82e | [
"BSD-3-Clause"
] | null | null | null | qcelemental/models/common_models.py | laurennk/QCElemental | fd6e008da0f2885109f99eb518ee165f9dd7d82e | [
"BSD-3-Clause"
] | null | null | null | qcelemental/models/common_models.py | laurennk/QCElemental | fd6e008da0f2885109f99eb518ee165f9dd7d82e | [
"BSD-3-Clause"
] | null | null | null |
import numpy as np
# Encoders, to be deprecated
ndarray_encoder = {np.ndarray: lambda v: v.flatten().tolist()}
qcschema_input_default = "qcschema_input"
qcschema_output_default = "qcschema_output"
qcschema_optimization_input_default = "qcschema_optimization_input"
qcschema_optimization_output_default = "qcsche... | 24.984615 | 102 | 0.69335 | from enum import Enum
from typing import Any, Dict, Optional
import numpy as np
from .basemodels import ProtoModel
# Encoders, to be deprecated
ndarray_encoder = {np.ndarray: lambda v: v.flatten().tolist()}
class Provenance(ProtoModel):
creator: str
version: Optional[str] = None
routine: Optional[str] ... | 0 | 0 | 0 | 1,020 | 0 | 0 | 0 | 30 | 182 |
9db3522b860e9b76e8ded02c198aea981dba6075 | 2,471 | py | Python | compipe/response/command_result.py | ImagineersHub/compipe | dd14c2701717d7d0901eb1139f59e7fbfeba7517 | [
"MIT"
] | null | null | null | compipe/response/command_result.py | ImagineersHub/compipe | dd14c2701717d7d0901eb1139f59e7fbfeba7517 | [
"MIT"
] | null | null | null | compipe/response/command_result.py | ImagineersHub/compipe | dd14c2701717d7d0901eb1139f59e7fbfeba7517 | [
"MIT"
] | null | null | null | from collections import namedtuple
MSGStatus = namedtuple('MSGStatus', ['value', 'color'])
| 23.533333 | 79 | 0.650749 | import json
from collections import namedtuple
from dataclasses import dataclass
from enum import Enum
from ..utils.mime_types import GMimeTypes
MSGStatus = namedtuple('MSGStatus', ['value', 'color'])
class MSGStatusCodes(Enum):
@property
def color(self):
return self.value.color # pylint: disable=n... | 0 | 1,838 | 0 | 181 | 0 | 0 | 0 | 22 | 331 |
0cdd95f6b329757b01d482f50029ff83e1cbea60 | 308 | py | Python | diy/example.py | dvdrm/gd | c004724344577bb608fa0611d10c16b211995f72 | [
"Apache-2.0"
] | 14 | 2022-03-27T03:10:37.000Z | 2022-03-31T18:35:18.000Z | diy/example.py | dvdrm/gd | c004724344577bb608fa0611d10c16b211995f72 | [
"Apache-2.0"
] | 11 | 2022-03-27T03:37:27.000Z | 2022-03-31T17:37:47.000Z | diy/example.py | dvdrm/gd | c004724344577bb608fa0611d10c16b211995f72 | [
"Apache-2.0"
] | 21 | 2022-03-26T15:32:33.000Z | 2022-03-31T21:32:22.000Z | # telethon
# jdbot,chat_id
from .. import jdbot, chat_id
# chat_idhello
| 23.692308 | 60 | 0.766234 | # 引入库文件,基于telethon
from telethon import events
# 从上级目录引入 jdbot,chat_id变量
from .. import jdbot, chat_id
# 格式基本固定,本例子表示从chat_id处接收到包含hello消息后,要做的事情
@jdbot.on(events.NewMessage(chats=chat_id, pattern='hello'))
# 定义自己的函数名称
async def hi(event):
# do something
await jdbot.send_message(chat_id, 'hello')
| 162 | 129 | 0 | 0 | 0 | 0 | 0 | 6 | 44 |
de344c25ad1dad3b8070da5068c010752a43f7d2 | 170 | py | Python | apns2/__init__.py | ofw/apns2-client | 5b060a462ddfc2570617b94bf9c5d0a1af76a8ee | [
"MIT"
] | 7 | 2018-05-22T08:04:11.000Z | 2021-03-25T18:43:26.000Z | apns2/__init__.py | ofw/apns2-client | 5b060a462ddfc2570617b94bf9c5d0a1af76a8ee | [
"MIT"
] | null | null | null | apns2/__init__.py | ofw/apns2-client | 5b060a462ddfc2570617b94bf9c5d0a1af76a8ee | [
"MIT"
] | 2 | 2018-12-16T14:47:33.000Z | 2020-09-22T06:38:25.000Z | # coding: utf-8
| 28.333333 | 90 | 0.823529 | # coding: utf-8
from .client import APNSClient
from .response import Response
from .notification import Notification, Payload, PayloadAlert, PRIORITY_LOW, PRIORITY_HIGH
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 87 | 67 |
68bd69f06accc55abbab961034cc5880a8a04ac1 | 1,034 | py | Python | ansiblemetrics/playbook/num_imported_playbooks.py | radon-h2020/AnsibleMetrics | 8a8e27d9b54fc1578d00526c8663184a2e686cb2 | [
"Apache-2.0"
] | 1 | 2020-04-24T16:09:14.000Z | 2020-04-24T16:09:14.000Z | ansiblemetrics/playbook/num_imported_playbooks.py | radon-h2020/AnsibleMetrics | 8a8e27d9b54fc1578d00526c8663184a2e686cb2 | [
"Apache-2.0"
] | null | null | null | ansiblemetrics/playbook/num_imported_playbooks.py | radon-h2020/AnsibleMetrics | 8a8e27d9b54fc1578d00526c8663184a2e686cb2 | [
"Apache-2.0"
] | null | null | null | import ansiblemetrics.utils as utils
| 25.85 | 90 | 0.592843 | import ansiblemetrics.utils as utils
from ansiblemetrics.ansible_metric import AnsibleMetric
class NumImportedPlaybooks(AnsibleMetric):
""" This class measures the number of imported playbooks in a playbook.
"""
def count(self):
"""Return the number of imported playbooks.
Example
... | 0 | 0 | 0 | 917 | 0 | 0 | 0 | 34 | 45 |
c50f0b794882ec436da0bf8f64059f5b7908b812 | 7,459 | py | Python | CodonSubstitution/build/biopython/do2to3.py | JackCurragh/DARNED | 13963d129bd8f69fb1106ad1f47394b3211a939c | [
"MIT"
] | 1 | 2015-10-07T20:34:29.000Z | 2015-10-07T20:34:29.000Z | CodonSubstitution/build/biopython/do2to3.py | JackCurragh/DARNED | 13963d129bd8f69fb1106ad1f47394b3211a939c | [
"MIT"
] | null | null | null | CodonSubstitution/build/biopython/do2to3.py | JackCurragh/DARNED | 13963d129bd8f69fb1106ad1f47394b3211a939c | [
"MIT"
] | null | null | null | """Helper script for building and installing Biopython on Python 3.
Note that we can't just use distutils.command.build_py function build_py_2to3
in setup.py since (as far as I can see) that does not allow us to alter the
2to3 options. In particular, we need to turn off the long fixer for some of
our files.
This code... | 43.115607 | 79 | 0.602225 | """Helper script for building and installing Biopython on Python 3.
Note that we can't just use distutils.command.build_py function build_py_2to3
in setup.py since (as far as I can see) that does not allow us to alter the
2to3 options. In particular, we need to turn off the long fixer for some of
our files.
This code... | 0 | 0 | 0 | 0 | 0 | 5,821 | 0 | -20 | 170 |
9c2d14031f319c6796567ba216558319241645f3 | 919 | py | Python | 2021/11a.py | msullivan/advent-of-code | ba4b0c3e229bca0f632d51d18ad72ecddd2405da | [
"MIT"
] | 8 | 2016-12-01T19:41:50.000Z | 2021-12-21T18:50:55.000Z | 2021/11a.py | msullivan/advent-of-code | ba4b0c3e229bca0f632d51d18ad72ecddd2405da | [
"MIT"
] | null | null | null | 2021/11a.py | msullivan/advent-of-code | ba4b0c3e229bca0f632d51d18ad72ecddd2405da | [
"MIT"
] | 3 | 2018-12-23T06:58:47.000Z | 2021-12-20T10:09:15.000Z | #!/usr/bin/env python3
import sys
ADIRS = [(x,y) for x in [-1,0,1] for y in [-1,0,1] if not x == y == 0]
if __name__ == '__main__':
main(sys.argv)
| 19.553191 | 72 | 0.462459 | #!/usr/bin/env python3
import sys
def vadd(v1, v2):
return tuple(x + y for x, y in zip(v1, v2))
ADIRS = [(x,y) for x in [-1,0,1] for y in [-1,0,1] if not x == y == 0]
def step(m):
for k in list(m):
m[k] += 1
togo = [k for k, v in m.items() if v > 9]
flashes = 0
while togo:
flash... | 0 | 0 | 0 | 0 | 0 | 695 | 0 | 0 | 69 |