Get Attribute

Fri 14 November 2025

title: "Get Attribute" author: "Rj" date: 2019-04-20 description: "List Test" type: technical_note draft: false


import sys
print(getattr(sys, 'version'))
3.6.8 |Anaconda, Inc.| (default, Dec 29 2018, 19:04:46) 
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)]


Score: 0

Category: basics

Read More

Get-Current-Conda

Fri 14 November 2025
import sys
import os

# Get the parent directory of the current notebook
current_dir = os.path.dirname(os.path.abspath(__file__)) if "__file__" in globals() else os.getcwd()
parent_dir = os.path.abspath(os.path.join(current_dir, "../../"))  # Adjust the path to reach the `notebooks` folder

# Add the parent directory to sys.path …

Category: plot-compare

Read More

Get Default Encoding

Fri 14 November 2025

title: "Get Default Encoding" author: "Rj" date: 2019-04-20 description: "-" type: technical_note draft: false


import sys
print(sys.getdefaultencoding())
utf-8

Score: 0

Category: basics

Read More

Get-Encoding

Fri 14 November 2025

title: "Get Encoding" author: "Rj" date: 2019-04-20 description: "-" type: technical_note draft: false


import sys
print(sys.getdefaultencoding())
utf-8


Score: 0

Category: basics

Read More

Get Full Matches

Fri 14 November 2025

title: "Get Full Matches" author: "Raja CSP Raman" date: 2019-04-20 description: "-" type: technical_note draft: false


import re
from typing import List
_RGX = re.compile(r'(.)\1*')
def long_repeat(string: str) -> List[str]:
    return [m.group(0) for m in _RGX.finditer(string)]
print(long_repeat('devvvvveeeeeeeeeeeloooooooooper'))
['d', 'e', 'vvvvv', 'eeeeeeeeeee', 'l …

Category: regex

Read More

Get Int Input

Fri 14 November 2025

title: "Get Int Input" author: "Rj" date: 2019-04-20 description: "List Test" type: technical_note draft: false


x = int(input("Enter a number: "))
y = int(input("Enter a number: "))

print((x+y))
Enter a number: one



---------------------------------------------------------------------------

ValueError                                Traceback (most recent call last)

<ipython-input-2-d1355a0ae898> in <module>()
----> 1 x = int(input …

Category: basics

Read More

Get-Specific-Contents

Fri 14 November 2025

title: "Get Specific Contents" author: "Raja CSP Raman" date: 2019-04-20 description: "-" type: technical_note draft: false


content = """<!DOCTYPE html>

  <!-- The following setting enables collapsible lists -->
  <p>
  <a href="#human">Human</a></p>

  <p class="collapse-section">
  <a class="collapsed collapse-toggle" data-toggle="collapse" 
  href=#mammals>Mammals</a>
  <div class="collapse" id="mammals">
  <ul …

Category: regex

Read More

Get-Value-And-Check-1

Fri 14 November 2025

DATA                              = "data"
JSON_DATA                         = "jsonData"
PENALIZATION_IMPUTATION_WEIGHTAGE = "penalizationImputationWeightage"
mltrainconfig_json = {
    "data" : {
        "jsonData" : {
            "penalizationImputationWeightage" : {
                "one" : "two"
            }
        }
    }
}
penalization_imputation_weightage = mltrainconfig_json.get(DATA, {})\
        .get(JSON_DATA, {})\
        .get(PENALIZATION_IMPUTATION_WEIGHTAGE, {})
penalization_imputation_weightage = penalization_imputation_weightage if penalization_imputation_weightage else imputing_factor_value
penalization_imputation_weightage
{'one': 'two'}



mltrainconfig_json = {
    "data" : {
        "jsonData" : {
            "penalizationImputationWeightage2" : {
                "one" : "two"
            }
        }
    }
}
imputing_factor_value = {
    "eleven" : "twelve"
}
penalization_imputation_weightage = mltrainconfig_json.get(DATA, {})\
        .get(JSON_DATA, {})\
        .get(PENALIZATION_IMPUTATION_WEIGHTAGE, {})
penalization_imputation_weightage
{}
penalization_imputation_weightage = penalization_imputation_weightage if …

Category: basics

Read More

Gingerbreadman-Map

Fri 14 November 2025

from bokeh.plotting import figure, output_file, show
from bokeh.io import output_notebook
from bokeh.models import ColumnDataSource
# Set Bokeh output to notebook
output_notebook()

Category: bokeh

Read More

Github-Language-Finder

Fri 14 November 2025

title: "GitHub Language Finder" author: "Rj" date: 2019-04-20 description: "List Test" type: technical_note draft: false


import requests
from bs4 import BeautifulSoup
# Collect and parse first page
page = requests.get('https://github.com/getify/BikechainJS')
soup = BeautifulSoup(page.text, 'html.parser')    

#print(soup)

summary_element = soup.select("div.overall-summary")

#print(summary_element)

commits …

Category: webreader

Read More
Page 106 of 146

« Prev Next »