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
12741310305
import sqlite3 con = sqlite3.connect('d_students.db') cur = con.cursor() # Create table #cur.execute('''CREATE TABLE s_information #(first_name text, last_name text, course text, age real)''') # Insert a row of data #cur.execute("INSERT INTO s_information VALUES ('Ade','Ola','product_design', 29)") # ...
kehindeorolade/Module_4_lesson_3
Module_4_less_3.py
Module_4_less_3.py
py
1,043
python
en
code
0
github-code
6
[ { "api_name": "sqlite3.connect", "line_number": 3, "usage_type": "call" } ]
24512005131
import datetime as dt import warnings import numpy as np import pandas as pd from asgiref.sync import async_to_sync from dateutil.parser import parse from django.core.cache import cache from django.utils import timezone from apps.integration.tasks.sockets.get_kws_object import get_kws_object warnings.filterwarnings(...
finbyz/trading_child
apps/integration/tasks/sockets/option_websocket.py
option_websocket.py
py
3,575
python
en
code
0
github-code
6
[ { "api_name": "warnings.filterwarnings", "line_number": 13, "usage_type": "call" }, { "api_name": "django.core.cache.cache.get", "line_number": 17, "usage_type": "call" }, { "api_name": "django.core.cache.cache", "line_number": 17, "usage_type": "name" }, { "api_n...
21888795134
import time from pyvisauto import Region import api.api_core as api import fleet.fleet_core as flt import config.config_core as cfg import nav.nav as nav import stats.stats_core as sts import util.kca as kca_u from kca_enums.kcsapi_paths import KCSAPIEnum from util.logger import Log class FactoryCore(object): ena...
XVs32/kcauto_custom
kcauto/factory/factory_core.py
factory_core.py
py
8,911
python
en
code
5
github-code
6
[ { "api_name": "config.config_core.config", "line_number": 34, "usage_type": "attribute" }, { "api_name": "config.config_core", "line_number": 34, "usage_type": "name" }, { "api_name": "time.time", "line_number": 38, "usage_type": "call" }, { "api_name": "time.time...
3642629983
from utils.transformers_utils import SiameseRobertaModel,TrainerLogger,get_preds,compute_metrics,update_metrics import numpy as np import pandas as pd from transformers import RobertaTokenizerFast,RobertaConfig,TrainingArguments from datasets import Dataset,DatasetDict #!pip install datasets import evaluate ...
matisyo/vulnerability_detection
Notebooks/8. Transformers Classifier.py
8. Transformers Classifier.py
py
4,686
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.where", "line_number": 18, "usage_type": "call" }, { "api_name": "datasets.DatasetDict", "line_number": 20, "usage_type": "call" }, { "api_name": "datasets.Dataset.fro...
39932475902
import argparse import requests from tabulate import tabulate def make_api_request(query, filters, page, pagesize): url = 'http://localhost:3000/log/search' data = { 'query': query, 'filters': filters, 'page': page, 'pageSize': pagesize } response = requests.post(url, ...
harikrishnanum/LogQube
cli/search.py
search.py
py
2,041
python
en
code
0
github-code
6
[ { "api_name": "requests.post", "line_number": 15, "usage_type": "call" }, { "api_name": "tabulate.tabulate", "line_number": 30, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 42, "usage_type": "call" } ]
42842609252
# This is a replacement for test/integration/inflate_tokens.sh. # The original script had a lot of problems as described in https://app.zenhub.com/workspaces/current-sprint---engineering-615a2e9fe2abd5001befc7f9/issues/sifchain/issues/719. # See https://www.notion.so/sifchain/TEST-TOKEN-DISTRIBUTION-PROCESS-41ad0861560...
Sifchain/sifnode
test/integration/framework/src/siftool/inflate_tokens.py
inflate_tokens.py
py
18,307
python
en
code
106
github-code
6
[ { "api_name": "typing.Mapping", "line_number": 14, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 14, "usage_type": "name" }, { "api_name": "siftool.test_utils.EnvCtx", "line_number": 18, "usage_type": "attribute" }, { "api_name": "siftool.test...
14132002645
from sqlalchemy import Boolean, Column, ForeignKey, Integer, String, DateTime, Float, UniqueConstraint, Index from sqlalchemy.orm import relationship from src.models import Base class GpsRecord(Base): __tablename__ = "gps_record" id = Column(Integer, primary_key=True, index=True) datetime = Column(DateT...
jmcastellote/whereabouts
src/gps_record/model.py
model.py
py
1,126
python
en
code
0
github-code
6
[ { "api_name": "src.models.Base", "line_number": 6, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 10, "usage_type": "call" }, { "api_name": "sqlalchemy.Integer", "line_number": 10, "usage_type": "argument" }, { "api_name": "sqlalchemy.Co...
31192442591
""" Created on Fri Mar 4 19:28:46 2022 @author: Miguel """ from _legacy.exe_isotopeChain_taurus import DataTaurus class Template: com = 'com' z = 'z' a = 'a' seed = 'seed' b20 = 'b20' varN2 = 'varN2' iterartions = 'iters' hamil = 'interaction' TEMPLATE = """NUCLEUS {a...
migueldelafuente1/taurus_tools
_legacy/exe_q20pes_axial.py
exe_q20pes_axial.py
py
33,646
python
en
code
1
github-code
6
[ { "api_name": "_legacy.exe_isotopeChain_axial.DataAxial.INPUT_FILENAME", "line_number": 146, "usage_type": "attribute" }, { "api_name": "_legacy.exe_isotopeChain_axial.DataAxial", "line_number": 146, "usage_type": "name" }, { "api_name": "subprocess.call", "line_number": 150,...
2277882687
import random import time import discord from discord.ext import commands import utils class Misc(commands.Cog): def __init__(self, bot): self.bot = bot @commands.command() async def profile(self, ctx, user: discord.Member = None): """ Get information about a Discord user. Argument 'user', if sp...
SkippyTheSnake/Discord-bot
cogs/misc.py
misc.py
py
3,962
python
en
code
0
github-code
6
[ { "api_name": "discord.ext.commands.Cog", "line_number": 10, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 10, "usage_type": "name" }, { "api_name": "discord.Member", "line_number": 15, "usage_type": "attribute" }, { "api_name":...
25231410593
#! /usr/bin/env python # encoding: utf-8 # vim: ai ts=4 sts=4 et sw=4 ## ## ## @author Nadia ## nadia@gmail.com/joel@gmail.com ## import MySQLdb from datetime import datetime from mako.template import Template from creche import settings class SysEventService: """Class that will be delegated with creating event...
projet2019/Creche_Parentale
creche/coreapp/service/sys_event_service.py
sys_event_service.py
py
8,574
python
en
code
0
github-code
6
[ { "api_name": "MySQLdb.connect", "line_number": 21, "usage_type": "call" }, { "api_name": "creche.settings.DATABASES", "line_number": 21, "usage_type": "attribute" }, { "api_name": "creche.settings", "line_number": 21, "usage_type": "name" }, { "api_name": "creche...
10819501559
import yaml import librosa import numpy as np import os sr = 22050 namesong = 'LizNelson_Rainfall' def merge_stems(namesong): # Merge all instrumental stems into 1 mix and all vocal stems into 1 mix stream = open("./MedleyDB_sample/Audio/" + namesong + "/" + namesong + "_METADATA.yaml", "r") ...
moulinleo/Voice-Isolation
merge_stems.py
merge_stems.py
py
2,850
python
en
code
0
github-code
6
[ { "api_name": "yaml.load_all", "line_number": 16, "usage_type": "call" }, { "api_name": "librosa.load", "line_number": 26, "usage_type": "call" }, { "api_name": "librosa.load", "line_number": 31, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_numbe...
30881965405
# -*- coding: utf-8 -*- import os from setuptools import setup, find_packages version = '0.9.4' long_description = ( open('README.rst').read() + '\n' + open(os.path.join('docs', 'HISTORY.rst')).read() + '\n') setup(name='plone.jsonapi.routes', version=version, description="Plone JSON API...
collective/plone.jsonapi.routes
setup.py
setup.py
py
1,641
python
en
code
12
github-code
6
[ { "api_name": "os.path.join", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "setuptools.setup", "line_number": 14, "usage_type": "call" }, { "api_name": "setuptools.find_packages",...
12816084120
import requests import os from dotenv import load_dotenv class YaUploader: BASE_URL = 'https://cloud-api.yandex.net/v1/disk/resources' GET_FILES = '/files' UPLOAD_LINK = '/upload' def __init__(self, token) -> None: self.token = token def get_headers(self): headers = { ...
SergeyMMedvedev/8_api_requests
task_2.py
task_2.py
py
1,652
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 24, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 30, "usage_type": "call" }, { "api_name": "requests.put", "line_number": 42, "usage_type": "call" }, { "api_name": "dotenv.load_dotenv", "line...
33126934610
import pandas as pd from tools.readFile import read_excl # 读取excel中指定列整列元素,返回一个集合 def readExcelData(filePath, column): df = pd.read_excel(filePath, usecols=[column - 1]) # 指定读取的列 df_list = df.values.tolist() backList = [] for i in df_list: backList.append(i[0]) if len(backList) == 0: ...
linhe-demo/sync_dataTable
tools/readExcel.py
readExcel.py
py
632
python
en
code
5
github-code
6
[ { "api_name": "pandas.read_excel", "line_number": 8, "usage_type": "call" }, { "api_name": "tools.readFile.read_excl", "line_number": 15, "usage_type": "call" } ]
17573160892
from flask import Flask, render_template, request, redirect, session, flash from mysqlconnection import connectToMySQL import json app = Flask(__name__) @app.route("/") def index(): mysql = connectToMySQL("leads_and_clients_db") query = "SELECT concat(clients.first_name, ' ', clients.last_name) as name, count...
aaronfennig/pythonDjango
flask/flask_mysql/leads_and_clients/server.py
server.py
py
963
python
en
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "mysqlconnection.connectToMySQL", "line_number": 9, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 19, "usage_type": "call" }, { "api_name": "json.d...
72782974907
import _pickle as pickle import numpy as np from mtqt_source import MTQTSource from pathlib import Path from pyrocko import orthodrome import tensorflow_probability as tfp import waveform_processing as wp tfd = tfp.distributions pi = np.pi def find_closest_grid_point(lat_ev, lon_ev, depth_ev, path_models=None, ...
braunfuss/BNN-MT
cnn_util.py
cnn_util.py
py
6,023
python
en
code
9
github-code
6
[ { "api_name": "tensorflow_probability.distributions", "line_number": 9, "usage_type": "attribute" }, { "api_name": "numpy.pi", "line_number": 10, "usage_type": "attribute" }, { "api_name": "pathlib.Path", "line_number": 16, "usage_type": "call" }, { "api_name": "p...
38793898315
# import tensorflow libraries import tensorflow as tf import numpy as np # import opencv and find webcam import cv2 cap = cv2.VideoCapture(0) if not(cap.isOpened()): print("Can't find webcam, shutting down...") quit() # set resolution of camera capture cap.set(cv2.CAP_PROP_FRAME_WIDTH, 960.0) cap.set(cv2.CAP_...
OSUrobotics/object_detection
mainfile.py
mainfile.py
py
2,379
python
en
code
0
github-code
6
[ { "api_name": "cv2.VideoCapture", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.CAP_PROP_FRAME_WIDTH", "line_number": 13, "usage_type": "attribute" }, { "api_name": "cv2.CAP_PROP_FRAME_HEIGHT", "line_number": 14, "usage_type": "attribute" }, { "api_...
28989994372
if True: from PyQt5.QtCore import pyqtSlot, QSettings from PyQt5.QtWidgets import QApplication, QDialog, QDialogButtonBox, QTableWidgetItem from PyQt5.QtXml import QDomDocument else: from PyQt4.QtCore import pyqtSlot, QSettings from PyQt4.QtGui import QApplication, QDialog, QDialogButtonBox, QTableW...
falkTX/Cadence
src/catarina.py
catarina.py
py
54,241
python
en
code
361
github-code
6
[ { "api_name": "PyQt4.QtGui.QDialog", "line_number": 61, "usage_type": "name" }, { "api_name": "ui_catarina_addgroup.Ui_CatarinaAddGroupW", "line_number": 61, "usage_type": "attribute" }, { "api_name": "PyQt4.QtGui.QDialog.__init__", "line_number": 63, "usage_type": "call"...
18164621881
import json # Read the network.json file with open("network.json", "r") as f: network = json.load(f) # Create a set to store all pairs (a, b) such that a follows b but b doesn't follow back a pairs = set() # Iterate over all users in the network for user, data in network.items(): # Get the list of...
GOVINDFROMINDIA/Twitter-Scam-Victims
GraphEvaluation.py
GraphEvaluation.py
py
1,265
python
en
code
0
github-code
6
[ { "api_name": "json.load", "line_number": 5, "usage_type": "call" } ]
12300846904
""" This example illustrates how to display the tree of a single TreeGrower for debugging purpose. """ from sklearn.datasets import make_classification import numpy as np from pygbm.binning import BinMapper from pygbm.grower import TreeGrower from pygbm import plotting rng = np.random.RandomState(0) n_samples = int...
ogrisel/pygbm
examples/plot_performance_profile_single_small_tree.py
plot_performance_profile_single_small_tree.py
py
1,076
python
en
code
175
github-code
6
[ { "api_name": "numpy.random.RandomState", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 13, "usage_type": "attribute" }, { "api_name": "sklearn.datasets.make_classification", "line_number": 17, "usage_type": "call" }, { "a...
72067619709
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Apr 9 13:31:37 2022 @author: basile """ import pandas as pd df = pd.DataFrame(columns=['index', 'prenom', 'nom', 'email', 'groupe', 'mystere']) df.to_csv('priants.csv', index=False) import streamlit as st input = st.text_input("text", key="text") ...
BasileR29/chapelet_tournant
test.py
test.py
py
422
python
en
code
0
github-code
6
[ { "api_name": "pandas.DataFrame", "line_number": 11, "usage_type": "call" }, { "api_name": "streamlit.text_input", "line_number": 17, "usage_type": "call" }, { "api_name": "streamlit.button", "line_number": 20, "usage_type": "call" }, { "api_name": "streamlit.sess...
24494832097
import requests import pandas as pd from bs4 import BeautifulSoup as bs def get_spy(): url = 'https://www.slickcharts.com/sp500' request = requests.get(url, headers={'User-Agent': 'Mozilla/5.0'}) soup = bs(request.text, "lxml") stats = soup.find('table', class_='table table-hover table-borderless t...
reesecake/td_api
util/IndexInfo.py
IndexInfo.py
py
520
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 9, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 11, "usage_type": "call" }, { "api_name": "pandas.read_html", "line_number": 15, "usage_type": "call" }, { "api_name": "pandas.to_numeric", ...
36152977435
import os, sys, logging from flask import Blueprint, current_app from flask import request, jsonify ml_model_bp = Blueprint('ml_model_bp', __name__) # create a Blueprint object # create 'index' view for testing purposes @ml_model_bp.route('/', methods=["GET", "POST"]) def index(): return "ML model service is run...
bhavenp/docker_sentiment_analysis
ml_service/ml_model_api/ml_model_blueprint.py
ml_model_blueprint.py
py
1,355
python
en
code
0
github-code
6
[ { "api_name": "flask.Blueprint", "line_number": 5, "usage_type": "call" }, { "api_name": "flask.current_app.model", "line_number": 18, "usage_type": "attribute" }, { "api_name": "flask.current_app", "line_number": 18, "usage_type": "name" }, { "api_name": "flask.r...
20232075182
from tradingview.client import TradingViewWebSocketClient, fetch_japan_symbols from datetime import datetime client = TradingViewWebSocketClient() symbols = fetch_japan_symbols() client.add_symbols(symbols[:100]) # client.add_symbols(['TSE:4689']) for x in client.fetch_ohlc(past_bar=302): print(datetime.fromtime...
otomarukanta/tradingview
example_ohlc.py
example_ohlc.py
py
341
python
en
code
0
github-code
6
[ { "api_name": "tradingview.client.TradingViewWebSocketClient", "line_number": 4, "usage_type": "call" }, { "api_name": "tradingview.client.fetch_japan_symbols", "line_number": 6, "usage_type": "call" }, { "api_name": "datetime.datetime.fromtimestamp", "line_number": 11, "...
13913894709
from __future__ import annotations as _annotations from typing import TYPE_CHECKING import pytest from watchfiles import watch from watchfiles.main import _default_force_polling if TYPE_CHECKING: from .conftest import SetEnv class MockRustNotify: @staticmethod def watch(*args): return 'stop' ...
samuelcolvin/watchfiles
tests/test_force_polling.py
test_force_polling.py
py
2,551
python
en
code
1,336
github-code
6
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 10, "usage_type": "name" }, { "api_name": "watchfiles.watch", "line_number": 29, "usage_type": "call" }, { "api_name": "conftest.SetEnv", "line_number": 35, "usage_type": "name" }, { "api_name": "watchfiles.watc...
11464862154
import speech_recognition as sr from requests import get from bs4 import BeautifulSoup from gtts import gTTS from paho.mqtt import publish import os ##### CONFIGURAÇÕES ##### with open('arquivoConfiguraGoogleSpeech.json') as credenciais_google: credenciais_google = credenciais_google.read() executaAcao = False se...
cicerojmm/assistentePessoalIoT
veronica/veronica.py
veronica.py
py
3,705
python
pt
code
2
github-code
6
[ { "api_name": "speech_recognition.Recognizer", "line_number": 24, "usage_type": "call" }, { "api_name": "speech_recognition.Microphone", "line_number": 25, "usage_type": "call" }, { "api_name": "speech_recognition.UnknownValueError", "line_number": 38, "usage_type": "attr...
3549042262
from django import forms from catalog.models import Category, Product class ProductAdminForm(forms.ModelForm): class Meta: model = Product fields = ['name', 'slug','brand','sku','price','old_price',\ 'is_active','is_bestseller','is_featured','quantity',\ 'descri...
Hamfri/shopping
catalog/forms.py
forms.py
py
626
python
en
code
0
github-code
6
[ { "api_name": "django.forms.ModelForm", "line_number": 5, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 5, "usage_type": "name" }, { "api_name": "catalog.models.Product", "line_number": 7, "usage_type": "name" }, { "api_name": "django.f...
29125164138
from django.conf.urls import include, patterns, url view_location = 'customProfile.views' urlpatterns = patterns(view_location, # Views url(r'^(?P<username>[-\w]+)/', include(patterns(view_location, url(r'^$', 'profileRedirect', {'redirect_url': 'artist:about'}, name='home'), url(r'^news/$', '...
TimBest/ComposersCouch
artist/urls.py
urls.py
py
2,864
python
en
code
1
github-code
6
[ { "api_name": "django.conf.urls.patterns", "line_number": 5, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 7, "usage_type": "call" }, { "api_name": "django.conf.urls.include", "line_number": 7, "usage_type": "call" }, { "api_name": "...
8845375190
from fastapi import APIRouter, Depends from fastapi_pagination import Page, Params from src.admins.dependencies import get_groups_service, get_valid_group from src.admins.models import Group from src.admins.schemas import CreateGroupSchema, GroupOut from src.admins.services import GroupService router = APIRouter() ...
Qwizi/fastapi-sourcemod
sourcemod_api/src/admins/views/groups.py
groups.py
py
1,015
python
en
code
0
github-code
6
[ { "api_name": "fastapi.APIRouter", "line_number": 10, "usage_type": "call" }, { "api_name": "fastapi_pagination.Params", "line_number": 14, "usage_type": "name" }, { "api_name": "src.admins.services.GroupService", "line_number": 15, "usage_type": "name" }, { "api_...
30357262081
from threading import Thread from time import sleep from traits.api import HasTraits, Int, Button from traitsui.api import View, Item, VGroup class ThreadDemo(HasTraits): # The thread specific counters: thread_0 = Int() thread_1 = Int() thread_2 = Int() # The button used to start the threads run...
enthought/traitsui
traitsui/examples/demo/Advanced/Multi_thread_demo.py
Multi_thread_demo.py
py
1,376
python
en
code
290
github-code
6
[ { "api_name": "traits.api.HasTraits", "line_number": 7, "usage_type": "name" }, { "api_name": "traits.api.Int", "line_number": 10, "usage_type": "call" }, { "api_name": "traits.api.Int", "line_number": 11, "usage_type": "call" }, { "api_name": "traits.api.Int", ...
30353743561
# Author: Varun Hiremath <varun@debian.org> # Enthought library imports. from traits.api import Instance, Enum from traitsui.api import View, Group, Item from tvtk.api import tvtk # Local imports from mayavi.filters.filter_base import FilterBase from mayavi.core.pipeline_info import PipelineInfo ###################...
enthought/mayavi
mayavi/filters/extract_vector_components.py
extract_vector_components.py
py
2,728
python
en
code
1,177
github-code
6
[ { "api_name": "mayavi.filters.filter_base.FilterBase", "line_number": 16, "usage_type": "name" }, { "api_name": "traits.api.Instance", "line_number": 25, "usage_type": "call" }, { "api_name": "tvtk.api.tvtk.ExtractVectorComponents", "line_number": 25, "usage_type": "attri...
28726581501
import logging import feedparser import requests from .. import read_list log = logging.getLogger(__name__) class VideoFeed: def __init__(self, known_path, url): self.url = url self.read_list = read_list.ReadList(known_path, url) def is_new(self, item): return self.read_list.is_new...
EliseAv/tubeforme
video_feeds/_base.py
_base.py
py
1,334
python
en
code
0
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 21, "usage_type": "call" }, { "api_name": "feedparser.parse", "line_number": 23, "usage_type": "call" } ]
9790495928
from django.core.files.storage import FileSystemStorage from django.http import FileResponse from django.http import HttpResponseBadRequest from django.http import HttpResponseNotFound from django.http import JsonResponse from rest_framework import mixins from rest_framework import viewsets from rest_framework.decorato...
wiksla/f5-bigip-journeys-app
journeys/backend/views.py
views.py
py
8,720
python
en
code
0
github-code
6
[ { "api_name": "journeys.modifier.conflict.plugins.load_plugins", "line_number": 23, "usage_type": "call" }, { "api_name": "django.http.JsonResponse", "line_number": 24, "usage_type": "call" }, { "api_name": "django.http.JsonResponse", "line_number": 28, "usage_type": "cal...
14098850969
#!/usr/bin/env python # -*- coding: utf-8 -*- """Few more things we might wanna work out here. Our lack of the module :mod:`inspect` is pretty surprising. Refer to either `IPython.core.oinspect` or `xonsh.inspectors` for some good uses of the std lib module. """ from pprint import pformat from pygments import highl...
farisachugthai/dynamic_ipython
default_profile/extensions/extension_inspect.py
extension_inspect.py
py
2,946
python
en
code
7
github-code
6
[ { "api_name": "pygments.styles.inkpot.InkPotStyle", "line_number": 21, "usage_type": "call" }, { "api_name": "gruvbox.gruvbox.GruvboxStyle", "line_number": 23, "usage_type": "call" }, { "api_name": "IPython.core.magic.Magics", "line_number": 32, "usage_type": "name" }, ...
19342659029
import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch.nn.utils import clip_grad_norm_ from torch.utils.data import DataLoader import torchvision.models as models from torch.autograd import Variable, grad from copy import deepcopy from tqdm import tq...
clarenceluo78/ActiveAD
models/nets_waal.py
nets_waal.py
py
10,208
python
en
code
0
github-code
6
[ { "api_name": "sys.path.append", "line_number": 15, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "torch.nn.Module", "line_number": 17, "usage_type": "attribute" }, { "api_name": "torch.nn", "li...
39911776352
import os import re import json import pickle import kss import pandas as pd from tqdm import tqdm from elasticsearch import Elasticsearch from torch.utils.data import DataLoader, TensorDataset from datasets import load_metric, load_from_disk, load_dataset, Features, Value, Sequence, DatasetDict, Dataset from sentence_...
TEAM-IKYO/Open-Domain-Question-Answering
code/prepare_dataset.py
prepare_dataset.py
py
12,138
python
en
code
24
github-code
6
[ { "api_name": "pickle.dump", "line_number": 18, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 25, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 32, "usage_type": "call" }, { "api_name": "kss.split_sentences", "line_num...
21940354299
r"""Format notebooks using the TensorFlow docs style. Install the tensorflow-docs package: $ python3 -m pip install -U [--user] git+https://github.com/tensorflow/docs Usage: $ python3 -m tensorflow_docs.tools.nbfmt [options] notebook.ipynb [...] See the TensorFlow notebook template: https://github.com/tensorflow/doc...
tensorflow/docs
tools/tensorflow_docs/tools/nbfmt/__main__.py
__main__.py
py
9,543
python
en
code
5,917
github-code
6
[ { "api_name": "absl.flags.DEFINE_integer", "line_number": 32, "usage_type": "call" }, { "api_name": "absl.flags", "line_number": 32, "usage_type": "name" }, { "api_name": "absl.flags.DEFINE_bool", "line_number": 34, "usage_type": "call" }, { "api_name": "absl.flag...
21215598425
# -*- coding: utf-8 -*- from datetime import datetime, timedelta from django.utils.translation import gettext as _ from django.db.models.manager import BaseManager import plotly.offline as plotly import plotly.graph_objs as go from reports import utils def weight_change( actual_weights: BaseManager, percentile_...
babybuddy/babybuddy
reports/graphs/weight_change.py
weight_change.py
py
3,806
python
en
code
1,766
github-code
6
[ { "api_name": "django.db.models.manager.BaseManager", "line_number": 13, "usage_type": "name" }, { "api_name": "datetime.datetime", "line_number": 13, "usage_type": "name" }, { "api_name": "datetime.datetime", "line_number": 24, "usage_type": "name" }, { "api_name...
17178723426
import streamlit as st import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns import plotly.graph_objects as go import plotly.express as px from sklearn.model_selection import train_test_split from xgboost import XGBRegressor import pickle st.set_page_config(page_title="Air Quality...
vavald/MDA_streamlit
pages/6_💨_AirQuality.py
6_💨_AirQuality.py
py
5,860
python
en
code
0
github-code
6
[ { "api_name": "streamlit.set_page_config", "line_number": 11, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 15, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 18, "usage_type": "call" }, { "api_name": "pickle.load...
18790221797
import torch import decord from decord import cpu, gpu from tqdm import tqdm import json import os import random import numpy as np import pickle def sample_frames(num_frames, vlen, sample='rand', fix_start=None): acc_samples = min(num_frames, vlen) intervals = np.linspace(start=0, stop=vlen, num=acc_samples ...
MILVLG/anetqa-code
clipbert/sample_imgs_clipbert.py
sample_imgs_clipbert.py
py
2,196
python
en
code
6
github-code
6
[ { "api_name": "numpy.linspace", "line_number": 14, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 19, "usage_type": "call" }, { "api_name": "json.load", "line_number": 29, "usage_type": "call" }, { "api_name": "json.load", "line_number":...
36994780654
# -*- coding:utf-8 -*- from __future__ import print_function from __future__ import division import tensorflow as tf import numpy as np from tqdm import tqdm import os import sys import shutil import time from utils import get_logger import network os.environ["CUDA_VISIBLE_DEVICES"] = "1" sys.path.append('../..') fr...
shelleyHLX/cail
models/Attention_Textcnn/train.py
train.py
py
9,638
python
en
code
77
github-code
6
[ { "api_name": "os.environ", "line_number": 15, "usage_type": "attribute" }, { "api_name": "sys.path.append", "line_number": 17, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 17, "usage_type": "attribute" }, { "api_name": "tensorflow.flags", ...
70986505148
#!/usr/bin/env python3 """ Created on Thu Mar 13 9:31:11 2020 @author: Hanrui Wu """ import pysam import sys import gzip def read_cell_names1(pathseq_bam_file, write_bac): seqbam = pysam.AlignmentFile(pathseq_bam_file, "rb",threads=36) read_name_pathseq = open(write_bac,'w') total_pathseq_reads=0 tota...
FredHutch/invadeseq
bin/UMI_matrix.py
UMI_matrix.py
py
20,709
python
en
code
1
github-code
6
[ { "api_name": "pysam.AlignmentFile", "line_number": 12, "usage_type": "call" }, { "api_name": "pysam.AlignmentFile", "line_number": 84, "usage_type": "call" }, { "api_name": "pysam.AlignmentFile", "line_number": 88, "usage_type": "call" }, { "api_name": "gzip.open...
20946824389
import datetime from pysolar import solar # Calculate the altitude and azimuth of the sun given the location and the time def sun_pos(payload): # Input variables lat = payload["lat"] # Lattitude (deg) lon = payload["lon"] # Longitude (deg) epoch = payload["epoch"] # time (Linux epoch in seconds) ...
bsamadi/metadata-processor
app/sun_pos.py
sun_pos.py
py
727
python
en
code
0
github-code
6
[ { "api_name": "datetime.datetime.fromtimestamp", "line_number": 13, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 13, "usage_type": "attribute" }, { "api_name": "datetime.timezone", "line_number": 13, "usage_type": "attribute" }, { "api...
17286729620
import cv2 import imutils import numpy as np cv2.namedWindow("MyImage") img = cv2.imread("img.jpg") # translated = imutils.translate(img, 25, -75) # rotated = imutils.rotate(img, 45) img = imutils.resize(img, width=600) # url_images = imutils.url_to_image( # "https://www.google.com/images/branding/googlelogo/2x/...
osoulim/Computer-Vision
Python/Week3/pre_proccess.py
pre_proccess.py
py
532
python
en
code
0
github-code
6
[ { "api_name": "cv2.namedWindow", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 7, "usage_type": "call" }, { "api_name": "imutils.resize", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.ones", "line_number...
26039871256
from __future__ import annotations import dataclasses import hashlib import os.path from collections import deque from dataclasses import dataclass from pathlib import PurePath from typing import Iterable, Mapping from pants.backend.go.util_rules import cgo, coverage from pants.backend.go.util_rules.assembly import (...
pantsbuild/pants
src/python/pants/backend/go/util_rules/build_pkg.py
build_pkg.py
py
38,872
python
en
code
2,896
github-code
6
[ { "api_name": "pants.engine.engine_aware.EngineAwareParameter", "line_number": 52, "usage_type": "name" }, { "api_name": "pants.engine.fs.Digest", "line_number": 58, "usage_type": "name" }, { "api_name": "pants.backend.go.util_rules.build_opts.GoBuildOptions", "line_number": ...
74884399227
# -*- coding: utf-8 -*- import re import sqlite3 from collections import defaultdict import requests import gnupg class OTCDB(object): gpg_file = 'GPG.db' rating_file = 'RatingSystem.db' def __init__(self, path): self.path = path self.trusted = {} def open_db(self): gpg_path = '{0}/{1}'.format(self.path,...
extempore/deedbundler
deedbundler/otc.py
otc.py
py
3,668
python
en
code
8
github-code
6
[ { "api_name": "sqlite3.connect", "line_number": 20, "usage_type": "call" }, { "api_name": "sqlite3.Row", "line_number": 21, "usage_type": "attribute" }, { "api_name": "sqlite3.connect", "line_number": 23, "usage_type": "call" }, { "api_name": "sqlite3.Row", "l...
3602691667
""" Description: 使用 Bokeh,基于各国家创建一个 CPI 和童工数据的散点图。 拓展: Bokeh(http://bokeh.pydata.org/)是一个 Python 绘图库,能够用相当简单的命令来绘制更 复杂的图表类型。如果想要创建一个条形图、散点图或时间序列图,尝试Bokeh,看看是 否合适。使用 Bokeh,基于各国家创建一个 CPI 和童工数据的散点图。 """ from bokeh.plotting import figure, show, output_file # NOTE: You'll need to have 'africa_cpi_cl' table from Chapte...
lafitehhq/PythonBook
Python-03数据处理/Reference/code/chp10-presentation-数据展示/chart_bokeh_使用Bokeh绘图1.0.py
chart_bokeh_使用Bokeh绘图1.0.py
py
1,776
python
zh
code
2
github-code
6
[ { "api_name": "bokeh.plotting.figure", "line_number": 20, "usage_type": "call" }, { "api_name": "bokeh.plotting.output_file", "line_number": 21, "usage_type": "call" }, { "api_name": "bokeh.plotting.show", "line_number": 27, "usage_type": "call" } ]
11704116245
import platform from tkinter import filedialog from web3 import Web3 from web3.contract import Contract from web3.providers.rpc import HTTPProvider from solcx import install_solc install_solc(version='latest') from solcx import compile_source import subprocess import os import tkinter as tk from PIL import Image, Image...
MassimilianoPiccinini/SoftwareSecurity-Blockchain
src/offchain.py
offchain.py
py
23,961
python
en
code
1
github-code
6
[ { "api_name": "solcx.install_solc", "line_number": 7, "usage_type": "call" }, { "api_name": "dotenv.load_dotenv", "line_number": 17, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path.dirname", ...
34953476775
from django.shortcuts import render_to_response from read_num.models import get_seven_read_data, get_today_hot_data, get_yesterday_hot_data from django.contrib.contenttypes.models import ContentType from blog.models import Blog from django.utils import timezone from django.db.models import Sum from django.core.cache im...
shane-constantine/mysite
mysite/views.py
views.py
py
1,499
python
en
code
0
github-code
6
[ { "api_name": "django.contrib.contenttypes.models.ContentType.objects.get_for_model", "line_number": 11, "usage_type": "call" }, { "api_name": "blog.models.Blog", "line_number": 11, "usage_type": "argument" }, { "api_name": "django.contrib.contenttypes.models.ContentType.objects"...
15067404413
from django.shortcuts import render, redirect from .forms import Registration, Login from django.contrib.auth import authenticate, login, logout from django.contrib import messages from .models import * from .custom_manager import CustomUserManager from django.contrib import messages import uuid from django.conf import...
leenabadgujar/Online_Tiffin_Service
CustomUser/views.py
views.py
py
4,317
python
en
code
0
github-code
6
[ { "api_name": "django.shortcuts.redirect", "line_number": 16, "usage_type": "call" }, { "api_name": "forms.Registration", "line_number": 18, "usage_type": "call" }, { "api_name": "django.contrib.messages.success", "line_number": 22, "usage_type": "call" }, { "api_...
86572452967
#!/usr/bin/env python3 """ Check for and replace aliases with their new names from vk.xml """ import argparse import pathlib import subprocess import sys import xml.etree.ElementTree as et THIS_FILE = pathlib.Path(__file__) CWD = pathlib.Path.cwd() VK_XML = THIS_FILE.parent / 'vk.xml' EXCLUDE_PATHS = [ VK_XML.re...
sailfishos-mirror/mesa
src/vulkan/registry/update-aliases.py
update-aliases.py
py
6,150
python
en
code
1
github-code
6
[ { "api_name": "pathlib.Path", "line_number": 12, "usage_type": "call" }, { "api_name": "pathlib.Path.cwd", "line_number": 13, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "pathlib.Path", "l...
31684540429
# -*- coding: utf-8 -*- import scrapy from scrapy.linkextractors import LinkExtractor from scrapy.spiders import CrawlSpider, Rule class DouluoSpider(CrawlSpider): name = 'douluo' allowed_domains = ['tycqxs.com'] start_urls = ['http://www.tycqxs.com/54_54196/'] custom_settings = {'ITEM_PIPELINES': {'s...
zhangcq1/MyCrawler
爬虫基础梳理/shop/shop/spiders/douluo.py
douluo.py
py
1,034
python
en
code
0
github-code
6
[ { "api_name": "scrapy.spiders.CrawlSpider", "line_number": 7, "usage_type": "name" }, { "api_name": "scrapy.spiders.Rule", "line_number": 13, "usage_type": "call" }, { "api_name": "scrapy.linkextractors.LinkExtractor", "line_number": 13, "usage_type": "call" }, { ...
74200612027
#!/usr/bin/env python # -*- coding: utf-8 -*- # @File : train.py # @Author: stoneye # @Date : 2023/09/01 # @Contact : stoneyezhenxu@gmail.com import tensorflow as tf import tensorflow.contrib.slim as slim import utils from models import ModelUtil from models import NextvladModel from models import TextExactor from m...
stoneyezhenxu/Multimodal_Video_Classification
src/video_model.py
video_model.py
py
23,282
python
en
code
0
github-code
6
[ { "api_name": "models.ModelUtil", "line_number": 28, "usage_type": "call" }, { "api_name": "models.NextvladModel", "line_number": 30, "usage_type": "call" }, { "api_name": "models.TrnModel", "line_number": 32, "usage_type": "call" }, { "api_name": "models.TextExac...
4135669430
#!/usr/bin/env python3 # Covariance Calculation from doc2vec model import numpy as np import gensim.models import gensim import sys import pickle from helpers import get_name def compute_covariance_matrix(model_name, to_json=True): model = gensim.models.Doc2Vec.load(model_name) doctags = list(model.docvecs....
papachristoumarios/sade
sade/corrcoef.py
corrcoef.py
py
930
python
en
code
8
github-code
6
[ { "api_name": "gensim.models.Doc2Vec.load", "line_number": 13, "usage_type": "call" }, { "api_name": "gensim.models", "line_number": 13, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.corrc...
43956557150
from flask import flash from db import db # Feedback function for registered users def feedback(user_id, message): sql = "INSERT INTO messages (user_id, message) VALUES (:user_id, :message)" db.session.execute(sql, {"user_id":user_id, "message":message}) db.session.commit() flash("Kiitos palautteestasi...
asianomainen/tsoha-s2020-tuntivarausjarjestelma
messages.py
messages.py
py
909
python
en
code
0
github-code
6
[ { "api_name": "db.db.session.execute", "line_number": 7, "usage_type": "call" }, { "api_name": "db.db.session", "line_number": 7, "usage_type": "attribute" }, { "api_name": "db.db", "line_number": 7, "usage_type": "name" }, { "api_name": "db.db.session.commit", ...
29017166061
from django.forms import model_to_dict from django.http import JsonResponse from rest_framework.decorators import api_view from rest_framework.parsers import JSONParser from api.models.facility import Facility from api.serializers.facility_serializer import FacilitySerializer @api_view(['GET']) def facility(request, ...
jazzhammer/jitgurup
api/views/facilitys_view.py
facilitys_view.py
py
2,880
python
en
code
0
github-code
6
[ { "api_name": "api.models.facility.Facility.objects.get", "line_number": 11, "usage_type": "call" }, { "api_name": "api.models.facility.Facility.objects", "line_number": 11, "usage_type": "attribute" }, { "api_name": "api.models.facility.Facility", "line_number": 11, "usa...
5469207228
#ライブラリ、モジュールをインポート import pandas as pd import openpyxl as px from openpyxl.formatting.rule import CellIsRule from openpyxl.styles import Color, PatternFill #ブック名入力 tdname=input('testdataName?') edname=input('editordataName?') #読み込んだブックの同じテストのデータをDataFrameに格納 td=pd.read_excel(tdname,header=1,sheet_name=0) ed=pd.read_e...
kobayu0902art/work_snippets
reshape/reshape_v1.4_1.py
reshape_v1.4_1.py
py
2,175
python
ja
code
0
github-code
6
[ { "api_name": "pandas.read_excel", "line_number": 12, "usage_type": "call" }, { "api_name": "pandas.read_excel", "line_number": 13, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 24, "usage_type": "call" }, { "api_name": "pandas.DataFrame...
15764585120
""" Anisha Kadri 2017 ak4114@ic.ac.uk A Module containing methods to create networks from different models. 1) For pure preferential attachement:- pref_att(N, m) 2) For random attachment:- rand_att(N,m) 3) For a mixture of the two, attachment via random walk:- walk_att(N,m,L) References ---------- [1]...
anishakadri/barabasialbert
model.py
model.py
py
5,291
python
en
code
0
github-code
6
[ { "api_name": "random.seed", "line_number": 48, "usage_type": "call" }, { "api_name": "networkx.complete_graph", "line_number": 52, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 79, "usage_type": "call" }, { "api_name": "random.seed", "...
654986927
#!/usr/bin/env python import argparse from .. import view_container def tobool(inp): return inp.lower() in ('y', '1', 'ok', 't') parser = argparse.ArgumentParser(description='Display datasets in h5 or n5/zarr container.') parser.add_argument('path', type=str, help='path to container') parser.add_argument('--nd...
constantinpape/heimdall
heimdall/scripts/view_container.py
view_container.py
py
1,184
python
en
code
20
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 11, "usage_type": "call" } ]
71245917627
import time import numpy as np from testing import Ptot import matplotlib.pyplot as plt if __name__ == "__main__": div = int(1e4) # number of tests Q = int(8e6)//div # population size N = int(40e6)//div R = 0 Ip_arr = np.arange(500, 3000) # FNR variations Ptot_a...
lubo93/disease-testing
sampling/testing_analytical_replacement_true_CA.py
testing_analytical_replacement_true_CA.py
py
881
python
en
code
2
github-code
6
[ { "api_name": "numpy.arange", "line_number": 16, "usage_type": "call" }, { "api_name": "time.time", "line_number": 24, "usage_type": "call" }, { "api_name": "testing.Ptot", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.savetxt", "line_number"...
74147618108
# coding:utf-8 """ Django administration setup @author: Sébastien Renard <Sebastien.Renard@digitalfox.org> @license: AGPL v3 or newer (http://www.gnu.org/licenses/agpl-3.0.html) """ from django.contrib import admin from django.utils.translation import gettext_lazy as _ from billing.models import ClientBill, SupplierB...
digitalfox/pydici
billing/admin.py
admin.py
py
2,334
python
en
code
122
github-code
6
[ { "api_name": "core.admin.ReturnToAppAdmin", "line_number": 16, "usage_type": "name" }, { "api_name": "django.utils.translation.gettext_lazy", "line_number": 28, "usage_type": "call" }, { "api_name": "django.utils.translation.gettext_lazy", "line_number": 29, "usage_type"...
28514991368
""" This module transforms the corpus into the format require by each benchmarked tool """ import json def liwc(senders, data): ds = dict() for hashed_addr in senders: try: emails = '. '.join(data[hashed_addr]) ds[hashed_addr] = emails except KeyError: cont...
collab-uniba/tosem2021-personality-rep-package
src/data_preparation.py
data_preparation.py
py
1,782
python
en
code
1
github-code
6
[ { "api_name": "json.load", "line_number": 46, "usage_type": "call" } ]
19707336879
# # # -*- coding: utf-8 -*- # # # @Time :2021/3/22 20:56 # # # @Author :huangzg28153 # # # @File :test.py # # # @Software :PyCharm # # import numpy as np # # import pandas as pd # # # type = [0,1,1,1,2,0,1,0,1,2,2,0] # # # ser = [0,1,2,3,4,5,6,0,1,2,3,4] # # # layer = [0,0,0,0,0,1,1,0,0,0,0,1] # # # samp...
hzg0601/cn-annotation
HGT_OAG_cn-annotation/codes/test.py
test.py
py
10,935
python
en
code
0
github-code
6
[ { "api_name": "pandas.DataFrame", "line_number": 268, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 277, "usage_type": "call" }, { "api_name": "os.getpid", "line_number": 286, "usage_type": "call" }, { "api_name": "multiprocessing...
1544319758
from fastapi import FastAPI, UploadFile, Form,File import cloudinary import cloudinary.uploader from fastapi.middleware.cors import CORSMiddleware app = FastAPI() app.add_middleware( CORSMiddleware, allow_origins=['*'], allow_credentials=True, allow_methods=["*"], allow_headers=["*"], ) # Confi...
naman360/courtledger
scripts/main.py
main.py
py
961
python
en
code
0
github-code
6
[ { "api_name": "fastapi.FastAPI", "line_number": 8, "usage_type": "call" }, { "api_name": "fastapi.middleware.cors.CORSMiddleware", "line_number": 10, "usage_type": "argument" }, { "api_name": "cloudinary.config", "line_number": 17, "usage_type": "call" }, { "api_n...
15206133090
"""Tests for utils.""" import unittest import torch from chemicalx.utils import segment_softmax class TestPipeline(unittest.TestCase): """Test the utils.""" def test_segment_softmax(self): """Set up the test case with some data.""" logit = torch.FloatTensor([-0.5, -2.5, 0.5, 1.5]) ...
AstraZeneca/chemicalx
tests/unit/test_utils.py
test_utils.py
py
789
python
en
code
672
github-code
6
[ { "api_name": "unittest.TestCase", "line_number": 10, "usage_type": "attribute" }, { "api_name": "torch.FloatTensor", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.LongTensor", "line_number": 16, "usage_type": "call" }, { "api_name": "torch.LongT...
1976029717
from django.db import models from equipas.models import Equipa # Create your models here. class Campeonato(models.Model): campeonato_id = models.AutoField(primary_key=True) modalidade = models.ForeignKey('Modalidade', models.DO_NOTHING) nome = models.CharField(max_length=100) epoca = models.CharField(m...
OliveiraRP/django-webapp
src/webapp/campeonatos/models.py
models.py
py
1,039
python
pt
code
0
github-code
6
[ { "api_name": "django.db.models.Model", "line_number": 5, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 5, "usage_type": "name" }, { "api_name": "django.db.models.AutoField", "line_number": 6, "usage_type": "call" }, { "api_name": "...
75131855228
from datetime import datetime import pymysql import json as j import flask as f from flask import Flask, redirect from flask import request from flask import send_from_directory from flaskext.mysql import MySQL app=Flask(__name__, static_url_path="") #Povezivanje sa bazom(parametri) mysql=MySQL(...
haribate98/Android
FlaskZaProjekat/main.py
main.py
py
3,497
python
en
code
1
github-code
6
[ { "api_name": "flask.Flask", "line_number": 15, "usage_type": "call" }, { "api_name": "flaskext.mysql.MySQL", "line_number": 18, "usage_type": "call" }, { "api_name": "pymysql.cursors", "line_number": 18, "usage_type": "attribute" }, { "api_name": "flask.request.g...
14852199031
# coding: utf-8 import math import torch import torch.nn as nn import torch.nn.functional as F from fairseq import utils from fairseq.criterions import FairseqCriterion, register_criterion from fairseq.criterions.label_smoothed_cross_entropy import LabelSmoothedCrossEntropyCriterion, label_smoothed_nll_loss def root_...
jack-and-rozz/speculative_sampling
fairseq/extensions/criterions/spacefusion_loss.py
spacefusion_loss.py
py
10,265
python
en
code
0
github-code
6
[ { "api_name": "torch.mean", "line_number": 14, "usage_type": "call" }, { "api_name": "torch.mul", "line_number": 14, "usage_type": "call" }, { "api_name": "torch.sqrt", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.clamp", "line_number": 17, ...
18132737377
# In this project, I'm going to desgin a user infterface for translating difference languages in real time # Library Used: google trans, textblob import googletrans import textblob import customtkinter from tkinter import END # Adding languages language = googletrans.LANGUAGES translator = googletrans.Translator() ...
JayChen1060920909/Projects
Real Time Translation.py
Real Time Translation.py
py
2,191
python
en
code
1
github-code
6
[ { "api_name": "googletrans.LANGUAGES", "line_number": 12, "usage_type": "attribute" }, { "api_name": "googletrans.Translator", "line_number": 13, "usage_type": "call" }, { "api_name": "tkinter.END", "line_number": 24, "usage_type": "argument" }, { "api_name": "tki...
39614840706
#!/usr/bin/env python3 import sys import os import time from datetime import datetime import textwrap import argparse import platform try: import influxdb except ImportError: print("Trying to Install required module: influxdb\n") os.system('python3 -m pip install influxdb') time.sleep(5) def fioinput(ip, po...
philcanman/fio-to-influxdb
fio_to_influxdb.py
fio_to_influxdb.py
py
9,043
python
en
code
1
github-code
6
[ { "api_name": "os.system", "line_number": 15, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 16, "usage_type": "call" }, { "api_name": "influxdb.InfluxDBClient", "line_number": 19, "usage_type": "call" }, { "api_name": "os.system", "line_nu...
31131850381
import jwt from fastapi import FastAPI, HTTPException from pydantic import BaseModel import requests import time import uvicorn from fastapi.middleware.cors import CORSMiddleware # GLOBALS app = FastAPI() origins = ["*"] app.add_middleware( CORSMiddleware, allow_origins=origins, allow_credentials=True,...
BoogieManN8/FootballTrainerHelper
main.py
main.py
py
5,139
python
en
code
0
github-code
6
[ { "api_name": "fastapi.FastAPI", "line_number": 13, "usage_type": "call" }, { "api_name": "fastapi.middleware.cors.CORSMiddleware", "line_number": 17, "usage_type": "argument" }, { "api_name": "pydantic.BaseModel", "line_number": 36, "usage_type": "name" }, { "api...
70929712188
# -*- coding: utf-8 -*- """ Created on Wed Sep 6 17:20:25 2023 @author: Gilberto """ "" # streamlit_app.py import io import base64 import streamlit as st import pandas as pd from datetime import datetime from mortgagestyle_v2 import MortgageStyle from straightline_v2 import StraightLineAmortization f...
gdelacruzv/Amortization_calculator
Amortization_app_V4.py
Amortization_app_V4.py
py
8,584
python
en
code
0
github-code
6
[ { "api_name": "streamlit.title", "line_number": 22, "usage_type": "call" }, { "api_name": "streamlit.header", "line_number": 25, "usage_type": "call" }, { "api_name": "streamlit.markdown", "line_number": 26, "usage_type": "call" }, { "api_name": "streamlit.header"...
3844969159
#! /usr/bin/python2 import pefile import os import array import math import pickle import time # from sklearn.externals import joblib import joblib import sys from .ModulePredict import data_extraction from .XKendworld import pure_import import pymongo import hashlib myclient = pymongo.MongoClient('DATABASE_URL') mydb...
fadzniaidil/imawa
malwr/CheckingFile.py
CheckingFile.py
py
3,102
python
en
code
1
github-code
6
[ { "api_name": "pymongo.MongoClient", "line_number": 16, "usage_type": "call" }, { "api_name": "joblib.load", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path", "line_numb...
15912701941
""" Class to deal with the pooling problem (differing amounts of tweets for various days) """ import torch from torch import nn, tensor device = torch.device("cuda" if torch.cuda.is_available() else "cpu") #device = torch.device("cpu") # will we have a device setting here? to ensure that the data is being processed...
biirving/michinaga
src/utils/pooling.py
pooling.py
py
1,583
python
en
code
2
github-code
6
[ { "api_name": "torch.device", "line_number": 10, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 10, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 10, "usage_type": "attribute" }, { "api_name": "torch.nn.Module"...
8224649664
import json, requests, io import pandas as pd import numpy as np import sys, argparse #Managing input parser = argparse.ArgumentParser(description='Script to download data of lung cancer from TCGA') parser.add_argument('-t', '--type', help='Sample type. Ej: NAD', required='True', choices=['NAD'...
josemaz/lung-mirnas
py/casemirna.py
casemirna.py
py
1,900
python
en
code
1
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 7, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 13, "usage_type": "attribute" }, { "api_name": "pandas.read_csv", "line_number": 31, "usage_type": "call" }, { "api_name": "json.load", ...
25070333505
from django.db import models from django.contrib import admin from django import forms import purplship.server.providers.models as carriers def model_admin(model): class _Admin(admin.ModelAdmin): list_display = ("__str__", "test", "active") exclude = ["active_users", "metadata"] formfield...
danh91/purplship
server/modules/core/purplship/server/providers/admin.py
admin.py
py
1,114
python
en
code
null
github-code
6
[ { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 9, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 9, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 13, "usage_type": "attribute" }, ...
28900645911
from keras.models import * from keras.layers import * import keras from dlblocks.keras_utils import allow_growth , showKerasModel allow_growth() from dlblocks.pyutils import env_arg import tensorflow as tf from Utils import Trainer class GiretTwoCell(keras.layers.Layer): def __init__(self, cell_1 , cell_2 , nHi...
divamgupta/mtl_girnet
sequence_labeling/girnet.py
girnet.py
py
3,916
python
en
code
6
github-code
6
[ { "api_name": "dlblocks.keras_utils.allow_growth", "line_number": 6, "usage_type": "call" }, { "api_name": "keras.layers", "line_number": 12, "usage_type": "attribute" }, { "api_name": "Utils.Trainer", "line_number": 62, "usage_type": "name" }, { "api_name": "Util...
39005103669
#!/usr/local/bin/python # The previous line (which must be the first one to work) makes the script self-executing, # assuming that the system has the Python interpreter at path /usr/local/bin/python. # This wants to be run in Python 3. # Reference Pre-Processor # Given: A string reference # An integer horizon...
Moyaccercchi/bio-info-graph
python/2_reference_preprocessor/e2.py
e2.py
py
4,348
python
en
code
1
github-code
6
[ { "api_name": "collections.defaultdict", "line_number": 51, "usage_type": "call" } ]
22895124073
import serial import getch serialport = serial.Serial("/dev/ttyS0") serialport.baudrate = 115200 while True: x = getch.getch() if "W" == x.upper(): # Forwards command = "+100+10015+00" elif "S" == x.upper(): # Backwards command = "-250-25015+00" elif x == "A" or x == "a...
SinaRabiee/Digital_LAB_SSH
ssh-raspberry.py
ssh-raspberry.py
py
597
python
en
code
0
github-code
6
[ { "api_name": "serial.Serial", "line_number": 4, "usage_type": "call" }, { "api_name": "getch.getch", "line_number": 8, "usage_type": "call" } ]
5556252937
from data.legacy_datagen import eddy_forcing,spatial_filter_dataset from data.high_res_dataset import HighResCm2p6 from constants.paths import FINE_CM2P6_PATH,TEMPORARY_DATA from utils.xarray_oper import plot_ds,fromtorchdict from data.load import load_grid,load_xr_dataset import xarray as xr import os import numpy as...
CemGultekin1/cm2p6
temp/data_comparison.py
data_comparison.py
py
2,408
python
en
code
0
github-code
6
[ { "api_name": "data.legacy_datagen.spatial_filter_dataset", "line_number": 12, "usage_type": "call" }, { "api_name": "constants.paths.FINE_CM2P6_PATH", "line_number": 15, "usage_type": "call" }, { "api_name": "data.load.load_xr_dataset", "line_number": 26, "usage_type": "...
11899942747
import requests import json import datetime # On importe la liste des jours pou lesquels on a déjà les données with open("days.txt", "r") as days: completed_days = days.read() days.close() # On importe la date d'aujourd'hui et on la formatte today = datetime.datetime.now() today = str(today).split(" ") to...
Aarrn33/auto-wind-importer
get_today.py
get_today.py
py
1,312
python
en
code
0
github-code
6
[ { "api_name": "datetime.datetime.now", "line_number": 11, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 11, "usage_type": "attribute" }, { "api_name": "requests.get", "line_number": 20, "usage_type": "call" }, { "api_name": "datetime.da...
71455781947
from flask import Flask,flash, render_template, url_for, request, redirect import googleapiclient.discovery from googleapiclient.discovery import build from google_auth_oauthlib.flow import InstalledAppFlow from gtts import gTTS import heapq import nltk import string from nltk.corpus import stopwords from nltk...
Anmol567/Youtube_Comment_Reviewer
my_new_flask_app.py
my_new_flask_app.py
py
6,600
python
en
code
1
github-code
6
[ { "api_name": "nltk.stem.WordNetLemmatizer", "line_number": 33, "usage_type": "call" }, { "api_name": "keras.datasets.imdb.get_word_index", "line_number": 34, "usage_type": "call" }, { "api_name": "keras.datasets.imdb", "line_number": 34, "usage_type": "name" }, { ...
11454255593
import torch import os import chartmodel from torch.utils.data import Dataset import albumentations from albumentations.pytorch import ToTensorV2 as AT from charttype import dataset batch_size = 32 num_workers = 4 if __name__ == '__main__': device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") ...
ksvyatov/chart-recognizer
charttype/test.py
test.py
py
1,473
python
en
code
0
github-code
6
[ { "api_name": "torch.device", "line_number": 14, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 14, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 14, "usage_type": "attribute" }, { "api_name": "albumentations.C...
12712406140
import tensorflow_hub as hub import matplotlib.pyplot as plt import numpy as np import scipy.cluster.hierarchy as scp module_url = "https://tfhub.dev/google/universal-sentence-encoder/4" text_model = hub.load(module_url) def embed_compare(sentence): text_embedding = text_model(sentence) sim_mat = np.inner(tex...
mgkumar138/determiners-objdet
submodels/universal_sentence_encoder_analysis.py
universal_sentence_encoder_analysis.py
py
2,035
python
en
code
0
github-code
6
[ { "api_name": "tensorflow_hub.load", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.inner", "line_number": 11, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.imshow", "line_number": 15, "usage_type": "call" }, { "api_name": "matplotlib.py...
12010103629
import time from appium import webdriver # 设备连接前置配置 descried_caps = dict() descried_caps["platformName"] = "android" descried_caps["platformVersion"] = "5.1.1" descried_caps["deviceName"] = "emulator-5554" descried_caps["appPackage"] = "com.bjcsxq.chat.carfriend" descried_caps["appActivity"] = ".MainActivity" # 实例化...
1chott/appAutoStudy
code_D_04/code_03_常见api启动关闭app.py
code_03_常见api启动关闭app.py
py
747
python
en
code
0
github-code
6
[ { "api_name": "appium.webdriver.Remote", "line_number": 15, "usage_type": "call" }, { "api_name": "appium.webdriver", "line_number": 15, "usage_type": "name" }, { "api_name": "time.sleep", "line_number": 17, "usage_type": "call" }, { "api_name": "time.sleep", ...
36065549678
from dotenv import load_dotenv import os import requests from pprint import pprint from datetime import datetime, timedelta from flight_data import FlightData load_dotenv() API_KEY = os.getenv("flight_search_api") KIWI_ENDPOINT = "https://api.tequila.kiwi.com" class FlightSearch: #This class is responsible for ta...
Shivam29k/Python_Projects
flight_deals_alert/flight_search.py
flight_search.py
py
3,453
python
en
code
1
github-code
6
[ { "api_name": "dotenv.load_dotenv", "line_number": 8, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 9, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 24, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "...
14699326224
# -*- coding: utf-8 -*- import sys from os import listdir from os.path import isfile, join import io def extract_files(path): onlyfiles = [f for f in listdir(path) if isfile(join(path, f))] return onlyfiles def get_text(onlyfiles,path): text = '' for file in onlyfiles: f = io.open(joi...
SerPablo/redib_extractor
src/text_extractor.py
text_extractor.py
py
683
python
en
code
0
github-code
6
[ { "api_name": "os.listdir", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path.isfile", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 16, "usage_type": "call" }, { "api_name": "io.open", "line_number": 2...
39912096462
import jwt from django.contrib.auth import authenticate from rest_framework.response import Response from rest_framework.views import APIView from rest_framework.generics import GenericAPIView from rest_framework import status from smtplib import SMTPException from .serializers import SignupSerializer, VerifyAccoun...
TEAM-ILSAN/yourpool-backend
users/views.py
views.py
py
3,630
python
en
code
0
github-code
6
[ { "api_name": "rest_framework.generics.GenericAPIView", "line_number": 17, "usage_type": "name" }, { "api_name": "serializers.SignupSerializer", "line_number": 18, "usage_type": "name" }, { "api_name": "emails.send_otp_via_email", "line_number": 25, "usage_type": "call" ...
41207274862
"""Environment using Gymnasium API for Franka robot. The code is inspired by the D4RL repository hosted on GitHub (https://github.com/Farama-Foundation/D4RL), published in the paper 'D4RL: Datasets for Deep Data-Driven Reinforcement Learning' by Justin Fu, Aviral Kumar, Ofir Nachum, George Tucker, Sergey Levine. This...
Skeli9989/Gymnasium-Robotics
gymnasium_robotics/envs/franka_kitchen/franka_env.py
franka_env.py
py
6,370
python
en
code
null
github-code
6
[ { "api_name": "numpy.array", "line_number": 36, "usage_type": "call" }, { "api_name": "gymnasium.envs.mujoco.mujoco_env.MujocoEnv", "line_number": 40, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 60, "usage_type": "call" }, { "api_name": "o...
16502029718
#! /usr/bin/python3 import logging import os from urllib3 import make_headers from telegram import (InlineKeyboardButton, InlineKeyboardMarkup, InputTextMessageContent, ReplyKeyboardMarkup, ReplyKeyboardRemove) from telegram.ext import (Updater, CommandHandler, MessageHandler, CallbackQueryHandle...
oleges1/meet_bot
bot/add_location.py
add_location.py
py
2,998
python
en
code
0
github-code
6
[ { "api_name": "logging.basicConfig", "line_number": 14, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 15, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 16, "usage_type": "call" }, { "api_name": "telegram.Repl...
41685965854
from utils import Position import copy import pickle def load_cache(file: str) -> dict: try: with open(file, 'rb') as f: cache = pickle.load(f) except FileNotFoundError: cache = {} return cache def save_cache(cache, file: str): with open(file, 'wb') as f: pickle....
Epico-Coder/TicTacToe
ai.py
ai.py
py
2,357
python
en
code
0
github-code
6
[ { "api_name": "pickle.load", "line_number": 9, "usage_type": "call" }, { "api_name": "pickle.dump", "line_number": 18, "usage_type": "call" }, { "api_name": "utils.Position", "line_number": 21, "usage_type": "name" }, { "api_name": "utils.Position", "line_numb...
22124073233
#!/usr/bin/env python # -*- coding: utf-8 -*- #todo: stop words and symbols are mucking things up import os import os.path import nltk import operator from nltk import word_tokenize import collections import math import sklearn import sklearn.cluster import numpy as np import pandas as pd from sklearn.cluster import KM...
mcwatera/WWTBHT
wwtbht/pages/scripts/ppmi/mcwatera_fp.py
mcwatera_fp.py
py
6,495
python
en
code
0
github-code
6
[ { "api_name": "os.getcwd", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 33, "usage_type": "call" }, { "api_name": "os.path", "line_number": 33, "usage_type": "attribute" }, { "api_name": "os.listdir", "line_number": 3...
71239238267
#!/usr/bin/env python # -*- coding: utf-8 -*- from collections import OrderedDict import numpy import json import sys import os.path def readXYZ(filename): # read molecular coordinates from .xyz file # return list of symbols and list of coordinate geom = [] with open(filename, "r") as f: for ...
humeniuka/chem-queue
scripts/bagel_template.py
bagel_template.py
py
3,245
python
en
code
0
github-code
6
[ { "api_name": "collections.OrderedDict", "line_number": 18, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 24, "usage_type": "attribute" }, { "api_name": "os.path.path.basename", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path.p...
16786521432
from flask import render_template, flash, redirect, url_for, request, jsonify, current_app, g, send_from_directory from flask_login import login_required, login_user, logout_user, current_user from app import db from app.helper import clean_list, normalize, convertArrayToString, convertStringToArray, prepFullAddressSea...
iamjasonkuo/househunt
app/project/routes.py
routes.py
py
14,693
python
en
code
0
github-code
6
[ { "api_name": "flask_login.current_user.is_authenticated", "line_number": 20, "usage_type": "attribute" }, { "api_name": "flask_login.current_user", "line_number": 20, "usage_type": "name" }, { "api_name": "flask_login.current_user.last_seen", "line_number": 21, "usage_ty...
9136295998
#1.创建一个文件夹 import os from multiprocessing import Pool,Manager def copyFileTask(name,oldFolderName,newFolderName,queue): fr=open(oldFolderName+'/'+name) fw=open(newFolderName+'/'+name,'w') content=fr.read() fw.write(content) fr.close() fw.close() queue.put(name) def main(): # 0.获取用户要输入...
pgg-pgg/pythonTest
19-多进程文件copy.py
19-多进程文件copy.py
py
1,051
python
en
code
0
github-code
6
[ { "api_name": "os.mkdir", "line_number": 19, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 21, "usage_type": "call" }, { "api_name": "multiprocessing.Pool", "line_number": 24, "usage_type": "call" }, { "api_name": "multiprocessing.Manager", ...
6836039340
from fastapi import APIRouter, Depends, Response from queries.games import GamesQueries from typing import Union router = APIRouter() @router.get("/api/games/{game_id}") def get_game( game_id: int, response: Response, queries: GamesQueries = Depends(), ): data = queries.get_game_by_id(game_id) if...
tinatran079/netstix
games/routers/games.py
games.py
py
1,682
python
en
code
0
github-code
6
[ { "api_name": "fastapi.APIRouter", "line_number": 5, "usage_type": "call" }, { "api_name": "fastapi.Response", "line_number": 11, "usage_type": "name" }, { "api_name": "queries.games.GamesQueries", "line_number": 12, "usage_type": "name" }, { "api_name": "fastapi....
38760601495
import sys import netCDF4 import math import itertools from functools import reduce def array_pieces(ndarray, max_bytes=None, overlap=0): ''' Generator to return a series of numpy arrays less than max_bytes in size and the offset within the complete data from a NetCDF variable Parameters: ndarray: ...
GeoscienceAustralia/geophys_utils
geophys_utils/_array_pieces.py
_array_pieces.py
py
4,493
python
en
code
22
github-code
6
[ { "api_name": "functools.reduce", "line_number": 26, "usage_type": "call" }, { "api_name": "math.ceil", "line_number": 31, "usage_type": "call" }, { "api_name": "math.pow", "line_number": 32, "usage_type": "call" }, { "api_name": "math.ceil", "line_number": 32...
30366634041
""" Simple polygon plot. The UI allows you to change some of the attributes of the plot. """ import numpy as np from traits.api import HasTraits, Instance, Range from traitsui.api import View, UItem, Item, Group, HGroup, VGroup, spring from chaco.api import Plot, ArrayPlotData, PolygonPlot from enable.api import Co...
enthought/chaco
chaco/examples/demo/basic/polygon_plot_demo.py
polygon_plot_demo.py
py
3,167
python
en
code
286
github-code
6
[ { "api_name": "traits.api.HasTraits", "line_number": 15, "usage_type": "name" }, { "api_name": "traits.api.Instance", "line_number": 18, "usage_type": "call" }, { "api_name": "chaco.api.Plot", "line_number": 18, "usage_type": "argument" }, { "api_name": "traits.ap...
70097864829
import pygame as pg import sys from pygame.sprite import Group from constants import * from settings import Settings from ship import Ship import functions as funcs from stats import Stats from button import Button from score import Score from sound import Sound def main(): sound = Sound() pg.init() ...
hoangdesu/Alien-Invasion-Pygame
main.py
main.py
py
2,009
python
en
code
1
github-code
6
[ { "api_name": "sound.Sound", "line_number": 15, "usage_type": "call" }, { "api_name": "pygame.init", "line_number": 16, "usage_type": "call" }, { "api_name": "pygame.time.Clock", "line_number": 18, "usage_type": "call" }, { "api_name": "pygame.time", "line_num...
8522443313
import requests from io import BytesIO import time from PIL import UnidentifiedImageError import warnings class PlateClient: def __init__(self, url: str): self.url = url def readNumber(self, im) -> str: res = requests.post( f'{self.url}/readNumber', headers={'Conte...
alexej-anosov/aaa_backend_hw
src/plate_client.py
plate_client.py
py
1,142
python
en
code
0
github-code
6
[ { "api_name": "requests.post", "line_number": 13, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 20, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 24, "usage_type": "call" } ]