A person earning minimum wages today cannot survive on it year after year.
Following case study done for two years for person in Delhi proves this point:
Item
Expense
Month
Total
7955
Dec-2016
Total
8221
Jan-2017
Total
9006
Feb-2017
Total
9254
Mar-2017
Total
8284
Apr-2017
Total
8497
May-2017
Total
9912
Jun-2017
Total
9051
Jul-2017
Total
7453
Aug-2017
Total
8541
Sep-2017
Total
9880
Oct-2017
Total
11678
Nov-2017
Average Monthly Expenses (2017): 8978
Item
Expense
Month
Total
15128
Dec-2017
Total
10794
Jan-2018
Total
10989
Feb-2018
Total
10385
Mar-2018
Total
13462
Apr-2018
Total
10790
May-2018
Total
10525
Jun-2018
Total
10159
Jul-2018
Total
10340
Aug-2018
Total
13508
Sep-2018
Total
11655
Oct-2018
Total
13777
Nov-2018
Average Monthly Expenses (2018): 11793 (Yearly Change: 31%)
Average Monthly Expenses (2019): 15624 (Yearly Change: 33%)
Item
Expense
Month
Total
16049
Jan-2020
Total
21408
Feb-2020
Total
11997
Mar-2020
Total
11306
Apr-2020
Total
11749
May-2020
Total
11230
Jun-2020
Total
13034
Jul-2020
Total
24481
Aug-2020
Total
24944
Sep-2020
Total
17305
Oct-2020
Total
35500
Nov-2020
Total
25167
Dec-2020
Average Monthly Expenses (2020): 18681 (Yearly Change: 19.6%)
Additional note about year 2020:
- My monthly accomodation rental was about Rs 4000 (for single occupancy).
- In Feb-2020, some expenses involved sister's wedding.
- From Aug 2020 to Dec 2020, there incurred a medical expenses of roughly Rs 8000 per month.
- In Nov 2020, there was an expenditure of about Rs 13000 on a matrimonial site.
- Each year, there is a roughly expenditure of Rs 3000 on phone bill that involves the internet usage.
We see here that:
1. There is an increment of over 31 percent in 2018 in average monthly expenses
2. Average monthly expenses increased by 33 percent in 2019.
3. Average monthly expenses increased by 19.6 percent in 2020.
That is when a person is living hand to mouth and there is no improvement in quality of any aspect of life.
We not only need 'Minimum Wages' act but we also need COLA (Cost of Living Adjustment) act as well.
How much increment did you get in your last appraisal? If it is below 10 percent, don't even bother to mention it.
Related articles:
% Are Minimum Wages Sufficent?
% Article showing minimum wages set by Indian government:
% Who benefits from a higher minimum wages?
How to manually generate a .pyc file from a .py file?
Answer: Use 'compileall' in the terminal. The following command will go recursively into sub directories and make .pyc files for all the python files it finds. The compileall module is part of the python standard library, so you don't need to install anything extra to use it. This works exactly the same way for python2 and python3.
$ python -m compileall .
Or You can compile individual files(s) from the command line with:
$ python -m compileall [file_1].py [file_n].py
-- -- -- -- --
We have a script.py file that looks like this:
print("Hello World!")In Use
(base) C:\Users\ashish\Desktop\code\1>dir
Directory of C:\Users\ashish\Desktop\code\1
01/28/2021 11:58 AM [DIR] .
01/28/2021 11:58 AM [DIR] ..
01/28/2021 11:59 AM 21 script.py
1 File(s) 21 bytes
2 Dir(s) 108,239,290,368 bytes free
(base) C:\Users\ashish\Desktop\code\1>python -m compileall .
Listing '.'...
Compiling '.\\script.py'...(base) C:\Users\ashish\Desktop\code\1>tree /fFolder PATH listing for volume OSDisk
C:.
│ script.py
│
└───__pycache__
script.cpython-37.pyc
(base) C:\Users\ashish\Desktop\code\1>
Execution(base) C:\Users\ashish\Desktop\code\2>dir Directory of C:\Users\ashish\Desktop\code\2
01/28/2021 12:00 PM [DIR] .
01/28/2021 12:00 PM [DIR] ..
01/28/2021 11:59 AM 124 script.cpython-37.pyc
1 File(s) 124 bytes
2 Dir(s) 108,236,578,816 bytes free
(base) C:\Users\ashish\Desktop\code\2>python script.cpython-37.pyc
Hello World!
(base) C:\Users\ashish\Desktop\code\2>cd ../1
We create a file "script2.py" at path "\code\1":
def myfunc(in_str = "Hello World"):
print(in_str)
(base) C:\Users\ashish\Desktop\code\1>dir
Directory of C:\Users\ashish\Desktop\code\1
01/28/2021 01:23 PM [DIR] .
01/28/2021 01:23 PM [DIR] ..
01/28/2021 11:59 AM 21 script.py
01/28/2021 01:23 PM 56 script2.py
01/28/2021 11:59 AM [DIR] __pycache__
2 File(s) 77 bytes
3 Dir(s) 107,205,185,536 bytes free
(base) C:\Users\ashish\Desktop\code\1>python -m compileall script2.py
Compiling 'script2.py'...
(base) C:\Users\ashish\Desktop\code\1>
We have "script3.py" at path "C:\Users\ashish\Desktop\code\1"from script2 import myfunc
myfunc()
myfunc("From script 3.")We run it to get.(base) C:\Users\ashish\Desktop\code\1>python script3.pyHello World
From script 3.Next, we try and fail (then later succeed) in using a compiled Python code:
We did these tests after reading from StackOverflow and as a result we generate some error logs:
(base) C:\Users\ashish\Desktop\code\2>python script3.py
Traceback (most recent call last):
File "script3.py", line 1, in [module]
from script2 import myfunc
ModuleNotFoundError: No module named 'script2'
(base) C:\Users\ashish\Desktop\code\2>python script2.cpython-37.pyc
(base) C:\Users\ashish\Desktop\code\2>python script3.py
File "script3.py", line 1
from script2.cpython-37 import myfunc
^
SyntaxError: invalid syntax Another failed attempt (before success) using "marshal" package:import marshal
s = open('script2.cpython-37.pyc', 'rb')
s.seek(12) # Also tried s.seek(8) here. First 4 bytes are for signaling a 'magic number'. Next 4 bytes holding a modification timestamp.
code_obj = marshal.load(s)
exec(code_obj)
myfunc()
myfunc("Testing from script4")(base) C:\Users\ashish\Desktop\code\2>python script4.py
Traceback (most recent call last):
File "script4.py", line 5, in [module]
code_obj = marshal.load(s)
ValueError: bad marshal data (unknown type code)
Note: Try fixing this code and post answer on StackOverflow [Link].
- - - - - - - - - - - - - - - - - - -
Successful run (1):
We create a script "script5.py" using the "imp" package:
import imp
my_module = imp.load_compiled("script2", "script2.cpython-37.pyc")
my_module.myfunc('Testing script 5.')
Execution:
(base) C:\Users\ashish\Desktop\code\3>python script5.pyscript5.py:14: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
import imp
Testing script 5.Successful run (2):
We create a script "script6.py" that uses the "importlib" package: [ Reference ]
import importlib
import sys
# For illustrative purposes.
#import tokenize
#file_path = tokenize.__file__
#module_name = tokenize.__name__
file_path = "script2.cpython-37.pyc"
module_name = "script2"
spec = importlib.util.spec_from_file_location(module_name, file_path)
module = importlib.util.module_from_spec(spec)
sys.modules[module_name] = module
spec.loader.exec_module(module)
module.myfunc()
module.myfunc("Testing from script 6.") (base) C:\Users\ashish\Desktop\code\3>DIR Directory of C:\Users\ashish\Desktop\code\3
01/28/2021 02:39 PM [DIR] .
01/28/2021 02:39 PM [DIR] ..
01/28/2021 02:06 PM 228 script2.cpython-37.pyc
01/28/2021 02:24 PM 418 script5.py
01/28/2021 02:38 PM 462 script6.py
3 File(s) 1,108 bytes
2 Dir(s) 106,838,298,624 bytes free(base) C:\Users\ashish\Desktop\code\3>python script6.pyHello World
Testing from script 6.
My overall emotions and feelings these days are of hatred and disappointment.
I am not very fond of my family. I told my sister (Anu) to not write to me unless she needs anything from me.
Anu had asked me about marriage and was throwing some ideas but she has been ignorant. I do not know when she last spoke to our mother, Sadhana. Anu's behavior is disgusting.
When a girls' families talk to me, I at first have to give the explanation about my address and given the present situation that my grandparents have put me in, I don't have an address. My uncle claims the Mayur Vihar house, my buas are not giving a clarity about Tri Nagar's house. Buas (all the three Manju, Kumkum and Rekha) rather tell me that I should buy a house in Chandigarh and move my mom there. On similar lines, my aunt had suggested in last December when I had been in Delhi that I should rent a place and take my mother there. My aunt pretends that Mayur Vihar house belongs to her when on paper it still belongs to my grandpa. I am not really sure what my Grandpa wants. To him, saying pleasing words, nice things and buttering was the way to get through me. I sure owe him something for what I am today but I don’t like to be in debt, I don’t want to be in debt.
My mother has separate demands like if I buy a house, the house should be near-by a Jain temple and this is not what I want as I am not religious. People buy house which is near-by the facilities such as hospitals or schools or offices or malls, but not a temple, no builder even promotes a property through a temple. What my mom doesn't understand is that Jains are a minority and a rather rigid one with distinguishing eating habits, religious practices and what not.
Also, I told Anu's father-in-law to stop sending me the 'good morning' messages. These were very irritating messages written in Hindi (spoken and written).
I am upset with my grandparents because they have not taken care of me as part of providing me a place to live. The house where my mother stays was in shambles with no roof, and rain falling down directly into her one room before I got it fixed.
When my Manju bua learns of this a few months later as I told her, she asks me if her old law books were there, which I had sold away as wastepaper for recycling. The books had taken the entire room and they were rotting there with termite. My badi bua would be asking about her Godrej almirah that is still there in the room. Kumkum bua and Manju bua call themselves very religious but their affinity towards these objects is rather surprising. She doesn't need the almirah, if she had needed it, she would have taken it away with her by now, but she hasn't.
Tree leaves piled up from months and nobody comes to pick them up and remove from here.
People should not put their deity's pictures everywhere. They are impinging on the autonomy of the general public with their basic right to a cleaner city.
A good sign: there is a public toilet here in this park but again it is not properly maintained.
First, we show the version of SpaCy we are using:
(e20200909) CMD>pip show spacy
Name: spacy
Version: 2.3.2
Summary: Industrial-strength Natural Language Processing (NLP) in Python
Home-page: https://spacy.io
Author: Explosion
Author-email: contact@explosion.ai
License: MIT
Location: c:\anaconda3\envs\e20200909\lib\site-packages
Requires: numpy, cymem, preshed, blis, tqdm, catalogue, thinc, wasabi, srsly, setuptools, murmurhash, plac, requests
Required-by: en-core-web-sm, aspect-based-sentiment-analysis
Before we dive into code, here are few points to note:
1. The execution of code starts from the 'main.py'
2. The first input file is "list_of_entity_names.txt" that has the entities to be detected in the input text. The entities are written all in one line separated by a semi-colon.
3. The second input file is "test_input_strings.txt" that contains the strings we want the entities to be detected in.
Filename: .\main.py from get_annotations import getAnnotatedStrings
with open('test_input_strings.txt') as f:
lines = f.readlines()
#print(lines)
annotations = []
for i in lines:
annotations.append(getAnnotatedStrings(i))
with open('output.txt', mode="a") as f:
for i in annotations:
f.write(str(i) + "\n") Filename: .\list_of_entity_names.txt apple;apple cider vinegar;banana;AppleFilename: .\get_annotations.py
import copy
with open('list_of_entity_names.txt') as f:
entity_names = f.read()
entity_names = list(set(entity_names.split(";")))
#print(entity_names)
def getAnnotatedStrings(textStr, entity_label = 'MY_ENTITY'):
textStr = textStr.replace("'", "").replace("^ ", "") # Cleaning of text from Wikipedia
haveMoreEntities = True
entity_position = []
entity_titles = []
for entityStr in entity_names:
start = textStr.find(entityStr)
end = start + len(entityStr)
if start != -1 and (not textStr[start - 1].isalnum()):
# By the condition (not textStr[start - 1].isalnum()) we check that the match found is not in the middle of another word.
try:
if (not textStr[end].isalnum()):
entity_position += [(start, end, entity_label)]
entity_titles += [entityStr]
except:
entity_position += [(start, end, entity_label)]
entity_titles += [entityStr]
print("Initial discovery of entities: ", entity_position)
print("Initial discovery of entity titles: ", entity_titles)
print()
# This "if" block was used for an activity with data related to 'pragramming languages'.
# entity_titles.index('C') Throws "ValueError: element is not in list"
if 'C' in entity_titles:
c_variants = []
if 'C#' in entity_titles:
c_variants.append('C#')
if 'C++' in entity_titles:
c_variants.append('C++')
if 'Objective-C' in entity_titles:
c_variants.append('Objective-C')
if len(c_variants) > 0:
for i in c_variants:
try:
c_start = entity_position[entity_titles.index('C')][0]
except:
break
i_start = entity_position[entity_titles.index(i)][0]
i_end = entity_position[entity_titles.index(i)][1]
if c_start >= i_start and c_start <= i_end:
del entity_position[entity_titles.index('C')]
entity_titles.remove('C') # First 'C' removed.
overlap_detection_arr = []
entity_position_out = copy.deepcopy(entity_position)
for i in entity_position:
temp_arr = []
for j in entity_position:
# This "i[1] < j[1] and i[1] > j[0]" is the overlap of kind:
# 'ashish', 'ishleen' being picked from a hypothetical word 'ashishleen'.
if i[1] < j[1] and i[1] > j[0]:
len1 = i[1] - i[0]
len2 = j[1] - j[0]
if len1 > len2:
try:
entity_position_out.remove(j)
del entity_titles[entity_position.index(j)]
except:
#print("Element not found.")
pass
else:
try:
entity_position_out.remove(i)
del entity_titles[entity_position.index(i)]
except:
#print("Element not found.")
pass
print("Overlap detected.")
else:
temp_arr.append(False)
# This "i[0] > j[0] and i[0] < j[1]" is the overlap of kind: jean (denoted by 'i'), greyjean (denoted by 'j')
if i[0] > j[0] and i[0] < j[1]:
len1 = i[1] - i[0]
len2 = j[1] - j[0]
if len1 > len2:
try:
entity_position_out.remove(j)
del entity_titles[entity_position.index(j)]
except:
#print("Element not found.")
pass
else:
try:
entity_position_out.remove(i)
del entity_titles[entity_position.index(i)]
except:
#print("Element not found.")
pass
print("Overlap detected.")
else:
temp_arr.append(False)
overlap_detection_arr.append(temp_arr)
if len(entity_titles) > 0:
rv = (str(textStr), {'entities': entity_position_out})
print(rv)
print()
return rv
Filename: .\output.txt
('An apple a day, keeps the doctor away.\n', {'entities': [(3, 8, 'MY_ENTITY')]})
('Dont add apple cider vinegar to everything.\n', {'entities': [(9, 28, 'MY_ENTITY')]})
('Apple is a fruit and so is banana.', {'entities': [(27, 33, 'MY_ENTITY'), (0, 5, 'MY_ENTITY')]})
Filename: .\test_input_strings.txt
An apple a day, keeps the doctor away.
Don't add apple cider vinegar to everything.
Apple is a fruit and so is banana.
When we run the code in Command Prompt, it runs like this:
(e20200909) C:\Users\ashish\code>python main.py
Initial discovery of entities: [(3, 8, 'MY_ENTITY')]
Initial discovery of entity titles: ['apple']
('An apple a day, keeps the doctor away.\n', {'entities': [(3, 8, 'MY_ENTITY')]})
Initial discovery of entities: [(9, 14, 'MY_ENTITY'), (9, 28, 'MY_ENTITY')]
Initial discovery of entity titles: ['apple', 'apple cider vinegar']
Overlap detected.
('Dont add apple cider vinegar to everything.\n', {'entities': [(9, 28, 'MY_ENTITY')]})
Initial discovery of entities: [(27, 33, 'MY_ENTITY'), (0, 5, 'MY_ENTITY')]
Initial discovery of entity titles: ['banana', 'Apple']
('Apple is a fruit and so is banana.', {'entities': [(27, 33, 'MY_ENTITY'), (0, 5, 'MY_ENTITY')]})
--- --- --- --- ---
Note How to Remove Unused Imports:
(e20200909) >>>conda install autoflake -c conda-forge
(e20200909) >>>autoflake -i --remove-all-unused-imports main.py
(e20200909) >>>autoflake -i --remove-all-unused-imports get_annotations.py
Here:
-i, --in-place: make changes to files instead of printing diffs
--- --- --- --- ---
February 2020: On a weekday morning, I received a phone call from Tri Nagar that a new prospective tenant would like to take the room on the first floor. This person Sanjay Kumar offered to pay ₹3000 for the bigger room facing the wider 75th street.
This man turned out to be a fraud.
He said he would pay ₹2500 in the first month and would pay ₹3000 next month onwards.
It never happened. He had joined in the second week of February. In March, he started delaying the payment and offered that he would get the bathroom door renovated in ₹1500 that I can reimburse from rent. It was the second time he was asking me to trust him for something. The first one was about the rent amount of ₹3000. The March payment didn't happen until 22nd, 23rd when I had to cancel the plan for bathroom door renovation and tell him to pay in full and immediately.
He paid about Rs 1500 and said he’d pay the rest the end of the month and the rest amount will come in a timely manner. This was the third time he was asking me to trust him.
A point to note is that he had also not paid any security, which is a fault on my part.
Following the 23rd, March, the lockdown happened. Sanjay Kumar is a fruit seller. He would have a castor for selling his fruits that he would sell in the market and earn a daily wage. Before this, he had said he was working for a travel agency where the owner died and his son didn’t run the business well and due to personal circumstances, he had to quit. Sanjay was living in our house with his son and wife. His son was in high school (9th or 10th) and his wife was a homemaker. His daughter was not staying here, and she was studying somewhere in a university.
It was a complete mess. In the month of April, there would be regular calls about his payments. It was very frustrating. The amount he was paying was not fixed and was like pennies to mevaried between 50 to 150 Rupees. Mom was not communicating it clearly to me about his total to-date payment and he would often come home late after she had gone to sleep so there would be no communication with me at times.
I would have to make calls to try and reach him at time continuously for 30-40 minutes. I would have to call home on his wife’s number to know of his whereabouts, or I would have to call mom to help me reach them. His wife would ask me to not call her or ask her anything as she did not have anything to do about the payment and that only Sanjay would have to answer.
By the end of the month, the situation had badly escalated and my Manju bua was aware about what was happening. Amma was aware. Mom had informed of Sanjay’s behavior to neighbors and mom had started to ponder if she should report about him to the police. My own tenor in Panchkula had become aware of problem at home and I was asked to not raise my voice in my room while being on call from home.
My bua asked me to be assertive but she refused to provide any significant help. She rather seemed distant and disinterested even to the ideas of accepting any money for the help I was asking. I was on my own. I had to hire a lawyer for this problematic tenant.
A thing to note about Sanjay was that he had a clear speech in Hindi, something I have not seen in our tenants so far.
In May, Sanjay and I had reached a point when he would start using threats such as telling me about his wealthy and powerful relatives. At times, he would go on to insult me. Sanjay had left by the May end. The lockdown had been a factor that he was not able to move out earlier. Sanjay might have done a fraud of roughly 3000 to 4000 Rupees by not paying the rent for last month of May and making part payments for the rest of the previous months.