max_stars_repo_path stringlengths 4 286 | max_stars_repo_name stringlengths 5 119 | max_stars_count int64 0 191k | id stringlengths 1 7 | content stringlengths 6 1.03M | content_cleaned stringlengths 6 1.03M | language stringclasses 111
values | language_score float64 0.03 1 | comments stringlengths 0 556k | edu_score float64 0.32 5.03 | edu_int_score int64 0 5 |
|---|---|---|---|---|---|---|---|---|---|---|
public_data/serializers.py | MTES-MCT/sparte | 0 | 0 | <reponame>MTES-MCT/sparte
from rest_framework_gis import serializers
from rest_framework import serializers as s
from .models import (
Artificialisee2015to2018,
Artificielle2018,
CommunesSybarval,
CouvertureSol,
EnveloppeUrbaine2018,
Ocsge,
Renaturee2018to2015,
Sybarval,
Voirie2018,... | from rest_framework_gis import serializers
from rest_framework import serializers as s
from .models import (
Artificialisee2015to2018,
Artificielle2018,
CommunesSybarval,
CouvertureSol,
EnveloppeUrbaine2018,
Ocsge,
Renaturee2018to2015,
Sybarval,
Voirie2018,
ZonesBaties2018,
... | en | 0.404844 | Marker GeoJSON serializer. Marker serializer meta class. | 2.186829 | 2 |
quick_search/admin.py | naman1901/django-quick-search | 0 | 1 | from django.contrib import admin
from .models import SearchResult
# Register your models here.
class SearchResultAdmin(admin.ModelAdmin):
fields = ["query", "heading", "url", "text"]
admin.site.register(SearchResult, SearchResultAdmin) | from django.contrib import admin
from .models import SearchResult
# Register your models here.
class SearchResultAdmin(admin.ModelAdmin):
fields = ["query", "heading", "url", "text"]
admin.site.register(SearchResult, SearchResultAdmin) | en | 0.968259 | # Register your models here. | 1.640673 | 2 |
rasa/train.py | Amirali-Shirkh/rasa-for-botfront | 0 | 2 | import asyncio
import os
import tempfile
from contextlib import ExitStack
from typing import Text, Optional, List, Union, Dict
from rasa.importers.importer import TrainingDataImporter
from rasa import model
from rasa.model import FingerprintComparisonResult
from rasa.core.domain import Domain
from rasa.utils.common im... | import asyncio
import os
import tempfile
from contextlib import ExitStack
from typing import Text, Optional, List, Union, Dict
from rasa.importers.importer import TrainingDataImporter
from rasa import model
from rasa.model import FingerprintComparisonResult
from rasa.core.domain import Domain
from rasa.utils.common im... | en | 0.748063 | Trains a Rasa model (Core and NLU). Args: domain: Path to the domain file. config: Dict of paths to the config for Core and NLU. Keys are language codes training_files: Paths to the training data for Core and NLU. output_path: Output path. force_training: If `True` retrain m... | 2.091617 | 2 |
coding_intereview/1475. Final Prices With a Special Discount in a Shop.py | Jahidul007/Python-Bootcamp | 2 | 3 | <gh_stars>1-10
class Solution:
def finalPrices(self, prices: List[int]) -> List[int]:
res = []
for i in range(len(prices)):
for j in range(i+1,len(prices)):
if prices[j]<=prices[i]:
res.append(prices[i]-prices[j])
break
... | class Solution:
def finalPrices(self, prices: List[int]) -> List[int]:
res = []
for i in range(len(prices)):
for j in range(i+1,len(prices)):
if prices[j]<=prices[i]:
res.append(prices[i]-prices[j])
break
if j==len(p... | none | 1 | 2.914667 | 3 | |
rplugin/python3/denite/ui/default.py | timgates42/denite.nvim | 0 | 4 | <gh_stars>0
# ============================================================================
# FILE: default.py
# AUTHOR: <NAME> <<EMAIL> at g<EMAIL>>
# License: MIT license
# ============================================================================
import re
import typing
from denite.util import echo, error, clearm... | # ============================================================================
# FILE: default.py
# AUTHOR: <NAME> <<EMAIL> at g<EMAIL>>
# License: MIT license
# ============================================================================
import re
import typing
from denite.util import echo, error, clearmatch, regex_... | en | 0.465682 | # ============================================================================ # FILE: default.py # AUTHOR: <NAME> <<EMAIL> at g<EMAIL>> # License: MIT license # ============================================================================ #util#check_matchdelete')) # if hasattr(self._vim, 'run_coroutine'): # self._... | 1.901279 | 2 |
PyDSTool/core/context_managers.py | yuanz271/PyDSTool | 0 | 5 | <filename>PyDSTool/core/context_managers.py
# -*- coding: utf-8 -*-
"""Context managers implemented for (mostly) internal use"""
import contextlib
import functools
from io import UnsupportedOperation
import os
import sys
__all__ = ["RedirectStdout", "RedirectStderr"]
@contextlib.contextmanager
def _stdchannel_red... | <filename>PyDSTool/core/context_managers.py
# -*- coding: utf-8 -*-
"""Context managers implemented for (mostly) internal use"""
import contextlib
import functools
from io import UnsupportedOperation
import os
import sys
__all__ = ["RedirectStdout", "RedirectStderr"]
@contextlib.contextmanager
def _stdchannel_red... | en | 0.715551 | # -*- coding: utf-8 -*- Context managers implemented for (mostly) internal use A context manager to temporarily redirect stdout or stderr Originally by <NAME>, 2013 (http://marc-abramowitz.com/archives/2013/07/19/python-context-manager-for-redirected-stdout-and-stderr/) | 2.358697 | 2 |
pos_kiosk/hooks.py | Muzzy73/pos_kiosk | 1 | 6 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from . import __version__ as app_version
app_name = "pos_kiosk"
app_title = "Pos Kiosk"
app_publisher = "9t9it"
app_description = "Kiosk App"
app_icon = "octicon octicon-file-directory"
app_color = "grey"
app_email = "<EMAIL>"
app_license = "MIT"
# Inclu... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from . import __version__ as app_version
app_name = "pos_kiosk"
app_title = "Pos Kiosk"
app_publisher = "9t9it"
app_description = "Kiosk App"
app_icon = "octicon octicon-file-directory"
app_color = "grey"
app_email = "<EMAIL>"
app_license = "MIT"
# Inclu... | en | 0.525243 | # -*- coding: utf-8 -*- # Includes in <head> # ------------------ # include js, css files in header of desk.html # app_include_css = "/assets/pos_kiosk/css/pos_kiosk.css" # app_include_js = "/assets/pos_kiosk/js/pos_kiosk.js" # include js, css files in header of web template # web_include_css = "/assets/pos_kiosk/css/p... | 1.404778 | 1 |
pypagai/models/model_lstm.py | gcouti/pypagAI | 1 | 7 | <gh_stars>1-10
from keras import Model, Input
from keras.layers import Dense, concatenate, LSTM, Reshape, Permute, Embedding, Dropout, Convolution1D, Flatten
from keras.optimizers import Adam
from pypagai.models.base import KerasModel
class SimpleLSTM(KerasModel):
"""
Use a simple lstm neural network
"""... | from keras import Model, Input
from keras.layers import Dense, concatenate, LSTM, Reshape, Permute, Embedding, Dropout, Convolution1D, Flatten
from keras.optimizers import Adam
from pypagai.models.base import KerasModel
class SimpleLSTM(KerasModel):
"""
Use a simple lstm neural network
"""
@staticmet... | en | 0.751499 | Use a simple lstm neural network Use a simple lstm neural network Use a simple lstm neural network # eb_story = Flatten()(eb_story) # eb_question = Flatten()(eb_question) | 2.97849 | 3 |
lib/variables/latent_variables/__init__.py | joelouismarino/variational_rl | 15 | 8 | <filename>lib/variables/latent_variables/__init__.py
from .fully_connected import FullyConnectedLatentVariable
from .convolutional import ConvolutionalLatentVariable
| <filename>lib/variables/latent_variables/__init__.py
from .fully_connected import FullyConnectedLatentVariable
from .convolutional import ConvolutionalLatentVariable
| none | 1 | 1.085513 | 1 | |
easyai/model/backbone/cls/pnasnet.py | lpj0822/image_point_cloud_det | 1 | 9 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# Author:
''' PNASNet in PyTorch.
Paper: Progressive Neural Architecture Search
'''
from easyai.base_name.block_name import NormalizationType, ActivationType
from easyai.base_name.backbone_name import BackboneName
from easyai.model.backbone.utility.base_backbone import *
fr... | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# Author:
''' PNASNet in PyTorch.
Paper: Progressive Neural Architecture Search
'''
from easyai.base_name.block_name import NormalizationType, ActivationType
from easyai.base_name.backbone_name import BackboneName
from easyai.model.backbone.utility.base_backbone import *
fr... | en | 0.536206 | #!/usr/bin/env python # -*- coding:utf-8 -*- # Author: PNASNet in PyTorch. Paper: Progressive Neural Architecture Search | 2.712146 | 3 |
map_download/cmd/TerrainDownloader.py | cugxy/map_download | 27 | 10 | # -*- coding: utf-8 -*-
# coding=utf-8
import json
import os
import math
import logging
import requests
import time
from map_download.cmd.BaseDownloader import DownloadEngine, BaseDownloaderThread, latlng2tile_terrain, BoundBox
def get_access_token(token):
resp = None
request_count = 0
url = "https://ap... | # -*- coding: utf-8 -*-
# coding=utf-8
import json
import os
import math
import logging
import requests
import time
from map_download.cmd.BaseDownloader import DownloadEngine, BaseDownloaderThread, latlng2tile_terrain, BoundBox
def get_access_token(token):
resp = None
request_count = 0
url = "https://ap... | en | 0.730894 | # -*- coding: utf-8 -*- # coding=utf-8 | 2.447342 | 2 |
tools/utils.py | vahini01/electoral_rolls | 16 | 11 | <reponame>vahini01/electoral_rolls
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Nov 10 23:28:58 2017
@author: dhingratul
"""
import urllib.request
import os
from selenium import webdriver
from selenium.webdriver.support.ui import Select
from bs4 import BeautifulSoup
import ssl
import requests
impo... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Nov 10 23:28:58 2017
@author: dhingratul
"""
import urllib.request
import os
from selenium import webdriver
from selenium.webdriver.support.ui import Select
from bs4 import BeautifulSoup
import ssl
import requests
import wget
from PyPDF2 import PdfFileR... | en | 0.882415 | #!/usr/bin/env python3 # -*- coding: utf-8 -*- Created on Fri Nov 10 23:28:58 2017 @author: dhingratul # Keep trying until the webpage successfully downloads # If it downloads, get out and get on with life # If it doesn't download after the timeout period, an exceptions is thrown, and we try again Check is the PDF val... | 3.105863 | 3 |
exp/viz_raw_manhattan.py | ellencwade/coronavirus-2020 | 0 | 12 | <gh_stars>0
"""
Experiment summary
------------------
Treat each province/state in a country cases over time
as a vector, do a simple K-Nearest Neighbor between
countries. What country has the most similar trajectory
to a given country?
Plots similar countries
"""
import sys
sys.path.insert(0, '..')
from utils impor... | """
Experiment summary
------------------
Treat each province/state in a country cases over time
as a vector, do a simple K-Nearest Neighbor between
countries. What country has the most similar trajectory
to a given country?
Plots similar countries
"""
import sys
sys.path.insert(0, '..')
from utils import data
impor... | en | 0.734333 | Experiment summary ------------------ Treat each province/state in a country cases over time as a vector, do a simple K-Nearest Neighbor between countries. What country has the most similar trajectory to a given country? Plots similar countries # ------------ HYPERPARAMETERS ------------- # ---------------------------... | 3.331203 | 3 |
Dataset Card for Starcoder Data with Python Education and Language Scores
Dataset Summary
The starcoderdata-python-edu-lang-score dataset contains the Python subset of the starcoderdata dataset. It augments the existing Python subset with features that assess the educational quality of code and classify the language of code comments. This dataset was created for high-quality Python education and language-based training, with a primary focus on facilitating models that can leverage educational scores and focus on specific languages for code comments (e.g., English or Portuguese). The dataset is suitable for various applications, including educational content evaluation and multilingual code understanding.
Uses
Direct Use
This dataset can be directly used to:
- Train models on code that has high educational value.
- Train language models to focus on specific languages in code comments.
Out-of-Scope Use
The dataset is not intended for tasks unrelated to code content analysis, such as general NLP classification or non-educational content filtering.
Dataset Structure
Each record in the dataset includes:
max_stars_repo_path: repo pathmax_stars_repo_name: repo namecontent: The original code content.content_cleaned: The content with specific metadata (e.g., reponame) removed for cleaner processing.language: The detected language of code comments.language_score: The confidence score for the language classification.comments: Extracted comments from the code content.edu_score: The educational score representing the quality of content (ranging from 0 to 5).edu_int_score: The integer representation of edu_score, rounded for simplified use cases.
Dataset Creation
Curation Rationale
The creation of the starcoderdata-python-edu-lang-score dataset had two purposes.
- Identification of high-quality code via an educational quality classification
- Filtering for natural languages that are used to write code comments
Data Collection and Processing
Data was collected from the Python subset of the starcoderdata dataset and received the following processing steps:
Content Cleaning: The preprocessing step removes metadata tags like or to ensure the content is ready for processing. This step is useful in creating a standardized input for further classification and scoring.
Language Classification:
- Model Used: The FastText language identification model (lid.176.bin) was employed to detect the language of comments within the code. This model supports a wide range of languages, ensuring robust language detection.
Educational Scoring:
- Model Used: The educational scoring model was pre-trained on sequence classification to evaluate the quality and educational value of Python code content. This model was sourced from Hugging Face’s HuggingFaceTB/python-edu-scorer.
Glossary
- Educational Score: A measure of the quality of code content based on its potential educational value, ranging from 0 (low quality) to 5 (high quality).
- Language Code: A code representing the detected language in code comments, based on FastText classification.
- Downloads last month
- 964