Ip-Generator-With-Faker

Fri 14 November 2025

import pyutil as pyu
pyu.get_local_pyinfo()
'conda env: ml312-2024; pyv: 3.12.7 | packaged by Anaconda, Inc. | (main, Oct  4 2024, 13:27:36) [GCC 11.2.0]'
!pip install faker
Collecting faker
  Using cached Faker-33.1.0-py3-none-any.whl.metadata (15 kB)
Requirement already satisfied …

Category: ip

Read More

Ip Whois

Fri 14 November 2025

title: "IP Whois Simple" author: "Rj" date: 2019-04-20 description: "-" type: technical_note draft: false


from ipwhois import IPWhois
from pprint import pprint
obj = IPWhois('133.1.2.5')
results = obj.lookup_whois(inc_nir=True)
pprint(results)
{'asn': '4730',
 'asn_cidr': '133.1.0.0/16',
 'asn_country_code': 'JP',
 'asn_date': '1997-03-01',
 'asn_description': 'ODINS …

Category: basics

Read More

Ip2Long

Fri 14 November 2025

title: "IP To Long" author: "Rj" date: 2019-04-20 description: "List Test" type: technical_note draft: false


import math
class AuthException(Exception):
    pass
def ip_to_long(ip_address):
    '''

    '''

    if(ip_address == '0:0:0:0:0:0:0:1'):
        ip_address = '127.0.0.1'

    ip_address_array = ip_address.split('.')

    if(len(ip_address_array) != 4):    
        raise AuthException('Invalid Ip …

Category: basics

Read More

Ip2Long-5518

Fri 14 November 2025

import pyutil as pyu
pyu.get_local_pyinfo()
'conda env: ml312-2024; pyv: 3.12.7 | packaged by Anaconda, Inc. | (main, Oct  4 2024, 13:27:36) [GCC 11.2.0]'
import ipaddress

def ip_to_long(ip):
    # Convert IP string to a long integer
    return int(ipaddress.IPv4Address(ip))

# Example usage
ip = "192 …

Category: ip

Read More

Iris-Analysis

Fri 14 November 2025
import numpy as np
from sklearn.datasets import load_iris
from sklearn.tree import DecisionTreeClassifier, export_graphviz
from sklearn.model_selection import train_test_split
import pydotplus
from IPython.display import Image

# Load the dataset
iris = load_iris()
X = iris.data
y = iris.target

# Split the dataset
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0 …

Category: pydotplus

Read More

Isotonic

Fri 14 November 2025

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


import numpy as np
import matplotlib.pyplot as plt
from matplotlib.collections import LineCollection

from sklearn.linear_model import LinearRegression
from sklearn.isotonic import IsotonicRegression
from sklearn.utils import check_random_state
n = 100
x = np.arange(n)
rs = check_random_state(0)
y …

Category: sklearn

Read More

Isotonic-1

Fri 14 November 2025

import numpy as np
import matplotlib.pyplot as plt
from matplotlib.collections import LineCollection

from sklearn.linear_model import LinearRegression
from sklearn.isotonic import IsotonicRegression
from sklearn.utils import check_random_state
n = 100
x = np.arange(n)
rs = check_random_state(0)
y = rs.randint(-50, 50, size=(n,)) + 50. * np.log(1 + np …

Category: sklearn

Read More

Item-In-List

Fri 14 November 2025

import pyutil as pyu
pyu.get_local_pyinfo()
'conda env: ml311; pyv: 3.11.10 (main, Oct  3 2024, 07:29:13) [GCC 11.2.0]'
print(pyu.ps2("haystack-ai ollama-haystack python-dotenv"))
haystack-ai==2.8.0
ollama-haystack is not installed in the current environment.
python-dotenv==0.21.0

model_cache = {
    "test1.joblib" : {"one …

Category: basics

Read More

Itertool Chain

Fri 14 November 2025

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


from itertools import chain
string = 'Toronto'
chain(string)
<itertools.chain at 0x108ed2ba8>
chars = chain(string)
type(chars)
itertools.chain
chars
<itertools.chain at 0x108ed2b70>
for c in chars:
    print(c)
T
o
r
o
n
t …

Category: basics

Read More

Jaccard-Text-Similarity

Fri 14 November 2025

title: "Jaccard Text Similarity" author: "Rj" date: 2019-04-21 description: "-" type: technical_note draft: false


def get_jaccard_sim(str1, str2): 
    a = set(str1.split()) 
    b = set(str2.split())
    c = a.intersection(b)
    return float(len(c)) / (len(a) + len(b) - len(c))
content1 = "AI is our friend and it has been friendly"
content2 …

Category: textprocessing

Read More
Page 110 of 146

« Prev Next »