23ws-LLMcoder/LLMcoder-GitHub-Python-Mix-Direct
Dataset Card for LLMcoder-GitHub-Python-Mix-Direct Python target autocomplete suggestions in the format of conversations for OpenAI's fine-tuning. Dataset Details Dataset Description Curated by: [More Information Needed] Funded by [optional]: [More Information Needed] Shared by [optional]: [More Information Needed] Language(s) (NLP): [More Information Needed] License: [More Information Needed] Dataset Sources [optional] The data… See the full description on the dataset page: https://huggingface.co/datasets/23ws-LLMcoder/LLMcoder-GitHub-Python-Mix-Direct.
0216
1'Yes'2 3 if community_creation_admin_only == True:4 new_comm = "No"5 else:6 new_comm = "Yes"7 8 if federation_enabled == False or federated_allowed != []:9 fed = 'No'10 else:11 fed = "Yes"12 print( "\tfederation_enabled:|" +str(federation_enabled)+ "|" )13 print( "\tfederated_allowed:|" +str(federated_allowed)+ "|" )14 print( "\tfed:|" +str(fed)+ "|" )15 16 if enable_downvotes == True:17 downvotes = "Yes"18 else:19 downvotes = "No"20 21 if registration_mode == "closed":22 new_users = "No"23 else:24 new_users = "Yes"25 26 # stupid way to say gimmie the 'uptime_alltime' data from the json where27 # the 'domain' matches this iteration lemmy instance's domain28 uptime = [x['uptime_alltime'] for x in uptime_data['data']['nodes'] if x['domain'] == domain]29 30 # stupid way to say gimmie the 'monthsmonitored' data from the json where31 # the 'domain' matches this iteration lemmy instance's domain32 age = [x['monthsmonitored'] for x in age_data['data']['nodes'] if x['domain'] == domain]33 34 # did we figure out an uptime for this domain?35 if uptime == []:36 # we couldn't find an uptime; set it to '??'37 uptime = '??'38 else:39 # we got an uptime! Format it for the table40 41 uptime = uptime[0]42 # let's keep the data simple43 uptime = round(float(uptime))44 uptime = str(uptime)+ "%"45 46 # did we figure out an age for this domain?47 if age == []:48 # we couldn't find an uptime; set it to '??'49 age = '??'50 else:51 # we got an uptime! Format it for the table52 53 age = age[0]54 # let's keep the data simple55 age = round(float(age))56 57 csv_contents += "[" +name+ "](https://" +domain+ "),"58 csv_contents += new_users+ ","59 csv_contents += new_comm+ ","60 csv_contents += fed+ ","61 csv_contents += adult+ ","62 csv_contents += downvotes+ ","63 csv_contents += str(users_month)+ ','64 csv_contents += str(blocking)+ ','65 csv_contents += str(blocked_by)+ ','66 csv_contents += str(uptime)+ ','67 csv_contents += str(age)+ ','68 csv_contents += version69 csv_contents += "\n"70 71# write the instance data table to the csv file72with open( OUT_CSV, "w" ) as csv_file:73 csv_file.write( csv_contents )74 75#########################76# RECOMMENDED INSTANCES #77#########################78 79# shrink the list to just a few recommended instances80all_instances = list()81recommended_instances = list()82with open(OUT_CSV) as csv_file:83 84 for instance in csv.DictReader( csv_file ):85 all_instances.append( instance )86 87 # only include instances that are "yes" across-the-board88 if instance['NU'] == "Yes" \89 and instance['NC'] == "Yes" \90 and instance['Fed'] == "Yes" \91 and instance['Adult'] == "Yes" \92 and instance['↓V'] == "Yes":93 94 recommended_instances.append( instance )95 96# remove instances with too few or too may users97recommended_instances = [x for x in recommended_instances if int(x['Users']) > 60 and int(x['Users']) < 1000]98 99# get a lits of all the instances that have more than 1 blocked instance and100# then get the average number of instances that are blocked101try:102 bi_list = [ int(x['BI']) for x in all_instances if int(x['BI']) > 1 ]103 bi_avg = numpy.average( bi_list )104except (Exception, RuntimeWarning) as e:105 print( "WARNING: Caught numpy exception when calculating bi_avg: " +str(e) )106 bi_avg = 2107 108# get a lits of all the instances that are blocked by more than 1 instance and109# then get the average number of that instances are are blocked110try:111 bb_list = [ int(x['BB']) for x in all_instances if int(x['BB']) > 1 ]112 bb_avg = numpy.average( bb_list )113except (Exception, RuntimeWarning) as e:114 print( "WARNING: Caught numpy exception when calculating bb_avg: " +str(e) )115 bb_avg = 2116 117print( "bi_avg:|" +str(bi_avg)+ "|" )118print( "bb_avg:|" +str(bb_avg)+ "|" )119 120# remove instances that are blocking or blocked-by too many other instancesk121recommended_instances = [ x for x in recommended_instances if int(x['BI']) <= bi_avg and int(x['BB']) <= bb_avg ]122 123# remove instances that haven't been online for 2 months124recommended_instances = [ x for x in recommended_instances if int(x['MO']) >= 2 ]125 126# limit to those with the best uptime; first we make sure that we actually127# have the uptime data128uptime_available = [x for x in recommended_instances if x['UT'] != '??']129 130# do we have uptime data?131if uptime_available != list():132 # we have uptime data; proceed with reducing the set of recommended_instances133 # based on uptime134 135 # loop down from 100% to 0%136 for percent_uptime in reversed(range(100)):137 138 high_uptime_instances = [x for x in recommended_instances if x['UT'] != '??' and int(x['UT'][:-1]) > percent_uptime]139 140 # do we have more than one instance above this uptime?141 if len(high_uptime_instances) > 1:142 # we already have enough instances; ignore the rest with lower uptime143 recommended_instances = high_uptime_instances144 break145 146# prepare data for csv file147csv_contents = "Instance,NU,NC,Fed,Adult,↓V,Users,BI,BB,UT,MO,Version\n"148for instance in recommended_instances:149 csv_contents += instance['Instance']+ ','150 csv_contents += instance['NU']+ ','151 csv_contents += instance['NC']+ ','152 csv_contents += instance['Fed']+ ','153 csv_contents += instance['Adult']+ ','154 csv_contents += instance['↓V']+ ','155 csv_contents += instance['Users']+ ','156 csv_contents += instance['BI']+ ','157 csv_contents += instance['BB']+ ','158 csv_contents += instance['UT']+ ','159 csv_contents += instance['MO']+ ','160 csv_contents += instance['Version']161 csv_contents += "\n"162 163# write the recommended instance data table to a csv file164with open( 'recommended-instances.csv', "w" ) as csv_file:165 csv_file.write( csv_contents )166 167# convert csv file data to markdown table168df = pd.read_csv( 'recommended-instances.csv' )169recommended_markdown_table = df.to_markdown( tablefmt='pipe', index = False )170 171# add newline to protect the table from getting klobbered by the text around it172recommended_markdown_table = "\n" + recommended_markdown_table + "\n"173 174readme_contents += """175# Recommended Instances176 177Just **click on a random instance** from the below "recommended" instances.178 179Don't overthink this. **It doesn't matter which instance you use.** You'll still be able to interact with communities (subreddits) on all other instances, regardless of which instance your account lives 🙂180"""181 182# add the markdown table to the readme's contents183readme_contents += recommended_markdown_table184 185readme_contents += """186# What's next?187 188## Subscribe to ~~Subreddits~~ Communities189 190After you pick an instance and register an account, you'll want to subscribe to communities. You can subscribe to "local" communities on your instance, and (if you chose an instance that isn't siloed) you can also subscribe to "remote" communities on other instances.191 192To **find popular communities** across all lemmy instances in the fediverse, you can use the [Lemmy Community Browser](https://browse.feddit.de/) run by feddit.de.193 194 * https://browse.feddit.de/195 196If you want a more direct mapping of your favorite /r/subreddits to lemmy, checkout these sites:197 1981. [redditmigration.com](https://redditmigration.com/)1991. [sub.rehab](https://sub.rehab/?searchTerm=&visibleServices=lemmy&officialOnly=false&newOnly=false&favoriteOnly=false&sortBy=users_active_week)2001. yoasif's [Unofficial Subreddit Migration List](https://www.quippd.com/writing/2023/06/15/unofficial-subreddit-migration-list-lemmy-kbin-etc.html)201 202 203<a href="https://tech.michaelaltfield.net/2023/06/11/lemmy-migration-find-subreddits-communities/"><img src="lemmy-migration-find-subreddits-communities.jpg" alt="How To Find Lemmy Communities" /></a>204 205For more information, see my guide on [How to Find Popular Lemmy Communities](https://tech.michaelaltfield.net/2023/06/11/lemmy-migration-find-subreddits-communities/)206 207## Other links208 209You may want to also checkout the following websites for more information about Lemmy210 211 * [Official Lemmy Documentation](https://join-lemmy.org/docs/en/index.html)212 * [Intro to Lemmy Guide](https://tech.michaelaltfield.net/2023/06/11/lemmy-migration-find-subreddits-communities/) - How to create a lemmy account, find, and subscribe-to popular communities213 * [Lemmy Community Browser](https://browse.feddit.de/) - List of all communities across all lemmy instances, sorted by popularity214 * [Lemmy Map](https://lemmymap.feddit.de) - Data visualization of lemmy instances215 * [The Federation Info](https://the-federation.info/platform/73) - Another table comparing lemmy instances (with pretty charts)216 * [Federation Observer](https://lemmy.fediverse.observer/list) - Yet another table comparing lemmy instances217 * [FediDB](https://fedidb.org/software/lemmy) - Yet another site comparing lemmy instances (with pretty charts)218 * [Lemmy Sourcecode](https://github.com/LemmyNet/lemmy)219 * [Jerboa (Official Android Client)](https://f-droid.org/packages/com.jerboa/)220 * [Mlem (iOS Client)](https://apps.apple.com/gb/app/mlem-for-lemmy/id6450543782)221 222"""223 224#################225# ALL INSTANCES #226#################227 228# convert csv file data to markdown table229df = pd.read_csv( OUT_CSV )230markdown_table = df.to_markdown( tablefmt='pipe', index = False )231 232# a