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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f9018d542882a2b4348b7736cc1deaa344619663 | 9,971 | py | Python | hybridbackend/tensorflow/distribute/nccl.py | fuhailin/HybridBackend | 113383c5870b7180fa67c194208a27f76bdbf3f0 | [
"Apache-2.0"
] | 38 | 2021-12-01T06:54:36.000Z | 2022-03-23T11:23:21.000Z | hybridbackend/tensorflow/distribute/nccl.py | fuhailin/HybridBackend | 113383c5870b7180fa67c194208a27f76bdbf3f0 | [
"Apache-2.0"
] | 15 | 2021-12-01T09:15:26.000Z | 2022-03-28T02:49:21.000Z | hybridbackend/tensorflow/distribute/nccl.py | fuhailin/HybridBackend | 113383c5870b7180fa67c194208a27f76bdbf3f0 | [
"Apache-2.0"
] | 8 | 2021-12-02T01:16:14.000Z | 2022-01-28T04:51:16.000Z | # Copyright 2021 Alibaba Group Holding Limited. 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 ... | 31.454259 | 79 | 0.726407 | # Copyright 2021 Alibaba Group Holding Limited. 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 | 4,833 | 0 | 3,145 | 0 | 0 | 0 | 215 | 364 |
e109bc196fb1f2d1fb3f57f50d8c167eee60e087 | 1,334 | py | Python | cielo/models.py | CharlesTenorio/strive_api | 27650f36df56d9ea3299bafa9e077f58ce68368c | [
"MIT"
] | null | null | null | cielo/models.py | CharlesTenorio/strive_api | 27650f36df56d9ea3299bafa9e077f58ce68368c | [
"MIT"
] | 7 | 2019-08-22T23:45:07.000Z | 2021-06-09T18:17:44.000Z | cielo/models.py | CharlesTenorio/strive_api | 27650f36df56d9ea3299bafa9e077f58ce68368c | [
"MIT"
] | null | null | null |
BANDEIRA_CHOICES = (
('Visa', 'Visa'),
('Master', 'Master'),
('Hipercard', 'Hipercard'),
('Hiper', 'Hiper'),
('American Express', 'American Express'),
('Elo', 'Elo'),
('Diners Club', 'Diners Club'),
('American Express', 'American Express'),
('Disc... | 40.424242 | 89 | 0.663418 | from django.db import models
BANDEIRA_CHOICES = (
('Visa', 'Visa'),
('Master', 'Master'),
('Hipercard', 'Hipercard'),
('Hiper', 'Hiper'),
('American Express', 'American Express'),
('Elo', 'Elo'),
('Diners Club', 'Diners Club'),
('American Express', 'Ameri... | 0 | 0 | 0 | 885 | 0 | 0 | 0 | 7 | 45 |
407d1646bf146f4c4bf795716d395c1a55d649fd | 1,913 | py | Python | breveIDE_windows_2.7.2_2/breveIDE_2.7.2/demos/Test/test2.py | Lamouse/Evolutionary-Creativity | 9e9a4094285241d0541e0b87a3bd2c5e4ba804d3 | [
"MIT"
] | null | null | null | breveIDE_windows_2.7.2_2/breveIDE_2.7.2/demos/Test/test2.py | Lamouse/Evolutionary-Creativity | 9e9a4094285241d0541e0b87a3bd2c5e4ba804d3 | [
"MIT"
] | null | null | null | breveIDE_windows_2.7.2_2/breveIDE_2.7.2/demos/Test/test2.py | Lamouse/Evolutionary-Creativity | 9e9a4094285241d0541e0b87a3bd2c5e4ba804d3 | [
"MIT"
] | null | null | null | import breve
breve.Test = Test
breve.CustomObject = CustomObject
breve.myCustomShape = myCustomShape
Test() | 23.9125 | 102 | 0.639833 | import breve
class Test( breve.Control ):
def __init__( self ):
breve.Control.__init__( self )
self.object = None
self.increm = 0.1
Test.init( self )
def init( self ):
self.setBackgroundColor( breve.vector( 0, 0, 0 ) )
self.setDisplayTextColor( breve.vector( 1, 1, 1 ) )
self.setIterat... | 0 | 0 | 0 | 1,711 | 0 | 0 | 0 | 0 | 75 |
a166d7c4f62757432e3b3ef641cd72b383c41da8 | 1,925 | py | Python | development/analyze_table.py | gunny26/datalogger | 7bd29ab88f2e2749284d80a6a834c94c0955a7e0 | [
"Apache-2.0"
] | null | null | null | development/analyze_table.py | gunny26/datalogger | 7bd29ab88f2e2749284d80a6a834c94c0955a7e0 | [
"Apache-2.0"
] | null | null | null | development/analyze_table.py | gunny26/datalogger | 7bd29ab88f2e2749284d80a6a834c94c0955a7e0 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
"""
Tool to analyze some datalogger raw data
"""
from __future__ import print_function
import os
import sys
import argparse
import json
parser = argparse.ArgumentParser(description="Tool to analyze some datalogger raw data")
parser.add_argument("-i", "--input-file", help="file to read from", required... | 40.104167 | 168 | 0.618701 | #!/usr/bin/python
"""
Tool to analyze some datalogger raw data
"""
from __future__ import print_function
import os
import sys
import argparse
import json
parser = argparse.ArgumentParser(description="Tool to analyze some datalogger raw data")
parser.add_argument("-i", "--input-file", help="file to read from", required... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3f075b961c96ec481153e8a963e1124cc22fa1f5 | 640 | py | Python | .hooks/python/this.py | Matej-Chmel/pwman | 6ca7aff2ebe51be703647d67fc87ac4b3862e68a | [
"Apache-2.0",
"CC0-1.0"
] | null | null | null | .hooks/python/this.py | Matej-Chmel/pwman | 6ca7aff2ebe51be703647d67fc87ac4b3862e68a | [
"Apache-2.0",
"CC0-1.0"
] | null | null | null | .hooks/python/this.py | Matej-Chmel/pwman | 6ca7aff2ebe51be703647d67fc87ac4b3862e68a | [
"Apache-2.0",
"CC0-1.0"
] | null | null | null |
REPO_DIR = abspath(join(dirname(realpath(__file__)), pardir, pardir))
TOKEN_PATH = join(REPO_DIR, '.hooks', '.token')
VERSION_PATH = join(REPO_DIR, 'res', 'version.txt')
| 29.090909 | 80 | 0.723438 | from os.path import *
REPO_DIR = abspath(join(dirname(realpath(__file__)), pardir, pardir))
TOKEN_PATH = join(REPO_DIR, '.hooks', '.token')
VERSION_PATH = join(REPO_DIR, 'res', 'version.txt')
class this:
version = None
def read_local_version(reason=None):
if reason is not None:
print(f'{reason}\nReading latest v... | 0 | 0 | 0 | 6 | 0 | 395 | 0 | 0 | 68 |
5010b73121964b1e2039f7c97a78c65b09242001 | 21,089 | py | Python | CalibTracker/SiStripChannelGain/test/Cosmic_B38/InputFiles_cff.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | CalibTracker/SiStripChannelGain/test/Cosmic_B38/InputFiles_cff.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | CalibTracker/SiStripChannelGain/test/Cosmic_B38/InputFiles_cff.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/80C4285C-779E-DD11-9889-001617E30CA4.root',
'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7... | 183.382609 | 184 | 0.843283 | 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/80C4285C-779E-DD11-9889-001617E30CA4.root',
'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
86cb5b787a863245630cfb96d1a30d227547d206 | 51 | py | Python | py_prod_bootstrap/__init__.py | fgka/python-bootstrap | b48b647a14c387b7fb73bc03e12bc32ab19a340d | [
"MIT"
] | null | null | null | py_prod_bootstrap/__init__.py | fgka/python-bootstrap | b48b647a14c387b7fb73bc03e12bc32ab19a340d | [
"MIT"
] | null | null | null | py_prod_bootstrap/__init__.py | fgka/python-bootstrap | b48b647a14c387b7fb73bc03e12bc32ab19a340d | [
"MIT"
] | null | null | null | # vim: ai:sw=4:ts=4:sta:et:fo=croql
# coding=utf-8
| 17 | 35 | 0.647059 | # vim: ai:sw=4:ts=4:sta:et:fo=croql
# coding=utf-8
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5d774960bd0333c394d01e191b493b0b28d848dd | 847 | py | Python | move_ave.py | emguse/nov-2021 | 56cf6a6548801f433b820372ef67971794912d8a | [
"MIT"
] | null | null | null | move_ave.py | emguse/nov-2021 | 56cf6a6548801f433b820372ef67971794912d8a | [
"MIT"
] | null | null | null | move_ave.py | emguse/nov-2021 | 56cf6a6548801f433b820372ef67971794912d8a | [
"MIT"
] | null | null | null |
if __name__ == "__main__":
main() | 27.322581 | 58 | 0.551358 | from collections import deque
class MovingAverage():
def __init__(self, length:int) -> None:
self.length = abs(length)
if self.length == 0:
self.length = 1
self.dq = deque([],maxlen=self.length)
pass
def simple_moving_average(self, new_value) -> float:
self.... | 0 | 0 | 0 | 625 | 0 | 108 | 0 | 8 | 68 |
b5604486231496348086a272db2cac36cec603f9 | 1,314 | py | Python | setup.py | RobertoPrevato/Like-a-sir | 64f83955748583734d35c2d24489d4b839d3a2a2 | [
"MIT"
] | 1 | 2022-03-01T12:51:07.000Z | 2022-03-01T12:51:07.000Z | setup.py | RobertoPrevato/Like-a-sir | 64f83955748583734d35c2d24489d4b839d3a2a2 | [
"MIT"
] | 2 | 2022-03-17T06:26:12.000Z | 2022-03-24T17:11:21.000Z | setup.py | RobertoPrevato/Like-a-srt | 64f83955748583734d35c2d24489d4b839d3a2a2 | [
"MIT"
] | null | null | null | from setuptools import setup
from likeasrt import VERSION
setup(
name="like-a-srt",
version=VERSION,
description=(
"CLI to generate SRT subtitles automatically from audio files, "
"using Azure Speech"
),
long_description=readme(),
long_description_content_type="text/markdown"... | 27.375 | 86 | 0.619482 | from setuptools import setup
from likeasrt import VERSION
def readme():
with open("README.md", encoding="utf8") as readme_file:
return readme_file.read()
setup(
name="like-a-srt",
version=VERSION,
description=(
"CLI to generate SRT subtitles automatically from audio files, "
... | 0 | 0 | 0 | 0 | 0 | 86 | 0 | 0 | 23 |
eee0684bb32299e587765326efa040f5dccabe3d | 4,489 | py | Python | pyjj/__init__.py | achooan/pyjj | deebdd1389b43194d7d02980a50e8cef38c67bb6 | [
"MIT"
] | 4 | 2019-07-01T12:36:32.000Z | 2019-07-28T16:03:57.000Z | pyjj/__init__.py | ach0o/pyjj | deebdd1389b43194d7d02980a50e8cef38c67bb6 | [
"MIT"
] | 2 | 2021-02-02T22:21:15.000Z | 2021-06-02T00:12:11.000Z | pyjj/__init__.py | ach0o/pyjj | deebdd1389b43194d7d02980a50e8cef38c67bb6 | [
"MIT"
] | null | null | null | import click
from .config import PyjjConfig
pass_config = click.make_pass_decorator(PyjjConfig, ensure=True)
if __name__ == "__main__":
pyjj()
| 28.411392 | 88 | 0.63043 | import click
from .config import PyjjConfig
from .database import Database as Db
from .messages import msg, header, content, division
from .utils import validate_url
pass_config = click.make_pass_decorator(PyjjConfig, ensure=True)
@click.group(help="A CLI tool for bookmark management")
@pass_config
def pyjj(config... | 0 | 4,023 | 0 | 0 | 0 | 0 | 0 | 56 | 250 |
8c1f646db29f15d989fdd2c1cec89576b5179c77 | 7,546 | py | Python | roblopy/user.py | jackprogramsjp/Roblopy | 8190a467edbf27e16de7cf78c0a51b7950085425 | [
"MIT"
] | 1 | 2020-07-07T00:20:10.000Z | 2020-07-07T00:20:10.000Z | roblopy/user.py | jackprogramsjp/Roblopy | 8190a467edbf27e16de7cf78c0a51b7950085425 | [
"MIT"
] | 3 | 2020-04-05T07:15:10.000Z | 2020-07-06T21:21:59.000Z | roblopy/user.py | jackprogramsjp/Roblopy | 8190a467edbf27e16de7cf78c0a51b7950085425 | [
"MIT"
] | null | null | null |
# @staticmethod
# def GetProfileDescription(userId):
# response = no_data_get(f"https://www.roblox.com/users/{userId}/profile").content
# soup = BeautifulSoup(response, "html.parser")
#
# try:
# description = soup.find("span", {"class": "profile-about-content-... | 33.990991 | 119 | 0.555924 | from bs4 import BeautifulSoup
from .utils.request import get
from typing import Optional
class User:
"""
Represents a Roblox user.
"""
def __init__(self, user_id: int):
"""
Construct a new user class.
:param user_id: The User's ID.
"""
response =... | 0 | 5,416 | 0 | 740 | 0 | 0 | 0 | 23 | 494 |
d7f6fd72cf75693b0e429580feefa645d9e58921 | 16,043 | py | Python | tests/test_openvas_lib_data.py | abhishekvasishtb/openvas_lib | 8525e05860e012e30ff633652cb5d20050baa032 | [
"BSD-3-Clause"
] | 77 | 2015-04-22T10:43:15.000Z | 2021-02-21T04:14:46.000Z | tests/test_openvas_lib_data.py | zeinlol/openvas_lib | 326bde506ccb2b98fe52f30bfc623e30f4525194 | [
"BSD-3-Clause"
] | 39 | 2015-03-18T04:33:15.000Z | 2022-03-17T06:52:00.000Z | tests/test_openvas_lib_data.py | zeinlol/openvas_lib | 326bde506ccb2b98fe52f30bfc623e30f4525194 | [
"BSD-3-Clause"
] | 100 | 2015-01-18T16:42:55.000Z | 2021-12-01T23:57:14.000Z | import unittest
# def test___init__(self):
# # open_vas_override = OpenVASOverride()
# assert False # TODO: implement your test here
#
# def test_make_object(self):
# # open_vas_override = OpenVASOverride()
# # self.assertEqual(expected, open_vas_override.make_object(oid, name... | 40.718274 | 189 | 0.640778 | import unittest
class TestOpenVASPort(unittest.TestCase):
pass
# def test___init__(self):
# # open_vas_port = OpenVASPort(port_name, number, proto)
# assert False # TODO: implement your test here
#
# def test_number(self):
# # open_vas_port = OpenVASPort(port_name, number, prot... | 0 | 0 | 0 | 11,149 | 0 | 0 | 0 | 0 | 115 |
4db4785bd46c81d6467fd0fe7cfc8660df756c1c | 452 | py | Python | migrations/data/manitobarydercup/tournament.py | travisbale/scorecard | c131a87bb9552b2bde2b1adb68ce7a440cb32278 | [
"MIT"
] | null | null | null | migrations/data/manitobarydercup/tournament.py | travisbale/scorecard | c131a87bb9552b2bde2b1adb68ce7a440cb32278 | [
"MIT"
] | null | null | null | migrations/data/manitobarydercup/tournament.py | travisbale/scorecard | c131a87bb9552b2bde2b1adb68ce7a440cb32278 | [
"MIT"
] | null | null | null | """Create a new tournament."""
from scorecard import db
from scorecard.models.tournament import Tournament
def create(name, start_date, end_date):
"""Create a tournament."""
tournament = Tournament.query.filter_by(name=name, start_date=start_date, end_date=end_date).first()
if tournament is None:
... | 25.111111 | 104 | 0.712389 | """Create a new tournament."""
from scorecard import db
from scorecard.models.tournament import Tournament
def create(name, start_date, end_date):
"""Create a tournament."""
tournament = Tournament.query.filter_by(name=name, start_date=start_date, end_date=end_date).first()
if tournament is None:
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
503a69376129ef2d85059273118ef42eef987c2d | 5,087 | py | Python | models/common/base.py | LukasHedegaard/co3d | b95ca94ee6c01448bd292a6ec8cc6e3d606c74c4 | [
"Apache-2.0"
] | 13 | 2021-06-02T09:44:49.000Z | 2022-03-29T08:41:40.000Z | models/common/base.py | LukasHedegaard/co3d | b95ca94ee6c01448bd292a6ec8cc6e3d606c74c4 | [
"Apache-2.0"
] | null | null | null | models/common/base.py | LukasHedegaard/co3d | b95ca94ee6c01448bd292a6ec8cc6e3d606c74c4 | [
"Apache-2.0"
] | 2 | 2021-10-10T09:56:09.000Z | 2021-12-03T17:31:30.000Z | from ride.utils.logging import getLogger
logger = getLogger("co3d")
| 35.082759 | 175 | 0.574209 | from operator import attrgetter
import torch
from continual import CoModule
from pytorch_lightning.utilities.parsing import AttributeDict
from ride.core import Configs, RideMixin
from ride.utils.logging import getLogger
from ride.utils.utils import name
logger = getLogger("co3d")
class Co3dBase(RideMixin):
hpar... | 0 | 1,767 | 0 | 3,013 | 0 | 0 | 0 | 81 | 156 |
b1664cffd968bf82490505f180f2edab3159b619 | 1,105 | py | Python | api/api/migrations/0016_many_prepared_pdf_per_application.py | marzmehr/family-law-act-app | f036a23657e117eb04a8a0014e0153654ee97696 | [
"Apache-2.0"
] | 4 | 2020-04-06T23:42:41.000Z | 2022-03-20T18:32:59.000Z | api/api/migrations/0016_many_prepared_pdf_per_application.py | marzmehr/family-law-act-app | f036a23657e117eb04a8a0014e0153654ee97696 | [
"Apache-2.0"
] | 86 | 2020-03-11T01:33:07.000Z | 2022-03-31T21:45:04.000Z | api/api/migrations/0016_many_prepared_pdf_per_application.py | marzmehr/family-law-act-app | f036a23657e117eb04a8a0014e0153654ee97696 | [
"Apache-2.0"
] | 10 | 2020-01-22T17:28:35.000Z | 2021-07-29T20:42:22.000Z | # Generated by Django 3.1.7 on 2021-04-13 20:33
| 29.864865 | 125 | 0.59276 | # Generated by Django 3.1.7 on 2021-04-13 20:33
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0015_application_id_to_prepared_pdf'),
]
operations = [
migrations.RemoveField(
model_name='application',
nam... | 0 | 0 | 0 | 991 | 0 | 0 | 0 | 19 | 46 |
6e420ed3b6ec4029fdd935f505d00b2f84d651d4 | 588 | py | Python | opencv/pysource/08.trackbars.py | hainguyenvan/images-processing | c7e9701b2261573ad244c0ebc669d60bd3f0a1a9 | [
"MIT"
] | null | null | null | opencv/pysource/08.trackbars.py | hainguyenvan/images-processing | c7e9701b2261573ad244c0ebc669d60bd3f0a1a9 | [
"MIT"
] | null | null | null | opencv/pysource/08.trackbars.py | hainguyenvan/images-processing | c7e9701b2261573ad244c0ebc669d60bd3f0a1a9 | [
"MIT"
] | null | null | null | import cv2
cap = cv2.VideoCapture(0)
cv2.namedWindow("frame")
cv2.createTrackbar("test", "frame", 50, 500, nothing)
cv2.createTrackbar("color/gray", "frame", 0, 1, nothing)
while True:
ret, frame = cap.read()
if not ret:
break
test = cv2.getTrackbarPos("test", "frame")
font = cv2.FONT_HERSH... | 21 | 66 | 0.62585 | import cv2
import numpy as np
def nothing(x):
pass
cap = cv2.VideoCapture(0)
cv2.namedWindow("frame")
cv2.createTrackbar("test", "frame", 50, 500, nothing)
cv2.createTrackbar("color/gray", "frame", 0, 1, nothing)
while True:
ret, frame = cap.read()
if not ret:
break
test = cv2.getTrackbarP... | 0 | 0 | 0 | 0 | 0 | 3 | 0 | -3 | 45 |
bb15b0bcc5bb96af358e4b9a602b2adad72a8a8e | 32,496 | py | Python | src/test/xos/xosTest.py | huseyinbolt/cord-tester | ed9b79916e6326a45bfaf3227b8ff922d76df4f1 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/test/xos/xosTest.py | huseyinbolt/cord-tester | ed9b79916e6326a45bfaf3227b8ff922d76df4f1 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/test/xos/xosTest.py | huseyinbolt/cord-tester | ed9b79916e6326a45bfaf3227b8ff922d76df4f1 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null |
# Copyright 2017-present Open Networking Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 60.066543 | 177 | 0.75597 |
# Copyright 2017-present Open Networking Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 0 | 3,886 | 0 | 27,073 | 0 | 0 | 0 | -49 | 265 |
e143d64b0edf7e20756c5107443336d3756cb153 | 7,236 | py | Python | src/madpack/utilities.py | spring-operator/madlib | daf67f81b608396d8e3c04a9bf9890449a0a5b3c | [
"Apache-2.0"
] | null | null | null | src/madpack/utilities.py | spring-operator/madlib | daf67f81b608396d8e3c04a9bf9890449a0a5b3c | [
"Apache-2.0"
] | null | null | null | src/madpack/utilities.py | spring-operator/madlib | daf67f81b608396d8e3c04a9bf9890449a0a5b3c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python#
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# ... | 40.424581 | 87 | 0.52681 | #!/usr/bin/env python#
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# ... | 0 | 0 | 0 | 2,650 | 0 | 57 | 0 | 0 | 48 |
c6e6b13899e482e6b8b0447f59dd9ecafd2a2cb4 | 1,060 | py | Python | python/atexit/offical_doc.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/atexit/offical_doc.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/atexit/offical_doc.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | """
The following simple example demonstarates how a module can initialize a counter from a file
when it is imported and save the counter's updated value automatically when the program terminates
without relying on the application making an explicit call into this module at termination
"""
try:
with open("counterfi... | 25.238095 | 98 | 0.718868 | """
The following simple example demonstarates how a module can initialize a counter from a file
when it is imported and save the counter's updated value automatically when the program terminates
without relying on the application making an explicit call into this module at termination
"""
try:
with open("counterfi... | 0 | 64 | 0 | 0 | 0 | 197 | 0 | 0 | 90 |
485eee6e44c1156b88a4e8aaf153e8f3f0b30f8a | 31,914 | py | Python | pandas/tools/plotting.py | takluyver/pandas | 6c820b4b1a3b945d52cffbd9a4d40a582c077b5d | [
"BSD-3-Clause"
] | null | null | null | pandas/tools/plotting.py | takluyver/pandas | 6c820b4b1a3b945d52cffbd9a4d40a582c077b5d | [
"BSD-3-Clause"
] | null | null | null | pandas/tools/plotting.py | takluyver/pandas | 6c820b4b1a3b945d52cffbd9a4d40a582c077b5d | [
"BSD-3-Clause"
] | null | null | null | # being a bit too dynamic
# pylint: disable=E1101
import pandas.core.common as com
import numpy as np
def scatter_matrix(frame, alpha=0.5, figsize=None, **kwds):
"""
Draw a matrix of scatter plots.
Parameters
----------
kwds : other plotting keyword arguments
To be passed to scatter func... | 30.221591 | 79 | 0.567776 | # being a bit too dynamic
# pylint: disable=E1101
from pandas.util.decorators import cache_readonly
import pandas.core.common as com
import numpy as np
def scatter_matrix(frame, alpha=0.5, figsize=None, **kwds):
"""
Draw a matrix of scatter plots.
Parameters
----------
kwds : other plotting key... | 0 | 557 | 0 | 9,848 | 0 | 3,534 | 0 | 28 | 402 |
87edcc5488a97578f51befd6a32d044abb6c5615 | 4,630 | py | Python | watchdog.py | tbma2014us/ops-tools | d6368fedbbf1fea06aea9fc657087b9371dd00cc | [
"Apache-2.0"
] | 2 | 2020-08-13T15:33:35.000Z | 2022-01-22T09:59:15.000Z | watchdog.py | tbma2014us/ops-tools | d6368fedbbf1fea06aea9fc657087b9371dd00cc | [
"Apache-2.0"
] | null | null | null | watchdog.py | tbma2014us/ops-tools | d6368fedbbf1fea06aea9fc657087b9371dd00cc | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""
Monitors the availability of the TCP port, runs external process if port is unavailable,
but not more frequently than cooldown timeout. Persistent information is stored in /tmp
"""
import logging.handlers
logger = logging.getLogger()
# noinspection PyTypeChecker
if __name__ ==... | 37.33871 | 112 | 0.62743 | #!/usr/bin/env python
"""
Monitors the availability of the TCP port, runs external process if port is unavailable,
but not more frequently than cooldown timeout. Persistent information is stored in /tmp
"""
import argparse
import contextlib
import datetime
import logging.handlers
import os
import random
import ... | 0 | 0 | 0 | 1,507 | 0 | 2,516 | 0 | -92 | 355 |
79bd071e364ccf486ca5c00e1267b45035455585 | 580 | py | Python | source/domain/__init__.py | seemir/stressa | 7c3b178cf13f74ee010dbd44ce99188de3862ef7 | [
"MIT"
] | null | null | null | source/domain/__init__.py | seemir/stressa | 7c3b178cf13f74ee010dbd44ce99188de3862ef7 | [
"MIT"
] | 337 | 2019-09-27T12:26:14.000Z | 2022-03-31T04:13:04.000Z | source/domain/__init__.py | seemir/stressa | 7c3b178cf13f74ee010dbd44ce99188de3862ef7 | [
"MIT"
] | 1 | 2019-11-08T13:40:30.000Z | 2019-11-08T13:40:30.000Z | # -*- coding: utf-8 -*-
"""
Domain model implementation
"""
__author__ = 'Samir Adrik'
__email__ = 'samir.adrik@gmail.com'
| 20.714286 | 35 | 0.775862 | # -*- coding: utf-8 -*-
"""
Domain model implementation
"""
__author__ = 'Samir Adrik'
__email__ = 'samir.adrik@gmail.com'
from .expenses import Expenses
from .currency import Currency
from .address import Address
from .percent import Percent
from .family import Family
from .entity import Entity
from .person import... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 79 | 375 |
34e238b61d6b5235a3780f6205e3668b3046d1b3 | 11,994 | py | Python | src/experimental/analyse_results.py | neildhir/DCBO | dc8a1df096cc83b37f45f9e546ed7f59ad693f33 | [
"MIT"
] | 6 | 2021-11-07T08:08:55.000Z | 2022-01-27T18:21:34.000Z | src/experimental/analyse_results.py | neildhir/DCBO | dc8a1df096cc83b37f45f9e546ed7f59ad693f33 | [
"MIT"
] | null | null | null | src/experimental/analyse_results.py | neildhir/DCBO | dc8a1df096cc83b37f45f9e546ed7f59ad693f33 | [
"MIT"
] | 2 | 2021-12-19T18:09:30.000Z | 2022-01-13T03:04:39.000Z | from typing import Callable, Dict
def get_relevant_results(results: Callable, replicates: int) -> Dict[str, tuple]:
"""
When we get results from a notebook they are in a different format from when we pickle them. This function converts the results into the correct format so that we can analyse them.
Para... | 36.678899 | 184 | 0.609221 | from typing import Callable, Dict, Tuple
import numpy as np
from numpy import cumsum
from copy import deepcopy
from ..utils.utilities import calculate_best_intervention_and_effect
def get_relevant_results(results: Callable, replicates: int) -> Dict[str, tuple]:
"""
When we get results from a notebook they are... | 0 | 0 | 0 | 0 | 0 | 10,464 | 0 | 58 | 387 |
3419bba1c75411baceb526966ccef4570e3255d9 | 30,401 | py | Python | VUsbTools/Log.py | scanlime/vusb-analyzer | 38397212fabf8c3f62503605b833e094a5f1183f | [
"Unlicense"
] | 34 | 2015-01-13T20:04:06.000Z | 2022-03-30T14:29:31.000Z | VUsbTools/Log.py | a-sf-mirror/vusb-analyzer | 23869c07bb0e6bc95946337ae320bf012e372bbc | [
"MIT"
] | 2 | 2015-01-13T20:09:12.000Z | 2017-02-27T12:36:51.000Z | VUsbTools/Log.py | a-sf-mirror/vusb-analyzer | 23869c07bb0e6bc95946337ae320bf012e372bbc | [
"MIT"
] | 15 | 2015-01-13T20:31:15.000Z | 2021-09-02T05:15:04.000Z | #
# VUsbTools.Log
# Micah Elizabeth Scott <micah@vmware.com>
#
# Implements parsers for USB log files. Currently
# this includes slurping usbAnalyzer data out of the
# VMX log, and parsing the XML logs exported by
# Ellisys Visual USB.
#
# Copyright (C) 2005-2010 VMware, Inc. Licensed under the MIT
# License, please se... | 36.939247 | 87 | 0.542087 | #
# VUsbTools.Log
# Micah Elizabeth Scott <micah@vmware.com>
#
# Implements parsers for USB log files. Currently
# this includes slurping usbAnalyzer data out of the
# VMX log, and parsing the XML logs exported by
# Ellisys Visual USB.
#
# Copyright (C) 2005-2010 VMware, Inc. Licensed under the MIT
# License, please se... | 0 | 0 | 0 | 28,612 | 0 | 0 | 0 | 58 | 250 |
97daf54e1087de9fda53865105a6ca1aaa27c279 | 4,135 | py | Python | find_flags.py | detrout/encode4-curation | c4d7904a8013a276c2771afaeb28db94b73ff020 | [
"BSD-3-Clause"
] | null | null | null | find_flags.py | detrout/encode4-curation | c4d7904a8013a276c2771afaeb28db94b73ff020 | [
"BSD-3-Clause"
] | null | null | null | find_flags.py | detrout/encode4-curation | c4d7904a8013a276c2771afaeb28db94b73ff020 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python3
if __name__ == '__main__':
main()
| 30.62963 | 98 | 0.630955 | #!/usr/bin/python3
from collections import Counter
from htsworkflow.submission.encoded import ENCODED
import psycopg2
import pandas
def main(cmdline=None):
server = ENCODED('www.encodeproject.org')
server.load_netrc()
with psycopg2.connect(database='htsworkflow', host='felcat.caltech.edu') as conn:
... | 0 | 0 | 0 | 0 | 2,314 | 1,576 | 0 | 25 | 159 |
54ef86a8942cfef3d5df4d97ddfaa58e1b8bb0b0 | 1,157 | py | Python | src/pumpwood_communication/hash.py | Murabei-OpenSource-Codes/pumpwood-communication | 1d56dd6d1e3f3ced7c33da4af93b512fde9e4ed7 | [
"BSD-3-Clause"
] | null | null | null | src/pumpwood_communication/hash.py | Murabei-OpenSource-Codes/pumpwood-communication | 1d56dd6d1e3f3ced7c33da4af93b512fde9e4ed7 | [
"BSD-3-Clause"
] | null | null | null | src/pumpwood_communication/hash.py | Murabei-OpenSource-Codes/pumpwood-communication | 1d56dd6d1e3f3ced7c33da4af93b512fde9e4ed7 | [
"BSD-3-Clause"
] | null | null | null | """Create hash from a dictionary."""
import os
import hashlib
from .serializers import pumpJsonDump
from typing import List
def create_hash_from_dict(index_dict: dict, salt: str = "",
get_env: bool = True, keys: List[str] = None):
"""Create a hash for the index."""
# If get_env set a... | 33.057143 | 75 | 0.650821 | """Create hash from a dictionary."""
import os
import hashlib
from .serializers import pumpJsonDump
from typing import List
def create_hash_from_dict(index_dict: dict, salt: str = "",
get_env: bool = True, keys: List[str] = None):
"""Create a hash for the index."""
# If get_env set a... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
01c71add863481b471830c8175b2fad831a6d622 | 200 | py | Python | py_nest_thermostat/logger.py | bastienboutonnet/py-nest-thermostat | a015ffe618e90a2f890a8a5e66d3881e3f2378e1 | [
"MIT"
] | 3 | 2021-12-01T18:53:36.000Z | 2021-12-24T16:47:49.000Z | py_nest_thermostat/logger.py | bastienboutonnet/py-nest-thermostat | a015ffe618e90a2f890a8a5e66d3881e3f2378e1 | [
"MIT"
] | 8 | 2021-12-01T20:16:18.000Z | 2022-02-08T21:01:43.000Z | py_nest_thermostat/logger.py | bastienboutonnet/py-nest-thermostat | a015ffe618e90a2f890a8a5e66d3881e3f2378e1 | [
"MIT"
] | 1 | 2021-12-24T16:47:52.000Z | 2021-12-24T16:47:52.000Z | import logging
from rich.logging import RichHandler
FORMAT = "%(message)s"
logging.basicConfig(level="INFO", format=FORMAT, datefmt="[%X]", handlers=[RichHandler()])
log = logging.getLogger("rich")
| 25 | 90 | 0.74 | import logging
from rich.logging import RichHandler
FORMAT = "%(message)s"
logging.basicConfig(level="INFO", format=FORMAT, datefmt="[%X]", handlers=[RichHandler()])
log = logging.getLogger("rich")
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e64c39a5bdfbbcb485c2cc33376d2ba99ecf112b | 252 | py | Python | Step1-PythonBasic/Practices/yuxq/10-11/ex10.py | Jumpers/MysoftAutoTest | 50efc385a96532fc0777061d6c5e7201a4991f04 | [
"Apache-2.0"
] | null | null | null | Step1-PythonBasic/Practices/yuxq/10-11/ex10.py | Jumpers/MysoftAutoTest | 50efc385a96532fc0777061d6c5e7201a4991f04 | [
"Apache-2.0"
] | null | null | null | Step1-PythonBasic/Practices/yuxq/10-11/ex10.py | Jumpers/MysoftAutoTest | 50efc385a96532fc0777061d6c5e7201a4991f04 | [
"Apache-2.0"
] | null | null | null | tabby_cat="\tI'm tabbed in."
persian_cat="I'm split\non a line."
backslash_cat="I'm\\a\\cat."
fat_cat="""
I'll do a list:
\t* Cat food
\t* Fishies
\t* Catnip\n\t* Grass
"""
print tabby_cat
print persian_cat
print backslash_cat
print fat_cat | 19.384615 | 36 | 0.68254 | tabby_cat="\tI'm tabbed in."
persian_cat="I'm split\non a line."
backslash_cat="I'm\\a\\cat."
fat_cat="""
I'll do a list:
\t* Cat food
\t* Fishies
\t* Catnip\n\t* Grass
"""
print tabby_cat
print persian_cat
print backslash_cat
print fat_cat | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5bcd8bea62a574ea82bafbdff02cab2eaaea0311 | 669 | py | Python | HierarichaicalClustering.py | MahmoudAbusaqer/Clustering.py | 9ef6208d051eeef0c0f098a4fd4e548156e16ec5 | [
"Apache-2.0"
] | null | null | null | HierarichaicalClustering.py | MahmoudAbusaqer/Clustering.py | 9ef6208d051eeef0c0f098a4fd4e548156e16ec5 | [
"Apache-2.0"
] | null | null | null | HierarichaicalClustering.py | MahmoudAbusaqer/Clustering.py | 9ef6208d051eeef0c0f098a4fd4e548156e16ec5 | [
"Apache-2.0"
] | null | null | null | import pandas as pd
iris = pd.read_csv('IRIS.csv')
# print(iris.head(5))
# split data attributes and label attribute
attributes = iris.drop(['species'], axis=1)
labels = iris['species']
# import and build hieratchy cluster model
from scipy.cluster.hierarchy import linkage, dendrogram
hc = linkage(attributes, 'single... | 23.892857 | 60 | 0.702541 | import pandas as pd
iris = pd.read_csv('IRIS.csv')
# print(iris.head(5))
# split data attributes and label attribute
attributes = iris.drop(['species'], axis=1)
labels = iris['species']
# import and build hieratchy cluster model
from scipy.cluster.hierarchy import linkage, dendrogram
hc = linkage(attributes, 'single... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
526d64c86ec27dfd527c1b31c0f459bc525cb0c1 | 2,879 | py | Python | cloudflare_exporter/exporter.py | cpaillet/cloudflare-exporter | 194a0ce0f316aadc2802fbf180d06f5aab7849be | [
"Apache-2.0"
] | null | null | null | cloudflare_exporter/exporter.py | cpaillet/cloudflare-exporter | 194a0ce0f316aadc2802fbf180d06f5aab7849be | [
"Apache-2.0"
] | 7 | 2019-11-28T11:43:56.000Z | 2020-06-09T08:21:19.000Z | cloudflare_exporter/exporter.py | cpaillet/cloudflare-exporter | 194a0ce0f316aadc2802fbf180d06f5aab7849be | [
"Apache-2.0"
] | 3 | 2019-11-28T08:36:23.000Z | 2022-02-21T11:34:41.000Z |
if __name__ == '__main__':
main()
| 42.338235 | 82 | 0.572768 | import argparse
import logging
import sys
from aiohttp import web
from prometheus_client.core import REGISTRY
from cloudflare_exporter.collector import CloudflareCollector
from cloudflare_exporter.config import (DEFAULT_HOST,
DEFAULT_LOGS_FETCH,
... | 0 | 0 | 0 | 0 | 0 | 2,185 | 0 | 428 | 224 |
9e513ab7def44aae526688fda8460e192ab48963 | 5,601 | py | Python | src/extension/src/RuntimeContextHandler.py | Azure/LinuxPatchExtension | 6af622afb4298805bdf47328d6bc66a785f7166b | [
"Apache-2.0"
] | 4 | 2020-06-01T14:36:30.000Z | 2021-08-24T16:55:50.000Z | src/extension/src/RuntimeContextHandler.py | Azure/LinuxPatchExtension | 6af622afb4298805bdf47328d6bc66a785f7166b | [
"Apache-2.0"
] | 34 | 2020-09-11T17:20:42.000Z | 2022-03-28T14:08:44.000Z | src/extension/src/RuntimeContextHandler.py | Azure/LinuxPatchExtension | 6af622afb4298805bdf47328d6bc66a785f7166b | [
"Apache-2.0"
] | 1 | 2020-12-28T10:13:20.000Z | 2020-12-28T10:13:20.000Z | # Copyright 2020 Microsoft Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | 70.898734 | 349 | 0.74933 | # Copyright 2020 Microsoft Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | 0 | 0 | 0 | 4,892 | 0 | 0 | 0 | 8 | 90 |
ba0d7ccfeb185965828c45fa889e8a87f6968642 | 5,444 | py | Python | samples/contrib/pytorch-samples/cifar10/cifar10_datamodule.py | RonsenbergVI/pipelines | a85dc4f5f1f65f14bd807dec9ab25d8dafb34379 | [
"Apache-2.0"
] | 2,860 | 2018-05-24T04:55:01.000Z | 2022-03-31T13:49:56.000Z | samples/contrib/pytorch-samples/cifar10/cifar10_datamodule.py | RonsenbergVI/pipelines | a85dc4f5f1f65f14bd807dec9ab25d8dafb34379 | [
"Apache-2.0"
] | 7,331 | 2018-05-16T09:03:26.000Z | 2022-03-31T23:22:04.000Z | samples/contrib/pytorch-samples/cifar10/cifar10_datamodule.py | RonsenbergVI/pipelines | a85dc4f5f1f65f14bd807dec9ab25d8dafb34379 | [
"Apache-2.0"
] | 1,359 | 2018-05-15T11:05:41.000Z | 2022-03-31T09:42:09.000Z | # !/usr/bin/env/python3
# Copyright (c) Facebook, Inc. and its affiliates.
# 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 ... | 36.536913 | 98 | 0.591661 | # !/usr/bin/env/python3
# Copyright (c) Facebook, Inc. and its affiliates.
# 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 ... | 0 | 168 | 0 | 4,465 | 0 | 0 | 0 | 31 | 134 |
7cd64b0870d8323f3c093a616aa65567f0e3b4cb | 27,612 | py | Python | see/Segmentors.py | genster6/see-segment | 3564edf7d0e8b9add79ddfd5b63466fec7a4022e | [
"MIT"
] | null | null | null | see/Segmentors.py | genster6/see-segment | 3564edf7d0e8b9add79ddfd5b63466fec7a4022e | [
"MIT"
] | null | null | null | see/Segmentors.py | genster6/see-segment | 3564edf7d0e8b9add79ddfd5b63466fec7a4022e | [
"MIT"
] | null | null | null | """Segmentor library designed to learn how to segment images using GAs.
This libary actually does not incode the GA itself, instead it just defines
the search parameters the evaluation funtions and the fitness function (comming soon)."""
# DO: Research project-clean up the parameters class to reduce the search space... | 35.81323 | 164 | 0.633529 | """Segmentor library designed to learn how to segment images using GAs.
This libary actually does not incode the GA itself, instead it just defines
the search parameters the evaluation funtions and the fitness function (comming soon)."""
# DO: Research project-clean up the parameters class to reduce the search space... | 0 | 0 | 0 | 24,376 | 0 | 71 | 0 | 42 | 440 |
7b19b8ec5c5d60a6a3c79eddaa378e1b3aa0b813 | 289 | py | Python | Data Structures and Algorithms/LeetCode Algo Solutions/EASY DIFFICULTY PROBLEMS/PlusOne.py | akkik04/Python-DataStructures-and-Algorithms | 8db63173218e5a9205dbb325935c71fec93b695c | [
"MIT"
] | 1 | 2022-01-22T18:19:07.000Z | 2022-01-22T18:19:07.000Z | Data Structures and Algorithms/LeetCode Algo Solutions/EASY DIFFICULTY PROBLEMS/PlusOne.py | akkik04/Python-DataStructures-and-Algorithms | 8db63173218e5a9205dbb325935c71fec93b695c | [
"MIT"
] | null | null | null | Data Structures and Algorithms/LeetCode Algo Solutions/EASY DIFFICULTY PROBLEMS/PlusOne.py | akkik04/Python-DataStructures-and-Algorithms | 8db63173218e5a9205dbb325935c71fec93b695c | [
"MIT"
] | null | null | null | # PLUS ONE LEETCODE SOLUTION:
# creating a class.
| 28.9 | 69 | 0.643599 | # PLUS ONE LEETCODE SOLUTION:
# creating a class.
class Solution(object):
# creating a function to solve the problem.
def plusOne(self, digits):
# returning the modified version of the array.
return list(map(int, str(int(''.join(map(str,digits))) + 1))) | 0 | 0 | 0 | 214 | 0 | 0 | 0 | 0 | 22 |
7e9e2fdac9e8a144278059bcc1c6b14baacd058f | 760 | py | Python | drone_awe/params/Drone/Mavic2.py | rymanderson/Drone-Models | 396ed030f277a96365c7cbfaffb3d2006e5b12a8 | [
"MIT"
] | 2 | 2019-12-01T10:27:54.000Z | 2019-12-01T10:28:07.000Z | drone_awe/params/Drone/Mavic2.py | rymanderson/drone_awe | 396ed030f277a96365c7cbfaffb3d2006e5b12a8 | [
"MIT"
] | null | null | null | drone_awe/params/Drone/Mavic2.py | rymanderson/drone_awe | 396ed030f277a96365c7cbfaffb3d2006e5b12a8 | [
"MIT"
] | null | null | null | # Create structure with mavic 2 pro parameters
params = {'wingtype' : 'rotary',
'TOW' : 0.907, #kg
'max_speed' : 20, #m/s
'max_alt' : 6000, #m above sea level
'max_t' : 31, #min, no wind
'max_t_hover' : 29, #mi... | 36.190476 | 56 | 0.392105 | # Create structure with mavic 2 pro parameters
params = {'wingtype' : 'rotary',
'TOW' : 0.907, #kg
'max_speed' : 20, #m/s
'max_alt' : 6000, #m above sea level
'max_t' : 31, #min, no wind
'max_t_hover' : 29, #mi... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1260be3f4dddd22f4fa22666c86e4b7ede953487 | 3,714 | py | Python | utils.py | Agchai52/ConditinalDeblurGAN-Pytorch | 4e6438c22223b6cbcb7be0a27f009bca8b91d61c | [
"MIT"
] | 4 | 2020-04-10T17:57:16.000Z | 2020-11-24T01:19:04.000Z | utils.py | Agchai52/ConditinalDeblurGAN-Pytorch | 4e6438c22223b6cbcb7be0a27f009bca8b91d61c | [
"MIT"
] | 3 | 2021-02-25T03:29:41.000Z | 2022-03-12T00:18:08.000Z | utils.py | Agchai52/ConditinalDeblurGAN-Pytorch | 4e6438c22223b6cbcb7be0a27f009bca8b91d61c | [
"MIT"
] | 1 | 2020-12-10T03:47:28.000Z | 2020-12-10T03:47:28.000Z | from __future__ import division
import torchvision.transforms as transforms
import matplotlib as mpl
mpl.use('TkAgg')
#plot_losses()
| 31.74359 | 114 | 0.618471 | from __future__ import division
import os
import numpy as np
import math
import torch
import torchvision.transforms as transforms
from PIL import Image
import matplotlib as mpl
mpl.use('TkAgg')
import matplotlib.pyplot as plt
def save_img(args, image_tensor, filename):
image_tensor = torch.clamp(image_tensor, min... | 0 | 0 | 0 | 419 | 0 | 2,933 | 0 | -24 | 247 |
6fbef8e9e8e81593b183fa49ac416fbec33e65bb | 218 | py | Python | run_DP.py | wdomitrz/dp_dpll | 1434efabe95665e984a746f8ef8ad7489916078c | [
"MIT"
] | null | null | null | run_DP.py | wdomitrz/dp_dpll | 1434efabe95665e984a746f8ef8ad7489916078c | [
"MIT"
] | null | null | null | run_DP.py | wdomitrz/dp_dpll | 1434efabe95665e984a746f8ef8ad7489916078c | [
"MIT"
] | null | null | null | import sys
from base import DP, least_common
if __name__ == "__main__":
if len(sys.argv) != 2:
print("Expected exactly one argument - the .cnf file name")
exit(1)
DP(least_common)(sys.argv[1])
| 24.222222 | 67 | 0.642202 | import sys
from base import DP, least_common
if __name__ == "__main__":
if len(sys.argv) != 2:
print("Expected exactly one argument - the .cnf file name")
exit(1)
DP(least_common)(sys.argv[1])
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
275fc9763ae6aaf317319e3382901b40c840cb50 | 1,400 | py | Python | main.py | SamChatfield/final-year-project | 9d1ae2cb3009ffbff89cb438cfcde855db8a53ac | [
"MIT"
] | null | null | null | main.py | SamChatfield/final-year-project | 9d1ae2cb3009ffbff89cb438cfcde855db8a53ac | [
"MIT"
] | null | null | null | main.py | SamChatfield/final-year-project | 9d1ae2cb3009ffbff89cb438cfcde855db8a53ac | [
"MIT"
] | null | null | null |
POOL_SIZE = 4
if __name__ == "__main__":
main()
| 22.580645 | 88 | 0.691429 | import numpy as np
import hmm
import utils
from cnn import CNNModel3 as CNNModel
from discriminator import Discriminator
from ea import EA
POOL_SIZE = 4
def init_real_hmm():
# Set the fixed parameters of the "real" HMM
x = 5
y = "abc"
s = [1.0, 0.0, 0.0, 0.0, 0.0]
# Create "real" HMM with rando... | 0 | 0 | 0 | 0 | 0 | 1,133 | 0 | 7 | 202 |
07c7b2b3a4e1561b7b9b663075fdfbd8c0b45840 | 13,807 | py | Python | guillotina/schema/_bootstrapfields.py | diefenbach/guillotina | a8c7247fca8294752901f643b35c5ed1c5dee76d | [
"BSD-2-Clause"
] | null | null | null | guillotina/schema/_bootstrapfields.py | diefenbach/guillotina | a8c7247fca8294752901f643b35c5ed1c5dee76d | [
"BSD-2-Clause"
] | null | null | null | guillotina/schema/_bootstrapfields.py | diefenbach/guillotina | a8c7247fca8294752901f643b35c5ed1c5dee76d | [
"BSD-2-Clause"
] | null | null | null | ##############################################################################
#
# Copyright (c) 2002 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... | 31.74023 | 82 | 0.616064 | ##############################################################################
#
# Copyright (c) 2002 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... | 0 | 1,258 | 0 | 10,506 | 0 | 0 | 0 | 490 | 649 |
8ce18082211b909eac5b9538822052963b829027 | 9,972 | py | Python | linux/particle_filter_python_by_markus_waldmann/particle_filter.py | juebrauer/Solutions-Exercises-MultimodalSensorSystems | b1f4bae5ce21d992ff740804af07b227d34f828b | [
"Unlicense"
] | 2 | 2021-06-15T11:50:21.000Z | 2022-01-05T15:52:06.000Z | linux/particle_filter_python_by_markus_waldmann/particle_filter.py | juebrauer/Solutions-Exercises-MultimodalSensorSystems | b1f4bae5ce21d992ff740804af07b227d34f828b | [
"Unlicense"
] | null | null | null | linux/particle_filter_python_by_markus_waldmann/particle_filter.py | juebrauer/Solutions-Exercises-MultimodalSensorSystems | b1f4bae5ce21d992ff740804af07b227d34f828b | [
"Unlicense"
] | 1 | 2021-05-23T19:10:54.000Z | 2021-05-23T19:10:54.000Z | # A straightforward implementation
# of the particle filter idea
#
# A particle filter is a sample based approach
# for recursive Bayesian filtering
# The particles are a population based discrete
# representation of a probability density function.
#
# The filter recursively updates
#
# - the particle locat... | 36.394161 | 103 | 0.63919 | # A straightforward implementation
# of the particle filter idea
#
# A particle filter is a sample based approach
# for recursive Bayesian filtering
# The particles are a population based discrete
# representation of a probability density function.
#
# The filter recursively updates
#
# - the particle locat... | 0 | 162 | 0 | 8,588 | 0 | 0 | 0 | 11 | 116 |
a3f3404d2f30af7f5f47ca1398c6a75278f5817b | 6,100 | py | Python | code/main.py | michael-1003/EfficientNet-1D | ec7ff79fbde647b97d5c60359eba3c68beae934b | [
"MIT"
] | 4 | 2021-06-23T02:58:42.000Z | 2022-01-19T11:09:38.000Z | code/main.py | michael-1003/EfficientNet-1D | ec7ff79fbde647b97d5c60359eba3c68beae934b | [
"MIT"
] | 1 | 2021-06-23T03:19:45.000Z | 2021-06-23T03:19:45.000Z | code/main.py | michael-1003/EfficientNet-1D | ec7ff79fbde647b97d5c60359eba3c68beae934b | [
"MIT"
] | 3 | 2021-05-22T09:24:50.000Z | 2021-06-23T03:13:08.000Z | import argparse
import torch.nn as nn
import torch.optim as optim
import numpy as np
from configurator import read_config
from src.utils import make_dir
#%% Input args
# Run this file in background: nohup python main.py --config_fname=sample > log_sample.txt &
parser = argparse.ArgumentParser()
parser.... | 39.354839 | 127 | 0.581475 | import os
import time
import sys
import argparse
import torch
import torch.nn as nn
import torch.optim as optim
from torch.utils.data import DataLoader
from torch.utils.tensorboard import SummaryWriter
import numpy as np
from configurator import read_config, select_data, select_model, select_loss, selec... | 0 | 0 | 0 | 0 | 0 | 4,170 | 0 | 139 | 234 |
145fae9f4ac4dc233781136f0554dcf3814c3f8b | 18,329 | py | Python | src/ostorlab/agent/message/proto/v2/parse/cve_pb2.py | bbhunter/ostorlab | 968fe4e5b927c0cd159594c13b73f95b71150154 | [
"Apache-2.0"
] | 113 | 2022-02-21T09:30:14.000Z | 2022-03-31T21:54:26.000Z | src/ostorlab/agent/message/proto/v2/parse/cve_pb2.py | bbhunter/ostorlab | 968fe4e5b927c0cd159594c13b73f95b71150154 | [
"Apache-2.0"
] | 2 | 2022-02-25T10:56:55.000Z | 2022-03-24T13:08:06.000Z | src/ostorlab/agent/message/proto/v2/parse/cve_pb2.py | bbhunter/ostorlab | 968fe4e5b927c0cd159594c13b73f95b71150154 | [
"Apache-2.0"
] | 20 | 2022-02-28T14:25:04.000Z | 2022-03-30T23:01:11.000Z | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: cve.proto
import sys
_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _re... | 45.368812 | 1,380 | 0.665012 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: cve.proto
import sys
_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _re... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d71816b5dfb607c0604ad673ce6bd7f777f04c05 | 600 | py | Python | plugins/PyBirchPlugin.py | BlackXanthus/PyBirch5 | 61a70fe48f859509bd737d2c204882e13c2411c6 | [
"BSD-3-Clause"
] | null | null | null | plugins/PyBirchPlugin.py | BlackXanthus/PyBirch5 | 61a70fe48f859509bd737d2c204882e13c2411c6 | [
"BSD-3-Clause"
] | null | null | null | plugins/PyBirchPlugin.py | BlackXanthus/PyBirch5 | 61a70fe48f859509bd737d2c204882e13c2411c6 | [
"BSD-3-Clause"
] | null | null | null | ##
# The abstract class that is the basic plugin
##
| 17.142857 | 45 | 0.748333 | from TextString import TextString
##
# The abstract class that is the basic plugin
##
class PyBirchPlugin:
_pybirchmagic="PyBirchPluginMagic"
def __init__(self):
self._plugin_name="Py Birch Base Plugin"
self._plugin_version="0.2"
def hello_world(self):
print("Abstract Class Loaded")
return None
def ... | 0 | 0 | 0 | 491 | 0 | 0 | 0 | 12 | 45 |
05896c42173dea02103091673feb63d6c6bfc251 | 1,914 | py | Python | pg_python2/pg_dates.py | ingloriousb/pg_python2 | a4b78150d24fc4ebff1c1671cfd66ab421ad1705 | [
"BSD-2-Clause"
] | null | null | null | pg_python2/pg_dates.py | ingloriousb/pg_python2 | a4b78150d24fc4ebff1c1671cfd66ab421ad1705 | [
"BSD-2-Clause"
] | null | null | null | pg_python2/pg_dates.py | ingloriousb/pg_python2 | a4b78150d24fc4ebff1c1671cfd66ab421ad1705 | [
"BSD-2-Clause"
] | null | null | null | import calendar
from umalqurra.hijri_date import HijriDate
import jdatetime
from datetime import datetime
def middle_east_parsed_date(text_date, kwargs):
"""
:param text_date:
:param kwargs: format : %d-%m-%Y for 12-7-1397.
:return:
"""
dict_month_numeric = dict((v, k) for k, v in enumerate(c... | 30.380952 | 85 | 0.600836 | import calendar
from umalqurra.hijri_date import HijriDate
import jdatetime
from datetime import datetime
import re
def split_non_alpha(string_to_split):
ret_val = []
arr_spl = re.split('[^a-zA-Z0-9 ]', string_to_split)
for s in arr_spl:
ret_val.append(s.strip())
return ret_val
def middle_ea... | 0 | 0 | 0 | 0 | 0 | 192 | 0 | -12 | 68 |
258f87f7934eab8366be49ae5985c5e51862d13e | 1,533 | py | Python | tuw_trinamic_iwos_revolute_controller/src/tuw_trinamic_iwos_revolute_controller/device/wheel.py | kaltenegger/tuw_trinamic | 86760553ea137d189612edf99b0ea0446d72f9a3 | [
"BSD-3-Clause"
] | null | null | null | tuw_trinamic_iwos_revolute_controller/src/tuw_trinamic_iwos_revolute_controller/device/wheel.py | kaltenegger/tuw_trinamic | 86760553ea137d189612edf99b0ea0446d72f9a3 | [
"BSD-3-Clause"
] | null | null | null | tuw_trinamic_iwos_revolute_controller/src/tuw_trinamic_iwos_revolute_controller/device/wheel.py | kaltenegger/tuw_trinamic | 86760553ea137d189612edf99b0ea0446d72f9a3 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
| 34.840909 | 117 | 0.714286 | #!/usr/bin/env python3
import math
from tuw_trinamic_iwos_revolute_controller.device.motor import Motor
from tuw_trinamic_iwos_revolute_controller.device.configuration_tool import ConfigurationTool
class Wheel:
"""
class representing a wheel controlled with Trinamic TMCM-1640
"""
def __init__(self, ... | 0 | 0 | 0 | 1,309 | 0 | 0 | 0 | 109 | 91 |
0a93400fd59ffbf7a2b05328787cae4a9c1759ae | 1,031 | py | Python | examples/plotting/radon.py | heprom/pymicro | 176bf3a829dbf67796a3d4471f18868a3da229a7 | [
"MIT"
] | 30 | 2017-03-02T14:43:48.000Z | 2022-02-25T13:22:22.000Z | examples/plotting/radon.py | heprom/pymicro | 176bf3a829dbf67796a3d4471f18868a3da229a7 | [
"MIT"
] | 14 | 2019-12-29T12:41:29.000Z | 2021-12-01T21:13:20.000Z | examples/plotting/radon.py | heprom/pymicro | 176bf3a829dbf67796a3d4471f18868a3da229a7 | [
"MIT"
] | 18 | 2017-03-21T12:43:19.000Z | 2022-03-22T14:30:06.000Z | import os, numpy as np
from pymicro.file.file_utils import HST_read
from skimage.transform import radon
from matplotlib import pyplot as plt
'''
Example of use of the radon transform.
'''
data = HST_read('../data/mousse_250x250x250_uint8.raw', autoparse_filename=True, zrange=range(1))[:, :, 0]
fig, (ax1, ax2) = plt.su... | 34.366667 | 106 | 0.731329 | import os, numpy as np
from pymicro.file.file_utils import HST_read
from skimage.transform import radon
from matplotlib import pyplot as plt
'''
Example of use of the radon transform.
'''
data = HST_read('../data/mousse_250x250x250_uint8.raw', autoparse_filename=True, zrange=range(1))[:, :, 0]
fig, (ax1, ax2) = plt.su... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
eaf4e4052c4df78e2e8309ca66ba30a99e51f981 | 404 | py | Python | prog.py | schrum2/SonicDeepRLEvolution | f4476fa66d96c4f6cd9bf15947f0e9392c99eadb | [
"MIT"
] | null | null | null | prog.py | schrum2/SonicDeepRLEvolution | f4476fa66d96c4f6cd9bf15947f0e9392c99eadb | [
"MIT"
] | 4 | 2019-08-22T08:02:25.000Z | 2019-08-22T08:07:35.000Z | prog.py | schrum2/SonicDeepRLEvolution | f4476fa66d96c4f6cd9bf15947f0e9392c99eadb | [
"MIT"
] | null | null | null | import argparse
parser = argparse.ArgumentParser(prog='PROG')
parser.add_argument('foo', type=perfect_square)
args = parser.parse_args()
print(args.foo) | 26.933333 | 52 | 0.690594 | import argparse
import math
def perfect_square(string):
value = int(string)
sqrt = math.sqrt(value)
if sqrt != int(sqrt):
msg = "%r is not a perfect square" % string
raise argparse.ArgumentTypeError(msg)
return math.sqrt(value)
parser = argparse.ArgumentParser(prog='PROG')
parser... | 0 | 0 | 0 | 0 | 0 | 216 | 0 | -10 | 45 |
b7d5b5fb86ea4bb818e118dcb16c87a208f51c53 | 2,764 | py | Python | memote/suite/tests/test_sbml.py | matthiaskoenig/memote | 7c14cd304523dda83eaf4835ee007243e8673f85 | [
"Apache-2.0"
] | null | null | null | memote/suite/tests/test_sbml.py | matthiaskoenig/memote | 7c14cd304523dda83eaf4835ee007243e8673f85 | [
"Apache-2.0"
] | null | null | null | memote/suite/tests/test_sbml.py | matthiaskoenig/memote | 7c14cd304523dda83eaf4835ee007243e8673f85 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2019 Novo Nordisk Foundation Center for Biosustainability,
# Technical University of Denmark.
#
# 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... | 36.853333 | 78 | 0.713459 | # -*- coding: utf-8 -*-
# Copyright 2019 Novo Nordisk Foundation Center for Biosustainability,
# Technical University of Denmark.
#
# 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... | 0 | 1,884 | 0 | 0 | 0 | 0 | 0 | 21 | 69 |
c4b1802e56632a6b37d5aa10c0b46d1a3b8cbe9b | 463 | py | Python | TestLib/NormFilters.py | EmilPi/PuzzleLib | 31aa0fab3b5e9472b9b9871ca52e4d94ea683fa9 | [
"Apache-2.0"
] | 52 | 2020-02-28T20:40:15.000Z | 2021-08-25T05:35:17.000Z | TestLib/NormFilters.py | EmilPi/PuzzleLib | 31aa0fab3b5e9472b9b9871ca52e4d94ea683fa9 | [
"Apache-2.0"
] | 2 | 2021-02-14T15:57:03.000Z | 2021-10-05T12:21:34.000Z | TestLib/NormFilters.py | EmilPi/PuzzleLib | 31aa0fab3b5e9472b9b9871ca52e4d94ea683fa9 | [
"Apache-2.0"
] | 8 | 2020-02-28T20:40:11.000Z | 2020-07-09T13:27:23.000Z |
if __name__ == "__main__":
main()
| 21.045455 | 73 | 0.740821 | from PuzzleLib.Backend import gpuarray
from PuzzleLib.Modules import SubtractMean, LCN
from PuzzleLib.Visual import loadImage, showImage
def main():
subtractMean = SubtractMean(size=7)
lcn = LCN(N=7)
img = gpuarray.to_gpu(loadImage("../TestData/Bench.png"))
subtractMean(img)
showImage(subtractMean.data.get(),... | 0 | 0 | 0 | 0 | 0 | 264 | 0 | 71 | 90 |
c3e18c48da47d09639838dff038ca42b114c2c5b | 5,783 | py | Python | utils/meters.py | LegionChang/CoTNet | b1bc456c0b13b282b807d1082a1598b71014b4fe | [
"Apache-2.0"
] | 360 | 2021-07-26T07:23:29.000Z | 2022-03-16T03:03:25.000Z | python_developer_tools/cv/bases/conv/CoTNet/CoTNet-master/utils/meters.py | HonestyBrave/python_developer_tools | fc0dcf5c4ef088e2e535206dc82f09bbfd01f280 | [
"Apache-2.0"
] | 22 | 2021-07-29T15:05:00.000Z | 2022-03-17T04:28:14.000Z | python_developer_tools/cv/bases/conv/CoTNet/CoTNet-master/utils/meters.py | HonestyBrave/python_developer_tools | fc0dcf5c4ef088e2e535206dc82f09bbfd01f280 | [
"Apache-2.0"
] | 47 | 2021-07-27T02:14:21.000Z | 2022-02-25T09:15:12.000Z | import decimal
import torch
def accuracy(output, target, topk=(1,)):
"""Computes the accuracy over the k top predictions for the specified values of k"""
maxk = max(topk)
batch_size = target.size(0)
_, pred = output.topk(maxk, 1, True, True)
pred = pred.t()
correct = pred.eq(target.reshape(1, ... | 32.488764 | 134 | 0.605395 | import decimal
import numpy as np
from collections import deque
import torch
from config import cfg
from utils.timer import Timer
from utils.logger import logger_info
import utils.distributed as dist
from utils.distributed import sum_tensor
def accuracy(output, target, topk=(1,)):
"""Computes the accuracy over th... | 0 | 0 | 0 | 4,249 | 0 | 0 | 0 | 59 | 246 |
a7b173e38daeb055e31229e89e694045cf16422c | 352 | py | Python | Hackerearth/Recursion/Easy/Python/stairs.py | pranaylobo/Team-Kalm-CP | daa967d84ccd162efc0b7f19448daa01f745e7e2 | [
"Apache-2.0"
] | null | null | null | Hackerearth/Recursion/Easy/Python/stairs.py | pranaylobo/Team-Kalm-CP | daa967d84ccd162efc0b7f19448daa01f745e7e2 | [
"Apache-2.0"
] | 1 | 2021-02-15T16:02:47.000Z | 2021-02-15T16:02:47.000Z | Hackerearth/Recursion/Easy/Python/stairs.py | pranaylobo/Team-Kalm-CP | daa967d84ccd162efc0b7f19448daa01f745e7e2 | [
"Apache-2.0"
] | 1 | 2021-02-16T04:53:47.000Z | 2021-02-16T04:53:47.000Z |
print(solve(int(input()))) | 11.354839 | 51 | 0.4375 | def solve(n):
if n==0 or n==1:
return 1
elif n==2:
return 2
elif n==3:
return 4
elif n==4:
return 7
elif n==5:
return 13
elif n==6:
return 24
elif n==7:
return 44
else:
return solve(n-1) + solve(n-2) + solve(n-3... | 0 | 0 | 0 | 0 | 0 | 300 | 0 | 0 | 22 |
3d64bd367efb90a5dab78c19ff495414aaf0679b | 5,605 | py | Python | ResophNotes.py | rrottmann/ResophNotesPy | 0315ae85dad92075ac4f6fbdcf1f533b830f5903 | [
"BSD-2-Clause"
] | 1 | 2017-08-24T17:34:43.000Z | 2017-08-24T17:34:43.000Z | ResophNotes.py | rrottmann/ResophNotesPy | 0315ae85dad92075ac4f6fbdcf1f533b830f5903 | [
"BSD-2-Clause"
] | null | null | null | ResophNotes.py | rrottmann/ResophNotesPy | 0315ae85dad92075ac4f6fbdcf1f533b830f5903 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
ResophNotes.py
Convert to JSON and query ResophNotes notes from shell.
Copyright 2017 by Reiner Rottmann <reiner@rottmann.it
Released under the BSD License.
"""
import os
import sys
import base64
import uuid
import json
import argparse
import subprocess
import collect... | 33.363095 | 114 | 0.509723 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
ResophNotes.py
Convert to JSON and query ResophNotes notes from shell.
Copyright 2017 by Reiner Rottmann <reiner@rottmann.it
Released under the BSD License.
"""
import os
import sys
import base64
import uuid
import json
import argparse
import subprocess
import collect... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2fde3e0585be2c7e44bbf4a50888acdf44b8a5c1 | 1,703 | py | Python | review2.py | cs-fullstack-2019-spring/python-review2-cw-gkg901 | 0a0d65b7548614e48048c7bf742cbe9c56108ffe | [
"Apache-2.0"
] | null | null | null | review2.py | cs-fullstack-2019-spring/python-review2-cw-gkg901 | 0a0d65b7548614e48048c7bf742cbe9c56108ffe | [
"Apache-2.0"
] | null | null | null | review2.py | cs-fullstack-2019-spring/python-review2-cw-gkg901 | 0a0d65b7548614e48048c7bf742cbe9c56108ffe | [
"Apache-2.0"
] | null | null | null |
# Create a task list. A user is presented with the text below.
# Let them select an option to list all of their tasks, add a task to their list, delete a task, or quit the program.
# Make each option a different function in your program.
# Do NOT use Google. Do NOT use other students. Try to do this on your own.
... | 21.2875 | 132 | 0.53259 | def main():
ex()
# Create a task list. A user is presented with the text below.
# Let them select an option to list all of their tasks, add a task to their list, delete a task, or quit the program.
# Make each option a different function in your program.
# Do NOT use Google. Do NOT use other students. Try to do t... | 0 | 0 | 0 | 0 | 0 | 1,296 | 0 | 0 | 45 |
0a80ed22b1f8f2014a9901db8351528c6723316c | 579 | py | Python | Python/Strings/alphabet_rangoli.py | LikimiaD/HackerRank | ad34261ea4d7d721f92a3230a369eccaac5ef88b | [
"MIT"
] | null | null | null | Python/Strings/alphabet_rangoli.py | LikimiaD/HackerRank | ad34261ea4d7d721f92a3230a369eccaac5ef88b | [
"MIT"
] | null | null | null | Python/Strings/alphabet_rangoli.py | LikimiaD/HackerRank | ad34261ea4d7d721f92a3230a369eccaac5ef88b | [
"MIT"
] | null | null | null | import string
size = 10
mid_line = '-'.join([string.ascii_letters[size - x] for x in range(1, size)] + [string.ascii_letters[x] for x in range(size)])
lines = []
for x in range(2,size+1):
main = ''.join(string.ascii_letters[size - x] for x in range(1, x))
*main_list,_ = list(main)
reverse = ''.join(x for x ... | 36.1875 | 126 | 0.62867 | import string
size = 10
mid_line = '-'.join([string.ascii_letters[size - x] for x in range(1, size)] + [string.ascii_letters[x] for x in range(size)])
lines = []
for x in range(2,size+1):
main = ''.join(string.ascii_letters[size - x] for x in range(1, x))
*main_list,_ = list(main)
reverse = ''.join(x for x ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
be18080a401b2813e33234cd1be2ebc3fe126b62 | 971 | py | Python | app/modules/users.py | Gerschtli/betting-game-backend | 4fb38e5316ea6509b4468f8ca11de2f899366abb | [
"MIT"
] | null | null | null | app/modules/users.py | Gerschtli/betting-game-backend | 4fb38e5316ea6509b4468f8ca11de2f899366abb | [
"MIT"
] | 1 | 2021-11-04T16:42:26.000Z | 2021-11-04T16:42:26.000Z | app/modules/users.py | Gerschtli/betting-game-backend | 4fb38e5316ea6509b4468f8ca11de2f899366abb | [
"MIT"
] | null | null | null | from flask import Blueprint
from flask_restful import Api
from .. import models, request
module = Blueprint('users', __name__, url_prefix='/users')
api = Api(module)
| 26.243243 | 73 | 0.627188 | from flask import Blueprint
from flask_restful import Api
from .. import models, request
from ..resource import Resource
from ..response import Response, no_content
from ..validator import matcher, schemas, validate_input, validate_schema
module = Blueprint('users', __name__, url_prefix='/users')
api = Api(module)
... | 0 | 629 | 0 | 0 | 0 | 0 | 0 | 84 | 89 |
e40ae9de2fac686e2a524206e3c3fcd494ed381b | 15,777 | py | Python | sdk/python/pulumi_azure_nextgen/devtestlab/v20150521preview/virtual_machine_resource.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 31 | 2020-09-21T09:41:01.000Z | 2021-02-26T13:21:59.000Z | sdk/python/pulumi_azure_nextgen/devtestlab/v20150521preview/virtual_machine_resource.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 231 | 2020-09-21T09:38:45.000Z | 2021-03-01T11:16:03.000Z | sdk/python/pulumi_azure_nextgen/devtestlab/v20150521preview/virtual_machine_resource.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 4 | 2020-09-29T14:14:59.000Z | 2021-02-10T20:38:16.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import pulumi
from ... import _utilities, _tables
__all__ = ['VirtualMachineResource']
| 44.442254 | 364 | 0.652722 | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 0 | 6,025 | 0 | 9,328 | 0 | 0 | 0 | 32 | 134 |
85fcbea729438d4ba0adb8419eee9393e726705d | 2,289 | py | Python | watchdog/watchdog.py | rnme/centralization-sw | d0c0bafad37f15e23663a7c1fc599c61592ab389 | [
"MIT"
] | null | null | null | watchdog/watchdog.py | rnme/centralization-sw | d0c0bafad37f15e23663a7c1fc599c61592ab389 | [
"MIT"
] | null | null | null | watchdog/watchdog.py | rnme/centralization-sw | d0c0bafad37f15e23663a7c1fc599c61592ab389 | [
"MIT"
] | null | null | null | import asyncio
asyncio.run(watch())
| 32.7 | 85 | 0.492355 | import os
import asyncio
from datetime import datetime, timedelta
from influxdb import InfluxDBClient
class Measurement:
def __init__(self, point):
self.__ventilator = point[0][1]['ventilator']
self.__point = next(point[1])
def ventilator(self):
return self.__ventilator
def is_old... | 2 | 0 | 1,509 | 585 | 0 | 0 | 0 | 21 | 135 |
24efa0cb0f823331453c19591ce02aecff56c737 | 182 | py | Python | Exercise_06_ListSorting.py | lukas9557/learning_python | 5a8d61658bc9121314fd6633e1f782cf3e9641b6 | [
"MIT"
] | 2 | 2020-11-29T22:38:18.000Z | 2020-12-01T19:09:53.000Z | Exercise_06_ListSorting.py | lukas9557/learning_python | 5a8d61658bc9121314fd6633e1f782cf3e9641b6 | [
"MIT"
] | null | null | null | Exercise_06_ListSorting.py | lukas9557/learning_python | 5a8d61658bc9121314fd6633e1f782cf3e9641b6 | [
"MIT"
] | null | null | null | #Sort list, and sort list in reverse order
a = list()
a = [5, 2, 9, 1, 7, 6, 3, 8, 4]
b = list()
c = list()
b = sorted(a)
c = sorted(a, reverse = 1)
print(b)
print(c)
| 14 | 43 | 0.516484 | #Sort list, and sort list in reverse order
a = list()
a = [5, 2, 9, 1, 7, 6, 3, 8, 4]
b = list()
c = list()
b = sorted(a)
c = sorted(a, reverse = 1)
print(b)
print(c)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8bdb1d4535d1958f3b43243d1265f21126e3415d | 542 | py | Python | Q8/savefeatmap.py | avicennax/CSE190_src | 71e7a899d43e3b61aa48cfd5284c3dda75d20127 | [
"MIT"
] | null | null | null | Q8/savefeatmap.py | avicennax/CSE190_src | 71e7a899d43e3b61aa48cfd5284c3dda75d20127 | [
"MIT"
] | null | null | null | Q8/savefeatmap.py | avicennax/CSE190_src | 71e7a899d43e3b61aa48cfd5284c3dda75d20127 | [
"MIT"
] | null | null | null | import matplotlib as mt
mt.use('Agg')
import caffe
import numpy as np
import sys
if __name__ == "__main__":
# sys.argv[1] = net prefix
# sys.argv[2] = model prefix
# sys.argv[3] = model _iter_
# sys.argv[4] = output directory
if len(sys.argv) != 5:
raise ValueError("4 args required")
net = caffe.Net(sys.argv... | 24.636364 | 101 | 0.660517 | import matplotlib as mt
mt.use('Agg')
import caffe
import numpy as np
import sys
if __name__ == "__main__":
# sys.argv[1] = net prefix
# sys.argv[2] = model prefix
# sys.argv[3] = model _iter_
# sys.argv[4] = output directory
if len(sys.argv) != 5:
raise ValueError("4 args required")
net = caffe.Net(sys.argv... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7395f00fb45248c8e8b93ae3c0832e5913efdf9c | 4,804 | py | Python | src/commercetools/services/stores.py | labd/commercetools-python-sdk | d8ec285f08d56ede2e4cad45c74833f5b609ab5c | [
"MIT"
] | 15 | 2018-11-02T14:35:52.000Z | 2022-03-16T07:51:44.000Z | src/commercetools/services/stores.py | lime-green/commercetools-python-sdk | 63b77f6e5abe43e2b3ebbf3cdbbe00c7cf80dca6 | [
"MIT"
] | 84 | 2018-11-02T12:50:32.000Z | 2022-03-22T01:25:54.000Z | src/commercetools/services/stores.py | lime-green/commercetools-python-sdk | 63b77f6e5abe43e2b3ebbf3cdbbe00c7cf80dca6 | [
"MIT"
] | 13 | 2019-01-03T09:16:50.000Z | 2022-02-15T18:37:19.000Z | # DO NOT EDIT! This file is automatically generated
| 30.598726 | 85 | 0.601374 | # DO NOT EDIT! This file is automatically generated
import typing
from commercetools.helpers import RemoveEmptyValuesMixin
from commercetools.platform.models.store import (
Store,
StoreDraft,
StorePagedQueryResponse,
StoreUpdate,
StoreUpdateAction,
)
from commercetools.typing import OptionalListStr... | 0 | 0 | 0 | 4,355 | 0 | 0 | 0 | 189 | 204 |
c96ada2e1d2d45f3f0fcc2ab9ef34a8bfde8c9c6 | 1,049 | py | Python | routers/person.py | carlosjosecjr/desafio-backend | 8c7d70cc22f27fa9d25f85613507e3199c4b1b30 | [
"Unlicense"
] | null | null | null | routers/person.py | carlosjosecjr/desafio-backend | 8c7d70cc22f27fa9d25f85613507e3199c4b1b30 | [
"Unlicense"
] | null | null | null | routers/person.py | carlosjosecjr/desafio-backend | 8c7d70cc22f27fa9d25f85613507e3199c4b1b30 | [
"Unlicense"
] | null | null | null | from fastapi import APIRouter
person = APIRouter()
| 32.78125 | 110 | 0.684461 | import bcrypt
from fastapi import APIRouter
from fastapi import HTTPException
from peewee import IntegrityError
from db import Person as PersonORM
from db import SQLITE_DB
from schema import Person as PersonSchema
person = APIRouter()
@person.post("/person")
def receive_person(person_schema: PersonSchema):
try:... | 0 | 788 | 0 | 0 | 0 | 0 | 0 | 52 | 156 |
d9c57548efc336293152f2f9666dc6125db58f5b | 535 | py | Python | magic_square.py | shabidkhan/magic_square | 636e6b76d6cbd9b053ff00917c02a14e4675dd4d | [
"MIT"
] | null | null | null | magic_square.py | shabidkhan/magic_square | 636e6b76d6cbd9b053ff00917c02a14e4675dd4d | [
"MIT"
] | null | null | null | magic_square.py | shabidkhan/magic_square | 636e6b76d6cbd9b053ff00917c02a14e4675dd4d | [
"MIT"
] | null | null | null | marks = [
[1, 0, 4, 8],
[0, 2, 0, 6],
[2, 4, 5, 2],
[9, 5, 8, 3]
]
d1=0
d2=0
c=[]
r=[]
for i in range(len(marks)):
r.append(0)
for j in range(len(marks)):
c.append(0)
if(i==j):
d1=marks[i][j]+d1
if (i+j==len(marks)-1):
d2+=marks[i][j]
r[i]+=marks[i][j]
c[j]+=marks[i][j]
print('r',i,'... | 16.71875 | 58 | 0.485981 | marks = [
[1, 0, 4, 8],
[0, 2, 0, 6],
[2, 4, 5, 2],
[9, 5, 8, 3]
]
d1=0
d2=0
c=[]
r=[]
for i in range(len(marks)):
r.append(0)
for j in range(len(marks)):
c.append(0)
if(i==j):
d1=marks[i][j]+d1
if (i+j==len(marks)-1):
d2+=marks[i][j]
r[i]+=marks[i][j]
c[j]+=marks[i][j]
print('r',i,'... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0d60c40e37650182d37feba8ea9716e0f0242573 | 51 | py | Python | git_p.py | qszhuan/gity | 1659417a75f78fd47a8672a0411e70bdeb057af3 | [
"MIT"
] | null | null | null | git_p.py | qszhuan/gity | 1659417a75f78fd47a8672a0411e70bdeb057af3 | [
"MIT"
] | 1 | 2019-07-24T15:23:02.000Z | 2019-07-24T15:23:02.000Z | git_p.py | qszhuan/gity | 1659417a75f78fd47a8672a0411e70bdeb057af3 | [
"MIT"
] | null | null | null | import cli
if __name__ == "__main__":
cli.p()
| 10.2 | 26 | 0.607843 | import cli
if __name__ == "__main__":
cli.p()
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2bf1dc7b4095e6103c2ef4116bd3b338beb3b002 | 3,112 | py | Python | test/run_notebook.py | awslabs/sagemaker-privacy-for-nlp | 899f178748401eaf2713cec83d37306f8a1327a8 | [
"Apache-2.0",
"CC0-1.0"
] | 10 | 2020-07-08T18:59:05.000Z | 2022-02-03T21:49:33.000Z | test/run_notebook.py | awslabs/sagemaker-privacy-for-nlp | 899f178748401eaf2713cec83d37306f8a1327a8 | [
"Apache-2.0",
"CC0-1.0"
] | null | null | null | test/run_notebook.py | awslabs/sagemaker-privacy-for-nlp | 899f178748401eaf2713cec83d37306f8a1327a8 | [
"Apache-2.0",
"CC0-1.0"
] | 5 | 2021-01-06T07:12:20.000Z | 2022-01-27T17:24:36.000Z | from pathlib import Path
import os
import time
import logging
import boto3
import papermill as pm
import watchtower
from package import config, utils
if __name__ == "__main__":
run_on_start = False if config.TEST_OUTPUTS_S3_BUCKET == "" else True
if not run_on_start:
exit()
cfn_client = boto3... | 39.392405 | 111 | 0.666774 | from pathlib import Path
import os
import time
import logging
import boto3
import papermill as pm
import watchtower
from package import config, utils
if __name__ == "__main__":
run_on_start = False if config.TEST_OUTPUTS_S3_BUCKET == "" else True
if not run_on_start:
exit()
cfn_client = boto3... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b335e0180c38c2d8bb0d5ab26b2d8af5c77aa46f | 9,509 | py | Python | implicitresnet/solvers/linear.py | vreshniak/ImplicitResNet | 62e3c2f047f2572a0d0a0ee7cd3c8dd6e340080e | [
"MIT"
] | 2 | 2021-01-01T00:42:17.000Z | 2021-01-01T17:32:01.000Z | implicitresnet/solvers/linear.py | vreshniak/ImplicitResNet | 62e3c2f047f2572a0d0a0ee7cd3c8dd6e340080e | [
"MIT"
] | null | null | null | implicitresnet/solvers/linear.py | vreshniak/ImplicitResNet | 62e3c2f047f2572a0d0a0ee7cd3c8dd6e340080e | [
"MIT"
] | null | null | null | # import warnings
import torch
# from .nonlinear import lbfgs
# import scipy.sparse.linalg as sla
# import numpy as np
def rotmat(a,b):
"""
Adapted from http://www.netlib.org/templates/matlab/rotmat.m
Compute the Givens rotation matrix parameters for a and b.
"""
c = torch.zeros_like(a)
s = torch.zeros_like(a... | 31.075163 | 142 | 0.600694 | # import warnings
import torch
# from .nonlinear import lbfgs
# import scipy.sparse.linalg as sla
# import numpy as np
def rotmat(a,b):
"""
Adapted from http://www.netlib.org/templates/matlab/rotmat.m
Compute the Givens rotation matrix parameters for a and b.
"""
c = torch.zeros_like(a)
s = torch.zeros_like(a... | 0 | 0 | 0 | 0 | 0 | 1,718 | 0 | 0 | 46 |
7dca872fb6e827f89e4706178e94445562d46fc4 | 591 | py | Python | anubis/site.py | pekrau/Anubis | 32290f243a12f37c08f2b28a189011e98ac6e709 | [
"MIT"
] | 2 | 2020-12-24T21:04:30.000Z | 2021-12-14T17:09:39.000Z | anubis/site.py | pekrau/Anubis | 32290f243a12f37c08f2b28a189011e98ac6e709 | [
"MIT"
] | 474 | 2019-11-05T12:38:14.000Z | 2022-03-30T12:55:26.000Z | anubis/site.py | pekrau/Anubis | 32290f243a12f37c08f2b28a189011e98ac6e709 | [
"MIT"
] | null | null | null | "Endpoint for site-specific static files."
import flask
blueprint = flask.Blueprint('site', __name__)
| 26.863636 | 69 | 0.72758 | "Endpoint for site-specific static files."
import http.client
import os.path
import flask
blueprint = flask.Blueprint('site', __name__)
@blueprint.route('/static/<filename>')
def static(filename):
"Return the given site-specific static file."
dirpath = flask.current_app.config['SITE_STATIC_DIR']
if not... | 0 | 428 | 0 | 0 | 0 | 0 | 0 | -10 | 68 |
ed09571c4ecb14ddfbe50176211502c50462ebe0 | 8,769 | py | Python | Ch04.py | econcarol/ISLR | 497b65efdab5291111b8d8472606ea4bc40bba30 | [
"MIT"
] | 3 | 2020-04-18T21:15:56.000Z | 2022-02-03T12:09:54.000Z | Ch04.py | econcarol/ISLR | 497b65efdab5291111b8d8472606ea4bc40bba30 | [
"MIT"
] | null | null | null | Ch04.py | econcarol/ISLR | 497b65efdab5291111b8d8472606ea4bc40bba30 | [
"MIT"
] | 1 | 2021-12-27T23:59:18.000Z | 2021-12-27T23:59:18.000Z | # ISLR Ch 4 by Carol Cui
%reset
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LogisticRegression
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis, QuadraticDiscriminantAnalysis
from sklear... | 32.00365 | 112 | 0.641464 | # ISLR Ch 4 by Carol Cui
%reset
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LogisticRegression
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis, QuadraticDiscriminantAnalysis
from sklear... | 0 | 0 | 0 | 0 | 0 | 153 | 0 | 0 | 88 |
791b6dd92bbb31cebd779a17307f7f84e2d5ee44 | 1,014 | py | Python | cajas/webclient/views/movement_withdraw_requirement_list.py | dmontoya1/cajas | 5eb3d5835250d5dafae398082200b79c1ca8063b | [
"MIT"
] | null | null | null | cajas/webclient/views/movement_withdraw_requirement_list.py | dmontoya1/cajas | 5eb3d5835250d5dafae398082200b79c1ca8063b | [
"MIT"
] | null | null | null | cajas/webclient/views/movement_withdraw_requirement_list.py | dmontoya1/cajas | 5eb3d5835250d5dafae398082200b79c1ca8063b | [
"MIT"
] | null | null | null | from cajas.webclient.views.utils import get_president_user
president = get_president_user()
| 36.214286 | 85 | 0.766272 |
from django.contrib.auth.mixins import LoginRequiredMixin
from django.views.generic import TemplateView
from cajas.movement.models.movement_withdraw import MovementWithdraw
from cajas.office.models.officeCountry import OfficeCountry
from cajas.users.models.partner import Partner
from cajas.webclient.views.utils impor... | 0 | 0 | 0 | 615 | 0 | 0 | 0 | 170 | 135 |
4209e089d8e339853461195c1e6519d689c092bf | 2,289 | py | Python | scrapping_Task4.py | priyanshumishra1009/scrapping | 84e2866bdc07a48a4967a712711eecb8a66a32c8 | [
"MIT"
] | null | null | null | scrapping_Task4.py | priyanshumishra1009/scrapping | 84e2866bdc07a48a4967a712711eecb8a66a32c8 | [
"MIT"
] | null | null | null | scrapping_Task4.py | priyanshumishra1009/scrapping | 84e2866bdc07a48a4967a712711eecb8a66a32c8 | [
"MIT"
] | null | null | null | import json
from bs4 import BeautifulSoup
import requests
op=open('scrap.json')
data_dic,ask,check={},int(input('tell the rank of the movie you wanna see:- ')),json.load(op)
for i in check:
if i['Rank']==ask:
url=i["Link"]
page=requests.get(url)
soup=BeautifulSoup(page.text,"html.parser")
body_of_web=soup.... | 50.866667 | 181 | 0.741372 | import json
from bs4 import BeautifulSoup
import requests
op=open('scrap.json')
data_dic,ask,check={},int(input('tell the rank of the movie you wanna see:- ')),json.load(op)
for i in check:
if i['Rank']==ask:
url=i["Link"]
page=requests.get(url)
soup=BeautifulSoup(page.text,"html.parser")
body_of_web=soup.... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
26d38c700f0094c9b1d8583aca1c94b5b82470bf | 14,154 | py | Python | python/MinVelWrapper.py | usgs/MinVel | c56a247e6b612d81a678ca19b2def64ce3aef107 | [
"CC0-1.0"
] | 1 | 2020-05-15T23:48:19.000Z | 2020-05-15T23:48:19.000Z | python/MinVelWrapper.py | usgs/MinVel | c56a247e6b612d81a678ca19b2def64ce3aef107 | [
"CC0-1.0"
] | 1 | 2019-02-22T18:33:46.000Z | 2019-07-17T22:16:06.000Z | python/MinVelWrapper.py | usgs/MinVel | c56a247e6b612d81a678ca19b2def64ce3aef107 | [
"CC0-1.0"
] | 1 | 2020-10-05T15:17:15.000Z | 2020-10-05T15:17:15.000Z | # Import the modules
import sys
import MinVel as mv
import numpy as np
# NOTES: May want to update temperature dependence of thermal expansivity using Holland and Powell's (2011)
# new revised equations (see figure 1 in that article). This will necessitate recalculating the first
# Gruneisen parameters... | 45.954545 | 117 | 0.391409 | # Import the modules
import sys
import MinVel as mv
import numpy as np
# NOTES: May want to update temperature dependence of thermal expansivity using Holland and Powell's (2011)
# new revised equations (see figure 1 in that article). This will necessitate recalculating the first
# Gruneisen parameters... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2daa18d637292aa93b13f7400412c154d0b1a284 | 3,484 | py | Python | matroid/src/images.py | matroid/matroid-python | e354cd9fe2fe6d8d425a4f82b1c0b9e15e0a5dac | [
"MIT"
] | 16 | 2017-03-29T12:00:26.000Z | 2021-04-25T21:13:11.000Z | matroid/src/images.py | matroid/matroid-python | e354cd9fe2fe6d8d425a4f82b1c0b9e15e0a5dac | [
"MIT"
] | 2 | 2019-06-13T23:14:59.000Z | 2020-06-19T20:07:43.000Z | matroid/src/images.py | matroid/matroid-python | e354cd9fe2fe6d8d425a4f82b1c0b9e15e0a5dac | [
"MIT"
] | 7 | 2017-04-03T09:32:47.000Z | 2020-04-15T21:23:21.000Z |
# https://staging.dev.matroid.com/docs/api/index.html#api-Images-Classify
# https://staging.dev.matroid.com/docs/api/index.html#api-Images-PostLocalize
| 29.777778 | 85 | 0.667049 | import os
import requests
from matroid import error
from matroid.src.helpers import api_call, batch_file_request
# https://staging.dev.matroid.com/docs/api/index.html#api-Images-Classify
@api_call(error.InvalidQueryError)
def classify_image(self, detectorId, file=None, url=None, **options):
"""
Classify an image ... | 0 | 3,172 | 0 | 0 | 0 | 0 | 0 | 25 | 133 |
b793a7d18609a5ee00bb5ed731a29673f11a853c | 657 | py | Python | etl/db.py | cfh294/ElectionModeling | 714da9ea004f042f9f775804168e3761e34f64f0 | [
"MIT"
] | null | null | null | etl/db.py | cfh294/ElectionModeling | 714da9ea004f042f9f775804168e3761e34f64f0 | [
"MIT"
] | null | null | null | etl/db.py | cfh294/ElectionModeling | 714da9ea004f042f9f775804168e3761e34f64f0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
Initialize tables in SQLITE db
"""
main() | 28.565217 | 115 | 0.726027 | #!/usr/bin/env python3
"""
Initialize tables in SQLITE db
"""
import argparse
from models import Base
from sqlalchemy import create_engine
from utils import database_string
def with_args(f):
def with_args_(*args, **kwargs):
ap = argparse.ArgumentParser(description="Provide a connection string to create al... | 0 | 95 | 0 | 0 | 0 | 335 | 0 | 23 | 134 |
cce5ed81d0115df0b6c721df9d259ad23fb9f8b8 | 1,744 | py | Python | yard/skills/66-python/cookbook/yvhai/demo/std/misc.py | paser4se/bbxyard | d09bc6efb75618b2cef047bad9c8b835043446cb | [
"Apache-2.0"
] | 1 | 2016-03-29T02:01:58.000Z | 2016-03-29T02:01:58.000Z | yard/skills/66-python/cookbook/yvhai/demo/std/misc.py | paser4se/bbxyard | d09bc6efb75618b2cef047bad9c8b835043446cb | [
"Apache-2.0"
] | 18 | 2019-02-13T09:15:25.000Z | 2021-12-09T21:32:13.000Z | yard/skills/66-python/cookbook/yvhai/demo/std/misc.py | paser4se/bbxyard | d09bc6efb75618b2cef047bad9c8b835043446cb | [
"Apache-2.0"
] | 2 | 2020-07-05T01:01:30.000Z | 2020-07-08T22:33:06.000Z | #!/usr/bin/env python3
#
| 31.709091 | 92 | 0.554472 | #!/usr/bin/env python3
# 杂项
import math
import glob
from timeit import Timer
from yvhai.demo.base import YHDemo
class MiscDemo(YHDemo):
def __init__(self):
super(MiscDemo, self).__init__('Misc')
@staticmethod
def test_math():
_sec = MiscDemo.mark_section('数学库')
print(' -- math.p... | 48 | 1,384 | 0 | 208 | 0 | 0 | 0 | -4 | 113 |
111de6773d8b6f5fd3cd5bf72499a88f8440046d | 736 | py | Python | tools/img2hex.py | TNKSoftware/helix_remix | 592756de82aba5f8ccb79d0087066f2d7dc4f1d4 | [
"MIT"
] | 1 | 2021-01-13T00:00:26.000Z | 2021-01-13T00:00:26.000Z | tools/img2hex.py | TNKSoftware/helix_remix | 592756de82aba5f8ccb79d0087066f2d7dc4f1d4 | [
"MIT"
] | null | null | null | tools/img2hex.py | TNKSoftware/helix_remix | 592756de82aba5f8ccb79d0087066f2d7dc4f1d4 | [
"MIT"
] | null | null | null | from PIL import Image
import numpy
import sys
argvs = sys.argv
argc = len(argvs)
src = "src.png" if argc <= 1 else argvs[1]
dest = "res.txt" if argc <= 2 else argvs[2]
print("{} => {}".format(src, dest))
img = Image.open(src).convert('RGB')
data = numpy.array(img)
w,h = img.size
sw = w
if sw % 8 != 0:
sw = sw + ... | 15.020408 | 63 | 0.519022 | from PIL import Image
import numpy
import sys
argvs = sys.argv
argc = len(argvs)
src = "src.png" if argc <= 1 else argvs[1]
dest = "res.txt" if argc <= 2 else argvs[2]
print("{} => {}".format(src, dest))
img = Image.open(src).convert('RGB')
data = numpy.array(img)
w,h = img.size
sw = w
if sw % 8 != 0:
sw = sw + ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7a1830607101f5ddb6f0f21ea2d15e595f05db4b | 1,675 | py | Python | vencode/tasks.py | AndreMacedo88/VEnCode-Web | c4c760f4aaea213efcebbf8ab9277e1884aa85ec | [
"BSD-3-Clause"
] | null | null | null | vencode/tasks.py | AndreMacedo88/VEnCode-Web | c4c760f4aaea213efcebbf8ab9277e1884aa85ec | [
"BSD-3-Clause"
] | null | null | null | vencode/tasks.py | AndreMacedo88/VEnCode-Web | c4c760f4aaea213efcebbf8ab9277e1884aa85ec | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import, unicode_literals
# Create your tasks here
| 31.603774 | 82 | 0.741493 | from __future__ import absolute_import, unicode_literals
from os import remove
from celery import shared_task
from VEnCode import DataTpm, Vencodes
from .models import Promoters154CellsBinarized, Enhancers154CellsBinarized
from .utils_views import *
# Create your tasks here
@shared_task
def fantom_results_task(da... | 0 | 723 | 0 | 0 | 0 | 600 | 0 | 83 | 182 |
5fd0124afbd403884eca84748171cfdf8a06af60 | 5,003 | py | Python | library/library_emission.py | ucl-exoplanets/TauREx_public | 28d47f829a2873cf15e3bfb0419b8bc4e5bc03dd | [
"CC-BY-4.0"
] | 18 | 2019-07-22T01:35:24.000Z | 2022-02-10T11:25:42.000Z | library/library_emission.py | ucl-exoplanets/TauREx_public | 28d47f829a2873cf15e3bfb0419b8bc4e5bc03dd | [
"CC-BY-4.0"
] | null | null | null | library/library_emission.py | ucl-exoplanets/TauREx_public | 28d47f829a2873cf15e3bfb0419b8bc4e5bc03dd | [
"CC-BY-4.0"
] | 1 | 2017-10-19T15:14:06.000Z | 2017-10-19T15:14:06.000Z | import scipy, itertools, logging
import numpy as np
def fit_brightness_temp(wave,flux):
'''
function fitting a black body to given flux-wavelength
value.
Input: Flux at wavelength (microns)
Output: brightness temperature.
'''
tempfit = scipy.optimize.fmin(chi,1000,args=(flux,wave),ma... | 33.353333 | 124 | 0.630022 | import scipy,itertools,sys,os,time,logging
import scipy.constants as con
import numpy as np
import ctypes as C
from scipy.stats.mstats_basic import tmean
def black_body(lamb, temp):
#small function calculating plank black body
#input: microns, kelvin
#output: W/m^2/micron
h = 6.62606957e-34
c ... | 0 | 0 | 0 | 0 | 0 | 613 | 0 | 36 | 120 |
2276102bc149b052f122b1b434d684a307f11c8f | 191 | py | Python | daltonapi/__init__.py | TendTo/dalton | 81a0ee9877c0142ccc1f9d92f938e38c465f1724 | [
"MIT"
] | null | null | null | daltonapi/__init__.py | TendTo/dalton | 81a0ee9877c0142ccc1f9d92f938e38c465f1724 | [
"MIT"
] | null | null | null | daltonapi/__init__.py | TendTo/dalton | 81a0ee9877c0142ccc1f9d92f938e38c465f1724 | [
"MIT"
] | null | null | null | """Dalton API Wrapper for WAX
This module provides a Python wrapper for the Atomic Asset API,
with plans to expand to WAX and Atomic Market API endpoints.
"""
__version__ = "0.3.0"
| 23.875 | 65 | 0.717277 | """Dalton API Wrapper for WAX
This module provides a Python wrapper for the Atomic Asset API,
with plans to expand to WAX and Atomic Market API endpoints.
"""
__version__ = "0.3.0"
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3eed3d8d123e605bd0c74c373d5313298c02dd09 | 207 | py | Python | generators/gen_nums.py | UltiRequiem/professional-phython-platzi | 0bf8f97b172d0799d6906193090ef69beb1c8b4b | [
"MIT"
] | 4 | 2021-08-02T21:34:46.000Z | 2021-09-24T03:26:35.000Z | generators/gen_nums.py | UltiRequiem/professional-phython-platzi | 0bf8f97b172d0799d6906193090ef69beb1c8b4b | [
"MIT"
] | null | null | null | generators/gen_nums.py | UltiRequiem/professional-phython-platzi | 0bf8f97b172d0799d6906193090ef69beb1c8b4b | [
"MIT"
] | 4 | 2021-08-02T21:34:47.000Z | 2021-08-11T03:21:37.000Z |
my_nums = num_generators(10)
while True:
try:
print(next(my_nums))
except StopIteration:
break
| 15.923077 | 33 | 0.63285 | def num_generators(max_num: int):
for num in range(1,max_num):
yield num
my_nums = num_generators(10)
while True:
try:
print(next(my_nums))
except StopIteration:
break
| 0 | 0 | 0 | 0 | 63 | 0 | 0 | 0 | 22 |
1de6239082805f3d24a765d3299b9bf0356bdc0e | 663 | py | Python | gui_e.g/try_wx_prc1.py | lukasdean/robust_python | 033d4fb84a3e7dcd4b8986125291b6f32d780c5c | [
"MIT"
] | null | null | null | gui_e.g/try_wx_prc1.py | lukasdean/robust_python | 033d4fb84a3e7dcd4b8986125291b6f32d780c5c | [
"MIT"
] | null | null | null | gui_e.g/try_wx_prc1.py | lukasdean/robust_python | 033d4fb84a3e7dcd4b8986125291b6f32d780c5c | [
"MIT"
] | null | null | null | #!/user/bin/env python
# -*-coding:utf-8 -*-
# @CreateTime : 2021/10/25 0:25
# @Author : xujiahui
# @Project : robust_python
# @File : try_wx_prc1.py
# @Version : V0.0.1
# @Desc : ?
if __name__ == "__main__":
app = MyApp()
app.MainLoop()
| 19.5 | 54 | 0.53997 | #!/user/bin/env python
# -*-coding:utf-8 -*-
# @CreateTime : 2021/10/25 0:25
# @Author : xujiahui
# @Project : robust_python
# @File : try_wx_prc1.py
# @Version : V0.0.1
# @Desc : ?
import wx
class MainFrame(wx.Frame):
def __init__(self, parent, id, title, size):
sup... | 6 | 0 | 0 | 309 | 0 | 0 | 0 | -12 | 75 |
d0df816dd0c90dd0f25d52021a7d810faf5c8da7 | 1,388 | py | Python | treadmill/api/cron.py | gaocegege/treadmill | 04325d319c0ee912c066f07b88b674e84485f154 | [
"Apache-2.0"
] | 2 | 2017-03-20T07:13:33.000Z | 2017-05-03T03:39:53.000Z | treadmill/api/cron.py | gaocegege/treadmill | 04325d319c0ee912c066f07b88b674e84485f154 | [
"Apache-2.0"
] | 12 | 2017-07-10T07:04:06.000Z | 2017-07-26T09:32:54.000Z | treadmill/api/cron.py | gaocegege/treadmill | 04325d319c0ee912c066f07b88b674e84485f154 | [
"Apache-2.0"
] | 2 | 2017-05-04T11:25:32.000Z | 2017-07-11T09:10:01.000Z | """Implementation of cron API.
"""
# import fnmatch
import logging
from treadmill import authz
# from treadmill import context
# from treadmill import cron
# from treadmill.cron import model as cron_model
_LOGGER = logging.getLogger(__name__)
def init(authorizer):
"""Returns module API wrapped with authorizer... | 23.525424 | 62 | 0.556916 | """Implementation of cron API.
"""
# import fnmatch
import logging
from treadmill import authz
# from treadmill import context
# from treadmill import cron
from treadmill import schema
# from treadmill.cron import model as cron_model
_LOGGER = logging.getLogger(__name__)
class API(object):
"""Treadmill Cron RE... | 0 | 580 | 0 | 367 | 0 | 0 | 0 | 7 | 45 |
82ad456a9639256075ab802f83982de3249310a7 | 109 | py | Python | Src/PythonSharp.Tests/Examples/namedargs.py | ajlopez/PythonSharp | 7120ca465311bdb9e8cbb3c66f6214f28d4dd13e | [
"MIT"
] | 10 | 2017-09-21T04:31:20.000Z | 2022-01-29T16:46:41.000Z | Src/PythonSharp.Tests/Examples/namedargs.py | ajlopez/PythonSharp | 7120ca465311bdb9e8cbb3c66f6214f28d4dd13e | [
"MIT"
] | null | null | null | Src/PythonSharp.Tests/Examples/namedargs.py | ajlopez/PythonSharp | 7120ca465311bdb9e8cbb3c66f6214f28d4dd13e | [
"MIT"
] | 5 | 2016-07-31T20:01:13.000Z | 2021-12-01T01:37:49.000Z |
print(foo()) # 5
print(foo(b=3)) # 7
print(foo(b=3,a=2)) # 8
| 12.111111 | 24 | 0.477064 | def foo(a=1, b=2):
return a+b*2
print(foo()) # 5
print(foo(b=3)) # 7
print(foo(b=3,a=2)) # 8
| 3 | 0 | 0 | 0 | 0 | 15 | 0 | 0 | 23 |
3777daa4d07af17bbe8867fb0b79c7e85ff2eb18 | 1,178 | py | Python | tests/test_ws.py | kelar86/detectem | b1ecc3543b7c44ee76c4cac0d3896a7747bf86c1 | [
"MIT"
] | null | null | null | tests/test_ws.py | kelar86/detectem | b1ecc3543b7c44ee76c4cac0d3896a7747bf86c1 | [
"MIT"
] | 1 | 2021-03-26T00:23:57.000Z | 2021-03-26T00:23:57.000Z | tests/test_ws.py | kelar86/detectem | b1ecc3543b7c44ee76c4cac0d3896a7747bf86c1 | [
"MIT"
] | 1 | 2019-07-28T10:11:01.000Z | 2019-07-28T10:11:01.000Z |
"""
Tests run with `autospec` to match function signature in case of change
"""
| 26.177778 | 78 | 0.686757 | import json
from unittest.mock import patch
from boddle import boddle
from detectem.ws import do_detection
from detectem.exceptions import SplashError, NoPluginsError
"""
Tests run with `autospec` to match function signature in case of change
"""
@patch('detectem.ws.get_detection_results', autospec=True)
def test_... | 0 | 856 | 0 | 0 | 0 | 0 | 0 | 57 | 181 |
30b176793b08f80c3bc32214bb465d1be846197c | 2,465 | py | Python | SpeedTest.py | kyleishie/ISPMonitor | a547913bdf1e980f17cadf86608dacf269bb3f60 | [
"MIT"
] | null | null | null | SpeedTest.py | kyleishie/ISPMonitor | a547913bdf1e980f17cadf86608dacf269bb3f60 | [
"MIT"
] | null | null | null | SpeedTest.py | kyleishie/ISPMonitor | a547913bdf1e980f17cadf86608dacf269bb3f60 | [
"MIT"
] | null | null | null | """SpeedTester."""
| 35.724638 | 118 | 0.647465 | """SpeedTester."""
import datetime
import json
import dateutil.parser
class SpeedTestResult(object):
"""Represents the results of a test performed by a SpeedTester."""
def __init__(self, download, startTime, ping=None, upload=None, endTime=None):
"""Results of a speedtest performed by a SpeedTester."... | 0 | 0 | 0 | 2,323 | 0 | 0 | 0 | -15 | 135 |
fc36e5f276ceb852f85f61f79def217e7d9e1808 | 1,469 | py | Python | hedonometer/model.py | trabajo-grado/arcs-classification | 0d4b5f861c4a9f81151f1c9b30c410dd13de9646 | [
"MIT"
] | null | null | null | hedonometer/model.py | trabajo-grado/arcs-classification | 0d4b5f861c4a9f81151f1c9b30c410dd13de9646 | [
"MIT"
] | null | null | null | hedonometer/model.py | trabajo-grado/arcs-classification | 0d4b5f861c4a9f81151f1c9b30c410dd13de9646 | [
"MIT"
] | 2 | 2021-05-27T01:59:57.000Z | 2021-08-19T12:31:47.000Z | import torch.nn
| 32.644444 | 63 | 0.593601 | import torch.nn
from torch import nn
from transformers import BertModel
import numpy as np
class SentimentClassifier(nn.Module):
def __init__(self, pretrained_model, name):
super(SentimentClassifier, self).__init__()
self.name = name
self.bert = BertModel.from_pretrained(pretrained_model)
... | 0 | 0 | 0 | 1,354 | 0 | 0 | 0 | 9 | 89 |
6c038f1c4d41f50ee2e6474eb543ec844881d310 | 60 | py | Python | TUI/TCC/Catalog/__init__.py | StarkillerX42/stui | 668628cf7539e7d2be12846033141e4eb8616fe1 | [
"BSD-3-Clause"
] | null | null | null | TUI/TCC/Catalog/__init__.py | StarkillerX42/stui | 668628cf7539e7d2be12846033141e4eb8616fe1 | [
"BSD-3-Clause"
] | null | null | null | TUI/TCC/Catalog/__init__.py | StarkillerX42/stui | 668628cf7539e7d2be12846033141e4eb8616fe1 | [
"BSD-3-Clause"
] | null | null | null | """Catalog of user objects"""
| 20 | 29 | 0.733333 | """Catalog of user objects"""
from .CatalogMenuWdg import *
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 | 22 |
545ec95f8f61929e8c9526a6c2c6b417d5ba52ea | 1,388 | py | Python | dictionaries/inventory.py | MaggieIllustrations/softuni-github-programming | f5695cb14602f3d2974359f6d8734332acc650d3 | [
"MIT"
] | null | null | null | dictionaries/inventory.py | MaggieIllustrations/softuni-github-programming | f5695cb14602f3d2974359f6d8734332acc650d3 | [
"MIT"
] | null | null | null | dictionaries/inventory.py | MaggieIllustrations/softuni-github-programming | f5695cb14602f3d2974359f6d8734332acc650d3 | [
"MIT"
] | 1 | 2022-01-14T17:12:44.000Z | 2022-01-14T17:12:44.000Z | #You will receive a journal with some Collecting items, separated with ', ' (comma and space). After that, until receiving "Craft!" you will be receiving different commands.
#Commands (split by " - "):
#"Collect - {item}" Receiving this command, you should add the given item in your inventory. If the item already exis... | 49.571429 | 173 | 0.68732 | #You will receive a journal with some Collecting items, separated with ', ' (comma and space). After that, until receiving "Craft!" you will be receiving different commands.
#Commands (split by " - "):
#"Collect - {item}" – Receiving this command, you should add the given item in your inventory. If the item already exi... | 15 | 0 | 0 | 0 | 0 | 206 | 0 | 0 | 22 |
406ad2a5e1ceed6576faa87fdec56b6b46fcb1c5 | 8,964 | py | Python | Captain/Captain.py | HerouFenix/rl_bots | 948b2b718a5777265f9571fa0297a17cec985064 | [
"MIT"
] | null | null | null | Captain/Captain.py | HerouFenix/rl_bots | 948b2b718a5777265f9571fa0297a17cec985064 | [
"MIT"
] | 1 | 2022-02-17T23:29:56.000Z | 2022-02-17T23:29:56.000Z | Captain/Captain.py | HerouFenix/rl_bots | 948b2b718a5777265f9571fa0297a17cec985064 | [
"MIT"
] | null | null | null |
from rlbot.agents.base_agent import GameTickPacket
try:
except:
print("==========================================")
print("\nrlutilities import failed.")
print("\n==========================================")
quit()
RENDERING = True
| 42.483412 | 184 | 0.625614 | from typing import List
from rlbot.agents.base_agent import BaseAgent, GameTickPacket, SimpleControllerState
from rlbot.utils.structures.game_data_struct import GameTickPacket
from tmcp import TMCPHandler, TMCPMessage
from util.vec import Vec3
from util.utilities import physics_object, Vector
from policy import bas... | 0 | 0 | 0 | 8,061 | 0 | 0 | 0 | 347 | 303 |
dda5db1c1a6e695025c263bd0d91096552216c7b | 4,794 | py | Python | 0167_two_sum_2/python_source.py | arthurdysart/LeetCode | 69f90877c5466927e8b081c4268cbcda074813ec | [
"Unlicense"
] | null | null | null | 0167_two_sum_2/python_source.py | arthurdysart/LeetCode | 69f90877c5466927e8b081c4268cbcda074813ec | [
"Unlicense"
] | null | null | null | 0167_two_sum_2/python_source.py | arthurdysart/LeetCode | 69f90877c5466927e8b081c4268cbcda074813ec | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Leetcode - Two Sum II
https://leetcode.com/problems/two-sum-ii-input-array-is-sorted
Created on Sun Nov 18 20:39:12 2018
@author: Arthur Dysart
"""
## REQUIRED MODULES
import sys
## MODULE DEFINITIONS
## MAIN MODULE
if __name__ == "__main__":
# Import exerci... | 25.365079 | 73 | 0.477263 | # -*- coding: utf-8 -*-
"""
Leetcode - Two Sum II
https://leetcode.com/problems/two-sum-ii-input-array-is-sorted
Created on Sun Nov 18 20:39:12 2018
@author: Arthur Dysart
"""
## REQUIRED MODULES
import sys
## MODULE DEFINITIONS
class Solution:
"""
One-pointer with binary search of sorted ... | 0 | 0 | 0 | 4,206 | 0 | 0 | 0 | 0 | 98 |
c6a64b8df51562d7cfa6dd28725199fe6d3b5a6d | 324 | py | Python | flight/migrations/0004_auto_20190719_0900.py | PatrickCmd/flight-booking-application | a521932530d622c6eef46ea6a0f968c8267b622e | [
"MIT"
] | null | null | null | flight/migrations/0004_auto_20190719_0900.py | PatrickCmd/flight-booking-application | a521932530d622c6eef46ea6a0f968c8267b622e | [
"MIT"
] | 8 | 2020-02-12T01:01:51.000Z | 2022-03-11T23:59:40.000Z | flight/migrations/0004_auto_20190719_0900.py | PatrickCmd/flight-booking-application | a521932530d622c6eef46ea6a0f968c8267b622e | [
"MIT"
] | 1 | 2019-08-13T19:04:11.000Z | 2019-08-13T19:04:11.000Z | # Generated by Django 2.2.3 on 2019-07-19 09:00
| 21.6 | 72 | 0.660494 | # Generated by Django 2.2.3 on 2019-07-19 09:00
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("flight", "0003_auto_20190719_0814")]
operations = [
migrations.RenameField(
model_name="seat", old_name="number", new_name="seat_number"
)
... | 0 | 0 | 0 | 218 | 0 | 0 | 0 | 11 | 46 |
320f6aa7caac035b61fa34a5b1c169e05b05a8d9 | 319 | py | Python | gryphon/tests/environment/exchange_wrappers/coinbase_live_orders.py | qiquanzhijia/gryphon | 7bb2c646e638212bd1352feb1b5d21536a5b918d | [
"Apache-2.0"
] | 1,109 | 2019-06-20T19:23:27.000Z | 2022-03-20T14:03:43.000Z | gryphon/tests/environment/exchange_wrappers/coinbase_live_orders.py | qiquanzhijia/gryphon | 7bb2c646e638212bd1352feb1b5d21536a5b918d | [
"Apache-2.0"
] | 63 | 2019-06-21T05:36:17.000Z | 2021-05-26T21:08:15.000Z | gryphon/tests/environment/exchange_wrappers/coinbase_live_orders.py | qiquanzhijia/gryphon | 7bb2c646e638212bd1352feb1b5d21536a5b918d | [
"Apache-2.0"
] | 181 | 2019-06-20T19:42:05.000Z | 2022-03-21T13:05:13.000Z | import pyximport; pyximport.install()
| 31.9 | 82 | 0.830721 | import pyximport; pyximport.install()
from gryphon.lib.exchange.coinbase_btc_usd import CoinbaseBTCUSDExchange
from gryphon.tests.environment.exchange_wrappers.live_orders import LiveOrdersTest
class TestCoinbaseBTCUSDLiveOrders(LiveOrdersTest):
def setUp(self):
self.exchange = CoinbaseBTCUSDExchange()
| 0 | 0 | 0 | 100 | 0 | 0 | 0 | 112 | 68 |
e84c648aa2207e9f18ac7f16ec41c37e06f68057 | 2,351 | py | Python | addons/project/tests/test_project_config.py | SHIVJITH/Odoo_Machine_Test | 310497a9872db7844b521e6dab5f7a9f61d365a4 | [
"Apache-2.0"
] | null | null | null | addons/project/tests/test_project_config.py | SHIVJITH/Odoo_Machine_Test | 310497a9872db7844b521e6dab5f7a9f61d365a4 | [
"Apache-2.0"
] | null | null | null | addons/project/tests/test_project_config.py | SHIVJITH/Odoo_Machine_Test | 310497a9872db7844b521e6dab5f7a9f61d365a4 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import logging
_logger = logging.getLogger(__name__)
| 37.919355 | 79 | 0.649085 | # -*- coding: utf-8 -*-
import logging
from .test_project_base import TestProjectCommon
_logger = logging.getLogger(__name__)
class TestProjectConfig(TestProjectCommon):
"""Test module configuration and its effects on projects."""
@classmethod
def setUpClass(cls):
super(TestProjectConfig, cls)... | 0 | 905 | 0 | 1,293 | 0 | 0 | 0 | 27 | 46 |
eacd81437dbcbc037e8b4df23a508d3943eb12fe | 1,565 | py | Python | restructure_graphs.py | mheydasch/GC_analyzer_helpfiles | 693bca6a451d80db27f434a1482ab1a692533cd3 | [
"MIT"
] | null | null | null | restructure_graphs.py | mheydasch/GC_analyzer_helpfiles | 693bca6a451d80db27f434a1482ab1a692533cd3 | [
"MIT"
] | null | null | null | restructure_graphs.py | mheydasch/GC_analyzer_helpfiles | 693bca6a451d80db27f434a1482ab1a692533cd3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jan 14 15:52:16 2019
@author: max
"""
#%%
if __name__ == '__main__':
args=parseArguments()
path=args.dir
copy_file(path)
print(args)
... | 23.014706 | 103 | 0.577636 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jan 14 15:52:16 2019
@author: max
"""
import os
import re
import argparse
import shutil
#%%
def parseArguments():
# Define the parser and read arguments
parser = argparse.ArgumentParser(description='Get tags from all files in a directory.')
par... | 0 | 0 | 0 | 0 | 0 | 1,060 | 0 | -38 | 185 |
4102a635a2bfa689a3def92d450bca6b2ded2ded | 3,833 | py | Python | hardware_state.py | Lukas-Fuchs/alarm | 33dff7e7b09ecd0b073997f43b544d3a8fb2c559 | [
"MIT"
] | null | null | null | hardware_state.py | Lukas-Fuchs/alarm | 33dff7e7b09ecd0b073997f43b544d3a8fb2c559 | [
"MIT"
] | 3 | 2020-12-22T15:53:44.000Z | 2020-12-23T16:09:47.000Z | hardware_state.py | Lukas-Fuchs/alarm | 33dff7e7b09ecd0b073997f43b544d3a8fb2c559 | [
"MIT"
] | null | null | null |
# pretty simple data class to describe actions to be taken as rule consequences
| 31.162602 | 108 | 0.559092 | import datetime
from datetime import datetime as dt
import threading
from threading import Lock
import os
# pretty simple data class to describe actions to be taken as rule consequences
class action:
# unique identifier for this action; used to reference it further
id = ""
# fifo to write to
target = "... | 0 | 0 | 0 | 3,600 | 0 | 0 | 0 | -4 | 155 |
62851c76623c24d5ae5d1266b1718b9002223aae | 7,088 | py | Python | examples/ConfigActuation/tests/test_config_actuation.py | craig8/volttron | 2a954311d323effa3b79c2a53f6e8c3bb9664e1c | [
"Apache-2.0",
"BSD-2-Clause"
] | 1 | 2020-06-08T16:54:28.000Z | 2020-06-08T16:54:28.000Z | examples/ConfigActuation/tests/test_config_actuation.py | craig8/volttron | 2a954311d323effa3b79c2a53f6e8c3bb9664e1c | [
"Apache-2.0",
"BSD-2-Clause"
] | 8 | 2016-10-07T22:49:28.000Z | 2022-02-23T00:57:58.000Z | examples/ConfigActuation/tests/test_config_actuation.py | craig8/volttron | 2a954311d323effa3b79c2a53f6e8c3bb9664e1c | [
"Apache-2.0",
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*- {{{
# vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et:
#
# Copyright 2020, Battelle Memorial Institute.
#
# 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... | 41.694118 | 92 | 0.705277 | # -*- coding: utf-8 -*- {{{
# vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et:
#
# Copyright 2020, Battelle Memorial Institute.
#
# 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... | 0 | 3,652 | 0 | 0 | 0 | 759 | 0 | 192 | 246 |
7bb04b77685aaae83c05b0c21390584f7a553a1f | 878 | py | Python | src/piece/DPieceAI.py | fireclawthefox/AnkandoraLight | 05b71e1a2919141cce02cb1aade95fbac682614b | [
"BSD-2-Clause"
] | 3 | 2020-07-31T10:27:06.000Z | 2022-01-11T20:28:55.000Z | src/piece/DPieceAI.py | fireclawthefox/AnkandoraLight | 05b71e1a2919141cce02cb1aade95fbac682614b | [
"BSD-2-Clause"
] | null | null | null | src/piece/DPieceAI.py | fireclawthefox/AnkandoraLight | 05b71e1a2919141cce02cb1aade95fbac682614b | [
"BSD-2-Clause"
] | 1 | 2020-07-30T08:23:28.000Z | 2020-07-30T08:23:28.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
__author__ = "Fireclaw the Fox"
__license__ = """
Simplified BSD (BSD 2-Clause) License.
See License.txt or http://opensource.org/licenses/BSD-2-Clause for more info
"""
| 28.322581 | 83 | 0.705011 | #!/usr/bin/python
# -*- coding: utf-8 -*-
__author__ = "Fireclaw the Fox"
__license__ = """
Simplified BSD (BSD 2-Clause) License.
See License.txt or http://opensource.org/licenses/BSD-2-Clause for more info
"""
from direct.distributed.DistributedSmoothNodeAI import DistributedSmoothNodeAI
class DPieceAI(Distributed... | 0 | 0 | 0 | 562 | 0 | 0 | 0 | 57 | 46 |
a591bc1cf059796b5c6b9b23aa7308bee5a85c7d | 3,137 | py | Python | ascii_chess/ascii_board.py | butwhywhy/ASCIIchess | 133b54cacd8ba3b96a93d4cf4822e85fc7a4b4b1 | [
"MIT"
] | null | null | null | ascii_chess/ascii_board.py | butwhywhy/ASCIIchess | 133b54cacd8ba3b96a93d4cf4822e85fc7a4b4b1 | [
"MIT"
] | 3 | 2015-02-16T08:24:37.000Z | 2015-02-16T08:29:52.000Z | ascii_chess/ascii_board.py | butwhywhy/ASCIIchess | 133b54cacd8ba3b96a93d4cf4822e85fc7a4b4b1 | [
"MIT"
] | null | null | null | from ascii_drawing import figure_from_string
from .chess_rules import KING, QUEEN, ROOK, BISHOP, KNIGHT, PAWN
PIECE_NAMES = {KING: 'king', QUEEN: 'queen', ROOK: 'rook', BISHOP: 'bishop',
KNIGHT: 'knight', PAWN: 'pawn'}
from os import path
from pkg_resources import resource_string
ascii_pieces = {p : figure_f... | 35.247191 | 119 | 0.623207 | from ascii_drawing import Canvas, Square, figure_from_string, GeneralColorConversor, ScaleConversor
class ChessBoard(object):
def __init__(self, side, white_darkness, black_darkness):
self.extra = 4
self.side = side
self.white_darkness = white_darkness
self.black_darkness = black_d... | 0 | 0 | 0 | 2,563 | 0 | 0 | 0 | 55 | 46 |
a9de616a234815a30eff3f4f68d051ee59ecfb45 | 1,802 | py | Python | egyptianFractions.py | Existence-glitch/PythonCodes | a49121855364a5e0ac2ff227ef91f19086a52f09 | [
"MIT"
] | 1 | 2021-06-08T06:53:50.000Z | 2021-06-08T06:53:50.000Z | egyptianFractions.py | Existence-glitch/PythonCodes | a49121855364a5e0ac2ff227ef91f19086a52f09 | [
"MIT"
] | null | null | null | egyptianFractions.py | Existence-glitch/PythonCodes | a49121855364a5e0ac2ff227ef91f19086a52f09 | [
"MIT"
] | null | null | null |
main() | 43.95122 | 142 | 0.615982 | from math import gcd, ceil
def fibonacci(a, b):
#Se calcula el denominador de la más grande fracción unitaria ("Largest unit fraction")
luf_den = ceil(b/a)
#Resta entre la fracción a/b entregada y la más grande fracción unitaria que podemos extraer de ella.
subtraction = a/b - 1/luf_den
#Si ... | 36 | 0 | 0 | 0 | 0 | 1,698 | 0 | 5 | 73 |
b7857ccc0fb4a35bd036b819cf6fde09b5d47feb | 1,379 | py | Python | pineapple-py-main/src/backend.py | yujiecong/yjcL | 6d6dc4ad3611cb34c07192a1a3038a1ac3f67d6c | [
"MIT"
] | null | null | null | pineapple-py-main/src/backend.py | yujiecong/yjcL | 6d6dc4ad3611cb34c07192a1a3038a1ac3f67d6c | [
"MIT"
] | null | null | null | pineapple-py-main/src/backend.py | yujiecong/yjcL | 6d6dc4ad3611cb34c07192a1a3038a1ac3f67d6c | [
"MIT"
] | null | null | null |
if __name__ == '__main__':
main()
| 28.729167 | 87 | 0.672951 | import sys
from definition import Variable, Statement, Assignment, Print, SourceCode
from lexer import Lexer
from parser import parse
class Interpreter:
def __init__(self, source_code: str):
self.lexer = Lexer(source_code)
self.ast = parse(self.lexer)
self.variables = {}
def resolve... | 0 | 0 | 0 | 1,003 | 0 | 153 | 0 | 46 | 135 |
8561179a7caf34130d4ba161d933cfb6e7685eb6 | 359 | py | Python | core/migrations/0006_rename_choice_choices_name.py | morethanmin/fooorm | 770894ce20ececcfc635b28948f69819b72834a0 | [
"MIT"
] | 1 | 2021-09-10T07:08:16.000Z | 2021-09-10T07:08:16.000Z | core/migrations/0006_rename_choice_choices_name.py | morethanmin/fooorm | 770894ce20ececcfc635b28948f69819b72834a0 | [
"MIT"
] | null | null | null | core/migrations/0006_rename_choice_choices_name.py | morethanmin/fooorm | 770894ce20ececcfc635b28948f69819b72834a0 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.5 on 2021-08-07 03:52
| 18.894737 | 47 | 0.579387 | # Generated by Django 3.2.5 on 2021-08-07 03:52
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0005_auto_20210806_2255'),
]
operations = [
migrations.RenameField(
model_name='choices',
old_name='choice',
... | 0 | 0 | 0 | 253 | 0 | 0 | 0 | 11 | 46 |
0abcc7d18ee60c3f88f686aca48f7459c7c0d8b6 | 997 | py | Python | 04-functions/lottery.py | sn-lvpthe/CirquePy | a22cd1c76e650ab1752cbd6a3edfcfd50d9d58dc | [
"Unlicense"
] | null | null | null | 04-functions/lottery.py | sn-lvpthe/CirquePy | a22cd1c76e650ab1752cbd6a3edfcfd50d9d58dc | [
"Unlicense"
] | null | null | null | 04-functions/lottery.py | sn-lvpthe/CirquePy | a22cd1c76e650ab1752cbd6a3edfcfd50d9d58dc | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
if __name__ == "__main__": # this means that if somebody ran this Python file, execute only the code below
main()
| 26.945946 | 129 | 0.656971 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import random
def generate_lottery_numbers(quantity):
num_list = []
while True:
if len(num_list) == quantity: # when the length of the list reaches the desired quantity, stop choosing new numbers
break
lot_num = random.randint(1, 5... | 0 | 0 | 0 | 0 | 0 | 767 | 0 | -8 | 69 |