seq_id
string
text
string
repo_name
string
sub_path
string
file_name
string
file_ext
string
file_size_in_byte
int64
program_lang
string
lang
string
doc_type
string
stars
int64
dataset
string
pt
string
api
list
25208897980
from dataclasses import dataclass, asdict, field, make_dataclass from typing import List, Union, Any, Dict from enum import Enum from sigrok.core.classes import ConfigKey __all__ = [ "SrBlankState", "SrDeviceState", #"SrFileState", #"AnalogChannel", #"LogicChannel", ] colorsArray = [ '#fce94f'...
drdbrr/webrok
pysigrok/srtypes.py
srtypes.py
py
5,361
python
en
code
2
github-code
6
[ { "api_name": "sigrok.core.classes.ConfigKey.get", "line_number": 41, "usage_type": "call" }, { "api_name": "sigrok.core.classes.ConfigKey", "line_number": 41, "usage_type": "name" }, { "api_name": "dataclasses.make_dataclass", "line_number": 43, "usage_type": "call" },...
10158111328
from django.shortcuts import render, redirect from app14.models import ProductModel def openmainpage(request): if request.method == "POST": name = request.POST.get("product_name") price = request.POST.get("product_price") photo = request.FILES["product_photo"] ProductModel(name=nam...
suchishree/django_assignment1
project14/app14/views.py
views.py
py
443
python
en
code
0
github-code
6
[ { "api_name": "app14.models.ProductModel", "line_number": 10, "usage_type": "call" }, { "api_name": "django.shortcuts.redirect", "line_number": 11, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 13, "usage_type": "call" } ]
277437358
import torch import numpy as np from shapmagn.global_variable import DATASET_POOL from shapmagn.utils.obj_factory import partial_obj_factory # todo reformat the import style class DataManager(object): def __init__( self, ): """ the class for data management return a dict, each t...
uncbiag/shapmagn
shapmagn/datasets/data_manager.py
data_manager.py
py
3,588
python
en
code
94
github-code
6
[ { "api_name": "numpy.random.seed", "line_number": 44, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 44, "usage_type": "attribute" }, { "api_name": "torch.utils.data.DataLoader", "line_number": 63, "usage_type": "call" }, { "api_name": "torch...
12799024256
import webapp2, jinja2, os # Import requests with app engine adapter import requests, requests_toolbelt.adapters.appengine from bs4 import BeautifulSoup import datetime, time from google.appengine.ext import ndb # Patch adapter requests_toolbelt.adapters.appengine.monkeypatch() # os.path.dirname(__file__) is the c...
jQwotos/better-shareproint-slides
main.py
main.py
py
3,061
python
en
code
0
github-code
6
[ { "api_name": "requests_toolbelt.adapters.appengine.adapters.appengine.monkeypatch", "line_number": 12, "usage_type": "call" }, { "api_name": "requests_toolbelt.adapters.appengine.adapters", "line_number": 12, "usage_type": "attribute" }, { "api_name": "requests_toolbelt.adapters...
36689801955
from ..nmf import (PreambleEndRecord, ViaRecord, VersionRecord, ModeRecord, KnownEncodingRecord, UpgradeRequestRecord, UpgradeResponseRecord, Record, register_types, SizedEnvelopedMessageRecord, PreambleAckRecord, EndRecord) from .gssapi import GSSAPIStream cla...
ernw/net.tcp-proxy
nettcp/stream/nmf.py
nmf.py
py
1,954
python
en
code
54
github-code
6
[ { "api_name": "nmf.register_types", "line_number": 14, "usage_type": "call" }, { "api_name": "nmf.VersionRecord", "line_number": 18, "usage_type": "call" }, { "api_name": "nmf.ModeRecord", "line_number": 19, "usage_type": "call" }, { "api_name": "nmf.ViaRecord", ...
36011235958
# encoding: utf8 # Import local files: import colors as COLORS import margins as MARGINS import roi as ROI # External: external = ROI.ROI('External', 'External', COLORS.external) body = ROI.ROI('Body', 'Organ', COLORS.external) # Support: couch = ROI.ROI('Couch', 'Support', COLORS.couch) # Target volumes: gtv = ...
dicom/raystation-scripts
settings/rois.py
rois.py
py
21,183
python
en
code
40
github-code
6
[ { "api_name": "roi.ROI", "line_number": 10, "usage_type": "call" }, { "api_name": "colors.external", "line_number": 10, "usage_type": "attribute" }, { "api_name": "roi.ROI", "line_number": 11, "usage_type": "call" }, { "api_name": "colors.external", "line_numb...
9357978894
#!/usr/bin/env/python # coding: utf-8 # YouTube Data API Collector # Mat Morrison @mediaczar # Last updated: 2020-03-31 ''' Query the YouTube Data API for an individual channel URL or a file list of URLs. You may also specify which 'page' you'd like to start on (useful when the script breaks during a long data cap...
DigitalWhiskey/youtube_collector
youtube_collector.py
youtube_collector.py
py
8,081
python
en
code
0
github-code
6
[ { "api_name": "json.loads", "line_number": 63, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 63, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 80, "usage_type": "call" }, { "api_name": "scraperwiki.sqlite.save", "line_...
19772432260
#!/usr/bin/env python # coding: utf-8 # In[40]: import math import pandas as pd import numpy as np from pyspark.sql import SparkSession import pyspark.sql.functions as fc import json import requests spark = SparkSession.builder.config("spark.sql.warehouse.dir", "file:///C:/temp").appName("readCSV").getOrCreate() Da...
Lucas0717/house-search
spark_py/process_distinct_school.py
process_distinct_school.py
py
3,500
python
en
code
0
github-code
6
[ { "api_name": "pyspark.sql.SparkSession.builder.config", "line_number": 15, "usage_type": "call" }, { "api_name": "pyspark.sql.SparkSession.builder", "line_number": 15, "usage_type": "attribute" }, { "api_name": "pyspark.sql.SparkSession", "line_number": 15, "usage_type":...
26043231137
import cv2 import pickle import numpy as np espacios = [] with open('prueba.pkl', 'rb') as file: espacios = pickle.load(file) video = cv2.VideoCapture('video.mp4') # Inicializar el contador de cuadros ocupados full = 0 # Inicializar el estado de cada cuadro estado = [False] * len(espacios) while True: chec...
Kinartb/CC431A_Grafica
PC1/PC1_TRABAJO/main.py
main.py
py
1,599
python
es
code
0
github-code
6
[ { "api_name": "pickle.load", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.VideoCapture", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 19, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "lin...
43424744194
import os from aiohttp import web from cdtz import config LIST_TZ = [] def create_list_tz(): """Create list timezones. """ dir_zoneinfo = '/usr/share/zoneinfo' for dirpath, dirnames, filenames in os.walk(dir_zoneinfo): for file in filenames: filepath = os.path.join(dirpath, file) ...
IrovoyVlad/cusdeb-tz
bin/server.py
server.py
py
967
python
en
code
0
github-code
6
[ { "api_name": "os.walk", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path", "line_number": 16, "usage_type": "attribute" }, { "api_name": "aiohttp.web.json_response", "li...
73944509946
import os import numpy as np import cv2 from config import cfg from numpy.linalg import inv import sys class RawData(object): def __init__(self, use_raw = False): self.mapping_file = cfg.MAPPING_FILE self.rand_map = cfg.RAND_MAP self.path_prefix = "" self.ext = "" self.file...
yzhou-saic/MV3D_Yang
src/raw_data_from_mapping.py
raw_data_from_mapping.py
py
6,272
python
en
code
2
github-code
6
[ { "api_name": "config.cfg.MAPPING_FILE", "line_number": 11, "usage_type": "attribute" }, { "api_name": "config.cfg", "line_number": 11, "usage_type": "name" }, { "api_name": "config.cfg.RAND_MAP", "line_number": 12, "usage_type": "attribute" }, { "api_name": "conf...
29584667291
# -*- coding: utf-8 -*- from datetime import datetime import calendar from openerp import models, fields, api, sql_db from openerp.addons.avancys_orm import avancys_orm as orm from openerp.tools import DEFAULT_SERVER_DATE_FORMAT as DSDF, DEFAULT_SERVER_DATETIME_FORMAT as DSTF, float_compare from openerp.exceptions impo...
odoopruebasmp/Odoo_08
v8_llevatelo/hr_payroll_extended/models/hr_contribution_form.py
hr_contribution_form.py
py
82,426
python
en
code
0
github-code
6
[ { "api_name": "datetime.datetime.today", "line_number": 45, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 45, "usage_type": "name" }, { "api_name": "calendar.monthrange", "line_number": 48, "usage_type": "call" }, { "api_name": "unicode...
42339522829
from gtts import gTTS import speech_recognition as sr import os import time import webbrowser r = sr.Recognizer() order = "what can i do for you?" tts = gTTS(order) tts.save("order.mp3") os.startfile(r"C:\Users\Yodi\PycharmProjects\try\order.mp3") time.sleep(3) arr = [["Paradise", "someone"], ["kZ2xL_N...
yodifm/SpeechRecognition
SR/main.py
main.py
py
1,657
python
en
code
0
github-code
6
[ { "api_name": "speech_recognition.Recognizer", "line_number": 8, "usage_type": "call" }, { "api_name": "gtts.gTTS", "line_number": 10, "usage_type": "call" }, { "api_name": "os.startfile", "line_number": 12, "usage_type": "call" }, { "api_name": "time.sleep", ...
24213199857
import pygame import serial import time import sys class GUI: def __init__(self): # screen pygame.init() self.screen = pygame.display.set_mode((350, 400)) self.DELTA = 40 self.wide_value = 7500 self.angle_y = 3890 self.angle_x = 1230 s...
chinchilla2019/bebentos
main_and_pictures/main.py
main.py
py
7,165
python
en
code
0
github-code
6
[ { "api_name": "pygame.init", "line_number": 10, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 11, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 11, "usage_type": "attribute" }, { "api_name": "serial.Serial...
3666745897
from flask import Flask, request from flask_cors import CORS from pingback import ping_urls app = Flask(__name__) cors = CORS(app, resources=r'/pingback/', methods=['POST']) @app.route('/pingback/', methods=['GET', 'POST']) def api(): if request.method == 'POST': try: if request.is_json: ...
yingziwu/pingback
api.py
api.py
py
924
python
en
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 6, "usage_type": "call" }, { "api_name": "flask_cors.CORS", "line_number": 7, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 12, "usage_type": "attribute" }, { "api_name": "flask.request", ...
29979204168
import gensim from gensim.models import Word2Vec import gradio as gr # Load your trained Word2Vec model model = Word2Vec.load("word2vecsg2.model") def recommend_ingredients(*ingredients): # Filter out any None values from the ingredients ingredients = [i for i in ingredients if i] # Get most similar ingr...
egecandrsn/FoodPair.v0
app.py
app.py
py
1,134
python
en
code
0
github-code
6
[ { "api_name": "gensim.models.Word2Vec.load", "line_number": 6, "usage_type": "call" }, { "api_name": "gensim.models.Word2Vec", "line_number": 6, "usage_type": "name" }, { "api_name": "gradio.inputs.Dropdown", "line_number": 24, "usage_type": "call" }, { "api_name"...
529377311
from email.Utils import formataddr from zope import interface, component from zope.app.component.hooks import getSite from zope.traversing.browser import absoluteURL from zojax.principal.profile.interfaces import IPersonalProfile message = u""" Your invitation code: %s Or use link %s """ class InvitationMail(obje...
Zojax/zojax.personal.invitation
src/zojax/personal/invitation/template.py
template.py
py
990
python
en
code
1
github-code
6
[ { "api_name": "zope.traversing.browser.absoluteURL", "line_number": 24, "usage_type": "call" }, { "api_name": "zope.app.component.hooks.getSite", "line_number": 24, "usage_type": "call" }, { "api_name": "zojax.principal.profile.interfaces.IPersonalProfile", "line_number": 26,...
40322657669
# i have created this file prajakta ... from django.http import HttpResponse from django.shortcuts import render def index(request): return render(request,'index.html') def analyze(request): #get the text djtext=request.POST.get('text','default') #checkbox value removepunc=request.POST.get('remove...
maneprajakta/textprox
harry/views.py
views.py
py
2,439
python
en
code
3
github-code
6
[ { "api_name": "django.shortcuts.render", "line_number": 6, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 20, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 63, "usage_type": "call" }, { "api_name":...
70779220028
import os from accelerate.utils import is_tpu_available from ..dataset import FlattenDataset, ReprDataset from ..models import CachedS4, FlattenS4 from ..utils.trainer_utils import PredLoss, PredMetric from . import register_trainer from .base import Trainer @register_trainer("flatten_s4") class FlattenS4Trainer(Tr...
starmpcc/REMed
src/trainer/s4.py
s4.py
py
1,418
python
en
code
8
github-code
6
[ { "api_name": "base.Trainer", "line_number": 13, "usage_type": "name" }, { "api_name": "accelerate.utils.is_tpu_available", "line_number": 15, "usage_type": "call" }, { "api_name": "dataset.FlattenDataset", "line_number": 19, "usage_type": "name" }, { "api_name": ...
18921275912
"""Test the codeclimate JSON formatter.""" from __future__ import annotations import json import os import pathlib import subprocess import sys from tempfile import NamedTemporaryFile import pytest from ansiblelint.errors import MatchError from ansiblelint.file_utils import Lintable from ansiblelint.formatters impor...
ansible/ansible-lint
test/test_formatter_sarif.py
test_formatter_sarif.py
py
8,597
python
en
code
3,198
github-code
6
[ { "api_name": "ansiblelint.rules.AnsibleLintRule", "line_number": 22, "usage_type": "call" }, { "api_name": "ansiblelint.rules.AnsibleLintRule", "line_number": 23, "usage_type": "call" }, { "api_name": "ansiblelint.errors.MatchError", "line_number": 24, "usage_type": "nam...
5503988928
# https://www.hackerrank.com/challenges/validating-named-email-addresses/problem import email.utils import re email_pattern = r'([a-zA-Z](\w|\d|_|-|[.])*)@([a-zA-Z])*[.]([a-zA-Z]{1,3})' def is_valid_email_address(person): email = person[1] return re.fullmatch(email_pattern, email) is not None people = []...
Nikit-370/HackerRank-Solution
Python/validating-parsing-email-address.py
validating-parsing-email-address.py
py
524
python
en
code
10
github-code
6
[ { "api_name": "email.utils", "line_number": 11, "usage_type": "name" }, { "api_name": "re.fullmatch", "line_number": 12, "usage_type": "call" }, { "api_name": "email.utils", "line_number": 12, "usage_type": "argument" }, { "api_name": "email.utils.utils.parseaddr"...
37131271257
#!/usr/bin/env python #_*_coding:utf-8_*_ import numpy as np from sklearn.decomposition import PCA def pca(encodings, n_components = 2): encodings = np.array(encodings) data = encodings[:, 1:] shape = data.shape data = np.reshape(data, shape[0] * shape[1]) data = np.reshape([float(i) for i in data], s...
Superzchen/iFeature
clusters/pca.py
pca.py
py
505
python
en
code
152
github-code
6
[ { "api_name": "numpy.array", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.reshape", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.reshape", "line_number": 12, "usage_type": "call" }, { "api_name": "sklearn.decomposition.PCA", ...
17763602061
''' UserList objects¶ This class acts as a wrapper around list objects. It is a useful base class for your own list-like classes which can inherit from them and override existing methods or add new ones. In this way, one can add new behaviors to lists. The need for this class has been partially supplanted by the abil...
aparna0/competitive-programs
1collections module/userlist and usersting.py
userlist and usersting.py
py
2,368
python
en
code
0
github-code
6
[ { "api_name": "collections.UserString", "line_number": 51, "usage_type": "call" }, { "api_name": "collections.UserString", "line_number": 56, "usage_type": "call" }, { "api_name": "collections.UserString", "line_number": 74, "usage_type": "name" } ]
5131563876
from django.contrib.auth import get_user_model from django.core.validators import MaxValueValidator, MinValueValidator from django.db import models from .validators import validate_year NUMBER_OF_SYMBOLS = 20 User = get_user_model() class Category(models.Model): name = models.CharField( verbose_name='На...
Toksi86/yamdb_final
api_yamdb/reviews/models.py
models.py
py
3,953
python
en
code
0
github-code
6
[ { "api_name": "django.contrib.auth.get_user_model", "line_number": 8, "usage_type": "call" }, { "api_name": "django.db.models.Model", "line_number": 11, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 11, "usage_type": "name" }, { "ap...
13969225316
import tweepy import math from io import open #consumer key, consumer secret, access token, access secret. ckey="x" csecret="x" atoken="x-x" asecret="x" auth = tweepy.OAuthHandler(ckey, csecret) auth.set_access_token(atoken, asecret) api = tweepy.API(auth) hashtag = 'dilma' result_type = 'recent' total = 350 iterac...
ZackStone/PUC_6_RI
Test/twitter_api_search_3.py
twitter_api_search_3.py
py
1,072
python
en
code
0
github-code
6
[ { "api_name": "tweepy.OAuthHandler", "line_number": 11, "usage_type": "call" }, { "api_name": "tweepy.API", "line_number": 14, "usage_type": "call" }, { "api_name": "math.ceil", "line_number": 19, "usage_type": "call" }, { "api_name": "io.open", "line_number":...
21379769063
import test, gui, wx, config from unittests import dummy from domain import task, effort, category class ViewerContainerTest(test.wxTestCase): def setUp(self): self.settings = config.Settings(load=False) self.taskList = task.sorter.Sorter(task.TaskList(), settings=self.settings) ...
HieronymusCH/TaskCoach
branches/Release0_62_Branch/taskcoach/tests/unittests/guiTests/ViewerContainerTest.py
ViewerContainerTest.py
py
928
python
en
code
2
github-code
6
[ { "api_name": "test.wxTestCase", "line_number": 5, "usage_type": "attribute" }, { "api_name": "config.Settings", "line_number": 7, "usage_type": "call" }, { "api_name": "domain.task.sorter.Sorter", "line_number": 8, "usage_type": "call" }, { "api_name": "domain.ta...
29474328826
""" Hand-not-Hand creator """ """ this code is complete and ready to use """ import random import pandas as pd from sklearn.naive_bayes import MultinomialNB import helpers #utility funtcion to compute area of overlap def overlapping_area(detection_1, detection_2): x1_tl = detection_1[0] x2_tl = detection_2[0...
tqiu8/asl-cv
train_hand_detector.py
train_hand_detector.py
py
5,815
python
en
code
0
github-code
6
[ { "api_name": "helpers.getHandSet", "line_number": 33, "usage_type": "call" }, { "api_name": "helpers.convertToGrayToHOG", "line_number": 58, "usage_type": "call" }, { "api_name": "helpers.crop", "line_number": 58, "usage_type": "call" }, { "api_name": "random.ran...
39069895078
import time import serial import re from .haversine import haversine from threading import Thread from datetime import datetime, timedelta class Gps: def __init__(self, serial_port: str, timezone_hours: int = 0, serial_baudrate: int = 9600, round_number: int = 2): self.__serial = serial.Serial(serial_po...
policumbent/bob
modules/gps/src/steGPS/gps.py
gps.py
py
5,732
python
en
code
4
github-code
6
[ { "api_name": "serial.Serial", "line_number": 13, "usage_type": "call" }, { "api_name": "datetime.timedelta", "line_number": 16, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 28, "usage_type": "call" }, { "api_name": "haversine.haversine...
40687962293
import json import logging import threading import traceback from enum import Enum from typing import Any, Dict, List, Optional, Set, Tuple from lte.protos.policydb_pb2 import FlowMatch from magma.common.redis.client import get_default_client from magma.configuration.service_configs import load_service_config from mag...
magma/magma
lte/gateway/python/magma/pipelined/qos/common.py
common.py
py
22,178
python
en
code
1,605
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 25, "usage_type": "call" }, { "api_name": "enum.Enum", "line_number": 36, "usage_type": "name" }, { "api_name": "typing.Set", "line_number": 53, "usage_type": "name" }, { "api_name": "lte.protos.policydb_pb2.FlowMa...
18648883751
#!/usr/bin/env python3.7 import matplotlib matplotlib.use('Agg') import pylab as pl from matplotlib import rc import matplotlib.cm as cm from matplotlib.colors import Normalize rc('text', usetex=True) import numpy as np import numpy.linalg as nl import numpy.random as nr import os.path from numpy import cos, sin imp...
AmFamMLTeam/metric-space-magnitude
src/mobius.py
mobius.py
py
2,198
python
en
code
1
github-code
6
[ { "api_name": "matplotlib.use", "line_number": 3, "usage_type": "call" }, { "api_name": "matplotlib.rc", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path.path.splitext", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path.path", "...
36696903435
from typing import Dict, List from tips.framework.actions.sql_action import SqlAction from tips.framework.actions.sql_command import SQLCommand from tips.framework.metadata.additional_field import AdditionalField from tips.framework.metadata.table_metadata import TableMetaData from tips.framework.metadata.column...
ProjectiveGroupUK/tips-snowpark
tips/framework/actions/append_action.py
append_action.py
py
4,223
python
en
code
2
github-code
6
[ { "api_name": "tips.framework.actions.sql_action.SqlAction", "line_number": 13, "usage_type": "name" }, { "api_name": "tips.framework.metadata.table_metadata.TableMetaData", "line_number": 18, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 19, "usage_...
38029553646
# 分数/概率视图 from rest_framework import generics, filters, status from rest_framework.response import Response from ..models import User, Score, Probability, Question, History, Detail from ..serializer.results import ScoreSerializer, ProbabilitySerialzer from ..serializer.history import HistorySerializer, DetailSerializer...
Frank-LSY/LungCancerModel
back/lungcancer/polls/view/results.py
results.py
py
3,205
python
en
code
0
github-code
6
[ { "api_name": "rest_framework.generics.CreateAPIView", "line_number": 9, "usage_type": "attribute" }, { "api_name": "rest_framework.generics", "line_number": 9, "usage_type": "name" }, { "api_name": "serializer.results.ScoreSerializer", "line_number": 13, "usage_type": "n...
70454780987
#Libraries---------------------------------------------------------------------- """ Dependencies and modules necessary for analytical functions to work """ #Cheminformatics import rdkit from rdkit import Chem from rdkit.Chem import AllChem from rdkit.Chem import Draw from rdkit.Chem.Draw import IPythonConsole from r...
AusteKan/Chemexpy
chemexpy/chemexpy/similarity_dendogram.py
similarity_dendogram.py
py
2,593
python
en
code
0
github-code
6
[ { "api_name": "rdkit.Chem.AllChem.GetMorganFingerprintAsBitVect", "line_number": 43, "usage_type": "call" }, { "api_name": "rdkit.Chem.AllChem", "line_number": 43, "usage_type": "name" }, { "api_name": "pandas.DataFrame", "line_number": 49, "usage_type": "call" }, { ...
34519324302
''' Pydantic Models ''' from datetime import datetime from typing import List, Optional from pydantic import BaseModel class User(BaseModel): id: int name = "Yebin Lee" signup_ts : Optional[datetime]=None friends: List[int]=[] external_data = { "id":"123", "signup_ts":"2017-06-01 12:2...
YebinLeee/fast-api
Study_FastAPI/pydantic_models.py
pydantic_models.py
py
481
python
en
code
0
github-code
6
[ { "api_name": "pydantic.BaseModel", "line_number": 9, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 12, "usage_type": "name" }, { "api_name": "datetime.datetime", "line_number": 12, "usage_type": "name" }, { "api_name": "typing.List", ...
3981451688
''' Given a sorted list of numbers, change it into a balanced binary search tree. You can assume there will be no duplicate numbers in the list. Here's a starting point: ''' from collections import deque class Node: def __init__(self, value, left=None, right=None): self.value = value self.left = ...
MateuszMazurkiewicz/CodeTrain
InterviewPro/2019.11.22/task.py
task.py
py
1,347
python
en
code
0
github-code
6
[ { "api_name": "collections.deque", "line_number": 17, "usage_type": "call" } ]
21360428026
import pandas as pd from sklearn.model_selection import train_test_split from sklearn.impute import SimpleImputer path1 = 'project_data/DC_Crime.csv' path2 = 'project_data/DC_Properties.csv' path3 = 'project_data/DC_crime_test.csv' data = pd.read_csv(path1) Features =['SHIFT', 'OFFENSE', 'METHOD','BID',"NEIGHBORHOOD_...
montpelllier/MA333_Introduction-to-Big-Data-Science
decisiontree.py
decisiontree.py
py
1,129
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 8, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 16, "usage_type": "call" }, { "api_name": "sklearn.impute.SimpleImputer", "line_number": 18, "usage_type": "call" }, { ...
17779473058
#!/usr/bin/python3 """Query reddit API for work count in hot list using recusion""" import requests def count_words(subreddit, word_list, after=None, count={}): """Count words in word_list in subreddit""" if after is None: subred_URL = 'https://www.reddit.com/r/{}/hot.json'.format(subreddit) else:...
robertrowe1013/holbertonschool-interview
0x13-count_it/0-count.py
0-count.py
py
1,364
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 13, "usage_type": "call" } ]
35471156635
# -*- coding: utf-8 -*- from torch import cuda import transformers from transformers import AutoTokenizer from transformers import DataCollatorForTokenClassification, AutoConfig from transformers import AutoModelForTokenClassification, TrainingArguments, Trainer from datasets import load_metric, Dataset import pandas...
Odeuropa/wp3-information-extraction-system
SmellClassifier/training/train.py
train.py
py
13,483
python
en
code
2
github-code
6
[ { "api_name": "torch.cuda.is_available", "line_number": 21, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 21, "usage_type": "name" }, { "api_name": "transformers.set_seed", "line_number": 25, "usage_type": "call" }, { "api_name": "re.sub", ...
41734453103
from __future__ import absolute_import, unicode_literals from lol_stats_api.helpers.redis import db_metadata, db_matchlist from celery.decorators import task, periodic_task from celery.schedules import crontab from redis import Redis from celery_singleton import Singleton, clear_locks import os from datetime import dat...
fabran99/LolStatisticsBackend
bard_app_api/lol_stats_api/tasks.py
tasks.py
py
4,723
python
en
code
1
github-code
6
[ { "api_name": "lol_stats_api.helpers.mongodb.get_mongo_stats", "line_number": 23, "usage_type": "call" }, { "api_name": "celery_singleton.clear_locks", "line_number": 28, "usage_type": "call" }, { "api_name": "lol_stats_api.celeryApp.app", "line_number": 28, "usage_type":...
20763005925
from datetime import datetime from aiogram.dispatcher import FSMContext from aiogram.dispatcher.filters import Text from aiogram.types import Message, CallbackQuery, LabeledPrice, PreCheckoutQuery, ContentType, ShippingQuery from data.config import PAYMENT_TOKEN from data.shop_config import IS_PREPAYMENT, CURRENCY, N...
shehamane/kuriBot
src/handlers/users/ordering.py
ordering.py
py
3,797
python
en
code
0
github-code
6
[ { "api_name": "aiogram.types.CallbackQuery", "line_number": 17, "usage_type": "name" }, { "api_name": "aiogram.dispatcher.FSMContext", "line_number": 17, "usage_type": "name" }, { "api_name": "loader.dp.callback_query_handler", "line_number": 16, "usage_type": "call" },...
43266445764
from urllib.request import urlopen import json import matplotlib.pyplot as plt url = "http://cyrilserver.ddns.net:8080/hardware/esp32/all" # store the response of URL response = urlopen(url) arrData = [] # storing the JSON response # from url in data data_json = json.loads(response.read()) for i in range(len(d...
Monest-eco/Tools
graphData/allData.py
allData.py
py
434
python
en
code
0
github-code
6
[ { "api_name": "urllib.request.urlopen", "line_number": 9, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 14, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 18, "usage_type": "call" }, { "api_name": "matplotlib.py...
40025821479
from django.urls import path from . import views from .views import ( TicketCreateView, AssignCreateView, StatusCreateView, StatusLstCreateView, CgyCreateView, CgyListView, TicketListView ) urlpatterns = [ path('', views.home, name='sticket-home'), path('categories', C...
uppgrayedd1/webapp
webapp/sticket/urls.py
urls.py
py
783
python
en
code
0
github-code
6
[ { "api_name": "django.urls.path", "line_number": 14, "usage_type": "call" }, { "api_name": "views.home", "line_number": 14, "usage_type": "attribute" }, { "api_name": "django.urls.path", "line_number": 15, "usage_type": "call" }, { "api_name": "views.CgyListView.a...
32328440349
#--------------------------------- 라이브러리 --------------------------------- # 소켓 관련 라이브러리 from PIL import Image, ImageFile from io import BytesIO import socket from PIL import Image import pybase64 # 모델 관련 라이브러리 from PIL import Image import tensorflow as tf from tensorflow.keras.applications import Res...
MultiFinal/Fish_Project
PC.py
PC.py
py
8,991
python
ko
code
0
github-code
6
[ { "api_name": "tensorflow.keras.models.load_model", "line_number": 19, "usage_type": "call" }, { "api_name": "tensorflow.keras", "line_number": 19, "usage_type": "attribute" }, { "api_name": "influxdb_client.InfluxDBClient", "line_number": 55, "usage_type": "call" }, ...
10430336572
from pathlib import Path import argparse import sys import random from lib.conll import CoNLLReader def main(): parser = argparse.ArgumentParser(description="""Extract data based on comments info""") parser.add_argument('input', help="conllu file") parser.add_argument('output', help="target file", type=Pa...
coastalcph/ud-conversion-tools
extract.py
extract.py
py
2,049
python
en
code
3
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 9, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 11, "usage_type": "name" }, { "api_name": "sys.stderr", "line_number": 23, "usage_type": "attribute" }, { "api_name": "lib.conll.CoNLLRe...
74740608828
from tkinter import * from PIL import Image,ImageTk from tkinter import messagebox import pymysql def bookRegister(): ## When the user clicks the submit button this bookRegister function is run # BookInfos are stored in these variables. # and then these are uploaded to the database using the cursor metho...
DarkCodeOrg/library_management_system
AddBook.py
AddBook.py
py
3,270
python
en
code
0
github-code
6
[ { "api_name": "tkinter.messagebox.showinfo", "line_number": 27, "usage_type": "call" }, { "api_name": "tkinter.messagebox", "line_number": 27, "usage_type": "name" }, { "api_name": "tkinter.messagebox.showinfo", "line_number": 30, "usage_type": "call" }, { "api_na...
30906484831
from reportlab.platypus import (SimpleDocTemplate, Paragraph, PageBreak, Image, Spacer, Table, TableStyle) from reportlab.lib.styles import ParagraphStyle, getSampleStyleSheet from reportlab.pdfgen import canvas from reportlab.graphics.shapes import Line, LineShape, Drawing from reportlab.lib.pagesizes import LETTER, i...
GregorMonsonFD/holmly_sourcing_legacy
scripts/python/pdfGen/page_format_handler.py
page_format_handler.py
py
5,949
python
en
code
0
github-code
6
[ { "api_name": "reportlab.pdfbase.pdfmetrics.registerFont", "line_number": 13, "usage_type": "call" }, { "api_name": "reportlab.pdfbase.pdfmetrics", "line_number": 13, "usage_type": "name" }, { "api_name": "reportlab.pdfbase.ttfonts.TTFont", "line_number": 13, "usage_type"...
30804251376
from selenium import webdriver from selenium.webdriver.support.ui import WebDriverWait driver = webdriver.PhantomJS() driver.get('http://fund.eastmoney.com/fund.html') page_text = driver.find_element_by_id('pager').find_element_by_xpath('span[@class="nv"]').text page_count = ''.join(filter(str.isdigit, pag...
bobchi/learn_py
14.py
14.py
py
1,125
python
en
code
0
github-code
6
[ { "api_name": "selenium.webdriver.PhantomJS", "line_number": 4, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 4, "usage_type": "name" }, { "api_name": "selenium.webdriver.support.ui.WebDriverWait", "line_number": 21, "usage_type": "call" } ]
3847347050
import matplotlib matplotlib.use('Agg') import numpy as np import tinyarray import matplotlib.pyplot as plt from scipy.sparse import spdiags from scipy.sparse import eye from scipy.sparse import kron from scipy.sparse.linalg import inv from scipy.sparse import csr_matrix import adaptive from functools import partial fr...
hainingpan/nanowire_matlab
Ldos_dis.py
Ldos_dis.py
py
5,110
python
en
code
0
github-code
6
[ { "api_name": "matplotlib.use", "line_number": 2, "usage_type": "call" }, { "api_name": "tinyarray.array", "line_number": 19, "usage_type": "call" }, { "api_name": "tinyarray.array", "line_number": 20, "usage_type": "call" }, { "api_name": "tinyarray.array", "...
3029439171
#!/usr/bin/env python3 import os import csv import sys import matplotlib.pyplot as plt # Get theta values from file (if it exists) def readTheta (thetaFile): theta0 = 0 theta1 = 0 dataFile = "" if os.path.isfile(thetaFile): with open(thetaFile, newline='') as csvfile: spamreader = ...
cclaude42/ft_linear_regression
estimate.py
estimate.py
py
3,472
python
en
code
0
github-code
6
[ { "api_name": "os.path.isfile", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "csv.reader", "line_number": 15, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": ...
30571932153
import asyncio import datetime from queue import PriorityQueue import validators import youtube_dl class Player: queue = asyncio.Queue() # queue = PriorityQueue() play_next_song = asyncio.Event() next_song = None youtube_dl.utils.bug_reports_message = lambda: '' ytdl_format_options = { ...
MKA01/grajdelko
pl/savera/grajdelko/player/Player.py
Player.py
py
3,155
python
en
code
0
github-code
6
[ { "api_name": "asyncio.Queue", "line_number": 10, "usage_type": "call" }, { "api_name": "asyncio.Event", "line_number": 12, "usage_type": "call" }, { "api_name": "youtube_dl.utils", "line_number": 14, "usage_type": "attribute" }, { "api_name": "youtube_dl.YoutubeD...
74131023869
#!/usr/bin/python # Ce programme envoie la chaine 12345678 vers TTN # Importer les bibliothèques import serial import time # Définition des flags is_join = False # On peut joindre la carte is_exist = False # La carte Grove LoRa E5 a été détectée # Définition du timeout read_timeout = 0.2 # Créer ...
framboise314/Seeedstudio-Grove-E5-LoRa
programmes/lora-E5.py
lora-E5.py
py
2,569
python
fr
code
3
github-code
6
[ { "api_name": "serial.Serial", "line_number": 16, "usage_type": "call" }, { "api_name": "time.time", "line_number": 29, "usage_type": "call" }, { "api_name": "time.time", "line_number": 45, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 54,...
18100621514
""" 1971. Find if Path Exists in Graph https://leetcode.com/problems/find-if-path-exists-in-graph/ """ from typing import List, Tuple from unittest import TestCase, main class UnionFind: def __init__(self, n: int) -> None: self.root = list(range(n)) def find(self, a: int) -> int: """Returns t...
hirotake111/leetcode_diary
leetcode/1971/solution.py
solution.py
py
2,023
python
en
code
0
github-code
6
[ { "api_name": "typing.List", "line_number": 34, "usage_type": "name" }, { "api_name": "unittest.TestCase", "line_number": 46, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 47, "usage_type": "name" }, { "api_name": "typing.Tuple", "line_nu...
30324581341
import os, sys, re, pickle, json import numpy as np import cv2 import pandas as pd def get_seq(seq_dir, seq_name): seq_file = seq_dir + "/" + seq_name + ".pkl" seq = pickle.load(open(seq_file, "rb"), encoding='latin1') return seq def get_3dkeypoints(seq, frame_id, model_id): """ SMPL joints ...
egirgin/occlusionIndex
3dpw/src/utils.py
utils.py
py
4,338
python
en
code
0
github-code
6
[ { "api_name": "pickle.load", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.expand_dims", "line_number": 61, "usage_type": "call" }, { "api_name": "cv2.projectPoints", "line_number": 71, "usage_type": "call" }, { "api_name": "numpy.squeeze", "l...
4669064041
from Bio.Seq import Seq with open('rosalind_ba1b.txt') as file: text = file.readline().rstrip() k = int(file.readline().rstrip()) def get_pattern_count_dict(text, length=3): pattern_dict = {} seq = Seq(text) for i in range(len(text) - length + 1): pattern = text[i:i + length] if p...
Partha-Sarker/Rosalind-Problems
Lab Assignment - 1/chapter 1/ba1b Find the Most Frequent Words in a String.py
ba1b Find the Most Frequent Words in a String.py
py
987
python
en
code
0
github-code
6
[ { "api_name": "Bio.Seq.Seq", "line_number": 10, "usage_type": "call" } ]
7485160594
from datetime import datetime from os.path import basename from types import SimpleNamespace import math import numpy as np __version__ = "2020.10.06" def solve(length, supports, loads, EI, GA, top, bottom, shear): # {{{ """Solve the beam problem. Arguments: length: The length of the beam in mm. Th...
rsmith-nl/beammech
beammech.py
beammech.py
py
18,941
python
en
code
26
github-code
6
[ { "api_name": "numpy.sum", "line_number": 68, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 68, "usage_type": "call" }, { "api_name": "numpy.cumsum", "line_number": 70, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 71,...
36261973545
from collections import deque def solution1(graph): queue = deque([(0,0,0)]) n = len(graph) m = len(graph[0]) while queue: x,y,v = queue.popleft() if x>=n or y>=m or x<0 or y<0: continue if graph[x][y] == 1: graph[x][y] += v queue.append((x+1...
hon99oo/PythonAlgorithmStudy
이코테/DFS_BFS/예제_미로 탈출/solution.py
solution.py
py
1,924
python
ko
code
0
github-code
6
[ { "api_name": "collections.deque", "line_number": 4, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 35, "usage_type": "call" } ]
34042177473
import datetime import logging from django.contrib import auth from django.http import HttpResponseRedirect, HttpResponseNotFound from django.utils.translation import check_for_language from django.shortcuts import render from blueapps.account.components.bk_token.forms import AuthenticationForm from gcloud.core.signa...
caiyj/bk-sops
gcloud/core/views.py
views.py
py
2,776
python
en
code
null
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 13, "usage_type": "call" }, { "api_name": "gcloud.conf.settings.STATIC_URL", "line_number": 17, "usage_type": "attribute" }, { "api_name": "gcloud.conf.settings", "line_number": 17, "usage_type": "name" }, { "api_n...
19265168130
import smtplib from email.message import EmailMessage, MIMEPart import time from typing import Tuple class SendAMessage(): def __init__(self,action,msg_body,config,attach=None): self.config = config self.msg_body = msg_body self.attach = attach self.action = action self.set...
netmet1/constellation-node-automation
classes/send_sms_email.py
send_sms_email.py
py
2,744
python
en
code
2
github-code
6
[ { "api_name": "time.sleep", "line_number": 32, "usage_type": "call" }, { "api_name": "email.message.EmailMessage", "line_number": 38, "usage_type": "call" }, { "api_name": "smtplib.SMTP", "line_number": 69, "usage_type": "call" } ]
6836155009
# -*- coding: utf-8 -*- from windows import DSFWindow, PlateResWindow from epyparser import viia_parser, exparser from matplotlib.pyplot import figure, show from optim import linmelt from scipy import array, sqrt import csv def info(args): if args.csv_wells is not None: well_info = exparser(args.csv_wells,...
pozharski/epydsf
dsfactions.py
dsfactions.py
py
5,760
python
en
code
0
github-code
6
[ { "api_name": "epyparser.exparser", "line_number": 11, "usage_type": "call" }, { "api_name": "epyparser.viia_parser", "line_number": 17, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 18, "usage_type": "call" }, { "api_name": "win...
26008064699
import json from pathlib import Path def get_average_mark_student(student): overall_mark = 0 for mark in student: if mark in subjects: overall_mark += student[mark] student['average'] = overall_mark / len(subjects) return student # return student report card with added average mar...
1lubo/Student-Performance
main.py
main.py
py
2,482
python
en
code
0
github-code
6
[ { "api_name": "pathlib.Path", "line_number": 34, "usage_type": "call" }, { "api_name": "json.load", "line_number": 43, "usage_type": "call" } ]
19990663885
from django.conf.urls import url from . import views # 编写url尤其注意正则表达式匹配字符串的结尾,否则会引起冲突而达不到理想中的效果 urlpatterns = [ url(r'^$', views.index), url(r'^(\d+)/$', views.detail), url(r'^grades/$', views.grades), url(r'^students/$', views.students), url(r'^grades/(\d+)$', views.gradeStudents), url(r'^a...
Evanavevan/Django_Project
Project1/MyApp/urls.py
urls.py
py
427
python
en
code
0
github-code
6
[ { "api_name": "django.conf.urls.url", "line_number": 6, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 7, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 9, "usage_type": "call" }, { "api_name": "django.co...
15757093517
from flask import Flask, request, abort import os import face_detect as f # face_detect.py import base64 from linebot import ( LineBotApi, WebhookHandler ) from linebot.exceptions import ( InvalidSignatureError ) from linebot.models import ( MessageEvent, TextMessage, TextSendMessage, ImageMessage #ImageMes...
kentamseisyou/myahutest
main.py
main.py
py
2,201
python
en
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 17, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 20, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 21, "usage_type": "attribute" }, { "api_name": "linebot.LineBotApi", ...
13415308592
from pickletools import uint8 import time import numpy as np from onnxruntime import InferenceSession import cv2 import numpy as np # 加载ONNX模型 sess = InferenceSession('output.onnx') image = cv2.imread('38.jpg') image=cv2.resize(image,(1024,512)) cv2.normalize(image,image,0,255,cv2.NORM_MINMAX) #print(image) image=ima...
Tommy-Bie/Logistics-Package-Separation-Software
DatasetUtils/test.py
test.py
py
763
python
en
code
1
github-code
6
[ { "api_name": "onnxruntime.InferenceSession", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.resize", "line_number": 12, "usage_type": "call" }, { "api_name": "cv2.normalize", ...
22949757973
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # k2hat.py - Waqas Bhatti (wbhatti@astro.princeton.edu) - 07/15 # License: MIT. See the LICENCE file for license text. ''' This contains functions for reading K2 CSV light-curves produced by the HAT Project into a Python dictionary. Requires numpy. The only external func...
waqasbhatti/astrobase
astrobase/hatsurveys/k2hat.py
k2hat.py
py
25,449
python
en
code
50
github-code
6
[ { "api_name": "logging.DEBUG", "line_number": 66, "usage_type": "attribute" }, { "api_name": "logging.INFO", "line_number": 68, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 69, "usage_type": "call" }, { "api_name": "logging.basicC...
28199024080
import logging import os import json from flask import Flask from flask_ask import Ask, request, session, question, statement import datetime as DT os.system('sh transactions.sh > output.json') data = json.load(open('output.json')) app = Flask(__name__) ask = Ask(app, "/") logging.getLogger('flask_ask').setLevel(logg...
Interplay/HoyaHacks-18
main.py
main.py
py
6,607
python
en
code
0
github-code
6
[ { "api_name": "os.system", "line_number": 8, "usage_type": "call" }, { "api_name": "json.load", "line_number": 9, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 11, "usage_type": "call" }, { "api_name": "flask_ask.Ask", "line_number": 12, ...
28075967300
import numpy as np import matplotlib matplotlib.use("Qt5Agg") print("BACKEND: ", matplotlib.get_backend()) from matplotlib import pyplot as plt import utility as ut import network as nt from tqdm import tqdm as tqdm import plot as pt delta_T = 1e-3 # bars spiking_input = False dim = 8 n_outputs = 2*dim n_inputs = dim...
zimmerrol/spiking-bayesian-networks
bars_binary.py
bars_binary.py
py
1,960
python
en
code
6
github-code
6
[ { "api_name": "matplotlib.use", "line_number": 3, "usage_type": "call" }, { "api_name": "matplotlib.get_backend", "line_number": 4, "usage_type": "call" }, { "api_name": "utility.generate_bars", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.resha...
70267336189
import config from epyk.core.Page import Report # Create a basic report object page = Report() page.ui.text("#This is a text", options={"markdown": True}) page.ui.button("This is a test").click([ page.js.alert("test") ]) page.outs.publish(server="node", app_path=config.OUTPUT_PATHS_LOCALS_TS, module=config.OUT_F...
epykure/epyk-templates
web/app_nodejs.py
app_nodejs.py
py
328
python
en
code
17
github-code
6
[ { "api_name": "epyk.core.Page.Report", "line_number": 7, "usage_type": "call" }, { "api_name": "config.OUTPUT_PATHS_LOCALS_TS", "line_number": 14, "usage_type": "attribute" }, { "api_name": "config.OUT_FILENAME", "line_number": 14, "usage_type": "attribute" } ]
13389188618
from __future__ import print_function import torch import torchvision from torchvision import transforms import torch.nn as nn import torch.nn.functional as F from torchvision import models class Vgg16c(torch.nn.Module): def __init__(self): super(Vgg16c, self).__init__() vgg_pretrained...
jhilikb/NLBM
model/vgg_nlbm_cuhk.py
vgg_nlbm_cuhk.py
py
7,190
python
en
code
0
github-code
6
[ { "api_name": "torch.nn", "line_number": 17, "usage_type": "attribute" }, { "api_name": "torchvision.models.vgg16", "line_number": 20, "usage_type": "call" }, { "api_name": "torchvision.models", "line_number": 20, "usage_type": "name" }, { "api_name": "torch.nn.Se...
74918964666
import re from collections import defaultdict XMIN = -2 def find(rules,current): if len(current) < 5: return "" if current in rules: return rules[current] elif len(current) == 5: return "." else: size = len(current) left=find(rules,current[0:size-1]) rig...
aarroyoc/advent-of-code-2018
python/day12/day12_2.py
day12_2.py
py
1,670
python
en
code
1
github-code
6
[ { "api_name": "collections.defaultdict", "line_number": 21, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 22, "usage_type": "call" } ]
7074661101
import pandas as pd import pandas_datareader as web import matplotlib.pyplot as plt import datetime as dt start = dt.datetime(2021,1,1) end = dt.datetime.now() ticker_symbol = input('Enter the stock ticker which you wish to analyse: ') data = web.DataReader(ticker_symbol, 'yahoo', start, end) #print(data) delta = ...
amanpanditap/Python_Projects
finance_python/technical_stock_analysis/technical_stock_analysis.py
technical_stock_analysis.py
py
2,507
python
en
code
3
github-code
6
[ { "api_name": "datetime.datetime", "line_number": 6, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 7, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 7, "usage_type": "attribute" }, { "api_name": "pandas_da...
5510824333
from detectron2.engine import DefaultPredictor from detectron2.config import get_cfg import cv2 import numpy as np from detectron2 import model_zoo cfg = get_cfg() cfg.merge_from_file(model_zoo.get_config_file("COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml")) cfg.MODEL.ROI_HEADS.NUM_CLASSES = 1 cfg.MODEL.WEIGHTS...
hoainv99/mc-ocr
modules/image_segmentation/predict.py
predict.py
py
1,630
python
en
code
26
github-code
6
[ { "api_name": "detectron2.config.get_cfg", "line_number": 6, "usage_type": "call" }, { "api_name": "detectron2.model_zoo.get_config_file", "line_number": 7, "usage_type": "call" }, { "api_name": "detectron2.model_zoo", "line_number": 7, "usage_type": "name" }, { "...
18886739040
import re import ast from tkinter import Tk, Button, Text, Scrollbar, END from pathlib import Path from retroperm.project import RetropermProject from retroperm.rules import Rule from retroperm.rules.filesystem_rule import FilesystemRule from retroperm.rules.ban_library_function_rule import BanLibraryFunctionRule from...
SpiritSeal/retroperm
ui/gui2.py
gui2.py
py
3,484
python
en
code
0
github-code
6
[ { "api_name": "pathlib.Path", "line_number": 13, "usage_type": "call" }, { "api_name": "retroperm.project.RetropermProject", "line_number": 28, "usage_type": "call" }, { "api_name": "retroperm.project.RetropermProject", "line_number": 29, "usage_type": "call" }, { ...
39508101385
import numpy as np import matplotlib.pyplot as plt baseline = np.loadtxt('sub-AD4009_ses-baseline_acq-AP_date-2011-07-07_trc-av45_pet.csv', delimiter=',') followup = np.loadtxt('sub-AD4009_ses-followup_acq-AP_date-2013-07-03_trc-av45_pet.csv', delimiter=',') prediction = followup + np.random.normal(0, .025, size=foll...
SanoScience/MP-spreading-prediction
pictures/Graphical_abstract/plot.py
plot.py
py
1,090
python
en
code
4
github-code
6
[ { "api_name": "numpy.loadtxt", "line_number": 4, "usage_type": "call" }, { "api_name": "numpy.loadtxt", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.random.normal", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.random", "line...
31490583356
from django.contrib.auth import authenticate, login from django.contrib.auth import logout from django.shortcuts import render, redirect from django.http import JsonResponse import PathFinder.PathFinderModels.pathfinder_chat_bot as qamodel from langchain.vectorstores import Pinecone from langchain.embeddings.open...
Susa0823/PathFinderProject
PathFinder/PathFinderApp/views.py
views.py
py
16,953
python
en
code
0
github-code
6
[ { "api_name": "os.environ.get", "line_number": 34, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 34, "usage_type": "attribute" }, { "api_name": "pinecone.init", "line_number": 37, "usage_type": "call" }, { "api_name": "langchain.vectorstores.P...
5683288254
import torch.nn as nn from torch.nn.parameter import Parameter import torch import torch.nn.functional as F class DNN(nn.Module): def __init__(self, n_input, n_hidden, n_output, real): super(DNN, self).__init__() self.loss = 0 self.hidden1 = nn.Linear(n_input, n_hidden, True) ...
asd1354403003/NON
DNN.py
DNN.py
py
637
python
en
code
0
github-code
6
[ { "api_name": "torch.nn.Module", "line_number": 7, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 7, "usage_type": "name" }, { "api_name": "torch.nn.Linear", "line_number": 12, "usage_type": "call" }, { "api_name": "torch.nn", "line_numb...
23978857817
import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D def compute_dct_coeffs(blockSize): T = np.zeros((blockSize, blockSize)) T[0, :] = np.sqrt(1.0/blockSize) for i in range(1, blockSize): for j in range(blockSize): T[i][...
vince-robin/Image-compression
soft/functions/dct.py
dct.py
py
3,672
python
en
code
2
github-code
6
[ { "api_name": "numpy.zeros", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.cos", "line_number": 14, ...
45342937416
import torch import numpy as np import torch.nn as nn from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence import torch.nn.functional as F from torch.autograd import Variable from allennlp.modules.augmented_lstm import AugmentedLstm from allennlp.modules.input_variational_dropout import InputVariati...
makyr90/DL_Syntax_Models
Biaffine_parser_PyTorch/char_lstm.py
char_lstm.py
py
4,586
python
en
code
2
github-code
6
[ { "api_name": "torch.nn.Module", "line_number": 10, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 10, "usage_type": "name" }, { "api_name": "torch.nn.Embedding", "line_number": 36, "usage_type": "call" }, { "api_name": "torch.nn", "line...
8747023453
# -*- coding: utf-8 -*- """ Created on Fri Jul 19 13:34:12 2019 @author: ADMIN """ import AllFunctions as af import pandas as pd import numpy as np import pandas_profiling #import H2OHandler as hh df=pd.read_csv('train.csv') orgCC = df['cc_cons'].copy() df['isTrain']=True df2=pd.read_csv('test.csv') df2['isTrain']=...
kinjaldand/MLProjects
CreditCardConsumptionPatternAMEX/InitialExplore.py
InitialExplore.py
py
10,737
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 14, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 17, "usage_type": "call" }, { "api_name": "AllFunctions.getDFDesc", "line_number": 33, "usage_type": "call" }, { "api_name": "AllFunctions.g...
72231186747
from __future__ import print_function, division, unicode_literals import os import yaml from pymatgen.io.vasp.inputs import Kpoints, Incar from pymatgen.io.vasp.outputs import Vasprun import twod_materials.utils as utl from pymatgen.matproj.rest import MPRester from monty.serialization import loadfn import twod_ma...
ashtonmv/twod_materials
twod_materials/pourbaix/startup.py
startup.py
py
9,663
python
en
code
18
github-code
6
[ { "api_name": "twod_materials.__file__.replace", "line_number": 17, "usage_type": "call" }, { "api_name": "twod_materials.__file__", "line_number": 17, "usage_type": "attribute" }, { "api_name": "monty.serialization.loadfn", "line_number": 22, "usage_type": "call" }, ...
21253269122
from django.urls import path from .views import TagContentView #导入TagContentView from .views import XieyiConfigDateView from .views import NodeConfigMakeDevRequest,NodeConfigCopyRequest,NodeConfigReadAndSaveRequest,NodeConfigDeleteRequest from .views import XieyiConfigDateOrderView,XieyiTestCaseView,SenderHexDataOrd...
wawj901124/shangbaogongju
apps/shucaiyidate/urls.py
urls.py
py
3,118
python
zh
code
0
github-code
6
[ { "api_name": "django.urls.path", "line_number": 14, "usage_type": "call" }, { "api_name": "views.TagContentView.as_view", "line_number": 14, "usage_type": "call" }, { "api_name": "views.TagContentView", "line_number": 14, "usage_type": "name" }, { "api_name": "dj...
6428170708
# File: LangChainchatOpenAI.py # Author: Denys L # Date: October 8, 2023 # Description: import os import sys import hashlib from typing import Any import streamlit as st from dotenv import load_dotenv from langchain.callbacks.base import BaseCallbackHandler from fundamentals.langchain_utils import StuffSummarizerByCh...
lyepustin/bookNLP
app.py
app.py
py
2,293
python
en
code
0
github-code
6
[ { "api_name": "langchain.callbacks.base.BaseCallbackHandler", "line_number": 17, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 18, "usage_type": "name" }, { "api_name": "streamlit.session_state", "line_number": 19, "usage_type": "attribute" }, { ...
23138969943
import argparse from random import sample def load_data(fr_file,fw_file): all_users = [] all_moives = [] for lines in fr_file: if lines.startswith('i'): all_moives.append(lines.replace('\n','')) if lines.startswith('u'): all_users.append(lines.replace('\n','')) ...
55TFSI/RKGE
all_paths.py
all_paths.py
py
1,138
python
en
code
0
github-code
6
[ { "api_name": "random.sample", "line_number": 16, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 29, "usage_type": "call" } ]
43263411443
def plot_data_with_fit(data, fit_curve, format_x, format_y): import matplotlib.pyplot as plt import numpy as np import matplotlib.pyplot as mp mp.title('Final Curve Plot') format_x format_y plt.scatter(data[0],data[1], label='Data', s=1,) plt.plot(fit_curve[0],fit_curve[1], ...
UW-ParksidePhysics/Delgado-Omar
plot_data_with_fit.py
plot_data_with_fit.py
py
352
python
en
code
0
github-code
6
[ { "api_name": "matplotlib.pyplot.title", "line_number": 6, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 6, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.scatter", "line_number": 10, "usage_type": "call" }, { "api_name": "mat...
10909511760
from datetime import datetime from settings import ORDER_TTL, TCS_ACCOUNT_ID from tinkoff.invest import OrderDirection, OrderType from tinkoff.invest.schemas import StopOrderDirection as SODir from tinkoff.invest.schemas import StopOrderExpirationType as SType from tinkoff.invest.schemas import StopOrderType as SOType...
holohup/trademan-1.0-alpha-public
bot/tools/adapters.py
adapters.py
py
3,580
python
en
code
2
github-code
6
[ { "api_name": "tinkoff.invest.OrderDirection.ORDER_DIRECTION_SELL", "line_number": 13, "usage_type": "attribute" }, { "api_name": "tinkoff.invest.OrderDirection", "line_number": 13, "usage_type": "name" }, { "api_name": "tinkoff.invest.OrderDirection.ORDER_DIRECTION_BUY", "li...
37366648878
import configparser working_dir_list = ['./examples/test-ex1-50d/', './examples/test-ex2'] task_name_list = ['example 1', 'example 2'] task_id = 1 conjugated_eigvec_flag = 0 with_FVD_solution = False #with_FVD_solution = True working_dir_name = working_dir_list[task_id] task_name = task_name_list[task_id] # read p...
zwpku/EigenPDE-NN
plot_scripts/common.py
common.py
py
954
python
en
code
3
github-code
6
[ { "api_name": "configparser.ConfigParser", "line_number": 16, "usage_type": "call" } ]
410815561
from typing import Tuple import jax import jax.numpy as jnp import jax.scipy.linalg as linalg from numpy.typing import ArrayLike def transition_function(F: jnp.array, u: jnp.array, L: jnp.array, h: float, n_linspace=10000) -> Tuple[ ArrayLike, ArrayLike, ArrayLike]: r""" A prior of the form \...
hallelujahylefay/bayesianSDEsolver
bayesian_sde_solver/ode_solvers/probnum/transition_function.py
transition_function.py
py
1,114
python
en
code
0
github-code
6
[ { "api_name": "jax.numpy.array", "line_number": 9, "usage_type": "attribute" }, { "api_name": "jax.numpy", "line_number": 9, "usage_type": "name" }, { "api_name": "jax.numpy.linspace", "line_number": 22, "usage_type": "call" }, { "api_name": "jax.numpy", "line...
17689667482
import torch device = torch.device("cuda" if torch.cuda.is_available() else "cpu") no_resBlocks = 16 HR_shape = 96 train_data_path = '../data/train' val_data_path = '../data/val' advLossFactor = 0.001 VGGLossFactor = 0.006 mse_lr = 0.0001 mse_epochs = 700 initial_lr = 0.0001 second_lr = 0.00001 gan_epochs = 140 batch_...
abed11326/Training-a-Super-Resolution-GAN-for-4x-image-upscaling
hypParam.py
hypParam.py
py
365
python
en
code
0
github-code
6
[ { "api_name": "torch.device", "line_number": 3, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 3, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 3, "usage_type": "attribute" } ]
75112397948
from flask import Flask, render_template, request, redirect, url_for import requests app = Flask(__name__) @app.route("/", methods=["GET", "POST"]) def index(): try: nom = request.form['NOM'] prenom = request.form['PRENOM'] email = request.form['EMAIL'] return redirect(url_for(".t...
Foodjubi/fortnite-news
app.py
app.py
py
4,379
python
en
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "flask.request.form", "line_number": 10, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 10, "usage_type": "name" }, { "api_name": "flask.request.form",...
12026015047
import pygame # Global Consts # Colors BLACK = ( 0, 0, 0) WHITE = ( 255, 255, 255) BLUE = ( 0, 0, 255) RED = ( 255, 0, 0) GREEN = ( 0, 255, 0) SCREEN_WIDTH = 800 SCREEN_HEIGHT = 600 class Player(pygame.sprite.Sprite): # -- Attribute # Set speed vector change_x = 0...
danielp28/Python-Testing
platformer.py
platformer.py
py
8,838
python
en
code
0
github-code
6
[ { "api_name": "pygame.sprite", "line_number": 17, "usage_type": "attribute" }, { "api_name": "pygame.Surface", "line_number": 36, "usage_type": "call" }, { "api_name": "pygame.sprite.spritecollide", "line_number": 52, "usage_type": "call" }, { "api_name": "pygame....
72531854269
from typing import Final import sqlalchemy as sa def column_created_datetime(*, timezone: bool = True) -> sa.Column: return sa.Column( "created", sa.DateTime(timezone=timezone), nullable=False, server_default=sa.sql.func.now(), doc="Timestamp auto-generated upon creation",...
ITISFoundation/osparc-simcore
packages/postgres-database/src/simcore_postgres_database/models/_common.py
_common.py
py
2,235
python
en
code
35
github-code
6
[ { "api_name": "sqlalchemy.Column", "line_number": 7, "usage_type": "call" }, { "api_name": "sqlalchemy.DateTime", "line_number": 9, "usage_type": "call" }, { "api_name": "sqlalchemy.sql.func.now", "line_number": 11, "usage_type": "call" }, { "api_name": "sqlalchem...
24177027496
import pygame from pygame.locals import * class MyPlane(pygame.sprite.Sprite): def __init__(self,bg_size, screen): pygame.sprite.Sprite.__init__(self) self.screen = screen self.image1 = pygame.image.load('../img/hero1.png').convert_alpha() self.image2 = pygame.image.load('../img/he...
daniel-yaoyuan/paperplane
src/hero.py
hero.py
py
4,088
python
en
code
0
github-code
6
[ { "api_name": "pygame.sprite", "line_number": 5, "usage_type": "attribute" }, { "api_name": "pygame.sprite.Sprite.__init__", "line_number": 7, "usage_type": "call" }, { "api_name": "pygame.sprite", "line_number": 7, "usage_type": "attribute" }, { "api_name": "pyga...
71723953788
# coding:utf-8 import datetime from sqlalchemy import Column, Integer, DateTime, Numeric, create_engine, VARCHAR from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker from config import DB_CONFIG, DEFAULT_SCORE ''' sql操作的基类 包括ip,端口,types类型(0高匿名,1透明),protocol(0 http,1 https ht...
xindemeng/python-projects
jd_spider/jd_spider/db/SqlHelper.py
SqlHelper.py
py
6,761
python
en
code
0
github-code
6
[ { "api_name": "sqlalchemy.ext.declarative.declarative_base", "line_number": 15, "usage_type": "call" }, { "api_name": "sqlalchemy.Column", "line_number": 20, "usage_type": "call" }, { "api_name": "sqlalchemy.Integer", "line_number": 20, "usage_type": "argument" }, { ...
18573808607
from Utilities import say import Utilities import json import Room class Thing: """The basic class for all non-Room objects in the game""" def __init__(self, id, name): self.id = id self.name = name self.adjectives = [] self.alternate_names = [] # how the item should appear in a list. A book. An apple. A ...
LindseyL610/CS467-AdventureProject
Thing.py
Thing.py
py
66,406
python
en
code
0
github-code
6
[ { "api_name": "Room.Room", "line_number": 84, "usage_type": "attribute" }, { "api_name": "json.dumps", "line_number": 115, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 136, "usage_type": "call" }, { "api_name": "Utilities.say", "line_numb...
14712071511
from fastapi import APIRouter, Header from fastapi.exceptions import HTTPException from client import get_ccxt_client router = APIRouter() @router.get("/info/") async def list_markets(x_connection_id: str = Header()): try: client = get_ccxt_client(x_connection_id) return client.load_markets() ...
masked-trader/raccoon-exchange-service
src/server/routes/market.py
market.py
py
2,242
python
en
code
0
github-code
6
[ { "api_name": "fastapi.APIRouter", "line_number": 6, "usage_type": "call" }, { "api_name": "fastapi.Header", "line_number": 10, "usage_type": "call" }, { "api_name": "client.get_ccxt_client", "line_number": 12, "usage_type": "call" }, { "api_name": "client.load_ma...
5539453892
import cv2 import numpy as np """ YUV란? 빛의 밝기를 나타내는 휘도(Y)와 색상신호 2개(U, V)로 표현하는 방식이다. The Y′UV model defines a color space in terms of one luma component (Y′) and two chrominance components, called U (blue projection) and V (red projection) respectively. Y = 0.299R + 0.587G + 0.114B """ src = cv2.imread('../resou...
daebakk/Image-Processing
Assignment/Fundamentals of Image processing/BGRToY.py
BGRToY.py
py
794
python
en
code
0
github-code
6
[ { "api_name": "cv2.imread", "line_number": 16, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 19, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2YUV", "line_number": 19, "usage_type": "attribute" }, { "api_name": "numpy.zeros", "lin...
7755753027
from __future__ import absolute_import from __future__ import unicode_literals import argparse from .. import api, utils from ..command import Command, CMD_SUCCESS, HELP_LIST from ..exceptions import InvalidDateError, NotFoundError, WrappedValueError class Log(Command): """List enrollment information available ...
timhayduk/glusterDashboard
gitlab/lib/python3.5/site-packages/sortinghat/cmd/log.py
log.py
py
4,198
python
en
code
1
github-code
6
[ { "api_name": "command.Command", "line_number": 11, "usage_type": "name" }, { "api_name": "argparse.ArgumentParser", "line_number": 28, "usage_type": "call" }, { "api_name": "command.HELP_LIST", "line_number": 42, "usage_type": "name" }, { "api_name": "exceptions....
70096885309
from collections import deque def solution(progresses, speeds): progresses = deque(progresses) speeds = deque(speeds) answer = [] while progresses: count = 0 for i in range(len(speeds)): progresses[i] += speeds[i] while True: if progresses[0] < 100: ...
YooGunWook/coding_test
프로그래머스_복습/스택_기능개발.py
스택_기능개발.py
py
697
python
en
code
0
github-code
6
[ { "api_name": "collections.deque", "line_number": 5, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 6, "usage_type": "call" } ]
39671957475
""" Класс для работы с контестами """ import os import re import json import string import shutil import configparser, itertools from collections import OrderedDict from bs4 import BeautifulSoup from mysite import settings from .models import Cntsregs, Logins, Contests, Problems from problems.classes import ProblemsCre...
Raftor74/ejudge-web-app
contests/classes.py
classes.py
py
19,662
python
ru
code
0
github-code
6
[ { "api_name": "collections.OrderedDict", "line_number": 16, "usage_type": "name" }, { "api_name": "collections.OrderedDict.__setitem__", "line_number": 23, "usage_type": "call" }, { "api_name": "collections.OrderedDict", "line_number": 23, "usage_type": "name" }, { ...
42435364768
import threading import time import PySimpleGUI as sg import psutil from pathlib import Path import subprocess def is_running(process_name): running = False for proc in psutil.process_iter(): if process_name in proc.name(): running = True break return running def the_thre...
activatedtmx/GTAV-Auto-DLL-Injector
injector.py
injector.py
py
5,140
python
en
code
1
github-code
6
[ { "api_name": "psutil.process_iter", "line_number": 11, "usage_type": "call" }, { "api_name": "PySimpleGUI.Window", "line_number": 18, "usage_type": "attribute" }, { "api_name": "time.sleep", "line_number": 27, "usage_type": "call" }, { "api_name": "pathlib.Path",...
6642507334
from rest_framework import status from rest_framework.decorators import api_view from rest_framework.response import Response from .serializer import perfil_usuarioSerializer from .models import perfil_usuario @api_view(['GET', 'POST']) def lista_usuarios(request): if request.method == 'GET': users = perfi...
MarcoToloza/Caso_A_Parte-2-API
Api_qr/AppPi/views.py
views.py
py
1,057
python
en
code
0
github-code
6
[ { "api_name": "models.perfil_usuario.objects.all", "line_number": 10, "usage_type": "call" }, { "api_name": "models.perfil_usuario.objects", "line_number": 10, "usage_type": "attribute" }, { "api_name": "models.perfil_usuario", "line_number": 10, "usage_type": "name" },...