Saravanan666/pypi-org huggingface dataset:
Package: easy-env
Implement common operations over env vars such as reading booleans and integers.Installationpipinstalleasy_envUsageimportosimporteasy_env# setup env varssetup_vars=[('int','42'),('float','42.9'),('bool','yes'),('str','foo bar'),('bytes','Zm9v'),# base64 encoded b'foo'('list','1,2,3'),('list2','4 5 6'),]forvar,valueinsetup_vars:os.environ[var]=value# get varasserteasy_env.get_int('int')==42asserteasy_env.get_float('float')==42.9asserteasy_env.get_bool('bool')isTrueasserteasy_env.get_str('str')=='foo bar'asserteasy_env.get_bytes('bytes')==b'foo'asserteasy_env.get_list('list')==['1','2','3']# get w/ defaultasserteasy_env.get_int('NEW_VAR',5)==5# get w/o defaultasserteasy_env.get_int('NEW_VAR')isNone# get w/o default and raise exceptiontry:easy_env.get_int('NEW_VAR',raise_error=True)assertFalseexceptKeyError:assertTrue# get list of integersasserteasy_env.get_list('list',item_factory=int)==[1,2,3]# get list w/ another separatorasserteasy_env.get_list('list2',separator=' ')==['4','5','6']# detect type based on type of defaultasserteasy_env.get('int',1)==42asserteasy_env.get('int')=='42'asserteasy_env.get('float',1.0)==42.9asserteasy_env.get('bool',False)isTrueasserteasy_env.get('bytes',b'')==b'foo'asserteasy_env.get('list2',default=[],separator=' ')==['4','5','6']# set inteasy_env.set_int('int_var',42)assertos.getenv('int_var')=='42'# set floateasy_env.set_float('float_var',42.0)assertos.getenv('float_var')=='42.0'# set booleasy_env.set_bool('bool_var',True)assertos.getenv('bool_var')=='1'easy_env.set_bool('bool_var',False)assertos.getenv('bool_var')=='0'# set stringeasy_env.set_str('str_var','foo bar')assertos.getenv('str_var')=='foo bar'# set byteseasy_env.set_bytes('bytes_var',b'foo')assertos.getenv('bytes_var')=='Zm9v'# set listeasy_env.set_list('list_var',[1,2,3])assertos.getenv('list_var')=='1,2,3'easy_env.set_list('list_var',[1,2,3],separator=' ')assertos.getenv('list_var')=='1 2 3'easy_env.set_list('list_var',[1,2,3],serializer=lambdax:str(x-1))assertos.getenv('list_var')=='0,1,2'
Package: easy-env-var
Easy Environment VariablesAn easier way to use environment variables with the correct typecasting in Python.Since environment variables can only be strings, it usually means we need loads of
related variables or weird casting in our code. Withouteasy_env_varthat would
look something like thisCACHE_KEY=default
CACHE_BACKEND=redis_cache.RedisCache
CACHE_LOCATION=redis://localhost:6379/3
DEBUG=true
TIMEOUT=1000import os

CACHES = {
    os.environ.get("CACHE_KEY", "default"): {
        "BACKEND": os.environ["CACHE_BACKEND"],
        "LOCATION": os.environ["CACHE_LOCATION"],
    }
}
DEBUG = os.environ.get("DEBUG", "false") == "false"
TIMEOUT = int(os.environ.get("TIMEOUT", "300"))Witheasy_env_varit is as simple asCACHES = {"default": {"BACKEND": redis_cache.RedisCache, "LOCATION": redis://localhost:6379/3}}
DEBUG=true
TIMEOUT=1000from easy_env_var import env

CACHES = env("CACHE", expected_type=dict)
DEBUG = env("DEBUG", expected_type=bool, default=False)
TIMEOUT = env("TIMEOUT", expected_type=int, default=300)InstallationSimply install using pip by runningpip install easy_env_varFor Python 3.7 you will also needtyped-astwhich
should automatically be installed. For Python 3.8 and above it is not needed.Usagefrom easy_env_var import env
FOO = env("foo")  # get the environment variable named foo
BAR = env("bar", expected_type=float)  # cast to the correct data type
try:
    BAZ = env("baz")
except KeyError:
    BAZ = "Not Set"
# or simply pass a default
QUX = env("qux", default="The default value")Supported data typesEnvironment variables can be parsed to the following data types:str (this is the default type)intfloatbool (works with case-insensitive values of True & False)Decimallistdict (the keys need to always be strings)Sets and tuples are not supported since using lists is good enough for most use cases.Why easy_env_var?We wanted to call iteasy_envbut that's an
existing package.
Package: easyepub
EasyEpubLibrary for easier translating book pages in png.Installation:Download library using pip$pip3installeasyepubUsage example:Import the libraryfromeasyepubimportEasyEpubeasy=EasyEpub("path-to-book/book.epub")Retrieving book metadataformetaineasy.meta:print(meta)Retrieving book covereasy.get_cover("path-to-directory/cover.png")Retrieving book chapterseasy.get_content("path-to-directory")🤝 ContributingFeel free to contribute.
Package: easy-ernie
提示有封号风险.由于文心一言的Acs-Token算法的参数不定时的变化,所以包里调用了API.感兴趣的或有自动更新方法的可以联系我.若出现了用户访问被限制请到Isuue回复,我会及时更新Acs-Token算法的参数.介绍简洁的调用文心一言的WebAPI.需求语言: Python3.8+.其他: 文心一言账户.安装pip install easy-ernie --upgradeCookie访问文心一言.打开开发者工具.找到应用程序(Application).在左侧点击存储(Storage)-Cookies-https://yiyan.baidu.com.在列表中点击BAIDUID.复制下方Value的值.BDUSS_BFESS同理.使用Erniefromeasy_ernieimportErnieif__name__=='__main__':ernie=Ernie('BAIDUID','BDUSS_BFESS')sessionName='你好'result1=ernie.ask('你好',sessionName=sessionName)sessionId=result1['sessionId']chatBotId=result1['chatBotId']print(result1)result2=ernie.ask('我给你发的上一个消息是什么',sessionId=sessionId,sessionName=sessionName,parentChatId=chatBotId)print(result2)ernie.deleteConversation(sessionId)FastEriniefromeasy_ernieimportFastErnieif__name__=='__main__':fastErnie=FastErnie('BAIDUID','BDUSS_BFESS')print(fastErnie.ask('你好'))print(fastErnie.ask('我给你发的上一个消息是什么'))fastErnie.close()更多方法查看Wiki.感谢灵感来源自acheong08,ls233.
Package: easyerrors
This module allows you to easily test simple functions. All errors will be catched and showed to you gracefully.Note that this module is incredibly basic and does not work with any kind of indented code, so e.g. for loops are not an option.code examples:>>> from easyerrors import test
>>> 
>>> @test
>>> def tryout(msg, num):
... 	print(msg, num)
...
>>> tryout('hey', 3)

Testing code inside function 'tryout':

-------- Test started! --------

>>> print(msg, num,)
hey 3


-------- Test ended! -------->>> from easyerrors import test
>>> 
>>> @test
>>> def tryout(msg, num):
... 	print(msg, num)
... 	print(invalidargument)
...
>>> tryout('hey', 3)

Testing code inside function 'tryout':

-------- Test started! --------

>>> print(msg, num)
hey 3

>>> print(incorrectargument)
Error: name 'incorrectargument' is not defined


-------- Test ended! --------

 Errors found:
  - name 'incorrectargument' is not defined
Package: easyeval-tool
EasyEval馃敡InstallationInstallation for local development:git clone https://github.com/zjunlp/EasyEval
cd EasyEval
pip install -e .Installation using PyPI:pip install easyeval -i https://pypi.org/simple馃搶Use EasyEvalFairEvalFairEvalis the class for  two simple yet effective strategies,
namely Multiple Evidence Calibration (MEC) and Balanced Position Calibration (BPC) to calibrate the positional bias of LLMs.
Refer to the paper:Large Language Models are not Fair Evaluators.ExampleStep1: Provide the question json file for evaluation.Here is an example of the data:{"question_id":1,"text":"How can I improve my time management skills?"}{"question_id":2,"text":"What are the most effective ways to deal with stress?"}Step2: Provide the answer json files for evaluation.Note that the question_id  must be consistent with the question file. Here is an example of the data:{"question_id":1,"text":"Here are some tips to improve your time management skills:\n\n1. Create a schedule: Make a to-do list for the day ..."}{"question_id":2,"text":"Here are some effective ways to deal with stress:\n\n1. Exercise regularly: Physical activity can help reduce stress and improve mood ..."}Step3: EvaluationfromEasyEval.evalimportFairEval# Declare a eval classeval=FairEval(answer_file_list=["YOUR-ANSWER-FILE1","YOUR-ANSWER-FILE2"],question_file="YOUR-QUESTION-FILE",output="YOUR-OUTPUT-FILE",api_key="YOUR-KEY",eval_model='gpt-4',bpc=1,k=3)# Get the result from LLM API serviceeval.fair_eval()馃帀Contributors
Package: easyevaluations
This Python package shall facilitate the evaluation of the predictions of machine learning algorithms. In the current version, there are only two
functions in the package. For both regression and classification algorithms there is a function called “summary”, which takes the true values for the
dependent variable and the respective predictions as an input. It returns a thorough overview of the performance including the most common metrics.
This allows a quick analysis in order to determine the performance of the algorithm.# easy_evaluation
Package: easy-events
easy-eventsA library that help you to manage eventsGetting startedInstallationUsagesCode exampleDocumentationInstallationpip install easy-eventsGitHub :GithubUsagestextCode examplefromeasy_eventsimportEasyEvents# create an event or use it in a classclient=EasyEvents()# create another event (can be sync or async)# you can put as much parameters as you want@client.add_event(aliases="test1")deftest(arg1,arg2,*,arg3):# data is the default parameter, it contain some basic informations that you can format as you wantprint(arg1,arg2,arg3)# trigger the eventclient.trigger(data=test1,parameters="arg1 arg2 arg3 arg4")client.trigger("test1","arg1 arg2 arg3 arg4")client.trigger("test1",["arg1","arg2","arg3","arg4"])client.trigger("test1",{"arg1":"arg1","arg2":"arg2","arg3":["arg3","arg4"]})# dict wayclient.trigger({"event":"test1","parameters":{"arg1":"arg1","arg2":"arg2","arg3":["arg3","arg4"]}})# dict way v2client.trigger({"event":"test","parameters":["arg1","arg2","arg3","arg4"]})# dict way v3client.trigger({"event":"test1","parameters":"arg1 arg2 arg3 arg4"})# list wayclient.trigger(["test","arg1","arg2","arg3","arg4"])# str wayclient.trigger("test arg1 arg2 arg3 arg4")# the result will be (for all cases):# arg1 = arg1# arg2 = arg2# arg3 = [arg3, arg4]This library also support type assignationfromeasy_eventsimportEasyEventsclient=EasyEvents()@client.add_event()defsum(X:int,Y:int):returnX+Yclient.trigger("sum 5 10")client.trigger(["sum","5",10])# the result will be 15Context supportfromeasy_eventsimportEasyEventsclassCTX:def__init__(self,data:int=0):self.data=dataclient=EasyEvents(default_context=CTX)# client = EasyEvents(default_context=CTX(0)) works as well@client.add_event()defcontext(ctx):print("ctx.data = ",ctx.data)client.trigger("context",context=CTX(1))client.trigger("context")# this will print :# "ctx.data = 1"# "ctx.data = 0"
Package: easy_excel
pip install easy_excel, xlwt###Example easyimport osfrom easy_excel import Column, Sheet, Excelclass A:def __init__(self, a='Nothing', b='Hello my friend', c=43):self.a, self.b, self.c = a, b, cexcel_example = Excel()columns = [Column('a', lambda x: x.b, width=5000),Column('b', lambda x: x.b, width=6000),Column('Thi is C', lambda x: x.c)]sheet = Sheet('New sheet', columns=columns, objects=[A(), A(b='54'), A('Hi', 'example')])excel_example.add_sheet(sheet)base_dir = os.path.dirname(os.path.abspath(__file__))excel_example.save(file_name='example1', dir=base_dir + '/excel/')###Example inheritanceimport osfrom easy_excel import Column, Sheet, Excelclass CustomTemplateSheet(Sheet):title = 'Example title sheet'name = 'Example name sheet'columns = [Column('first', lambda x: x['first']),Column('this is second', lambda x: x['second'], width=15000),]excel = Excel()objects = [{'first': "I'm first", 'second': 'Hi'},{'first': '1', 'second': 2},{'first': 'and me', 'second': 'and you'},{'first': 'and me', 'second': 'and you'},{'first': 'and me', 'second': 'and you'},{'first': 'and me', 'second': 'and you'},{'first': 'and me', 'second': 'and you'},{'first': 'and me', 'second': 'and you'},]sheet1 = CustomTemplateSheet(objects=objects)sheet2 = CustomTemplateSheet(name='Im second sheet', title='Im for first object', object=objects[0])excel.add_sheet(sheet1)excel.add_sheet(sheet2)base_dir = os.path.dirname(os.path.abspath(__file__))excel.save(file_name='example2', dir=base_dir + '/excel/')
Package: easy-excel-tool
easy excel tool在实际工作中，沉淀的一些简易、好用的excel数据处理工具，减少重复代码与文件冗余，希望一样能为使用者带来益处。如果您也想贡献好的代码片段，请将代码以及描述，通过邮箱（xinkonghan@gmail.com）发送给我。代码格式是遵循自我主观，如存在不足敬请指出！安装pipinstalleasy-excel-tool主要功能excelcreate_excel创建一个空白的excel文件（可指定sheet名）add_sheet对指定excel文件新增sheet页（可指定sheet名）get_sheet_name获取excel文件所有sheet名remove_sheet删除excel文件中指定sheet页write_excel对excel文件写入或追加数据（可指定填充列，保留头部）简单使用fromeasy_excel_toolimportExcelexcel=Excel('./test.xlsx')# excel.create_excel(inplace=True)# excel.add_sheet(sheet_name=[#     'donation_information',# ])data=[{'a':1,'b':5,'c':'88'},{'a':7,'b':9,'c':66},]excel.write_excel(data,mode='w+',sheet_name='Sheet1',fill_column={'fill_column':'fill'},header=True,inplace=False,)链接Github：https://github.com/hanxinkong/easy-excel-tool在线文档：https://easy-excel-tool.xink.top/注明
Package: easyexception
# easyexceptionConveniently submit and print an error, warning, or message from your codes, and specify where the error, warning, or message came from.### Purpose
When one raise an exception in his/her program, or throws a warning, on the screen it is often unclear where the error/warning/message was initiated. This makes it hard for users of the program to troubleshoot the problem.Ineasyexception, this is solved by a simple trick, we combine all kinds of screen messages into one function:easyexception(origin, code, severity, msg)whereseveritycan be “Error”, “Warning”, or “Message”### Usage
To use theeasyexceptionfunction, import it in Python:from easyexception.exception import easyexceptionThe program developer just calls the function to define the above information and deliver the message to the user screen. e.g. if you are developing a calculator program and the user puts in a negative number and then presses “Square Root”. You want to throw a warning but not to stop the program, you may do:easyexception(“mymath.py”, “calculate_sqrt(n)”, “Warning”,
“Can not give the square root for a negative number”)The above assumeseasyexceptionis called in functioncalculate_sqrt(n)in file mymath.py.Or, if the user magically puts some texts in the input bar, and you hate it so much that you would like to raise an Error and stop the program. You may then do:easyexception(“get_user_input.py”, “eval_expr(eq)”, “Error”,
“Texts are not allowed in the input bar!”)Similarly, the above assumeseasyexceptionis called in functioneval_expr(eq)in file get_user_input.py.Finally,severity=”Message”can be used if you want to notify the user that a calculation is complete, or the user has cleared the memory, etc.### Installation
Install easyexception usingpip, orpip3pip install easyexception### Repository
[GitHub page](https://github.com/frankliuao/easyexception)
Package: easy-exceptions
EasyExceptionsThrow and catch named exceptions without creating a class first. The goal of this project is to make working with named exceptions simpler. It's often a huge overhead of work to create named exceptions in a separate file before being able to throw them to nicely be caught.Installationpip install easy-exceptionsUsagefrom easy_exceptions import EasyException
try:
    raise EasyException('NamedException')('TEST MESSAGE')
except EasyException('NamedException') as e:
    print("Caught this specific exception without having to define it!")EasyExceptions even supports using a custom parent class instead of the base Exception. This is because APIs often use a custom exception class for rendering error messages. All you have to do in this case is pass that parent class to EasyException and instantiate it the way you always would. For example:from easy_exceptions import EasyException 
from api.exceptions import BaseException # Your custom base exception
try:
    # you can pass whatever special args here that you usually do to BaseException
    raise EasyException('NamedException', parent=BaseException)(...)
except EasyException('NamedException', parent=BaseException):
    print("Caught the specific exception!") 
# This exception can still be caught by referencing the BaseException with regular syntax 
except BaseException:
    print("This would be called if the above exception handler wasn't there")This can be further simplified by binding the BaseException during application startup using the bind_parentfrom easy_exceptions import EasyException, bind_parent 
from api.exceptions import BaseException

bind_parent(BaseException)
try:
    raise EasyException('NamedException') 
except BaseException: #Could alse use EasyException('NamedException') to target the named exception only
    print("Exceptions are always of type BaseException now")
Package: easy-exchange-rates
easy-exchange-ratesUsagefromeasy_exchange_ratesimportAPIapi=API()time_series=api.get_exchange_rates(base_currency="EUR",start_date="2021-01-01",end_date="2021-08-13",targets=["USD","CAD"])data_frame=api.to_dataframe(time_series)print(data_frame.head(5))>>>CADUSD2021-01-011.5499881.2175822021-01-021.5447911.2135002021-01-031.5577911.2234092021-01-041.5660761.2250612021-01-051.5585531.229681Testingpython3 -m unittest discover -s tests
Package: easy-expressions
Easy does it!easy-expressionsThe world’s most gangsta regular expressions library.It turns this..regex=re.compile(r'(?:(?:\$){1,1})(?:(?:(?:\d)){1,})(?:(?:\.){1,1})(?:\d)(?:\d)')into this!fromeasy_expressionsimportEasyeasy=Easy()/.find("$")/.min(1).digits()/.then(".")/.digit()/.digit()regex=easy.getRegex()regex.findall("$10.00");Abouteasy-expressionsis a python regular expressions library with aPython for
Humansphilosophy. Rather than having to remember the complex regular
expressions syntax,easy-expressionsallows you to write complicated
regular expressions in natural English, so you’ll get your pattern
matches right the first time without any headache.Installationpip install easy-expressionsExamplesSearching for dollar amountsfromeasy_expressionsimportEasyeasy=Easy()/.find("$")/.min(1).digits()/.then(".")/.digit()/.digit()regex.test("$10.00");# Trueregex.test("$XX.YZ");# FalseSearching for Credit Cardseasy=Easy()\.startOfLine()\.exactly(4).digits()\.then('-')\.exactly(4).digits()\.then('-')\.exactly(4).digits()\.then('-')\.exactly(4).digits()input_s="Hey Joe! The credit card number for the invoice is 4444-5555-6666-7777. Thanks!"easy.test(input_s)# Trueinput_s="Hey Joe! The credit card number for the invoice is 1-2-3-4. Thanks!"easy.test(input_s)# FalseInspirationRegexes are hard when they should be easy.I had this idea while watching Straight Outta Compton. Turns out
[@thebinarysearchtree](https://github.com/thebinarysearchtree/) had
alreadyimplemented it in
JS, so this
is essentially a port of that.ContributingThis software is still quite young and I’m certain there are still bugs
in it. If you find bugs or want new features included, please create a
new Issue and send a pull request, along with an accompanying test.
Thanks!Other Easy ProjectsIf you like easy things, you may also enjoy:django-easy-apidjango-easy-splitdjango-easy-timezonesdjango-knockout-modelersimpleawsLicenseMIT, 2015.
Package: easy-extract
ContentsInstallationUsageCodeEasy-extract try to be a simple and universal multipart unarchiver,
it is designed to extract and repair collections of many archives format(rar, zip, xtm)in one command line.Very usefull when you grab on Usenet and you have many archives in differents directory.InstallationBefore you start using easy-extract, you must install these softwares :unrar-free7zip-fullpar2Then use easy_install:$ easy_install easy-extractUsageUsage: easy_extract [options] [directory]…Options:--versionshow program’s version number and exit-h,--helpshow this help message and exit-f,--forceDo not prompt confirmation message-n,--not-repairDo not try to repair archives on errors-c,--repair-onlyDo only a check and repair operation-r,--recursiveFind archives recursively-k,--keepDo not delete archives on success-x,--no-indexDo not index the extracted filesSimply runeasy_extractin the directory where the collections are:$ easy_extractTo find archives recursively in a directory:$ easy_extract -r my_archives/All the archives found will be prompted, then confirm the extraction.
Go make a coffee, the script will do the rest !
Easy_extract will handle the repair if the archives are corrupted.CodeIf you want to reuse the code to find archives you can do something like that :>>> from easy_extract.archive_finder import ArchiveFinder
>>> from easy_extract.archives.rar import RarArchive
>>> archive_finder = ArchiveFinder('./my_path/', recursive=True, archive_classes=[RarArchive,])
>>> archive_finder.archives
... [<easy_extract.archives.rar.RarArchive object at 0x...>, <easy_extract.archives.rar.RarArchive object at 0x...>]
Package: easyfactorlens
This lib can make IC test by data download from Ricequant.Usage:step1:Download ‘download_data_from_ricequant.ipynb’ fromhttps://pan.baidu.com/s/1JOHi4w7nAypfIHKW_v1tng,password:6666step2:Download data fromhttps://www.ricequant.comstep3:Set your parameters.eg:logger_path = ‘./factor_logs.log’   # your log pathfactor_info = “anything about your factor”data_file = r’C:UsersAdministratorDesktopricequant_local_alphalensdata’    # your data file pathpredict_periods = (1, 5, 10)    # your factor predict periodsstep4:Run analysis engine in your script.
Package: easyfaiss
Easy FaissEasy Faiss is a package for creating vector indexes / knowledge base for LLM chatbots. This provides an easy-to-use alternative over using vector databases such as Pinecone or Weaviate.Example script:importeasyfaissasefmodel,tokenizer=ef.bert_setup()data=["Hello, how are you?","What's the weather today?","How does photosynthesis work?","What's the capital of France?","Tell me about the history of the Roman Empire.","How can I improve my coding skills?","What's the recipe for a classic margarita?","Explain the theory of relativity.","What's the population of Tokyo?","How can I learn a new language quickly"]# create embeddings to store in indexembeddings=ef.create_embeddings(model=model,tokenizer=tokenizer,dataset=data)# create a query vector to perform similarity search on the indexuser_query="What's the population in Tokyo, Japan?"query_vector=ef.create_embeddings(model=model,tokenizer=tokenizer,dataset=[user_query])# create the indexflat_index=ef.FlatIndex(name='demo')flat_index.create_index(dimensions=768)flat_index.update_index(embeddings=embeddings,dataset=data)print(flat_index.details())# perform similarity searchindices,distances=flat_index.similarity_search(query_vector=query_vector,k=3)EasyFaiss currently provides 2 types of faiss indexesFlatIndex:Speed:This index is relatively slower for nearest neighbor search, especially as the number of vectors increases.Scale:Suitable for smaller datasets with low to moderate memory requirements.Accuracy:Provides exact nearest neighbor search, making it the most accurate option.HNSWFlatIndex:Speed:Hierarchical Navigable Small World (HNSW) allows for fast approximate nearest neighbor search, especially on large datasets.Scale:Well-suited for large datasets, as it uses approximate nearest neighbor search, which makes it more memory-efficient.Accuracy:Provides approximate results that might have a small trade-off in accuracy compared to FlatIndex.The choice between these two index types depends on your specific use case:Use FlatIndex when you have a relatively small dataset and need precise, exact nearest neighbor search.Use HNSWFlatIndex when you have a larger dataset, and you can tolerate a small reduction in accuracy in exchange for faster search and lower memory requirements.For FlatIndex, an upper limit for the number of vectors depends on the available memory, but it's typically suitable for a few thousand vectors (e.g., up to 10,000 or more, depending on the dimension of the vectors and available RAM). Beyond that, you might start experiencing memory limitations. HNSWFlatIndex is a good choice for larger datasets, including millions of vectors, provided you can accept the trade-offs in accuracy.
Package: easyfc
easyfc使用介绍1.  开发目的简化云函数开发的代码量，方便开发人员迅速组织云开发服务2.  快速开始方式1： 使用pip进行安装pipinstalleasyfc方式2： 自行下载安装打开pipy下载.whl文件或者.tar.gz 文件安装3. 演示使用(1)获取含有json的请求数据fromeasyfc.parseimportget_jsonenviron={}# environ是函数入口提供的参数jsonParams=get_json(environ)(2)获取请求头内参数fromeasyfc.parseimportget_headersenviron={}# environ是函数入口提供的参数params=get_headers(environ)(3)获取请求queryfromeasyfc.parseimportget_paramsenviron={}# environ是函数入口提供的参数params=get_params(environ)(4) 返回200状态并且返回文本fromeasyfc.responseimportok_text_start_responsedefhandler(environ):returnok_text_start_response()