Skip to content

Instantly share code, notes, and snippets.

View saisankargochhayat's full-sized avatar
🐳

Saisankar Gochhayat saisankargochhayat

🐳
View GitHub Profile
@saisankargochhayat
saisankargochhayat / Closest_pair_divide_and_conquer.py
Created January 20, 2021 12:31
Closest Pair of Points using Divide and Conquer
# A utility function to find the distance between two points
def dist(p1, p2):
return (p1[0] - p2[0])**2 + (p1[1] - p2[1])**2
# O(N) operation as at most 3 points are passed to this.
def brute(xP, n):
minDis = float("inf")
for i in range(n):
for j in range(i + 1, n):
currDis = dist(xP[i], xP[j])
@saisankargochhayat
saisankargochhayat / lev.py
Created January 12, 2021 03:00
modified for two strings
import pdb
import time
#!/usr/bin/python
# implementation of levenshtein for matching indian names
''' Calculates the Levenshtein distance of 2 strings'''
import csv
from optparse import OptionParser
import sys
{
"conditions": [
{
"status": "True",
"type": "Completed"
}
],
"finishedAt": "2020-07-20T16:27:32Z",
"nodes": {
"adviser-a7730e47": {
self = <tests.test_pipfile.TestPipfileLock object at 0x7f4392bab550>
pipfile_lock = 'Pipfile_test1.lock'
@pytest.mark.parametrize("pipfile_lock", [
'Pipfile_test1.lock',
])
def test_from_string(self, pipfile_lock: str):
with open(os.path.join(self.data_dir, 'pipfiles', pipfile_lock), 'r') as pipfile_lock_file:
content = pipfile_lock_file.read()
adviser-4e4520b7-3285270457: {"name": "sentry_sdk.errors", "levelname": "DEBUG", "module": "atexit", "lineno": 51, "funcname": "_shutdown", "created": 1595279407.2818103, "asctime": "2020-07-20 21:10:07,281", "msecs": 281.8102836608887, "relative_created": 169235.69345474243, "process": 1, "message": "atexit: got shutdown signal"}
adviser-4e4520b7-3285270457: {"name": "sentry_sdk.errors", "levelname": "DEBUG", "module": "atexit", "lineno": 55, "funcname": "_shutdown", "created": 1595279407.2824044, "asctime": "2020-07-20 21:10:07,282", "msecs": 282.40442276000977, "relative_created": 169236.28759384155, "process": 1, "message": "atexit: shutting down client"}
adviser-4e4520b7-3285270457: {"name": "sentry_sdk.errors", "levelname": "DEBUG", "module": "transport", "lineno": 335, "funcname": "flush", "created": 1595279407.2826114, "asctime": "2020-07-20 21:10:07,282", "msecs": 282.6113700866699, "relative_created": 169236.4945411682, "process": 1, "message": "Flushing HTTP transport"}
adviser-4e4520b7-3285270457:
{
"metadata": {
"analyzer": "thoth-adviser",
"analyzer_version": "0.9.4",
"arguments": {
"advise": {
"beam_width": 100000,
"count": 1,
"dev": false,
"library_usage": {
[sai@sai-pc srcops-testing]$ argo logs kebechet-job-2fa8e27a --follow
kebechet-job-2fa8e27a-625046206: {"name": "sentry_sdk.errors", "levelname": "DEBUG", "module": "__init__", "lineno": 99, "funcname": "setup_integrations", "created": 1593632198.4405189, "asctime": "2020-07-01 19:36:38,440", "msecs": 440.518856048584, "relative_created": 1114.8648262023926, "process": 1, "message": "Setting up integrations (with default = True)"}
kebechet-job-2fa8e27a-625046206: {"name": "sentry_sdk.errors", "levelname": "DEBUG", "module": "__init__", "lineno": 117, "funcname": "setup_integrations", "created": 1593632198.4429998, "asctime": "2020-07-01 19:36:38,442", "msecs": 442.99983978271484, "relative_created": 1117.3458099365234, "process": 1, "message": "Setting up previously not enabled integration logging"}
kebechet-job-2fa8e27a-625046206: {"name": "sentry_sdk.errors", "levelname": "DEBUG", "module": "__init__", "lineno": 117, "funcname": "setup_integrations", "created": 1593632198.4436004, "asctime": "2020-07-01 19:
1. copy https://raw.githubusercontent.com/thoth-station/template-project/master/.pre-commit-config.yaml to the repo
2. git add and commit
3. pre-commit install so that pre-commit hooks get installed
4. think about the config file: do you need the manifest check? do you need mypy?
5. pre-commit run --all-files so that the repo gets checks
6. fix issues...
7. git commit and send a PR!
8. feel the karma increase
<details><summary>$ pipenv --support</summary>
Pipenv version: `'2020.6.2'`
Pipenv location: `'/usr/local/lib/python3.8/site-packages/pipenv'`
Python location: `'/usr/bin/python3'`
Python installations found:
import re, os
from kebechet.utils import cloned_repo
from kebechet.managers import VersionManager
import typing
from git import Repo
import semver
import logging
from datetime import datetime