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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
17849635757 | from ..config import ElementName as BasicElementName, extract_display_name, ReactionConfig, \
NetworkGeneralConfig, ParameterName
from ..metabolic_network_elements.reaction_element import ReactionElement
class Reaction(object):
def __init__(
self, reaction_name, reversible=False, reaction_start_en... | LocasaleLab/Automated-MFA-2023 | figures/figure_plotting/figure_elements/metabolic_network/metabolic_network_contents/reaction.py | reaction.py | py | 12,308 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "config.extract_display_name",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "config.ReactionConfig.default_display_text_config",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "config.ReactionConfig",
"line_number": 34,
"usage_type... |
12532858756 | from setuptools import setup
with open('README.md') as f:
long_description = f.read()
setup(
name = "moderate",
version = "0.1",
license = 'MIT',
description = "A Python Distrubted System",
author = 'Thomas Huang',
url = 'https://github.com/thomashuang/Moderate',
packages = ['moderat... | whiteclover/Moderate | setup.py | setup.py | py | 676 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "setuptools.setup",
"line_number": 7,
"usage_type": "call"
}
] |
24609091 | from django.contrib.auth.models import User
from django.shortcuts import redirect, render, get_object_or_404
from .models import Post,Comment
from .forms import NewCommentForm
# Create your views here.
from qna.models import Question
from django.http import JsonResponse
from django.contrib.auth.decorators import login... | adityachaudhary147/MindQ | post/views.py | views.py | py | 3,755 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "models.Post",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.redirect",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "models.Post.objects.all",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "models.... |
73360149224 | # django imports
from django.contrib.auth.decorators import permission_required
from django.core.urlresolvers import reverse
from django.forms import ModelForm
from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response
from django.shortcuts import get_object_or_404
from django.template... | django-lfs/lfs | manage/views/static_blocks.py | static_blocks.py | py | 3,646 | python | en | code | 23 | github-code | 36 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "lfs.catalog.models.StaticBlock",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "lfs.catalog.models.StaticBlock.objects.all",
"line_number": 26,
"usage_type": "call... |
73774729063 | import torch
from torch import nn
import torch.nn.functional as F
import os
import math
import numpy as np
from train_pipeline import *
def init_siren(W, fan_in, omega=30, init_c=24, flic=2, is_first=False):
if is_first:
c = flic / fan_in
else:
c = np.sqrt(init_c / fan_in) / omega
W.unif... | kilianovski/my-neural-fields | notebooks/draft_01/sweep_pipeline.py | sweep_pipeline.py | py | 6,628 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.sqrt",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torch.nn.Module",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "torch.nn.Linear",
"line_... |
6187883293 | from __future__ import annotations
from datetime import datetime, time
from discord.ext import tasks
from app.log import logger
from app.utils import is_last_month_day, is_sunday, catch_exception
from app.utils.message_stats_routine import UserStatsForCurrentDay, message_day_counter
from app.utils.data.user_stats im... | range-kun/pituhon-bot | app/utils/message_stats_routine/user_stats_routine.py | user_stats_routine.py | py | 3,790 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "datetime.datetime.now",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "datetime.time",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "datetime.time",... |
2019695848 | #!/usr/bin/env python3.6
# -*-encoding=utf8-*-
import time
import pyquery
import requests
from fake_useragent import UserAgent
from spider.log import logging as log
class Get:
def __init__(self, url: str, try_time=9, try_sec=2):
ua = UserAgent()
self._url = url
self._try_time = try_time
self._try_sec = try_s... | dingjingmaster/library_t | python/spider/spider/get.py | get.py | py | 1,374 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "fake_useragent.UserAgent",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "requests.Session",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "requests.codes",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "pyquery... |
37411929075 | import os
import numpy as np
import matplotlib.pyplot as plt
from hyperion.model import ModelOutput
from hyperion.util.constants import pc
# Create output directory if it does not already exist
if not os.path.exists('frames'):
os.mkdir('frames')
# Open model
m = ModelOutput('flyaround_cube.rtout')
# Read image... | hyperion-rt/hyperion | docs/tutorials/scripts/flyaround_cube_animate.py | flyaround_cube_animate.py | py | 1,402 | python | en | code | 51 | github-code | 36 | [
{
"api_name": "os.path.exists",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.mkdir",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "hyperion.model.ModelOutput",
... |
30586982057 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import wx
from regionfixer_core.version import version_string as rf_ver
from gui.version import version_string as gui_ver
class AboutWindow(wx.Frame):
def __init__(self, parent, title="About"):
wx.Frame.__init__(self, parent, title=title,
... | Fenixin/Minecraft-Region-Fixer | gui/about.py | about.py | py | 2,684 | python | en | code | 509 | github-code | 36 | [
{
"api_name": "wx.Frame",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "wx.Frame.__init__",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "wx.Frame",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "wx.CLOSE_BOX",
"lin... |
70306634025 | from audioop import reverse
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.db import transaction
from django.http.response import HttpResponseRedirect
from django.shortcuts import render, get_object_or_404
from registration.forms import SignupForm
from user.models i... | Hosseinyousefi23/smallApp | registration/views.py | views.py | py | 1,854 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.shortcuts.render",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "registration.forms.SignupForm",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "registration.forms.SignupForm",
"line_number": 19,
"usage_type": "call"
},
{
... |
29084870079 | from sklearn.datasets import fetch_20newsgroups
from sklearn.model_selection import train_test_split
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.naive_bayes import MultinomialNB
from sklearn.metrics import classification_report
def naviebayes():
news = fetch_20newsgroups(data_home='./... | shnehna/machine_study | 朴素贝叶斯算法/NB.py | NB.py | py | 1,039 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sklearn.datasets.fetch_20newsgroups",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sklearn.feature_extraction.text.TfidfVectorizer",
"line_number": ... |
17772414022 | import swapper
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist
from formula_one.mixins.period_mixin import ActiveStatus
def get_role(person, role_name, active_status=ActiveStatus.ANY, silent=False, *args, **kwargs):
"""
Get a role corresponding to ... | IMGIITRoorkee/omniport-backend | omniport/core/kernel/managers/get_role.py | get_role.py | py | 2,280 | python | en | code | 67 | github-code | 36 | [
{
"api_name": "formula_one.mixins.period_mixin.ActiveStatus.ANY",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "formula_one.mixins.period_mixin.ActiveStatus",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "swapper.load_model",
"line_number": 24,
... |
37626028800 | from flask import Blueprint, redirect, render_template, session, url_for
from .forms import InfoForms
from flask_learning.models import Post
from datetime import datetime
date_time = Blueprint('date_time_picker', __name__)
@date_time.route("/dating", methods=['GET', 'POST'])
def select_date_time():
form = InfoFo... | SunnyYadav16/Flask_Learning | flask_learning/date_time_picker/routes.py | routes.py | py | 1,121 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask.Blueprint",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "forms.InfoForms",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "flask.session",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "flask.session",
"lin... |
4814315395 | from selenium import webdriver
from selenium.webdriver.common.by import By
driver = webdriver.Chrome()
driver.get("https://www.example.com")
# Get element with tag name 'div'
element = driver.find_element(By.TAG_NAME, 'div')
# Get all the elements available with tag name 'p'
elements = element.find_elements(... | Duyanhdda/IOT-LAB | a.py | a.py | py | 374 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.common.by.By.TAG_NAME",
"line_number": 8,
"usage_type": "attribute"
},
... |
17878440373 | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
r"""
Measures based on noise measurements
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. _iqms_cjv:
- :py:func:`~mriqc.qc.anatomical.cjv` -- **coefficient of joint variation**
(:abbr:`CJV (coefficient of join... | pGarciaS/PREEMACS | scripts/mriqc/mriqc/qc/anatomical.py | anatomical.py | py | 21,630 | python | en | code | 8 | github-code | 36 | [
{
"api_name": "math.sqrt",
"line_number": 197,
"usage_type": "call"
},
{
"api_name": "math.pi",
"line_number": 197,
"usage_type": "name"
},
{
"api_name": "sys.version_info",
"line_number": 199,
"usage_type": "name"
},
{
"api_name": "math.sqrt",
"line_number": ... |
1379123460 | import cv2
import time
from eye_tracking import EyeTracking
eye_tracking = EyeTracking()
webcam = cv2.VideoCapture(0)
while True:
_, frame = webcam.read()
if frame is None:
break
eye_tracking.refresh(frame)
frame = eye_tracking.annotated_frame()
text = ""
attention_text = ""
if... | dead4s/SpaHeron_MachineLearning_UXIS | eye_tracking/main.py | main.py | py | 2,111 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "eye_tracking.EyeTracking",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "eye_tracking.refresh",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "eye_trac... |
29696828936 | import utils
import numpy as np
def parse_input(path):
lines = utils.read_lines(path)
paths = [[utils.parse_coord_str(p) for p in l.split(" -> ")]
for l in lines]
height = 0
width = 0
for path in paths:
for p in path:
width = max(width, p[0])
height ... | dialogbox/adventofcode | py/2022/day14.py | day14.py | py | 2,028 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "utils.read_lines",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "utils.parse_coord_str",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.concatenate",
... |
39844703302 | """
Iguana (c) by Marc Ammon, Moritz Fickenscher, Lukas Fridolin,
Michael Gunselmann, Katrin Raab, Christian Strate
Iguana is licensed under a
Creative Commons Attribution-ShareAlike 4.0 International License.
You should have received a copy of the license along with this
work. If not, see <http://creativecommons.org... | midas66/iguana | src/common/validators.py | validators.py | py | 986 | python | en | code | null | github-code | 36 | [
{
"api_name": "datetime.date",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "datetime.date.today",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "django.core... |
1641551953 | # -*- coding: utf-8 -*-
import json
from datetime import datetime
from twisted.internet import reactor
from twisted.web.http import BAD_REQUEST
from twisted.web.server import NOT_DONE_YET
from config.config import CHAT_PER_PAGE, CHAT_CONNECTION_INTERVAL
from exception import BadRequest
from helper.chat_cmd import Cha... | PoolC/Yuzuki | resource/chat.py | chat.py | py | 6,624 | python | en | code | 10 | github-code | 36 | [
{
"api_name": "exception.BadRequest",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "helper.resource.YuzukiResource",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "helper.resource.YuzukiResource.__init__",
"line_number": 32,
"usage_type": "call"
}... |
34180539673 | import os
from django.conf import settings
from django.core.management.base import BaseCommand
from django.utils import timezone
from viewer.models import (
Target,
Molecule,
MoleculeTag,
TagCategory
)
from scoring.models import MolGroup
class Command(BaseCommand):
help = 'Add moleculeTag record f... | xchem/fragalysis-backend | viewer/management/commands/tags_from_sites.py | tags_from_sites.py | py | 5,073 | python | en | code | 4 | github-code | 36 | [
{
"api_name": "django.core.management.base.BaseCommand",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "django.utils.timezone.now",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "django.utils.timezone",
"line_number": 26,
"usage_type": "name"
},
... |
71232207785 | import torch
from typing import Optional, Dict, Any, Tuple
from transformers import (
AutoConfig,
AutoTokenizer,
T5ForConditionalGeneration,
MT5ForConditionalGeneration,
MT5EncoderModel
)
from parlai.agents.hugging_face.t5 import T5Agent, ParlaiT5Model
#from transformers.models.mt5.modeling_mt5 imp... | evelynkyl/xRAD_multilingual_dialog_systems | parlai_internal/agents/hugging_face/mt5.py | mt5.py | py | 6,563 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "transformers.models.t5.modeling_t5.T5Stack",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "parlai.core.opt.Opt",
"line_number": 37,
"usage_type": "name"
},
{
"api_n... |
74176385062 | '''
This file is used to ge through and upload metadata to cloud
storage for artist submissions
'''
#imports
import datetime
import os
import firebase_admin
from firebase_admin import credentials, firestore
import google.cloud
# can potentially execute the cloud utils rsync here if we want all in one
# authorizatio... | reyluno/isolatingtogether.github.io | utils/dbUpdate.py | dbUpdate.py | py | 3,428 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "firebase_admin.credentials.Certificate",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "firebase_admin.credentials",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "firebase_admin.initialize_app",
"line_number": 22,
"usage_type": "call"... |
27520982087 | # encoding:utf-8
__author__ = 'shiliang'
__date__ = '2019/4/9 21:12'
import requests
from lxml import etree
import pandas as pd
import xlrd
import time
import re
import aiohttp
import asyncio
# 全局变量
headers = {
'Cookie': 'OCSSID=sfg10a19had6hfavkctd32otf6',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) ... | SparksFly8/DataMingingPaper | spider/metadata_Coroutine_Spider.py | metadata_Coroutine_Spider.py | py | 8,375 | python | zh | code | 69 | github-code | 36 | [
{
"api_name": "asyncio.Semaphore",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "xlrd.open_workbook",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "aiohttp.ClientSession... |
24981710765 | import pandas as pd
import numpy as np
from typing import Tuple
import os
import seaborn as sns
import matplotlib.pyplot as plt
from fancyimpute import IterativeImputer
import sys
sys.path.append('.')
def load_all_data(basepath: str, names_files: list) -> Tuple[pd.DataFrame, pd.DataFrame, pd.DataFrame]:
"""aim... | infini11/MLOps-project | src/preprocessing.py | preprocessing.py | py | 9,913 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sys.path.append",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"lin... |
15556149755 | from __future__ import annotations
import numpy as np
from typing import List
from .meshdata import MeshCode
from . import R, rad2deg, deg2rad
class Point:
def __init__( self,
latitude: float, # <deg>
longitude: float, # <deg>
elevation: float = None, # <me... | kawa-yo/DiamonPearl | engine/utils/point.py | point.py | py | 2,509 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "meshdata.MeshCode",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "numpy.pi",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "numpy.arccos",
"lin... |
43831264470 | from datetime import datetime, timedelta
from enum import Enum
from typing import Any, Dict, List, Optional, Tuple, Type, TypeVar, Union
from uuid import UUID
from eventsourcing.domain.model.aggregate import AggregateRoot
# Locations in the world.
class Location(Enum):
HAMBURG = "HAMBURG"
HONGKONG = "HONGKON... | johnbywater/es-example-cargo-shipping | cargoshipping/domainmodel.py | domainmodel.py | py | 9,436 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "enum.Enum",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "enum.Enum",
"line_number": 37,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 45,
... |
20847546702 | """
Django settings for test_project project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ..... | j00bar/django-hydra | test_project/test_project/settings.py | settings.py | py | 2,762 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.path.dirname",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "dj_database_url.config",
"line_number": 63,
"usage_type": "call"
}
] |
5813639636 | # type: ignore
import os
import pathlib
import subprocess
import gnupg
import pytest
import requests
import toml
def pytest_collect_file(file_path, parent):
if file_path.suffix == ".sh" and file_path.name.startswith("test_"):
return ScriptFile.from_parent(parent, path=file_path)
class ScriptFile(pytes... | pulp/pulp-cli | pytest_pulp_cli/__init__.py | __init__.py | py | 5,190 | python | en | code | 26 | github-code | 36 | [
{
"api_name": "pytest.File",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "pytest.Function",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "subprocess.run",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "pytest.skip",
... |
5756767654 | import base64
import os
from io import BytesIO, StringIO
from pprint import pprint
import easyocr
import pandas as pd
from PIL import Image
import streamlit as st
bn_reader = easyocr.Reader(['bn'], gpu=True)
en_reader = easyocr.Reader(['en'], gpu=True)
def get_nid_image(image_url):
image_data = base64.b64decod... | bhuiyanmobasshir94/Computer-Vision | notebooks/colab/cv/ocr/ekyc/nid_scanner_with_streamlit_app.py | nid_scanner_with_streamlit_app.py | py | 4,287 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "easyocr.Reader",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "easyocr.Reader",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "base64.b64decode",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "io.BytesIO",
"line... |
31952638633 | ''' EXERCÍCIOS:
2) Dado a sequência de Fibonacci, onde se inicia por 0 e 1 e o próximo valor sempre será a soma dos 2 valores anteriores (exemplo: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34...), escreva um programa na linguagem que desejar onde, informado um número, ele calcule a sequência de Fibonacci e retorne uma mensagem avi... | bruno-kilo/FibonacciSequence | Fibonacci.py | Fibonacci.py | py | 4,259 | python | pt | code | 0 | github-code | 36 | [
{
"api_name": "json.load",
"line_number": 38,
"usage_type": "call"
}
] |
23603029370 | # -*- coding: utf-8 -*-
"""
Created on Thu Apr 5 17:05:36 2018
@author: s.jayanthi
"""
import cv2, numpy as np
img = cv2.imread(params.color_transfer_target_label1)
dst = [];
rows,cols = img.shape[0], img.shape[1]
M = cv2.getRotationMatrix2D((cols/2,rows/2),45,1)
for channel in range(img.shape[2]):
d_img = img[:... | murali1996/semantic_segmentation_of_nuclei_images | old_versions/dummy.py | dummy.py | py | 1,372 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "cv2.imread",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.getRotationMatrix2D",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.warpAffine",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.stack",
"l... |
35919457830 | from django.shortcuts import render, redirect
from .models import *
from login.models import *
from django.contrib import messages
from datetime import date, datetime
# Create your views here.
def appointments(request):
if 'user_id' not in request.session:
return redirect('/')
today = datetime.now()
... | AlexUrtubia/appointments | appo_app/views.py | views.py | py | 3,521 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.shortcuts.redirect",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "dja... |
42354884711 | from openpyxl import Workbook, load_workbook
target_workbook = Workbook()
sheet=target_workbook.active
sheet["A1"]="Номер заказа у партнера"
sheet["B1"]="Номер сертификата" # номер сертификата
sheet["C1"]="Продукт в системе партнера" #назначение платежа
sheet["D1"]="Код продукта в BD"
sheet["E1"]="Дата начала действи... | Mi6k4/programming_stuff | coding_stuff/python/opnepyexl/morphing.py | morphing.py | py | 1,960 | python | ru | code | 0 | github-code | 36 | [
{
"api_name": "openpyxl.Workbook",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "openpyxl.load_workbook",
"line_number": 29,
"usage_type": "call"
}
] |
19993372010 | import re
import argparse
import japanize_matplotlib
import matplotlib.pyplot as plt
from moviepy.editor import VideoClip
from moviepy.video.io.bindings import mplfig_to_npimage
def validate_date(date):
if re.match(r"^\d{4}/\d{1,2}/\d{1,2}", date):
return date
else:
raise argparse.ArgumentTyp... | HRTK92/line-to-movie | line_to_video.py | line_to_video.py | py | 5,704 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "re.match",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentTypeError",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "re.match"... |
4421637196 | from flask import Flask, request, jsonify;
import requests
from flask_cors import CORS
app = Flask(__name__)
CORS(app)
base_url = 'https://coronavirus-19-api.herokuapp.com'
@app.route('/get-all-cases')
def get_all_cases():
all_cases = requests.get(base_url + '/countries').json()
return jsonify(all_cases)
@app... | Rhukie/hw4_9pk6vl43kh | covid-api/app.py | app.py | py | 1,178 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask.jsonify",
"line_numb... |
29085620425 | import random
from threading import Timer
from typing import Union, List
from zone_api.audio_manager import Genre, get_music_streams_by_genres, get_nearby_audio_sink
from zone_api.core.devices.weather import Weather
from zone_api.core.parameters import ParameterConstraint, positive_number_validator, Parameters
from zo... | yfaway/zone-apis | src/zone_api/core/actions/announce_morning_weather_and_play_music.py | announce_morning_weather_and_play_music.py | py | 5,234 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "zone_api.core.action.Action",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "zone_api.core.action.Action.supported_parameters",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "zone_api.core.action.Action",
"line_number": 26,
"usage_type... |
553309764 | """序列化练习"""
# pickle
import json
import pickle
d = dict(name='Bob', age=20, acore=80)
f = open('dump.txt', 'wb')
pickle.dump(d, f)
f.close()
f = open('dump.txt', 'rb')
d = pickle.load(f)
print(d)
# json
d = dict(name='Bob', age=20, acore=80)
print(json.dumps(d))
# JSON进阶
# class序列化和反序列化
class Student(object):
... | xuxinyu2020/my-python-work | practice/24pickle_json.py | 24pickle_json.py | py | 1,040 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pickle.dump",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 41,... |
36635799452 | from cmath import exp
from email import message
import ssl, socket
import requests
from dateutil import parser
import pytz
import datetime, time
import telegram
requests.packages.urllib3.disable_warnings()
try:
_create_unverified_https_context = ssl._create_unverified_context
except AttributeError... | coeus-lei/python | domain-ssl-check/domain-ssl.py | domain-ssl.py | py | 2,862 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "requests.packages.urllib3.disable_warnings",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "requests.packages",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "ssl._create_unverified_context",
"line_number": 13,
"usage_type": "attr... |
35001350068 | import os
import struct
import numpy as np
# Based on https://gist.github.com/akesling/5358964 which is in return
# loosely inspired by http://abel.ee.ucla.edu/cvxopt/_downloads/mnist.py
# which is GPL licensed.
def read(dataset = "training", path = "."):
# Python function for importing the MNIST data set. It re... | CaptainProton42/MNISTFromScratch | modules/mnist.py | mnist.py | py | 1,898 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "os.path.join",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 1... |
24643892493 | import sqlite3
class OperationDB(object):
def get_conn(self):
'''连接数据库'''
conn = sqlite3.connect('cltdata.db')
return conn
def get_cursor(self):
'''创建游标'''
conn = self.get_conn()
#print('执行游标')
return conn.cursor()
def close_all(self, conn, cu):
'''关闭数据库游标对象和数据库连接对象'''
try:
i... | weijingwei/liwei_python | ASTM2/Operation_db.py | Operation_db.py | py | 4,387 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sqlite3.connect",
"line_number": 6,
"usage_type": "call"
}
] |
40280870495 | import cv2
import numpy as np
import argparse
import random
import os
import os.path as osp
from sklearn.feature_extraction import image
# import imutils
from tqdm import tqdm,trange
# argument parser
'''
dataNum: How many samples you want to synthesize
load_image_path: Path to l... | Chushihyun/MT-DETR | data/datagen_fog.py | datagen_fog.py | py | 6,879 | python | en | code | 22 | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.random.uniform",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 45,
"usage_type": "attribute"
},
{
"api_name": "numpy.... |
39660535041 | from collections import deque
class Solution:
def networkDelayTime(self, times: List[List[int]], n: int, k: int) -> int:
reach = {}
for time in times:
if time[0] in reach:
reach[time[0]].append([time[2], time[1]])
else:
reach[time[0]] = [[time... | deusi/practice | 743-network-delay-time/743-network-delay-time.py | 743-network-delay-time.py | py | 1,034 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "collections.deque",
"line_number": 15,
"usage_type": "call"
}
] |
7963630141 | from tkinter import *
from tkinter.font import Font
import numpy as np
import itertools as itr
import os
kryteria = ['rowery', 'telewizory', 'książki', 'telefony', 'drukarki']
#kryteria = ['rowery', 'telewizory', 'telefony']
kryteria_d = { i : "%.2f" % (1/len(kryteria)) for i in kryteria}
kryteriaKomb =list... | kwiecien-rafal/optymalizator-prezentow | AHP tkinter.py | AHP tkinter.py | py | 5,843 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "itertools.combinations",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.ones",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "numpy.true_divide",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"... |
29909677781 | # -*- coding: utf-8 -*-
import os
import sys
import math
import copy
import random
import timeit
import argparse
import numpy as np
import tensorflow as tf
from ..model import mlp_rel
from ..lib.data_utils import load_prop
from ..lib.utils import makedirs
if __name__ == '__main__':
parser = argparse.ArgumentPars... | fzc621/CondPropEst | src/arxiv_obj/cpbm.py | cpbm.py | py | 3,915 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "timeit.default_timer",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "lib.utils.makedirs",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "tenso... |
3406969266 | """
main.py
train the deep iamge prior model and get the denoised figure, calculate PSNR when required.
"""
import hydra
from pytorch_lightning import Trainer, seed_everything
from src.conf import Config
from src.data.datamodule import DeepImagePriorDataModule
from src.model.model import DeepImagePriorModel
import l... | ziyixi/Deep-Image-Prior-Pytorch-Lightning | main.py | main.py | py | 1,640 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "logging.ERROR",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "src.conf.Config",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "pytorch_lightnin... |
25718308081 | read_me = """Python 3 script that logs data from the Meraki dashboard into a MongoDB database.
You will need to have MongoDB installed and supply a configuration file for this script to run.
You can get the MongoDB Community Server here: https://www.mongodb.com/try/download/community
You can find a sample configurat... | meraki/automation-scripts | offline_logging/offline_logging.py | offline_logging.py | py | 24,201 | python | en | code | 361 | github-code | 36 | [
{
"api_name": "requests.Session",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "urllib.parse.urlencode",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 125,
"usage_type": "call"
},
{
"api_name": "requests.utils.pa... |
8531279483 | import numpy as np
import galois
from nacl.public import PrivateKey, Box
from io import BytesIO
import cProfile
import re
# A library for Shamir sharing arrays of field elements
# - An ArrayShare object is one share of the whole array
# - ArrayShare objects have encrypt and decrypt methods
# - share_array secret sh... | uvm-plaid/olympia | util/shamir_sharing.py | shamir_sharing.py | py | 4,835 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "numpy.ndarray",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "io.BytesIO",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.save",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "io.BytesIO",
"line_numbe... |
22565649698 | from typing import Any, Callable, Dict, Optional
import torch
import torch.nn as nn
from .gaussian_diffusion import GaussianDiffusion
from .k_diffusion import karras_sample
DEFAULT_KARRAS_STEPS = 64
DEFAULT_KARRAS_SIGMA_MIN = 1e-3
DEFAULT_KARRAS_SIGMA_MAX = 160
DEFAULT_KARRAS_S_CHURN = 0.0
def uncond_guide_model(
... | openai/shap-e | shap_e/diffusion/sample.py | sample.py | py | 2,871 | python | en | code | 10,619 | github-code | 36 | [
{
"api_name": "typing.Callable",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "torch.Tensor",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "torch.cat",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "torch.chunk",
"line_n... |
20039489365 | from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from builtins import open
from builtins import super
from builtins import str
from future import standard_library
from future.utils import with_metaclass
standard_library.... | kineticadb/kinetica-api-python | gpudb/packages/avro/avro_py3/ipc.py | ipc.py | py | 21,544 | python | en | code | 13 | github-code | 36 | [
{
"api_name": "future.standard_library.install_aliases",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "future.standard_library",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",
"line_number": 24,
"usage_type": "call"
},
{
... |
32187575097 | import asyncio
import aiohttp
from warnings import warn
with open("vk_access_token.txt", mode="r") as file:
vk_access_token = file.read()
vk_api_version = "5.154"
owner_id = "-160464793"
url = f"https://api.vk.ru/method/wall.get?v={vk_api_version}&owner_id={owner_id}&count=1&access_token={vk_access_token}"
as... | SaGiMan6/sesc-nsu-assistant-bot | scripts/morning_exercise_operations.py | morning_exercise_operations.py | py | 1,353 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "aiohttp.ClientSession",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "asyncio.sleep",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "warnings.warn",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "asyncio.gather",
... |
18400663422 | import os
from fastapi import status, HTTPException
from pydantic import BaseModel, validator
from typing import Union
ROOT_DIR = os.path.abspath('.')
ROOT_DIR = os.path.join(ROOT_DIR, 'assets')
PATH_REGEX = r'^(?![0-9._/])(?!.*[._]$)(?!.*\d_)(?!.*_\d)[a-zA-Z0-9_/]+$'
class Predicted(BaseModel):
recognized: Unio... | watcharap0n/api-facial-recognition-dlib | service-rec/server/schemas/predict.py | predict.py | py | 1,636 | python | en | code | 1 | github-code | 36 | [
{
"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": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 7... |
73577910183 | import os, sys
import numpy as np
import pickle
from UserCode.HGCalMaskResolutionAna import Argparser
from array import array as Carray
from collections import OrderedDict
from ROOT import TCanvas, TLatex, TFile, TMath, TH1F
from ROOT import TLegend, TH2F, TLorentzVector, TProfile, TH1D, TGraphErrors
from ROOT import ... | bfonta/HGCal | HGCalMaskResolutionAna/scripts/analysis.py | analysis.py | py | 30,149 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "UserCode.HGCalMaskVisualProd.RootPlotting.RootPlotting",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "ROOT.TLegend",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "ROOT.TLegend",
"line_number": 60,
"usage_type": "call"
},
{
"... |
4401153009 | import requests
from bs4 import BeautifulSoup
import re
from googlesearch import search
def remove_tags(text):
TAG_RE = re.compile(r'<[^>]+>')
return TAG_RE.sub('', text)
def spamcalls(num):
lists = []
r = requests.get("https://spamcalls.net/en/search?q={}".format(num))
if r.status_code == 200:
... | 742fool/DeadTrapv2 | website/backend/scanners/fraud.py | fraud.py | py | 1,708 | python | en | code | null | github-code | 36 | [
{
"api_name": "re.compile",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_num... |
36408696267 | from django.urls import path
from . import views
app_name = 'assure'
urlpatterns = [
path('', views.IndexView.as_view(), name='index'),
path('<int:pk>/detail/', views.DetailView.as_view(), name='detail'),
path('<int:pk>/results/', views.ResultsView.as_view(), name='results'),
path('<int:site_id>/comme... | chadwickcheney/SeleniumTests | assure/urls.py | urls.py | py | 360 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
42600435981 | #!/usr/bin/env python3
import os, psutil, signal
import sys
import fcntl
import pytz
import time
from datetime import datetime
import multiprocessing
from multiprocessing import Queue
import subprocess, shlex
import atexit
import signal
import socketserver
import socket
import re
import shutil
def getTaipeiTime():
... | TibaChang/ThesisTools | PassInstrument/training/Lib.py | Lib.py | py | 15,026 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "datetime.datetime.now",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "pytz.timezone",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.waitpid",
... |
29620338632 | # -*- coding: utf-8 -*-
from selenium import webdriver
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from lxml import etree
import time
import xlsxwriter
options = webdriver.ChromeOptions()
# 找到本地安... | hua345/myBlog | python/selenium/baidu.py | baidu.py | py | 2,515 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "selenium.webdriver.ChromeOptions",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 19,
"usage_type": "call"
},
{
"api... |
42248140291 | import json
from rdflib import Graph, Namespace, Literal, URIRef, XSD
from rdflib.namespace import XSD
# Mapping of codes to (image) annotation types
annotation_codes_classes = [("evoked_clusters", "ACVisualEvocation"), ("as", "ArtStyle"), ("act", "Action"), ("age","Age"), ("color", "Color"), ("em", "Emotion"), ("ic",... | delfimpandiani/ARTstract-KG | ARTstract-KG_creation/ARTstract_kg_construction/real_kg_construction/img_acve.py | img_acve.py | py | 4,284 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "rdflib.Namespace",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "rdflib.Namespace",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "rdflib.Namespace",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "rdflib.Namespace",... |
12198099018 | #!/usr/bin/python
import os
import sqlite3, time, re
import subprocess
from random import randint
from Scan_lib import Scan_Receive_sms, Scan_Smstome_sms
def Scansione(conn):
cursor = conn.execute("SELECT Subdomain, Number FROM Anagrafica")
cursor.fetchone()
for row in cursor:
if "receive-smss.com" in row:
S... | fulgid0/ASMS_discovery | ASMS_discover.py | ASMS_discover.py | py | 3,154 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "Scan_lib.Scan_Receive_sms",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "Scan_lib.Scan_Smstome_sms",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "o... |
41612108456 | ###################################################################
###################################################################
#
# DISCLAIMER:
# THIS IS A PROOF OF CONCEPT AND AS A RESULT, IS AN UGLY, HACKED TOGETHER MESS.
# IN NO WAY SHOULD THIS BE CONFUSED WITH 'GOOD' CODE.
#
# SORRY.
# -Deve... | deveyNull/phist | hashFunk.py | hashFunk.py | py | 7,822 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "imgHash.average_hash",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "time.strftime",
"li... |
759288278 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import datetime
from sqlalchemy import Column, String, create_engine, Integer, TIMESTAMP, func, Float, desc, Boolean
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
from flask import Flask, render_template, reque... | DxfAndCxx/calendar | app.py | app.py | py | 1,565 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "sqlalchemy.ext.declarative.declarative_base",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "flask_script.Manager",
"line_number": 17,
"usage_type": "call"
},
{
"api_... |
25161881681 | import base64
import binascii
from typing import List
import falcon
import hashlib
import hmac
import json
import logging
from botocore.exceptions import ClientError
from dacite import Config, from_dict
from dataclasses import asdict
from enum import Enum
from adyen_gift_card.api.adyen_notifications.request import... | NewStore/int-cinori | integrations/adyen_gift_card/adyen_gift_card/api/adyen_notifications/adyen_notifications.py | adyen_notifications.py | py | 4,418 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "adyen_gift_card.api.adyen_notifications.resources.NotificationsCredentials",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "adyen_gift_card.api.adyen_notifications.resources.Qu... |
13989867732 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import logging
import aiomysql
from webapp.www.fields import Field
logging.basicConfig(level=logging.INFO)
__pool = None
def log(sql, args=None):
logging.info('SQL: [%s] args: %s' % (sql, args or []))
# 创建全局连接池__pool,缺省情况下将编码设置为utf8,自动提交事务
# 每个HTTP请求都可以从连接池中直... | shellever/Python3Learning | webapp/www/orm.py | orm.py | py | 11,391 | python | zh | code | 0 | github-code | 36 | [
{
"api_name": "logging.basicConfig",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "logging.info",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "logging.info",
... |
32199916820 | import muesli_functions as mf
import scipy as sp
# Load samples
X,Y = mf.read2bands("../Data/grassland_id_2m.sqlite",70,106)
ID = []
# Compute NDVI
NDVI = []
for i in xrange(len(X)):
X_ = X[i]
# Compute safe version of NDVI
DENOM = (X_[:,1]+X_[:,0])
t = sp.where(DENOM>0)[0]
NDVI_ = (X_[t,1]-X... | mfauvel/GrasslandsSympa | Codes/filter_id.py | filter_id.py | py | 672 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "muesli_functions.read2bands",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "scipy.where",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "scipy.mean",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "scipy.newaxis",
... |
26236843242 | from django.contrib.auth.models import Group
from django.core.checks import messages
from django.core.files.images import ImageFile
from django.shortcuts import redirect, render
from django.http import HttpResponse, JsonResponse
from core.models import *
from core.forms import *
from django.contrib import messages
from... | felipe-quirozlara/changewear-django | changeWear/pages/views.py | views.py | py | 16,865 | python | es | code | 0 | github-code | 36 | [
{
"api_name": "django.shortcuts.render",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 71,
"usage_type": "call"
},
{
"api_name"... |
29909656261 | # -*- coding: utf-8 -*-
import os
import sys
import csv
import random
import timeit
import numpy as np
import argparse
import multiprocessing as mp
from ..lib.utils import makedirs
click_field_name = ["date", "format", "paper", "ip", "mode", "uid", "session",
"port", "id", "useragent", "usercookie... | fzc621/CondPropEst | src/arxiv_match/bootstrap_swap.py | bootstrap_swap.py | py | 4,987 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "multiprocessing.Process",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
... |
21393799623 | """
21.vek API Client
"""
from typing import Optional, Tuple
from bgd.constants import TWENTYFIRSTVEK
from bgd.responses import GameSearchResult, Price
from bgd.services.api_clients import JsonHttpApiClient
from bgd.services.base import GameSearchService
from bgd.services.constants import GET
from bgd.services.respons... | ar0ne/bg_deal | bgd/services/apis/twenty_first_vek.py | twenty_first_vek.py | py | 2,730 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "bgd.services.api_clients.JsonHttpApiClient",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "bgd.services.constants.GET",
"line_number": 23,
"usage_type": "argument"
},
... |
3097533124 | import rospy, math, numpy, tf
from collections import deque
from spencer_bagfile_tools.msg import AdditionalOdometryData
from dynamic_reconfigure.server import Server
from spencer_bagfile_tools.cfg import ReconstructOdometryConfig
from visualization_msgs.msg import MarkerArray, Marker
from geometry_msgs.msg import Poi... | spencer-project/spencer_people_tracking | utils/spencer_bagfile_tools/scripts/reconstruct_odometry.py | reconstruct_odometry.py | py | 11,138 | python | en | code | 620 | github-code | 36 | [
{
"api_name": "rospy.Time",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "rospy.Publisher",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "visualization_msgs.msg.MarkerArray",
"line_number": 39,
"usage_type": "argument"
},
{
"api_name": "ros... |
71903386024 | from typing import Tuple, Union, Dict
import numpy as np
import torch as th
from gym import spaces
from torch.nn import functional as F
def preprocess_obs(obs: Union[th.Tensor, Dict, Tuple], observation_space: spaces.Space,
normalize_images: bool = True, allow_unexpected: bool = True) -> th.Tensor... | buoyancy99/unsup-3d-keypoints | algorithms/common/utils.py | utils.py | py | 2,559 | python | en | code | 38 | github-code | 36 | [
{
"api_name": "typing.Union",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "torch.Tensor",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "typing.Dict",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_numb... |
34976365352 | #!/usr/bin/env python3
import requests
url = "http://10.10.90.182:8000"
url_= "https://10.10.90.182:1443/index.php"
header={'User-Agent':'<?php echo system($_REQUEST["c"];) ?>'}
r = requests.get(url_ + "?c=id", headers=header, verify=False)
print(r.text)
| lodwig/TryHackMe | Probe/check.py | check.py | py | 258 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "requests.get",
"line_number": 9,
"usage_type": "call"
}
] |
40193585375 | import xlrd
from account.backend.services import StateService
def read_data_from_excel(excel_file):
# reads data from an excel_file
file_path = str(excel_file)
# create a workbook using the excel file received
w_book = xlrd.open_workbook(file_path)
# open the excel_sheet with the data
sheet = w_book.sheet_... | Trojkev/kev-music | music/backend/albums_script.py | albums_script.py | py | 811 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "xlrd.open_workbook",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "account.backend.services.StateService",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "music.models.Album",
"line_number": 25,
"usage_type": "call"
}
] |
30372123851 | import sys
import cv2
import numpy as np
import Analyzer
from learning import Parameters
import FeatureDebug
WINDOW = 'Options'
PARAM1 = '1) Param 1'
PARAM2 = '2) Param 2'
MIN_RAD = '3) Minimum Radius'
MAX_RAD = '4) Maximum Radius'
WINDOW_BOUND = '5) Top Left Window Px'
WINDOW_BOUND2 = '6) Top Right Window px'
HOU... | vicidroiddev/eyeTracking | Fokus/debug/DebugOptions.py | DebugOptions.py | py | 4,149 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "FeatureDebug.TRACKBAR",
"line_number": 42,
"usage_type": "attribute"
},
{
"api_name": "learning.Parameters.HoughParamaters.getParams",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "learning.Parameters.HoughParamaters",
"line_number": 47,
"usage_... |
20961161383 | # Author:HU YUE
import pickle
import os
import sys
import logging
import random
BASE_DIR=os.path.dirname(os.path.dirname( os.path.abspath(__file__) ))
sys.path.append(BASE_DIR)
def loadd(f_all,name):
with open("%s.txt"%name, 'wb')as f:
pickle.dump(f_all, f)
# def nadd(wood):
# with open("%s.txt"%nam... | 001fly/-Module-two-operation | Atm/core/account1.py | account1.py | py | 6,440 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.path.dirname",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sys.path.append",
"line... |
14991188051 | #
# Copyright (C) 2012 ESIROI. All rights reserved.
# Dynamote is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# Dynamote is di... | maxajeanaimee/Domotique_multimedia | stb_process.py | stb_process.py | py | 4,488 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "zmq.Context",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "zmq.PUB",
"line_number": 54,
"usage_type": "attribute"
},
{
"api_name": "zmq.SUB",
"line_number": 55,
"usage_type": "attribute"
},
{
"api_name": "zmq.PULL",
"line_number": 5... |
850417471 | #pylint:disable=no-member
import cv2 as cv
# Blurring is used to smooth the image by removing noice from the image
img = cv.imread('../Resources/Photos/cats.jpg')
cv.imshow('Cats', img)
# kernel window size (ksize) ask for rows and columns and the blurring algo work on that kernal window through the whole image
# A... | dheeraj120501/Lets-Code | 06-Cool Things Computer Can't Do/03-Computer Vision with OpenCV/2-Advanced/03-blurring.py | 03-blurring.py | py | 677 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "cv2.imread",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.blur",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 13,
... |
34620777008 | import json
def make_func(name, inputs, outputs, mutability):
# For now, pass all hints, and I'll manually drop those that aren't needed.
header = f"""
@{mutability}
func {name[0:-1]}{{syscall_ptr: felt*, pedersen_ptr: HashBuiltin*, bitwise_ptr: BitwiseBuiltin*, range_check_ptr
}} ({', '.join([f"{inp['name... | briqNFT/briq-protocol | briq_protocol/generate_interface.py | generate_interface.py | py | 2,004 | python | en | code | 63 | github-code | 36 | [
{
"api_name": "json.load",
"line_number": 24,
"usage_type": "call"
}
] |
2848097490 | import tensorflow as tf
import argparse
import pandas as pd
import numpy as np
from PIL import Image, ImageDraw, ImageEnhance
from tqdm import tqdm
from model import *
from losses import *
import albumentations as albu
args = argparse.ArgumentParser(description='Process Training model')
args.add_argument('-i','--img... | SandiRizqi/OBJECT-DETECTION-YOLO-ALGORITHM-FOR-AERIAL-IMAGERY_FROM-SCRATCH | train_yolo.py | train_yolo.py | py | 9,124 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "numpy.unique",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "numpy.unique",
... |
43916018301 | from functools import lru_cache
MOD = 10 ** 9 + 7
class Solution:
def findPaths(self, m, n, maxMove, startRow, startColumn):
@lru_cache(None)
def rec(sr, sc, mm):
if sr < 0 or sr >= m or sc < 0 or sc >= n:
return 1
if mm == 0: return 0
... | robinsdeepak/leetcode | 576-out-of-boundary-paths/576-out-of-boundary-paths.py | 576-out-of-boundary-paths.py | py | 604 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "functools.lru_cache",
"line_number": 8,
"usage_type": "call"
}
] |
11379198461 | from django.views.generic import ListView
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.db.models import Count
from guesswho.core.models import (Game, Question, Trait, Trai... | schallis/guesswho | guesswho/core/views.py | views.py | py | 2,911 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.views.generic.ListView",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "guesswho.core.models.Game.objects.filter",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "guesswho.core.models.Game.objects",
"line_number": 19,
"usage_type... |
19213479137 |
import os.path
from os import listdir
from os.path import isfile, join
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import style
import cv2
from sklearn.svm import SVC
import hog
def get_good_train_set(directory="./NICTA/TrainSet/PositiveSamples"):
test_files = [join(directory, image) for ... | insomaniacvenkat/HOG | svm_train.py | svm_train.py | py | 4,128 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.path.join",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_numbe... |
32704563511 | from scipy.signal import hilbert
import numpy as np
import matplotlib.pyplot as plt
def compare_elements(array1, array2): # array1和array2大小相同
array = np.zeros(len(array1))
for i in range(len(array1)):
if array1[i] == array2[i]:
array[i] = 0
elif array1[i] > array2[i]:
... | sheep9159/click_number | function_connective.py | function_connective.py | py | 2,127 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.zeros",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.zeros_like",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "scipy.signal.hilbert",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.unwrap",
"... |
5353638973 | # coding: utf-8
"""
NGSI-LD metamodel and Sensor NGSI-LD custom model
ETSI GS CIM 009 V1.6.1 cross-cutting Context Information Management (CIM); NGSI-LD API; NGSI-LD metamodel and Sensor NGSI-LD custom model. # noqa: E501
The version of the OpenAPI document: 1.6.1
Generated by OpenAPI Generator (htt... | daniel-gonzalez-sanchez/ngsi-ld-client-tester | ngsi-ld-models/ngsi_ld_models/models/replace_attrs_request.py | replace_attrs_request.py | py | 7,277 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pydantic.BaseModel",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 37,
"usage_type": "name"
},
{
"api_name": "ngsi_ld_models.models.property_fragment_input.PropertyFragmentInput",
"line_number": 37,
"usage_type":... |
35599175738 | # Standardize time series data
from pandas import Series
from sklearn.preprocessing import StandardScaler
from math import sqrt
# load the dataset and print the first 5 rows
series = Series.from_csv('daily-minimum-temperatures-in-me.csv', header=0)
print(series.head())
# 准备数据
values = series.values
values = values.resh... | yangwohenmai/TimeSeriesForecasting | 数据准备/标准化和归一化/标准化.py | 标准化.py | py | 727 | python | en | code | 183 | github-code | 36 | [
{
"api_name": "pandas.Series.from_csv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pandas.Series",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "sklearn.preprocessing.StandardScaler",
"line_number": 12,
"usage_type": "call"
},
{
"api_name"... |
10021006698 | """
data_metrics_calculation_ingestion.py
=====================================
This module contains code to fetch weather data records and calculate relevant analytics and save it to the database.
"""
import argparse
from typing import Any
import pandas as pd
from sqlalchemy import create_engine
from sqlalchemy.orm ... | pri2si17-1997/weather_data_processing | src/data_metrics_calculation_ingestion.py | data_metrics_calculation_ingestion.py | py | 3,490 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "typing.Any",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "data_models.WeatherData",
"line_number": 29,
"usage_type": "argument"
},
{
"api_name": "pandas.DataFrame",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "pandas.to_dat... |
72135965225 | import numpy as np
from scipy.stats import bernoulli, binom
# Parâmetros da distribuição de Bernoulli
p = 0.5 # Probabilidade de sucesso
# Número de rodadas no jogo
num_rodadas = 5
pontuacao = 0
print("Bem-vindo ao jogo de adivinhação!")
print(f"Você tem {num_rodadas} rodadas para adivinhar o resultado de uma distr... | Dhisting1/Estatisca-Python | Estatistica-Python/gameDIstribuiçãoBernoulli.py | gameDIstribuiçãoBernoulli.py | py | 1,430 | python | pt | code | 0 | github-code | 36 | [
{
"api_name": "scipy.stats.bernoulli.rvs",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "scipy.stats.bernoulli",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "scipy.stats.binom.pmf",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": ... |
4000749197 | # -*- coding: utf-8 -*-
"""Dataset methods for natural language inference.
Tokenization -> lower casing -> stop words removal -> lemmatization
Authors:
Fangzhou Li - fzli@ucdavis.edu
Todo:
* TODOs
"""
import torch
from torch.utils.data import Dataset, DataLoader
from torch.nn.utils.rnn import pad_sequence
f... | IBPA/SemiAutomatedFoodKBC | src/entailment/_dataset.py | _dataset.py | py | 8,558 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 50,
"usage_type": "name"
},
{
"api_name": "transformers.PreTrainedTokenizerBase",
"line_number": 67,
"usage_type": "name"
},
{
"api_name": "torch.LongTensor",
"line_number": 74,
"usage_type": "call"
},
{
"ap... |
27103951389 | from flask import (
Blueprint, redirect, url_for
)
from Glastore.models.product import Product, product_heads
from Glastore.models.window import Window
from Glastore.views.auth import login_required
bp = Blueprint('product', __name__, url_prefix='/product')
@bp.route('/select_next_window/<int:id>')
@login_requir... | ChrisPoul/Glastore | Glastore/views/product.py | product.py | py | 950 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "flask.Blueprint",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "Glastore.models.product.Product.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "Glastore.models.product.Product",
"line_number": 14,
"usage_type": "name"
},
{
... |
15062131417 | import requests
import pandas
import datetime_translator
brandIds = { 202, 88, 31, 123, 101, 122, 36, 48, 135 }
data = {}
for brandId in brandIds:
headers = { 'User-Agent': '', 'content-type': 'application/json' }
jsonData = '{"variables":{"area":"salt-lake","brandId":%d,"countryCode":"US","criteria":{"locat... | ryanbarlow1/cheapest_gas_prices | get_gas_prices.py | get_gas_prices.py | py | 2,836 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "requests.post",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "datetime_translator.translate",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 30,
"usage_type": "call"
}
] |
21413366584 | import pydot
DEFAULT_NODE_ATTRS = {
'color': 'cyan',
'shape': 'box',
'style': 'rounded',
'fontname': 'palatino',
'fontsize': 10,
'penwidth': 2
}
def node_label(token):
try:
label = token._.plot['label']
except:
label = '{0} [{1}]\n({2} / {3})'.format(
toke... | cyclecycle/visualise-spacy-tree | visualise_spacy_tree/visualise_spacy_tree.py | visualise_spacy_tree.py | py | 1,757 | python | en | code | 7 | github-code | 36 | [
{
"api_name": "pydot.Dot",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "pydot.Node",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "pydot.Edge",
"line_number": 63,
"usage_type": "call"
}
] |
30857649928 | import json
import shutil
import hashlib
import os
def get_hash_md5(filename):
with open(filename, 'rb') as f:
m = hashlib.md5()
while True:
data = f.read(8192)
if not data:
break
m.update(data)
return m.hexdigest()
with open('sourse.js... | AlexVorobushek/UpdateFilesOnFlashDrive | main.py | main.py | py | 1,422 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "hashlib.md5",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path.isdir",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 25,
... |
14002518900 | import requests
import os
import re
from lxml import etree
def ParseHTML(url):
rawDoc = requests.get(url).text
html = etree.HTML(rawDoc)
return html
class Comic():
def __init__(self):
self.baseurl = "https://manhua.fzdm.com/39/"
self.baseimgurl = "https://p5.manhuapan.com/"
s... | Rickenbacker620/Codes | Python/Comic/comic.py | comic.py | py | 2,192 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "requests.get",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "lxml.etree.HTML",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "lxml.etree",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "requests.get",
"line_number"... |
69826427303 | import setuptools
with open('README.md', 'r') as f:
long_description = f.read()
setuptools.setup(
name='coropy',
version='0.0.1',
author='Ante Lojic Kapetanovic',
author_email='alojic00@fesb.hr',
description='A set of Python modules for COVID-19 epidemics modeling',
long_description=long_... | akapet00/coropy | setup.py | setup.py | py | 860 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "setuptools.setup",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 16,
"usage_type": "call"
}
] |
74353820583 | import torch
from numbers import Number
import numpy as np
class RandomMasking(torch.nn.Module):
"""
Random Masking from the paper "Hide-and-Seek: Forcing a Network to be Meticulous for
Weakly-supervised Object and Action Localization"
"""
def __init__(self, p_mask, patch_size, value):
"""
... | faberno/SurgicalToolLocalization | transforms/RandomMasking.py | RandomMasking.py | py | 2,599 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "torch.nn",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "numbers.Number",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "numbers.Number",
"line_number": 22,
"usage_type": "argument"
},
{
"api_name": "torch.permute",
"l... |
19262622912 | from datetime import datetime, timedelta
from pokemongo_bot import inventory
from pokemongo_bot.base_task import BaseTask
from pokemongo_bot.worker_result import WorkerResult
from pokemongo_bot.tree_config_builder import ConfigException
class ShowBestPokemon(BaseTask):
"""
Periodically displays the user best... | PokemonGoF/PokemonGo-Bot | pokemongo_bot/cell_workers/show_best_pokemon.py | show_best_pokemon.py | py | 5,191 | python | en | code | 3,815 | github-code | 36 | [
{
"api_name": "pokemongo_bot.base_task.BaseTask",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "pokemongo_bot.worker_result.WorkerResult.SUCCESS",
"line_number": 61,
"usage_type": "attribute"
},
{
"api_name": "pokemongo_bot.worker_result.WorkerResult",
"line_number... |
27293090578 | from django.conf import settings
from django.core.exceptions import ValidationError
# from django.core.validators import MinValueValidator
from django.db import models
from trip.validators import validator_datetime
from users.models import User
class Company(models.Model):
name = models.CharField(
max_le... | ZOMini/avia_trip | avia/trip/models.py | models.py | py | 5,272 | python | ru | code | 0 | github-code | 36 | [
{
"api_name": "django.db.models.Model",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 11,
"usage_type": "call"
},
{
"api_name"... |
29557430446 | import os
import sys
from typing import Optional
from brownie import network, accounts
def network_name() -> Optional[str]:
if network.show_active() is not None:
return network.show_active()
cli_args = sys.argv[1:]
net_ind = next(
(cli_args.index(arg) for arg in cli_args if arg == "--netwo... | lidofinance/curve-rewards-manager | utils/config.py | config.py | py | 1,846 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "brownie.network.show_active",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "brownie.network",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "brownie.network.show_active",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "... |
40588074038 | import cadquery as cq
from math import sin, pi
import numpy as np
plateRadius = 15
plateCenterHole = 4
pinRadius = 3.5/2
pinInter = 18
SCALE= 100 # scale profile dimentions
# input data from csv file of wing profile
data = np.genfromtxt('data/s7075-il.csv',delimiter=',')
pts = data[9:89]
# if we can normalize vectors... | Opezdol/pohhmann | src/cooling/carlson.py | carlson.py | py | 2,475 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.genfromtxt",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "numpy.linalg.norm",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.linalg",
... |
2884377589 | # -*- coding: utf8 -*-
__author__ = 'yqzhang'
from utils.util import get_requests, form_post,login,get_code_token
def detail(gooids):
login('0086','18810432995')
url='https://jf.lagou.com/integral/mall/goods/detail.json'
data={'goodsId':gooids}
return get_requests(url=url,remark='商品详情',data=data)
# de... | Ariaxie-1985/aria | api_script/jianzhao_web/gouinH5/detail.py | detail.py | py | 334 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "utils.util.login",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "utils.util.get_requests",
"line_number": 10,
"usage_type": "call"
}
] |
3731695404 | from sqlalchemy import (
Boolean,
Column,
DateTime,
Integer,
String,
ForeignKey,
)
from sqlalchemy import exc as sqlalchemy_exc
from sqlalchemy.dialects.postgresql import (
JSONB,
UUID,
ARRAY,
)
from sqlalchemy.sql.expression import false, null
from sqlalchemy.orm import relationsh... | abenga/abenga.com | py/lib/models/core.py | core.py | py | 2,678 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "abenga_site.py.lib.models.base.Base",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Integer",
"line_number": 27,
"usage_type": "argument"
},
{
"api_... |
4788623202 | from pytz import timezone
from datetime import datetime
import re
from urllib.parse import urlparse, urljoin
from flask import request, escape, Request
import tiktoken
from werkzeug.datastructures import ImmutableMultiDict
class HTTPMethodOverrideMiddleware(object):
allowed_methods = frozenset([
'GET',
... | mkmenta/chatgpt-research | utils.py | utils.py | py | 3,525 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "re.compile",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "flask.Request",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "flask.escape",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "werkzeug.datastructures.Immutab... |
2353697076 | import os
import dotenv
from telethon import sync
_users_cache = set() # to avoid double DMs
dotenv.load_dotenv()
MESSAGE_TEMPLATE = os.getenv("AUTO_DM")
CURSOR_FILE = "cursor.txt"
def _read_cursor() -> int:
if os.path.exists(CURSOR_FILE):
with open(CURSOR_FILE) as file:
return int(file.re... | rebryk/supertelega | dm.py | dm.py | py | 1,280 | python | en | code | 15 | github-code | 36 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.