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
26580059955
import requests import json URL = 'https://api.tfl.gov.uk/' def get_url(url, payload=None): url = url + '?app_id=2a3e2338&app_key=240b28f5941f4c099fc40f5af851d5d6' response = requests.get(url, params=payload) content = response.content.decode('utf8') return content def get_json_from_url(ur...
pohyk123/telegram-chatbot
tfl.py
tfl.py
py
3,090
python
en
code
0
github-code
21
[ { "api_name": "requests.get", "line_number": 8, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 14, "usage_type": "call" } ]
5422935397
#!/usr/bin/python3 import sys import yaml from yaml.loader import SafeLoader import subprocess import shlex import requests import os from datetime import datetime CONFIGURATION = {} def print_header(): print() print(" $$$$$$\ $$\ $$\ $$$$$$\ ") print(" $$ __$$\ $$ | $$ |$$ __$$\ ") ...
stefanosello/svc
analysis/bootstrap.py
bootstrap.py
py
3,050
python
en
code
2
github-code
21
[ { "api_name": "yaml.load", "line_number": 38, "usage_type": "call" }, { "api_name": "yaml.loader.SafeLoader", "line_number": 38, "usage_type": "name" }, { "api_name": "requests.get", "line_number": 64, "usage_type": "call" }, { "api_name": "datetime.datetime.now",...
34885827521
import numpy as np from sklearn.decomposition import PCA import matplotlib.pyplot as plt from PIL import Image from tensorflow import keras import os def process_obj(path): label_dict = {"gem": 0, "gem_fang": 1, "gem_square": 2, "gem_xie": 3, "other": 4} label = [] all_vertices = [] vertices = [] ...
1070143608/web-project
machineLearning/gem_kind.py
gem_kind.py
py
4,097
python
en
code
0
github-code
21
[ { "api_name": "numpy.array", "line_number": 37, "usage_type": "call" }, { "api_name": "sklearn.decomposition.PCA", "line_number": 42, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.scatter", "line_number": 50, "usage_type": "call" }, { "api_name": "matpl...
16786461197
#!/usr/bin/python # -*- coding: <utf-8> -*- from igraph import Graph; import io; import numpy as np; import re; import sys def __textSplit2(text): entries = text.split() if(len(entries)<2): raise ValueError(); return (float(entries[0]),float(entries[1])); def __textSplit3(text): entries = text.sp...
carolmb/political
xnet.py
xnet.py
py
12,575
python
en
code
7
github-code
21
[ { "api_name": "re.compile", "line_number": 28, "usage_type": "call" }, { "api_name": "igraph.Graph", "line_number": 216, "usage_type": "call" }, { "api_name": "sys.version_info", "line_number": 319, "usage_type": "attribute" }, { "api_name": "numpy.isscalar", ...
4912085573
"""empty message Revision ID: 84010ba917ba Revises: 18d24830a583 Create Date: 2021-06-12 16:55:48.546210 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '84010ba917ba' down_revision = '18d24830a583' branch_labels = None depends_on = None def upgrade(): # ...
fquintana93/evaluador
migrations/versions/84010ba917ba_.py
84010ba917ba_.py
py
820
python
en
code
0
github-code
21
[ { "api_name": "alembic.op.batch_alter_table", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "alembic.op.batch_alter_table", "line_number": 29, "usage_type": "call" }, { "api_name": "...
39387085308
import numpy as np import torch from Solver_Class import Solver from Individual_Class import Individual from Filter_param_Class import Filter_param from Filter_polynomial_Class import Filter_poly from Visualize_Accuracy import graph_accuracy import matplotlib.pyplot as plt #Back props to optimize filter. Loss type...
Davide-Botturi/github-upload
Train_Solver.py
Train_Solver.py
py
4,289
python
en
code
0
github-code
21
[ { "api_name": "matplotlib.pyplot.yscale", "line_number": 19, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 19, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.ylim", "line_number": 20, "usage_type": "call" }, { "api_name": "mat...
42605511508
from datetime import date from unittest import mock import pytest from django.contrib.auth import get_user_model from django.utils import timezone from mixer.backend.django import mixer from ..models import Manager, Member, Priority, Shift, Status, Task @pytest.fixture def user(): return get_user_model().object...
taiyeoguns/shiftmgr-django
shifts/tests/test_models.py
test_models.py
py
2,951
python
en
code
0
github-code
21
[ { "api_name": "django.contrib.auth.get_user_model", "line_number": 14, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 12, "usage_type": "attribute" }, { "api_name": "mixer.backend.django.mixer.blend", "line_number": 21, "usage_type": "call" }, ...
19765423602
import time import json import os import sys DBPATH = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir)) sys.path.append(DBPATH) import database def formatString(str): joinedStr = str.replace(" ", "") trimmedStr = joinedStr[0:5] return trimmedStr.lower() def formatDate(date): retu...
lumunge/Arb
saveData/saveSerie.py
saveSerie.py
py
6,514
python
en
code
8
github-code
21
[ { "api_name": "os.path.abspath", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_nu...
8570351152
import discord import DiscordUtils from discord.ext import commands from discord_components import * class Menus(commands.Cog): def __init__(self, bot): self.bot = bot @commands.command(name='select-test') async def menu1(self, ctx): await ctx.send("Just select the roles you're ...
nikplus-yt/Generic-Discord-Bot
cogs/menu.py
menu.py
py
3,396
python
en
code
0
github-code
21
[ { "api_name": "discord.ext.commands.Cog", "line_number": 6, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 6, "usage_type": "name" }, { "api_name": "discord.Embed", "line_number": 33, "usage_type": "call" }, { "api_name": "discor...
28127331725
from django.shortcuts import render, redirect from .models import Time, Disputa from .forms import TimeForm, DisputaForm def index(request): return render(request, 'index.html') def create_time(request): form = TimeForm(request.POST or None) times = Time.objects.all() if form.is_valid(): for...
TiFurt/DesafioDMS
exercicio02/competicao/views.py
views.py
py
1,503
python
pt
code
0
github-code
21
[ { "api_name": "django.shortcuts.render", "line_number": 7, "usage_type": "call" }, { "api_name": "forms.TimeForm", "line_number": 11, "usage_type": "call" }, { "api_name": "models.Time.objects.all", "line_number": 12, "usage_type": "call" }, { "api_name": "models....
3209891227
import time import librosa import wp as wp from dtw import dtw import librosa.display from scipy.spatial.distance import cdist import matplotlib.pyplot as plt import os import numpy as np import pandas as pd import scipy.io.wavfile as wav import math import matplotlib.pyplot as plt # Get feature from sklearn import me...
kenjius01/mfcc_dtw_hmm
dtw-mfcc.py
dtw-mfcc.py
py
3,138
python
en
code
1
github-code
21
[ { "api_name": "librosa.load", "line_number": 20, "usage_type": "call" }, { "api_name": "math.floor", "line_number": 21, "usage_type": "call" }, { "api_name": "math.floor", "line_number": 22, "usage_type": "call" }, { "api_name": "librosa.feature.mfcc", "line_n...
34991186925
#!/usr/bin/env python # Always prefer setuptools over distutils from setuptools import setup, find_packages # To use a consistent encoding from codecs import open from os import path here = path.abspath(path.dirname(__file__)) # Get the long description from the README file with open(path.join(here, 'README.rst'), e...
nick8325/remarkable-fs
setup.py
setup.py
py
1,462
python
en
code
79
github-code
21
[ { "api_name": "os.path.abspath", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "name" }, { "api_name": "os.path.dirname", "line_number": 9, "usage_type": "call" }, { "api_name": "codecs.open", "line_number":...
7826700741
from shiny import ui, App # Interface do usuário ---- app_ui = ui.page_navbar( ui.nav( "Página 1", ui.layout_sidebar( ui.panel_sidebar( ui.markdown( """ Um texto em **negrito** ou em *itálico*. Um parágrafo co...
schoulten/dev-dash
pd08/app.py
app.py
py
2,052
python
pt
code
0
github-code
21
[ { "api_name": "shiny.ui.page_navbar", "line_number": 5, "usage_type": "call" }, { "api_name": "shiny.ui", "line_number": 5, "usage_type": "name" }, { "api_name": "shiny.ui.nav", "line_number": 6, "usage_type": "call" }, { "api_name": "shiny.ui", "line_number":...
44529445236
""" URL configuration for aw_project project. The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/4.2/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='h...
yurite6174/augmented-world-backend-api
aw_project/urls.py
urls.py
py
1,688
python
en
code
1
github-code
21
[ { "api_name": "django.urls.path", "line_number": 23, "usage_type": "call" }, { "api_name": "django.contrib.admin.site", "line_number": 23, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 23, "usage_type": "name" }, { "api_name": "...
42659233495
import numpy as np from scipy.interpolate import interp2d NAN = np.NAN from scipy.misc import imsave import texture_format def _uv_to_pix(u, v, raster_shape): ''' According to glViewPort: x_r = (x_ndc+1)*width/2 + x_0 y_r = (y_ndc+1)*height/2 + y_0 We also have: x_ndc = 2.0 * u - 1....
xinyazhang/PuzzleTunnelDiscovery
src/GP/atlas.py
atlas.py
py
6,285
python
en
code
72
github-code
21
[ { "api_name": "numpy.NAN", "line_number": 3, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.floor", "line_number"...
5655518350
import os import shutil import tempfile from html.parser import HTMLParser from operator import itemgetter from flask import (Flask, Markup, abort, flash, redirect, render_template, render_template_string, request, send_file, url_for) from flask_weasyprint import render_pdf app = Flask(__name__) _...
Kozea/bobslide
bobslide.py
bobslide.py
py
14,518
python
en
code
1
github-code
21
[ { "api_name": "flask.Flask", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number...
8565148606
from typing import Set, Union, List import sys import warnings import numpy as np import pandas as pd from scipy.stats import pearsonr from sklearn.feature_selection import SelectorMixin # >= 0.23.2 from sklearn.base import BaseEstimator from sklearn.utils import check_array from sklearn.utils.validation import check...
yu9824/yikit
yikit/feature_selection/filter_method.py
filter_method.py
py
5,336
python
en
code
0
github-code
21
[ { "api_name": "sklearn.feature_selection.SelectorMixin", "line_number": 17, "usage_type": "name" }, { "api_name": "sklearn.base.BaseEstimator", "line_number": 17, "usage_type": "name" }, { "api_name": "typing.Union", "line_number": 18, "usage_type": "name" }, { "a...
25807155525
import unittest from slixmpp import Message from slixmpp.test import SlixTest import slixmpp.plugins.xep_0380 as xep_0380 from slixmpp.xmlstream import register_stanza_plugin class TestEME(SlixTest): def setUp(self): register_stanza_plugin(Message, xep_0380.stanza.Encryption) def testCreateEME(self)...
poezio/slixmpp
tests/test_stanza_xep_0380.py
test_stanza_xep_0380.py
py
1,038
python
en
code
108
github-code
21
[ { "api_name": "slixmpp.test.SlixTest", "line_number": 8, "usage_type": "name" }, { "api_name": "slixmpp.xmlstream.register_stanza_plugin", "line_number": 11, "usage_type": "call" }, { "api_name": "slixmpp.Message", "line_number": 11, "usage_type": "argument" }, { ...
16903944252
import telebot import settings from telebot import types bot = telebot.TeleBot(settings.TOKEN) def send_welcome(message): bot.reply_to(message, "Привет, новый друг!\nВведи '/go' для начала опроса\nЕсли хочешь узнать о видах удобрений, введи '/fertilizer'\nЕсли хочешь узнать что-то ещё - введи '/questions...
Gosteva-Ksenya/Telegram_bot
commands.py
commands.py
py
2,541
python
ru
code
0
github-code
21
[ { "api_name": "telebot.TeleBot", "line_number": 5, "usage_type": "call" }, { "api_name": "settings.TOKEN", "line_number": 5, "usage_type": "attribute" }, { "api_name": "telebot.types.ReplyKeyboardMarkup", "line_number": 17, "usage_type": "call" }, { "api_name": "t...
43706915869
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # (c) 2018-2019 gmrandazzo@gmail.com # This file is part of DeepMolecularNetwork. # You can use,modify, and distribute it under # the terms of the GNU General Public Licenze, version 3. # See the file LICENSE for details import sys import subprocess import multiprocessing...
gmrandazzo/DeepMolecularNetwork
deepmolecularnetwork/VoxelModeling/GenAPBS3DEPot.py
GenAPBS3DEPot.py
py
2,026
python
en
code
3
github-code
21
[ { "api_name": "subprocess.call", "line_number": 18, "usage_type": "call" }, { "api_name": "subprocess.call", "line_number": 54, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 58, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_nu...
7911559391
import discord from discord.ext import commands class Events(commands.Cog): def __init__(self, client): self.client = client @commands.Cog.listener() async def on_reaction_add(self, reaction, user): channel = reaction.message.channel await channel.send('{} has added {} ...
lordblaster/Landsystem-3.0
Discord/disc/cogs/Events.py
Events.py
py
1,705
python
en
code
0
github-code
21
[ { "api_name": "discord.ext.commands.Cog", "line_number": 5, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 5, "usage_type": "name" }, { "api_name": "discord.ext.commands.Cog.listener", "line_number": 9, "usage_type": "call" }, { ...
11308900270
import logging from django.apps import apps from django.contrib.postgres import fields as pg_fields from django.db import models from django.utils.functional import cached_property from django.utils.translation import ugettext_lazy as _ from .forms import DynamicForm, DummyForm from .utils import freeze, hashsum log...
madaian/mooc-jutut
dynamic_forms/models.py
models.py
py
2,071
python
en
code
null
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "django.db.models.Manager", "line_number": 15, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 15, "usage_type": "name" }, { "api_name": "util...
43706937389
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # (c) 2018-2019 gmrandazzo@gmail.com # This file is part of DeepMolecularNetwork. # You can use,modify, and distribute it under # the terms of the GNU General Public Licenze, version 3. # See the file LICENSE for details import numpy as np from multiprocessing import cpu_...
gmrandazzo/DeepMolecularNetwork
deepmolecularnetwork/VoxelModeling/Voxel.py
Voxel.py
py
8,738
python
en
code
3
github-code
21
[ { "api_name": "pathlib.Path", "line_number": 22, "usage_type": "call" }, { "api_name": "os.makedirs", "line_number": 23, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.save", "line_number":...
74217629174
import io from flask import Flask, make_response, request from stock import query app = Flask(__name__) @app.route("/images/<db>/<code>") def image(db, code): fig = Figure() ax = fig.add_subplot(111) quandl_code = db + "/" + code series = query.get(quandl_code=quandl_code) if "offset" in request...
her0e1c1/pystock
stock/server/http.py
http.py
py
829
python
en
code
2
github-code
21
[ { "api_name": "flask.Flask", "line_number": 6, "usage_type": "call" }, { "api_name": "stock.query.get", "line_number": 14, "usage_type": "call" }, { "api_name": "stock.query", "line_number": 14, "usage_type": "name" }, { "api_name": "flask.request.args", "line...
28821147286
from PIL import Image, ImageDraw, ImageFilter, ImageOps Image.MAX_IMAGE_PIXELS = None layers = [ 'Asphalt_01', 'BeachGrass_01', 'Cobblestone_01_Wave', 'Concrete_01', 'Concrete_02', 'Crop_Field_01', 'Crop_Field_02', 'Debris_Rock_01', 'default', 'Dirt_01', 'Dirt_02', 'ForestConif...
granQ/ReforgerSatGenerator
ReforgerSatGenerator.py
ReforgerSatGenerator.py
py
1,776
python
en
code
3
github-code
21
[ { "api_name": "PIL.Image.MAX_IMAGE_PIXELS", "line_number": 3, "usage_type": "attribute" }, { "api_name": "PIL.Image", "line_number": 3, "usage_type": "name" }, { "api_name": "PIL.Image.open", "line_number": 39, "usage_type": "call" }, { "api_name": "PIL.Image", ...
16117350507
import os import json def import_data(): # Gets files from teams directory team_files = os.listdir('./data/teams/') D = {} D['Leagues'] = [] team_id = 1 player_id = 1 # Iterate through all files for num in range(len(team_files)): # Read in file team_file = open('./d...
ceyevar/Python-Ranking-NHL
etc/stat_collection.py
stat_collection.py
py
2,549
python
en
code
0
github-code
21
[ { "api_name": "os.listdir", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path.basename", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path", "line_number": 22, "usage_type": "attribute" }, { "api_name": "json.dumps", "line_number...
18587937971
import re from collections import OrderedDict, defaultdict from textwrap import wrap from warnings import warn from astropy.table.pprint import get_auto_format_func from astropy.utils.exceptions import AstropyUserWarning from . import basic, core, fixedwidth class IpacFormatErrorDBMS(Exception): def __str__(sel...
astropy/astropy
astropy/io/ascii/ipac.py
ipac.py
py
20,888
python
en
code
4,015
github-code
21
[ { "api_name": "collections.OrderedDict", "line_number": 114, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 118, "usage_type": "call" }, { "api_name": "re.VERBOSE", "line_number": 122, "usage_type": "attribute" }, { "api_name": "collections.def...
70797951414
# This Python 3 environment comes with many helpful analytics libraries installed # It is defined by the kaggle/python docker image: https://github.com/kaggle/docker-python # For example, here's several helpful packages to load in # this is for ceshi import numpy as np # linear algebra import pandas as pd # data proc...
lihp11/ceshi
ceshi.py
ceshi.py
py
5,095
python
en
code
0
github-code
21
[ { "api_name": "subprocess.check_output", "line_number": 26, "usage_type": "call" }, { "api_name": "operator.itemgetter", "line_number": 39, "usage_type": "call" }, { "api_name": "time.time", "line_number": 55, "usage_type": "call" }, { "api_name": "sklearn.cross_v...
10662654766
### visibility manipulation/analysis relevant ### import numpy as np # from galario.double import get_image_size import matplotlib.pyplot as plt from scipy import stats def set_grid(u, v, verbose=True): # gridding parameter nxy, dxy = get_image_size(u, v, verbose=verbose) # in rad # condition for GALAR...
yyamato-as/visibility_fit
uvanalysis_utils.py
uvanalysis_utils.py
py
4,052
python
en
code
0
github-code
21
[ { "api_name": "numpy.sqrt", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 24, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 45, "usage_type": "call" }, { "api_name": "matplotlib.pyplot"...
12950564153
import datetime import pandas as pd import numpy as np import talib as ta import pybrain as brain from pybrain.tools.shortcuts import buildNetwork from pybrain.supervised.trainers import BackpropTrainer from pybrain.tools.customxml import NetworkWriter from pybrain.datasets import ClassificationDataSet from pybrain.str...
ZiqiuZang/PythonTraining
ANN/000300.py
000300.py
py
3,074
python
en
code
0
github-code
21
[ { "api_name": "pandas.read_csv", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 24, "usage_type": "call" }, { "api_name": "talib.EMA", "line_number": 25, "usage_type": "call" }, { "api_name": "talib.EMA", "line_number": ...
34421789158
"""Copy `hydpydoctestcustomize.pth` and `hydpydoctestcustomize.py` into the site-packages folder to ensure the coverage measurement is complete when executing tests in sub-processes.""" import os import coverage basepath = os.path.abspath(os.path.split(coverage.__path__[0])[0]) path_rcfile = os.path.join(basepath, "h...
hydpy-dev/hydpy
hydpy/tests/hydpydoctestcustomize.py
hydpydoctestcustomize.py
py
577
python
en
code
30
github-code
21
[ { "api_name": "os.path.abspath", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.path.split", "line_number": 8, "usage_type": "call" }, { "api_name": "coverage.__path__", "line...
19909330612
from __future__ import print_function # import matplotlib.pyplot as plt # import numpy as np # import numpy as np # import matplotlib # import matplotlib.pyplot as plt # import matplotlib.pyplot as plt # from matplotlib.lines import Line2D # from matplotlib.patches import Rectangle # from matplotlib.text import Text #...
Tweak161/finance
spielplatz.py
spielplatz.py
py
30,525
python
en
code
0
github-code
21
[ { "api_name": "PyQt5.QtWidgets.QMainWindow", "line_number": 648, "usage_type": "name" }, { "api_name": "PyQt5.QtCore.pyqtSignal", "line_number": 649, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QApplication", "line_number": 652, "usage_type": "call" }, { ...
13795988285
from kivy.app import App from kivy.uix.label import Label from kivy.uix.boxlayout import BoxLayout from kivy.uix.gridlayout import GridLayout from kivy.uix.image import Image from kivy.uix.button import Button from kivy.uix.scrollview import ScrollView from kivy.uix.textinput import TextInput from kivy.uix.popup import...
danielskih/Panda-Bar-App
main.py
main.py
py
19,236
python
en
code
0
github-code
21
[ { "api_name": "google.oauth2.service_account.Credentials.from_service_account_file", "line_number": 19, "usage_type": "call" }, { "api_name": "google.oauth2.service_account.Credentials", "line_number": 19, "usage_type": "name" }, { "api_name": "google.auth.transport.requests.Requ...
71475194293
#!/usr/bin/env python # coding: utf-8 import pandas as pd import xlsxwriter from datetime import date import gspread def price_sheet_create(): gc = gspread.service_account(filename='./.app_info/my-test-project-9203-a1d4481e7db0.json') sh = gc.open("MLS_Order_Config") # Read data df_codes = pd.Data...
beekenj/MLS_OrderGuide
modules/PriceFormat.py
PriceFormat.py
py
6,014
python
en
code
0
github-code
21
[ { "api_name": "gspread.service_account", "line_number": 12, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 17, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 18, "usage_type": "call" }, { "api_name": "pandas.read_...
4776216357
# Imports PIL module from fileinput import filename from webbrowser import get from PIL import Image from datetime import datetime # nice way to create unique file names def dateAsString(): # get current second second = datetime.now().second # get current minute minute = datetime.now().minute ...
CelestineOverflow/8bit
python/main.py
main.py
py
1,941
python
en
code
0
github-code
21
[ { "api_name": "datetime.datetime.now", "line_number": 9, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 9, "usage_type": "name" }, { "api_name": "datetime.datetime.now", "line_number": 11, "usage_type": "call" }, { "api_name": "datetime....
1825816286
import requests from bs4 import BeautifulSoup class ParseProduct: def __init__(self,link): r = requests.get(link) source = BeautifulSoup(r.content,"lxml") self.partName = source.select('h1.proName')[0].text.strip() self.partTitle = source.select('h2.proSubName')[0].text.strip() ...
hasanyucel/PythonProjects
Applications/Projects/E-Commerce/Parse Part/parseFromN11.py
parseFromN11.py
py
480
python
en
code
1
github-code
21
[ { "api_name": "requests.get", "line_number": 6, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 7, "usage_type": "call" } ]
39094698362
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup, find_packages from pip.req import parse_requirements from pip.download import PipSession with open('README.rst') as readme_file: readme = readme_file.read() pip_session = PipSession() #parsed_reqs = parse_requirements('requirements.txt'...
vrutkovs/elephas
setup.py
setup.py
py
1,577
python
en
code
0
github-code
21
[ { "api_name": "pip.download.PipSession", "line_number": 12, "usage_type": "call" }, { "api_name": "pip.req.parse_requirements", "line_number": 15, "usage_type": "call" }, { "api_name": "setuptools.setup", "line_number": 19, "usage_type": "call" }, { "api_name": "s...
16642457514
import argparse import os from pytorch_med_imaging.logger import Logger __all__ = ['ConsoleEntry'] class ConsoleEntry(argparse.ArgumentParser): r""" This class is a wrapped parser which contains some presets: +-------+------+-------------+------------+---------+-----------------------+ | label | flag...
alabamagan/maxillary_sinus_diagnosis_toolkit
msdtk/scripts/console_entry.py
console_entry.py
py
3,952
python
en
code
0
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 7, "usage_type": "attribute" }, { "api_name": "pytorch_med_imaging.logger.Logger", "line_number": 52, "usage_type": "call" }, { "api_name": "os.path.isdir", "line_number": 67, "usage_type": "call" }, { "api_n...
10955100807
from typing import List class Solution: def maxSubarraySumCircular(self, nums: List[int]) -> int: if max(nums) < 0: return max(nums) maxSum = nums[0] maxSlidingSum = nums[0] minSum = nums[0] minSlidingSum = nums[0] for idx in range(1, len(nums)): ...
A7fa7fa/python-leetcode
0918 - maximum-sum-circular-subarray/maximum-sum-circular-subarray.py
maximum-sum-circular-subarray.py
py
754
python
en
code
0
github-code
21
[ { "api_name": "typing.List", "line_number": 5, "usage_type": "name" } ]
41189202477
from pymongo import MongoClient class MongoStorage: def __init__(self, is_test=False): self.client = MongoClient() db_name = "shooping_list_bot" if is_test: db_name += "_test" self.client.drop_database(db_name) self.db = self.client.get_database(db_name) ...
nonZero/MyShoopingListBot
mongo_storage.py
mongo_storage.py
py
774
python
en
code
1
github-code
21
[ { "api_name": "pymongo.MongoClient", "line_number": 6, "usage_type": "call" } ]
41970060875
from NASTRAN_handler import NASTRAN_handler from utils.myHandler import ThreadedHTTPServer import time import argparse #get arguments from command parser = argparse.ArgumentParser() parser.add_argument("--host", type=str, default="localhost", help="Provide host name") parser.add_argument("--port", type=int, default=43...
lerausenco/KBE-Prosjekt
Nodes/run_NASTRAN_server.py
run_NASTRAN_server.py
py
716
python
en
code
2
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 7, "usage_type": "call" }, { "api_name": "utils.myHandler.ThreadedHTTPServer", "line_number": 14, "usage_type": "call" }, { "api_name": "NASTRAN_handler.NASTRAN_handler", "line_number": 14, "usage_type": "argument" ...
7059539557
from telegram.ext.updater import Updater from telegram.update import Update from telegram import InlineKeyboardButton, InlineKeyboardMarkup from telegram.ext.callbackcontext import CallbackContext from telegram.ext.commandhandler import CommandHandler from telegram.ext.messagehandler import MessageHandler from telegram...
harshitgoyal101/Airbnb
bot.py
bot.py
py
13,626
python
en
code
0
github-code
21
[ { "api_name": "telegram.ext.updater.Updater", "line_number": 12, "usage_type": "call" }, { "api_name": "telegram.update.Update", "line_number": 28, "usage_type": "name" }, { "api_name": "telegram.ext.callbackcontext.CallbackContext", "line_number": 28, "usage_type": "name...
4627225503
from functools import lru_cache from chainer import cuda from chainer import function from chainer.utils import type_check import numpy as np def _get_batch_diagonal_cpu(array): batch_size, m, n = array.shape assert m == n rows, cols = np.diag_indices(n) return array[:, rows, cols] def _set_batch_d...
chainer/chainerrl
chainerrl/functions/lower_triangular_matrix.py
lower_triangular_matrix.py
py
4,453
python
en
code
1,134
github-code
21
[ { "api_name": "numpy.diag_indices", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.diag_indices", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.int32", ...
9134398338
import setuptools with open('README.md', 'r') as fh: long_description = fh.read() setuptools.setup( name='trace_event_handler', version='0.0.4', author='Matthias Lochbrunner', author_email='matthias_lochbrunner@web.de', description='Python Logging Handler which dumps in the Trace Event Format ...
lochbrunner/trace_event_handler
setup.py
setup.py
py
752
python
en
code
1
github-code
21
[ { "api_name": "setuptools.setup", "line_number": 6, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 15, "usage_type": "call" } ]
16377438622
import re import ziamath as zm from django import template import xml.etree.ElementTree as ET ET.register_namespace("", "http://www.w3.org/2000/svg") # zm.config.minsizefraction = .6 zm.config.precision = 2 zm.config.svg2 = False zm.config.decimal_separator = ',' register = template.Library() shortcuts = { r'\...
Luganskaya-Svetlana/Physalis
physalisproject/problems/templatetags/ziamath_filter.py
ziamath_filter.py
py
4,287
python
en
code
3
github-code
21
[ { "api_name": "xml.etree.ElementTree.register_namespace", "line_number": 5, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree", "line_number": 5, "usage_type": "name" }, { "api_name": "ziamath.config", "line_number": 9, "usage_type": "attribute" }, { "a...
74991257971
from typing import Optional import json import logging import os import ssl import time from http.client import HTTPConnection, HTTPSConnection HOST_NAME: Optional[str] = "api.listenbrainz.org" PATH_SUBMIT = "/1/submit-listens" SSL_CONTEXT: Optional[ssl.SSLContext] = ssl.create_default_context() # to run against a lo...
quodlibet/quodlibet
quodlibet/ext/events/listenbrainz/listenbrainz.py
listenbrainz.py
py
5,365
python
en
code
1,306
github-code
21
[ { "api_name": "typing.Optional", "line_number": 9, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 11, "usage_type": "name" }, { "api_name": "ssl.SSLContext", "line_number": 11, "usage_type": "attribute" }, { "api_name": "ssl.create_default...
27827130333
#!/usr/bin/env python """ Your music library contains N songs and your friend wants to listen to L songs during your road trip (repeats are allowed). Make a playlist so that every song is played at least once, and a song can only be played again only if K other songs have been played. Return the number of possible pla...
pozorvlak/cassidoo
2020/2020-11-09_num_playlists/num_playlists.py
num_playlists.py
py
9,265
python
en
code
1
github-code
21
[ { "api_name": "itertools.permutations", "line_number": 28, "usage_type": "call" }, { "api_name": "math.factorial", "line_number": 59, "usage_type": "call" }, { "api_name": "minizinc.Solver.lookup", "line_number": 85, "usage_type": "call" }, { "api_name": "minizinc...
21513294229
# -*- coding: utf-8 -*- import os import fitz def process_pdf_image(file_path, image_path): """PDF转成图片""" pdf_document = fitz.open(file_path) for page_num in range(pdf_document.pageCount): pdf_page = pdf_document[page_num] rotate = int(0) zoom_x = 1.33333333 # (1.33333333-->1056x...
pythonyhd/bourse
bourse/utils/process_pdf.py
process_pdf.py
py
893
python
en
code
13
github-code
21
[ { "api_name": "fitz.open", "line_number": 9, "usage_type": "call" }, { "api_name": "fitz.Matrix", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_number": 17, ...
11606489510
#!/usr/bin/python3 import os import re import time import requests import json from datetime import datetime from bs4 import BeautifulSoup from markdownify import markdownify as md SLEEP_TIME = 180 FILE_PATH = "/opt/google_news_rss/json" # FeedURL | Feed title FEEDS = [ "https://news.google.com/rss/topics/CAAqBwgK...
the-pixel-hunter/Security-feeds-to-Elastic
python_collectors/google_news_rss_collector.py
google_news_rss_collector.py
py
3,881
python
en
code
3
github-code
21
[ { "api_name": "datetime.datetime.strptime", "line_number": 29, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 29, "usage_type": "name" }, { "api_name": "re.sub", "line_number": 33, "usage_type": "call" }, { "api_name": "requests.get", ...
20015889584
# -*- coding:utf-8 -*- from datetime import datetime import pyping def main(): # 1번 문제 nowTime = datetime.now() strNow = nowTime.strftime('%Y-%m-%d %H:%M:%S') print(strNow) # 2번 문제 dest_url = 'google.com' res = pyping.ping(dest_url) if not res.ret_code: print("Success") el...
JohnHaan/cloudtechpython
20170313/DONE/sjhan.py
sjhan.py
py
1,172
python
en
code
0
github-code
21
[ { "api_name": "datetime.datetime.now", "line_number": 8, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 8, "usage_type": "name" }, { "api_name": "pyping.ping", "line_number": 14, "usage_type": "call" } ]
9840098322
import itertools def steps_ready(blocked_count): return list(sorted([blockee for blockee in blocked_count.keys() if blocked_count[blockee] == 0])) def step_duration(step): return 60 + "ABCDEFGHIJKLMNOPQRSTUVWXYZ".index(step) + 1 def solve(input_data): pairs = [(toks[1], toks[7]) for toks in [line.spli...
jeresch/advent-2018
solutions/sol7p2.py
sol7p2.py
py
2,139
python
en
code
0
github-code
21
[ { "api_name": "itertools.count", "line_number": 33, "usage_type": "call" } ]
43580459145
#!/usr/bin/env python import time import datetime import random import matplotlib matplotlib.use('Agg') import matplotlib.colors as mplcol import matplotlib.pyplot as plt from matplotlib import cm import numpy as np import pandas as pd from dynamo.dataformat import Configuration from dynamo.utils.interface.mysql impor...
SmartDataProjects/dynamo
utilities/sankey.py
sankey.py
py
6,272
python
en
code
1
github-code
21
[ { "api_name": "matplotlib.use", "line_number": 6, "usage_type": "call" }, { "api_name": "datetime.datetime.fromtimestamp", "line_number": 22, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 22, "usage_type": "attribute" }, { "api_name": "...
18959209081
from django.urls import path, include from . import views app_name = 'call_of_the_wild' urlpatterns = [ path('', views.page_blank, name='blank'), path('need_zone_times', views.page_need_zone_times, name='page_need_zone_times'), path('trophy_stats', views.page_trophy_stats, name='page_trophy_stats'), ]
benspelledabc/djangosite
imrunicorn/call_of_the_wild/urls.py
urls.py
py
317
python
en
code
1
github-code
21
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" } ]
42241030131
from __future__ import absolute_import, unicode_literals import logging from tornado import gen from tornado.concurrent import Future from .config import Config from .msg import Msg from .utils import mark_as_proxy_method, is_proxy, simple_oid logger = logging.getLogger(__name__) class BaseRole(object): defau...
miphreal/python-logdog
logdog/core/base_role.py
base_role.py
py
5,909
python
en
code
19
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "config.Config", "line_number": 16, "usage_type": "call" }, { "api_name": "utils.simple_oid", "line_number": 53, "usage_type": "call" }, { "api_name": "config.pop", "li...
3780593737
########################################################## # Parse Arma's Preset file + install mods + restart LGSM # # Alexis TARUSSIO : alexis.tarussio@gmail.com # 24/10/2020 # # 24/10/20 V1.00 Creation # # ########################################################## import subprocess import os import shutil import ...
Elenui/Arma3-Mod-Manager
A3modmanager.py
A3modmanager.py
py
3,799
python
en
code
0
github-code
21
[ { "api_name": "pathlib.Path", "line_number": 25, "usage_type": "call" }, { "api_name": "configparser.RawConfigParser", "line_number": 29, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 36, "usage_type": "attribute" }, { "api_name": "os.environ"...
7714699812
import discord from discord.ext import commands import requests import json client = commands.Bot(command_prefix="!") @client.command() async def minecraft(ctx, arg): r = requests.get('https://api.minehut.com/server/' + arg + '?byName=true') json_data = r.json() description = json_data["server"]["motd"...
Skelly1301/MSS
bot/minecraft.py
minecraft.py
py
828
python
en
code
1
github-code
21
[ { "api_name": "discord.ext.commands.Bot", "line_number": 8, "usage_type": "call" }, { "api_name": "discord.ext.commands", "line_number": 8, "usage_type": "name" }, { "api_name": "requests.get", "line_number": 12, "usage_type": "call" }, { "api_name": "discord.Embe...
9204876335
from django.urls import path from friends import views urlpatterns = [ path('user', views.UserView.as_view()), path( 'user/<uuid:user_id>/friend/<uuid:friend_id>', views.FriendshipView.as_view() ), path('user/<uuid:user_id>/friends', views.FriendshipsView.as_view()) ]
ruslanzakharov/friends_service
friends/urls.py
urls.py
py
303
python
en
code
0
github-code
21
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "friends.views.UserView.as_view", "line_number": 6, "usage_type": "call" }, { "api_name": "friends.views.UserView", "line_number": 6, "usage_type": "attribute" }, { "api_name...
42687989687
import os from os.path import basename, dirname, curdir, abspath, isdir, isfile, exists, splitext, join as pjoin import sys from glob import glob import shutil from calendar import monthrange import logging import traceback from subprocess import CalledProcessError from flo.computation import Computation from flo.buil...
gpcureton/hirs_csrb_monthly
source/flo/__init__.py
__init__.py
py
9,799
python
en
code
0
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 35, "usage_type": "call" }, { "api_name": "flo.computation.Computation", "line_number": 38, "usage_type": "name" }, { "api_name": "timeutil.datetime", "line_number": 49, "usage_type": "call" }, { "api_name": "timeu...
581191033
# _*_coding :utf-8 _*_ # @Time :2022/8/3 21:43 # @File : 测试_006 # @Project : python_ubuntu_progress import socket import time import multiprocessing def sd(): while True: ins = input(':') # 在控制台 输入与输出 看起来美观 if not ins: client.send('exit'.encode('utf-8')) # 客户端退出连接 ...
wufake70/myPython
python_ubuntu_progress/测试_006_client2(升级版).py
测试_006_client2(升级版).py
py
1,566
python
en
code
0
github-code
21
[ { "api_name": "time.sleep", "line_number": 29, "usage_type": "call" }, { "api_name": "socket.socket", "line_number": 40, "usage_type": "call" }, { "api_name": "multiprocessing.Process", "line_number": 53, "usage_type": "call" } ]
13558404795
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Sep 29 21:29:23 2021 @author: varun """ import os import cv2 import math import numpy as np os.chdir("/home/varun/Downloads/ml_assignment/1/ELL784 Assignment 1_files") #%% #240,352,3 def gaussian(x ,mean, sd): return 1/math.sqrt(math.pow(2*m...
varunsood189/Machine-learning
assignment_1.py
assignment_1.py
py
6,230
python
en
code
0
github-code
21
[ { "api_name": "os.chdir", "line_number": 12, "usage_type": "call" }, { "api_name": "math.sqrt", "line_number": 19, "usage_type": "call" }, { "api_name": "math.pow", "line_number": 19, "usage_type": "call" }, { "api_name": "math.pi", "line_number": 19, "usa...
23494465777
#!/usr/bin/env python # encoding: utf-8 # ================== vcfconcat4LD ================= # In order to facilitate the calculation with VCFTools and the plotting of # pairwise r2 (LD) between SNPs (i.e. an LD heatmap) between chromosomes, # this script modifies the input vcf file in such a way that all SNPs have ...
johannessonlab/HetVPaper
PaLD/scripts/vcfconcat4LD.py
vcfconcat4LD.py
py
4,484
python
en
code
0
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 34, "usage_type": "call" }, { "api_name": "gzip.open", "line_number": 52, "usage_type": "call" }, { "api_name": "sys.stdout.write", "line_number": 70, "usage_type": "call" }, { "api_name": "sys.stdout", "...
35611863898
import sqlite3 import logging import threading from pathlib import Path from typing import Union from datetime import datetime from .info_data.sqlite import FileInfo from ..utils import delete_file from ..config import config log = logging.getLogger(__name__) # Since download tracker is working on another thread (Qu...
mansuf/mangadex-downloader
mangadex_downloader/tracker/sqlite.py
sqlite.py
py
9,210
python
en
code
304
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "sqlite3.threadsafety", "line_number": 17, "usage_type": "attribute" }, { "api_name": "pathlib.Path", "line_number": 19, "usage_type": "call" }, { "api_name": "pathlib.Path...
74345964214
# # crnverifier/pathway_decomposition.py # Original source from the Nuskell compiler project # # Authors: # - Seung Woo Shin (seungwoo.theory@gmail.com) # - Stefan Badelt (bad-ants-fleet@posteo.eu) # import logging log = logging.getLogger(__name__) from itertools import chain from collections import Counter fro...
DNA-and-Natural-Algorithms-Group/crnverifier
crnverifier/pathway_decomposition.py
pathway_decomposition.py
py
31,301
python
en
code
0
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "itertools.chain", "line_number": 24, "usage_type": "name" }, { "api_name": "itertools.chain", "line_number": 29, "usage_type": "name" }, { "api_name": "collections.Counter...
12649609813
import xml.etree.ElementTree as ET import pandas as pd import xmltodict class ReSpecTh(): def __init__(self, tree): self.tree = tree self.root = self.tree.getroot() @property def apparatus(self): a = self.root.find("./apparatus/kind") if a is None: return None ...
sciexpem/sciexpem
experimentmanager/respecth.py
respecth.py
py
7,244
python
en
code
0
github-code
21
[ { "api_name": "pandas.DataFrame.from_records", "line_number": 73, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 73, "usage_type": "attribute" }, { "api_name": "xmltodict.parse", "line_number": 189, "usage_type": "call" }, { "api_name": "...
72514691573
# -*- coding: utf-8 -*- from api.pokAPI import ApiClass from business_objects.pokemon import pokemon from business_objects.user import utilisateur from orm.simpleDB import orm from random import shuffle from menu.menuClass import menu from mytools.poktools import * eval_answers = {'Exit': 'exit_func', 'Sign up': 's...
Dellagi/pokemonApp
main.py
main.py
py
2,959
python
en
code
0
github-code
21
[ { "api_name": "api.pokAPI.ApiClass", "line_number": 31, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "line_number": 32, "usage_type": "call" }, { "api_name": "business_objects.pokemon.pokemon", "line_number": 34, "usage_type": "call" }, { "api_name": "orm.si...
16372104442
from telegram.ext.updater import Updater from telegram.update import Update from telegram.ext.callbackcontext import CallbackContext from telegram.ext.commandhandler import CommandHandler from telegram.ext.messagehandler import MessageHandler from telegram.ext.filters import Filters import telegram import os import sy...
raspiuser1/chatgpt_telegram_bot
chatgpt-bot.py
chatgpt-bot.py
py
2,480
python
en
code
0
github-code
21
[ { "api_name": "openai.api_key", "line_number": 16, "usage_type": "attribute" }, { "api_name": "telegram.ext.updater.Updater", "line_number": 24, "usage_type": "call" }, { "api_name": "telegram.Bot", "line_number": 25, "usage_type": "call" }, { "api_name": "telegra...
8504696238
import geoschema import segyio import json import os.path from glob import glob from pyproj import Proj from geopandas import GeoDataFrame as gpd from shapely.geometry import Point, LineString import matplotlib.pyplot as plt def get_survey_meta_paths(path, pattern): return glob(os.path.join(path, pattern)) def ...
smalcie/KIDT
seismicqc.py
seismicqc.py
py
5,433
python
en
code
0
github-code
21
[ { "api_name": "glob.glob", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path.path.join", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.path", "line_num...
38501026121
import torch.nn as nn import torch import torch.nn.functional as F class ResidualBlock(nn.Module): def __init__(self, input_planes, output_planes, stride=1): super(ResidualBlock, self).__init__() self.conv1 = nn.Conv2d(input_planes, output_planes, kernel_size=3, stride=stride, padding=1, bias=False...
ngkhiem97/cv-face-mask-detection
models/resnet.py
resnet.py
py
3,096
python
en
code
0
github-code
21
[ { "api_name": "torch.nn.Module", "line_number": 5, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 5, "usage_type": "name" }, { "api_name": "torch.nn.Conv2d", "line_number": 8, "usage_type": "call" }, { "api_name": "torch.nn", "line_numbe...
72537044534
# monke patch the gspread lib to have 1 second delay after every request # in order to comply with my 60 request per min quota import time from gspread import client old_request = client.Client.request def slow_request(*args, **kwargs): time.sleep(1) return old_request(*args, **kwargs) client.Client.reques...
Utilka/Enthropic_Heavens_Map_Editor
main.py
main.py
py
7,133
python
en
code
1
github-code
21
[ { "api_name": "gspread.client.Client", "line_number": 6, "usage_type": "attribute" }, { "api_name": "gspread.client", "line_number": 6, "usage_type": "name" }, { "api_name": "time.sleep", "line_number": 10, "usage_type": "call" }, { "api_name": "gspread.client.Cli...
75195848373
import datetime import time import pandas as pd from datetime import datetime from datetime import timedelta if __name__ == '__main__': ftime = '0 2022-06-09 08:00' stime = '600 2022-06-09 18:00' ftime = ftime.split()[2] stime = stime.split()[2] print(ftime+'-'+stime) df = pd.DataF...
keeesp/IGORA
main.py
main.py
py
946
python
en
code
0
github-code
21
[ { "api_name": "pandas.DataFrame", "line_number": 15, "usage_type": "call" }, { "api_name": "pandas.date_range", "line_number": 15, "usage_type": "call" }, { "api_name": "datetime.datetime.strptime", "line_number": 38, "usage_type": "call" }, { "api_name": "datetim...
71769706932
from pymongo import MongoClient client = MongoClient() client = MongoClient('localhost', 27017) database = client.database collection = database.files_collection #hash filename juan = {"file": "juan", "tags": ["a", "c"]} amelia = {"file": "amelia", "tags": ["b", "c"]} amelia1 = {"file": "amelia1", "tags": ["b", "c"...
acuriel/distributed-systems-project
database.py
database.py
py
783
python
en
code
0
github-code
21
[ { "api_name": "pymongo.MongoClient", "line_number": 3, "usage_type": "call" }, { "api_name": "pymongo.MongoClient", "line_number": 5, "usage_type": "call" } ]
39895229085
# coding: utf-8 import dns.resolver import http.client IP_LIST = [] # 定义域名变量 APP_DOMAIN = "www.baidu.com" # 定义业务域名 def get_ip_list(domain=""): try: A = dns.resolver.query(domain, "A") except Exception as e: print("dns resolver error:" + str(e)) for i in A.response.answer: for ...
warmsirius/python-notebook
2.Python运维/1.系统性能信息/4.1 DNS多域名服务监控.py
4.1 DNS多域名服务监控.py
py
1,382
python
en
code
0
github-code
21
[ { "api_name": "dns.resolver.resolver.query", "line_number": 12, "usage_type": "call" }, { "api_name": "dns.resolver.resolver", "line_number": 12, "usage_type": "attribute" }, { "api_name": "dns.resolver", "line_number": 12, "usage_type": "name" }, { "api_name": "h...
3761056092
import argparse from collections import defaultdict import pandas as pd def count_clusters(clusterfile): c_map = defaultdict(list) count = {} with open(clusterfile) as fin: for line in fin: (relation, uri, cluster) = line.rstrip('\n').split('\t') c_map[cluster].append(uri) ...
juarezsacenti/kg-summ-rec
summarization/count_clusters.py
count_clusters.py
py
881
python
en
code
2
github-code
21
[ { "api_name": "collections.defaultdict", "line_number": 6, "usage_type": "call" }, { "api_name": "pandas.DataFrame.from_dict", "line_number": 15, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 15, "usage_type": "attribute" }, { "api_name"...
44910074855
import pytest from app import create_app, db @pytest.fixture(autouse=True) def set_test_env_vars(monkeypatch): monkeypatch.setenv('TEST_SECRET_KEY', 'test') monkeypatch.setenv("DEBUGGING_VERBOSITY", "4") # connection to SQLExpress connection_string = r'DRIVER={ODBC Driver 13 for SQL Server};' + "SERVE...
Bougiefever/LabelManagerFlask
tests/conftest.py
conftest.py
py
1,842
python
en
code
0
github-code
21
[ { "api_name": "pytest.fixture", "line_number": 5, "usage_type": "call" }, { "api_name": "app.create_app", "line_number": 19, "usage_type": "call" }, { "api_name": "app.testing", "line_number": 20, "usage_type": "attribute" }, { "api_name": "app.app_context", "...
29472530695
import json from threading import Thread import customtkinter import keyboard import pyaudio import STTSLocal as STTS from threading import Event from enum import Enum import sounddevice as sd import speech_recognition as sr import numpy as np import time import subLocal as SUB import translator import chatbot import s...
0Xiaohei0/VoiceToJapanese
UI.py
UI.py
py
63,117
python
en
code
117
github-code
21
[ { "api_name": "enum.Enum", "line_number": 20, "usage_type": "name" }, { "api_name": "sounddevice.InputStream", "line_number": 38, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 41, "usage_type": "call" }, { "api_name": "sounddevice.InputS...
4366037173
import sys import os import numpy as np import torch from transformers import AutoTokenizer, AutoModel from tqdm.auto import tqdm from src.helper import * from scipy.stats import spearmanr def usim_predict(left,right,tokenizer,model,flag,layer_start,layer_end,maxlen): string_features1, string_features2 = [], [...
cambridgeltl/MirrorWiC
evaluation_scripts/test_usim.py
test_usim.py
py
2,462
python
en
code
10
github-code
21
[ { "api_name": "tqdm.auto.tqdm", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.concatenate", "line_number": 20, "usage_type": "call" }, { "api_name": "tqdm.auto.tqdm", "l...
34624106742
import math import copy from dataclasses import dataclass, field from argparse import Namespace from typing import List, Tuple, Dict from torch.distributions import Categorical import torch import fastBPE import numpy as np import sacrebleu from collections import namedtuple from fairseq import metrics, utils from fa...
HubReb/imitkd_ast
fairseq/fairseq/criterions/aggrevate_policy_gradient.py
aggrevate_policy_gradient.py
py
45,009
python
en
code
1
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 30, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 31, "usage_type": "attribute" }, { "api_name": "logging.FileHandler", "line_number": 34, "usage_type": "call" }, { "api_name": "logging.DEBU...
74947717493
""" 덧셈하여 타겟을 만들 수 있는 배열의 두 숫자 인덱스를 리턴하라. leetcode: https://leetcode.com/problems/two-sum/ in을 이용한 탐색 """ from typing import List def twoSum(nums: List[int], target: int) -> List[int]: for i, n in enumerate(nums): complement = target - n if complement in nums[i + 1 :]: return [nums.i...
zusdn90/Python-Algorithm-Interview
ch07/1-2.py
1-2.py
py
534
python
ko
code
0
github-code
21
[ { "api_name": "typing.List", "line_number": 11, "usage_type": "name" } ]
42276656404
from __future__ import print_function import sys from src.time_functions import get_Issuing_Time_text as get_time from src.time_functions import get_Issuing_Date_text as get_date from src.convert_time import convert_time from src.check_everything import checkEverything import pytz FMT_STRING = "%m-%d-%Y %H:%M" def wf...
allenea/Forecast_Search_Wizard
src/read_time.py
read_time.py
py
10,214
python
en
code
10
github-code
21
[ { "api_name": "src.time_functions.get_Issuing_Date_text", "line_number": 49, "usage_type": "call" }, { "api_name": "sys.stdout.flush", "line_number": 57, "usage_type": "call" }, { "api_name": "sys.stdout", "line_number": 57, "usage_type": "attribute" }, { "api_nam...
34953688326
__author__ = "Vanessa Sochat" __copyright__ = "Copyright 2020, Vanessa Sochat" __license__ = "MPL 2.0" from django.conf.urls import url, include from snakeface.apps.users import views from social_django import urls as social_urls urlpatterns = [ # url(r"^login/$", views.login, name="login"), url(r"^login/n...
snakemake/snakeface
snakeface/apps/users/urls.py
urls.py
py
553
python
en
code
14
github-code
21
[ { "api_name": "django.conf.urls.url", "line_number": 11, "usage_type": "call" }, { "api_name": "snakeface.apps.users.views.notebook_login", "line_number": 11, "usage_type": "attribute" }, { "api_name": "snakeface.apps.users.views", "line_number": 11, "usage_type": "name" ...
24439901244
import sys, collections read = sys.stdin.readline for _ in range(int(read())): V, E = map(int, read().split()) graph = {i+1: [] for i in range(V)} status = [0] * (V+1) for _ in range(E): u, v = map(int, read().split()) graph[u].append(v) graph[v].append(u) result = 'YES' ...
bassyu/ps
BOJ/01707.py
01707.py
py
785
python
en
code
0
github-code
21
[ { "api_name": "sys.stdin", "line_number": 2, "usage_type": "attribute" }, { "api_name": "collections.deque", "line_number": 18, "usage_type": "call" } ]
20612364718
''' Created on @author: dangze.huo ''' import aautility import priceseries import datetime import xlrd _today = datetime.date(2015,12,7) market_data = {} market_assets = [] # list of priceseries def load_data(datalist_file): i = datalist_file.rfind( '/' ) if i == -1 : i = datalist...
andyhdz/backtest
asset allocation/market.py
market.py
py
2,256
python
en
code
0
github-code
21
[ { "api_name": "datetime.date", "line_number": 12, "usage_type": "call" }, { "api_name": "xlrd.open_workbook", "line_number": 32, "usage_type": "call" }, { "api_name": "datetime.datetime.strptime", "line_number": 41, "usage_type": "call" }, { "api_name": "datetime....
19654859304
from datetime import datetime from typing import Any from collections.abc import Iterable class Filter: """Describe a filter object to be passed to list_tasks function""" def __init__( self, tags: Iterable[str] | None = None, priority: int | None = None, date: datetime | None ...
anthonyraf/linetasker
linetasker/utils/filter.py
filter.py
py
721
python
en
code
1
github-code
21
[ { "api_name": "collections.abc.Iterable", "line_number": 11, "usage_type": "name" }, { "api_name": "datetime.datetime", "line_number": 13, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 19, "usage_type": "name" } ]
10085641697
from collections import namedtuple import torch.nn as nn __all__ = [ 'list_nodes', 'find_nodes', 'rule_linear_nodes', 'rule_batchnorm_nodes', 'rule_activation_nodes', 'get_rules_multiple_blocks', ] Node = namedtuple('Node', 'name module') def list_nodes(net, name='', verbo...
sbenslan/sem21f23
quantlab/graphs/analyse.py
analyse.py
py
3,849
python
en
code
1
github-code
21
[ { "api_name": "collections.namedtuple", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.nn.modules", "line_number": 69, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 69, "usage_type": "name" }, { "api_name": "torch.nn.module...
40928199668
from django.shortcuts import render from datetime import datetime from .models import Phone import base64 from django.core.exceptions import ObjectDoesNotExist import pyotp from rest_framework.response import Response from rest_framework.views import APIView # Create your views here. class generateKey: ...
MariamFathima/Phonenumber_verification
phone_verify/views.py
views.py
py
1,694
python
en
code
0
github-code
21
[ { "api_name": "datetime.datetime.date", "line_number": 16, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 16, "usage_type": "name" }, { "api_name": "datetime.datetime.now", "line_number": 16, "usage_type": "call" }, { "api_name": "rest_f...
10807094316
import numpy as np import cv2 from PIL import Image, ImageDraw class AverageMeter(object): """Computes and stores the average and current value""" def __init__(self): self.reset() def reset(self): self.val = 0 self.avg = 0 self.sum = 0 self.count = 0 def update...
kanosawa/simple-face-alignment-pytorch
utils/log_utils.py
log_utils.py
py
1,134
python
en
code
4
github-code
21
[ { "api_name": "numpy.uint8", "line_number": 25, "usage_type": "attribute" }, { "api_name": "PIL.Image.fromarray", "line_number": 27, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 27, "usage_type": "name" }, { "api_name": "PIL.ImageDraw.Draw", ...
343572494
from pathlib import Path from tqdm import tqdm from whaaaaat import prompt from modules import database from modules.composition.jpg import dir_to_jpg from modules.composition.pdf import dir_to_pdf from modules.database.models.manga import Manga from modules.sorting import numerical_sort from modules.ui.colorize impo...
m-haisham/Manga-K
modules/composition/menu/menu.py
menu.py
py
2,727
python
en
code
2
github-code
21
[ { "api_name": "dir.directories.pdf", "line_number": 16, "usage_type": "attribute" }, { "api_name": "dir.directories", "line_number": 16, "usage_type": "name" }, { "api_name": "dir.directories.jpg", "line_number": 17, "usage_type": "attribute" }, { "api_name": "dir...
9236171803
from gensim import corpora,models import pandas as pd #from functools import reduce from datetime import datetime #from goto import with_goto import os import pickle class My_dictionary: def __init__(self,train,test,no_below,no_above): self.train=train self.test=test self.no_above=no_above self.no_below=n...
cheng-Ye/DC_TextClass
DL-tsinghuaNLP/preprocess_data.py
preprocess_data.py
py
2,632
python
en
code
0
github-code
21
[ { "api_name": "gensim.corpora.Dictionary", "line_number": 33, "usage_type": "call" }, { "api_name": "gensim.corpora", "line_number": 33, "usage_type": "name" }, { "api_name": "pandas.DataFrame", "line_number": 44, "usage_type": "call" }, { "api_name": "pickle.dump...
12487055806
#!/usr/bin/env python2 # -*- coding: utf-8 -*- #This program is useful if you want to search a specific object in a xml file and delete # that xml file if do not have that specific object. import os import xml.etree.ElementTree as ET from xml.dom import minidom origin_ann_dir = './Annotations/' #new_ann_dir = './A...
MuhammadAsadJaved/Important-shells
count&Delete_XML_Dont_Have_objects.py
count&Delete_XML_Dont_Have_objects.py
py
790
python
en
code
12
github-code
21
[ { "api_name": "os.listdir", "line_number": 16, "usage_type": "call" }, { "api_name": "xml.dom.minidom.parse", "line_number": 21, "usage_type": "call" }, { "api_name": "xml.dom.minidom", "line_number": 21, "usage_type": "name" } ]
72631781172
from selenium import webdriver from datetime import datetime def get_hot_keywords(): options = webdriver.ChromeOptions() options.add_argument('headless') with webdriver.Chrome('./chromedriver', options=options) as driver: driver.implicitly_wait(60) driver.get('https://www.naver.com') ...
JangHanbin/tistory_poster
naver_crawler.py
naver_crawler.py
py
1,205
python
en
code
0
github-code
21
[ { "api_name": "selenium.webdriver.ChromeOptions", "line_number": 5, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 5, "usage_type": "name" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 8, "usage_type": "call" }, { "api_na...
18382093791
import os import re import pytest from wazuh_testing.modules import TIER1, WINDOWS from wazuh_testing.tools import PREFIX from wazuh_testing.tools.local_actions import run_local_command_returning_output from wazuh_testing.tools.configuration import load_configuration_template, get_test_cases_data from wazuh_testing.mod...
wazuh/wazuh-qa
tests/integration/test_logcollector/test_location/test_win_location_wildcards.py
test_win_location_wildcards.py
py
5,400
python
en
code
29
github-code
21
[ { "api_name": "wazuh_testing.modules.TIER1", "line_number": 11, "usage_type": "name" }, { "api_name": "wazuh_testing.modules.WINDOWS", "line_number": 11, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 14, "usage_type": "call" }, { "api_name":...
73233698294
import json from django.http import HttpResponse from django_swagger_utils.drf_server.utils.decorator.interface_decorator \ import validate_decorator from .validator_class import ValidatorClass from content_management_portal.storages.question_storage_implementation import\ QuestionStorageImplementation from con...
bammidichandini/content_management_portal
content_management_portal/views/create_coding_question_statement/api_wrapper.py
api_wrapper.py
py
1,332
python
en
code
0
github-code
21
[ { "api_name": "content_management_portal.storages.question_storage_implementation.QuestionStorageImplementation", "line_number": 21, "usage_type": "call" }, { "api_name": "content_management_portal.presenters.presenter_implementation.PresenterImplementation", "line_number": 22, "usage_ty...
11772984542
#!/usr/bin/env python # -*- coding:utf-8 -*- # Author: Donny You(youansheng@gmail.com) # Some runner used by main runner. import math import os from collections import OrderedDict import torch import torch.nn as nn from torch.nn.parallel.scatter_gather import gather as torch_gather from lib.tools.helper.dist_helper ...
donnyyou/torchcv
lib/runner/runner_helper.py
runner_helper.py
py
10,705
python
en
code
2,235
github-code
21
[ { "api_name": "torch.device", "line_number": 22, "usage_type": "call" }, { "api_name": "torch.Tensor", "line_number": 29, "usage_type": "attribute" }, { "api_name": "torch.cuda.set_device", "line_number": 35, "usage_type": "call" }, { "api_name": "torch.cuda", ...
1856748682
"""write a function that accepts a number as a parameter. The function should return a number that’s the difference between the largest and smallest numbers that the digits can form in the number. For example, if the parameter is “213”, the function should return “198”, which is the result of 123 subtracted from 321.""...
Edv1nas/Lesson24
exercise_two.py
exercise_two.py
py
793
python
en
code
0
github-code
21
[ { "api_name": "dotenv.dotenv_values", "line_number": 7, "usage_type": "call" } ]
2506650080
import cv2 import pyzbar.pyzbar as pyzbar import numpy as np path = '/Users/rohan/Downloads/images/test4.png' img = cv2.imread(path) d = pyzbar.decode(img) for obj in d: print(obj.data) (x,y,w,h) = obj.rect cv2.rectangle(img, (x,y), (x+w, y+h),(255,0,0), 3) cv2.imshow('image',img) cv2.waitKey(0) cv2.dest...
undercoverMavrick/Adisys
trial6.py
trial6.py
py
363
python
en
code
1
github-code
21
[ { "api_name": "cv2.imread", "line_number": 6, "usage_type": "call" }, { "api_name": "pyzbar.pyzbar.decode", "line_number": 9, "usage_type": "call" }, { "api_name": "pyzbar.pyzbar", "line_number": 9, "usage_type": "name" }, { "api_name": "cv2.rectangle", "line_...
12026172723
""" Definition of views. """ from django.shortcuts import render, get_object_or_404 from django.http import HttpRequest from django.template import RequestContext from django.views import View from datetime import datetime from .models import ImportantButton def home(request): """Renders the home page.""" ass...
seanbraley/DjangoTestProject
DjangoTestProject/app/views.py
views.py
py
2,190
python
en
code
0
github-code
21
[ { "api_name": "django.http.HttpRequest", "line_number": 14, "usage_type": "argument" }, { "api_name": "django.shortcuts.render", "line_number": 15, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 20, "usage_type": "call" }, { "api_nam...
33920249329
import time import pymongo as pmg myclient = pmg.MongoClient("mongodb://localhost:27017/") # 获取数据库列表 dblist = myclient.list_database_names() print(dblist) stock = myclient['stock'] finance = stock['finance'] stockList = stock['list'] # 传入JSON形式的空对象,会删除该集合中所有的数据 # list.delete_many({}) # 锁定一个字段,需要在该字...
BodomLake/stock2
test/mongo-client.py
mongo-client.py
py
1,281
python
en
code
0
github-code
21
[ { "api_name": "pymongo.MongoClient", "line_number": 5, "usage_type": "call" }, { "api_name": "time.time", "line_number": 18, "usage_type": "call" }, { "api_name": "time.time", "line_number": 28, "usage_type": "call" } ]
3609899613
# -*- coding:utf-8 -*- import requests #网页处理模块 import re #正则表达式模块 import code #解决编码错误 page=[] #建立目标网页的列表 for i in range(0,101,50): #手动获取每一页的编页信息 html='http://tieba.baidu.com/f?kw=%E6%9E%97%E6%88%90%E5%88%9A&ie=utf-8&pn='+str(i) #获取网页地址 page.append(html) #逐个添加至目标网页列表当中 #print html.text.encode('utf-8') ...
HYSkyline/baidubbs
baidubbs_title.py
baidubbs_title.py
py
784
python
zh
code
0
github-code
21
[ { "api_name": "requests.get", "line_number": 11, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 12, "usage_type": "call" } ]
33977968659
from django.shortcuts import ( render, redirect, ) from django.urls import ( reverse_lazy ) from .models import Issue from django.contrib.auth.mixins import ( LoginRequiredMixin, UserPassesTestMixin ) from django.views.generic import ( ListView, CreateView, DetailView, DeleteView, )...
ChernovMykola/issue-tracker
issue_app/views.py
views.py
py
1,387
python
en
code
0
github-code
21
[ { "api_name": "django.views.generic.ListView", "line_number": 22, "usage_type": "name" }, { "api_name": "models.Issue", "line_number": 23, "usage_type": "name" }, { "api_name": "models.Issue.objects.all", "line_number": 26, "usage_type": "call" }, { "api_name": "m...
41164427399
import argparse from ..appscale_datastore_batch import DatastoreFactory def main(): parser = argparse.ArgumentParser( description='Checks if the data layout is valid') parser.add_argument('--db-type', help='The database type') args = parser.parse_args() datastore_batch = DatastoreFactory.getDatastore(ar...
HafeezRai/appscale
AppDB/appscale/datastore/scripts/data_layout.py
data_layout.py
py
431
python
en
code
0
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 7, "usage_type": "call" }, { "api_name": "appscale_datastore_batch.DatastoreFactory.getDatastore", "line_number": 12, "usage_type": "call" }, { "api_name": "appscale_datastore_batch.DatastoreFactory", "line_number": 12, ...