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
73907153148
import tkinter as tk import os from style import fnt, ACTIVE_BG, BG, FG, ACCENT class Option(tk.Checkbutton): def __init__(self, parent, filename): # Pull option content from file with open(filename, 'r') as f: self.content = f.readlines() # Grab description of option f...
johnathan-coe/TexInit
widgets.py
widgets.py
py
1,828
python
en
code
0
github-code
6
[ { "api_name": "tkinter.Checkbutton", "line_number": 5, "usage_type": "attribute" }, { "api_name": "tkinter.IntVar", "line_number": 14, "usage_type": "call" }, { "api_name": "style.FG", "line_number": 15, "usage_type": "name" }, { "api_name": "style.fnt", "line...
72699110267
import os import requests class RegistryHandler(object): get_repos_url = '/v2/_catalog' get_tags_url = '/v2/{repo}/tags/list' get_digests_url = '/v2/{repo}/manifests/{tag}' delete_digest_url = '/v2/{repo}/manifests/{digest}' def __init__(self, host): self.host = host def get_repos(se...
zzyy8678/stady_python
delete_regestry.py
delete_regestry.py
py
2,144
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 16, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 21, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 27, "usage_type": "call" }, { "api_name": "requests.delete", "line_nu...
35282991136
import subprocess import argparse import datetime import json import time def get_options(): parser = argparse.ArgumentParser( description='Provision a Kubernetes cluster in GKE.') parser.add_argument( '-c', '--cluster', type=str, default=None, help='K8s cluster to configure' ) ...
NVIDIA/nvindex-cloud
provision/gke/finalize.py
finalize.py
py
2,346
python
en
code
10
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 9, "usage_type": "call" }, { "api_name": "subprocess.check_output", "line_number": 31, "usage_type": "call" }, { "api_name": "subprocess.CalledProcessError", "line_number": 32, "usage_type": "attribute" }, { ...
30358219721
import unittest from traits.api import HasTraits, Int, Str, Tuple from traitsui.api import Item, View from traits.testing.api import UnittestTools from traitsui.tests._tools import ( BaseTestMixin, create_ui, requires_toolkit, reraise_exceptions, ToolkitName, ) class TupleEditor(HasTraits): ...
enthought/traitsui
traitsui/tests/editors/test_tuple_editor.py
test_tuple_editor.py
py
2,229
python
en
code
290
github-code
6
[ { "api_name": "traits.api.HasTraits", "line_number": 16, "usage_type": "name" }, { "api_name": "traits.api.Tuple", "line_number": 19, "usage_type": "call" }, { "api_name": "traits.api.Int", "line_number": 19, "usage_type": "argument" }, { "api_name": "traits.api.S...
14505164780
import typing from qittle.http.client import ABCHTTPClient, AiohttpClient from .abc import ABCSessionManager class SessionManager(ABCSessionManager): def __init__(self, http_client: typing.Optional[typing.Type[ABCHTTPClient]] = None): self.http_client = http_client or AiohttpClient self....
cyanlabs-org/qittle
qittle/http/session/manager.py
manager.py
py
621
python
en
code
8
github-code
6
[ { "api_name": "abc.ABCSessionManager", "line_number": 7, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 8, "usage_type": "attribute" }, { "api_name": "typing.Type", "line_number": 8, "usage_type": "attribute" }, { "api_name": "qittle.http....
26038424036
from __future__ import annotations from typing import ClassVar from pants.core.util_rules.environments import EnvironmentField from pants.engine.target import ( COMMON_TARGET_FIELDS, BoolField, Dependencies, DictStringToStringField, IntField, MultipleSourcesField, SpecialCasedDependencies,...
pantsbuild/pants
src/python/pants/backend/adhoc/target_types.py
target_types.py
py
12,321
python
en
code
2,896
github-code
6
[ { "api_name": "pants.engine.target.Dependencies", "line_number": 22, "usage_type": "name" }, { "api_name": "pants.engine.target.StringField", "line_number": 26, "usage_type": "name" }, { "api_name": "typing.ClassVar", "line_number": 27, "usage_type": "name" }, { "...
2578089451
from collections import defaultdict def func(nums1, nums2): hash = defaultdict(int) while nums1: np1 = nums1.pop() hash[np1[0]] += np1[1] while nums2: np2 = nums2.pop() hash[np2[0]] += np2[1] return sorted([[key, value] for key, value in hash.items()]) ...
mayo516/Algorithm
주리머/2-2w/wc/(성공) 6362. Merge Two 2D Arrays by Summing Values.py
(성공) 6362. Merge Two 2D Arrays by Summing Values.py
py
409
python
en
code
null
github-code
6
[ { "api_name": "collections.defaultdict", "line_number": 3, "usage_type": "call" } ]
28158074215
"""Destroy unused AMIs in your AWS account. Usage: ami_destroyer.py <requiredtag> [options] Arguments: <requiredtag> Tag required for an AMI to be cleaned up in the form tag:NameOfTag Options: --retain=<retain> Number of images to retain, sorted newest to latest [default: 2] -...
crielly/amidestroyer
amidestroyer.py
amidestroyer.py
py
4,275
python
en
code
5
github-code
6
[ { "api_name": "logging.Logger", "line_number": 22, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 25, "usage_type": "attribute" }, { "api_name": "logging.StreamHandler", "line_number": 26, "usage_type": "call" }, { "api_name": "sys.stdout", ...
3625906365
from django.shortcuts import render, redirect, get_object_or_404 from django.views.generic import DetailView, View, UpdateView, ListView, TemplateView from django.core.urlresolvers import reverse from django.urls import reverse_lazy from django.contrib import messages from django.http import Http404 from .models impor...
tegarty/E-Commerce_django
orders/views.py
views.py
py
8,371
python
en
code
1
github-code
6
[ { "api_name": "django.views.generic.View", "line_number": 44, "usage_type": "name" }, { "api_name": "models.Checkout.objects.filter", "line_number": 49, "usage_type": "call" }, { "api_name": "models.Checkout.objects", "line_number": 49, "usage_type": "attribute" }, { ...
4222865674
#!usr/bin/python import os import SimpleITK as sitk import numpy as np import scipy.ndimage.interpolation import skimage.exposure import skimage.filters import skimage.transform path="//Users//zhangyuwei//Desktop//test" ShrinkFactor = 4 for i in os.walk(path): for j in range(len(i[2])): ...
20zzyw/Radiomic-Toolbox
N4ITK_instance.py
N4ITK_instance.py
py
4,354
python
en
code
0
github-code
6
[ { "api_name": "os.walk", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path.splitext", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path", "line_number": 16, "usage_type": "attribute" }, { "api_name": "os.path.splitext", "line_nu...
35383876896
import json from random import randint import discord from discord.ext import tasks, commands def getData(): with open("data.json", "r") as levelsFile: return json.loads(levelsFile.read()) def setData(_dict): with open("data.json", "w") as levelsFile: levelsFile.write(json.dumps(_dict)) l...
JONKKKK/Codes
2MS2A/dnd.py
dnd.py
py
7,250
python
en
code
0
github-code
6
[ { "api_name": "json.loads", "line_number": 10, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 15, "usage_type": "call" }, { "api_name": "discord.ext.commands.Cog", "line_number": 21, "usage_type": "attribute" }, { "api_name": "discord.ext.comma...
13276813866
import sys from os.path import join from PyQt5 import uic from PyQt5.QtWidgets import QApplication, QMainWindow, QPushButton, QListWidgetItem, QWidget from PyQt5.QtGui import QPixmap from PyQt5.QtCore import Qt import sqlite3 from functools import partial class EditInfo(QWidget): def __init__(self, id) -> None: ...
QBoff/Moscow-Kiper
task5/main.py
main.py
py
5,993
python
en
code
0
github-code
6
[ { "api_name": "PyQt5.QtWidgets.QWidget", "line_number": 12, "usage_type": "name" }, { "api_name": "PyQt5.uic.loadUi", "line_number": 15, "usage_type": "call" }, { "api_name": "PyQt5.uic", "line_number": 15, "usage_type": "name" }, { "api_name": "os.path.join", ...
31791424883
import setuptools with open('README.md', 'r') as fh: long_description = fh.read() setuptools.setup( name='bhamcal', version='0.1', license='GPL 3', python_requires='>=3', author='Justin Chadwell', author_email='jedevc@gmail.com', url='https://github.com/jedevc/bhamcal', descripti...
jedevc/bhamcal
setup.py
setup.py
py
881
python
en
code
12
github-code
6
[ { "api_name": "setuptools.setup", "line_number": 6, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 20, "usage_type": "call" } ]
23142628393
# Neuon AI - PlantCLEF 2020 import tensorflow as tf from preprocessing import inception_preprocessing slim = tf.contrib.slim import numpy as np import cv2 from nets.inception_v4 import inception_v4 from nets import inception_utils from PIL import Image from six.moves import cPickle import pandas as pd from sklearn.met...
NeuonAI/plantclef2020_challenge
validate_image.py
validate_image.py
py
9,376
python
en
code
1
github-code
6
[ { "api_name": "tensorflow.contrib", "line_number": 5, "usage_type": "attribute" }, { "api_name": "six.moves.cPickle.load", "line_number": 46, "usage_type": "call" }, { "api_name": "six.moves.cPickle", "line_number": 46, "usage_type": "name" }, { "api_name": "panda...
25798704755
#! python3 import sys import win32api from PyQt5.QtWidgets import QApplication, QWidget, \ QToolTip, QPushButton, QMessageBox, QDesktopWidget, \ QMainWindow, QAction, QMenu, QStatusBar from PyQt5.QtGui import QIcon, QFont from PyQt5.QtCore import QCoreApplication ''' #面向过程 app = QApplication(sys.argv) w = QWid...
JcobCN/PyLearn
pyQt5.py
pyQt5.py
py
3,718
python
en
code
0
github-code
6
[ { "api_name": "PyQt5.QtWidgets.QMainWindow", "line_number": 23, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QToolTip.setFont", "line_number": 32, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QToolTip", "line_number": 32, "usage_type": "name" }, { ...
34777830541
# Set up logging import sys import logging logging.basicConfig( format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", handlers=[logging.StreamHandler(sys.stdout)], level=logging.WARNING, ) logger = logging.getLogger(__name__) from typing import Optional from dat...
ServiceNow/picard
seq2seq/prediction_output.py
prediction_output.py
py
7,647
python
en
code
299
github-code
6
[ { "api_name": "logging.basicConfig", "line_number": 5, "usage_type": "call" }, { "api_name": "logging.StreamHandler", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.stdout", "line_number": 8, "usage_type": "attribute" }, { "api_name": "logging.WARNIN...
10139749320
from django.shortcuts import render, redirect, reverse, get_object_or_404 from django.contrib.auth.mixins import LoginRequiredMixin from django.views.generic import View from .forms import (CreateCourseForm, CreateCourseRegistrationForm, CreateDepartmentForm, ...
shreygoel7/Pinocchio
Pinocchio/academicInfo/views.py
views.py
py
12,563
python
en
code
0
github-code
6
[ { "api_name": "django.contrib.auth.mixins.LoginRequiredMixin", "line_number": 16, "usage_type": "name" }, { "api_name": "django.views.generic.View", "line_number": 16, "usage_type": "name" }, { "api_name": "forms.CreateCourseForm", "line_number": 22, "usage_type": "name" ...
24132755409
#!/usr/bin/env python import argparse def filter_sam( out_fn, in_fn, chromosome): with open(out_fn, 'w') as donor_out: for line in open(in_fn, 'r'): if line.startswith("@SQ"): if "SN:{}\t".format(chromosome) in line: donor_out.write(line) elif line.startswith("@"): donor_ou...
supernifty/reference-bias
bin/filter_sam.py
filter_sam.py
py
832
python
en
code
2
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 19, "usage_type": "call" } ]
1419172936
"""scene.py module""" # Michael Gresham # CPSC 386-01 # 2021-11-29 # greshammichael@csu.fullerton.edu # @Michael-Gresham # # Lab 03-00 # # My scene class # Holds all the scenes that are present in snek game. import pygame from pygame.constants import SCRAP_SELECTION from random import randint import os import pickle fr...
Michael-Gresham/Portfolio
cpsc-386-04-snake-Michael-Gresham-main/scene.py
scene.py
py
19,048
python
en
code
0
github-code
6
[ { "api_name": "pygame.Surface", "line_number": 27, "usage_type": "call" }, { "api_name": "pygame.display.update", "line_number": 50, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 50, "usage_type": "attribute" }, { "api_name": "pygame.QUIT"...
2088985509
#!/usr/bin/env python """@namespace IMP.pmi.tools Miscellaneous utilities. """ from __future__ import print_function, division import IMP import IMP.algebra import IMP.isd import IMP.pmi import IMP.pmi.topology try: from collections.abc import MutableSet # needs Python 3.3 or later except ImportError: fro...
salilab/pmi
pyext/src/tools.py
tools.py
py
60,875
python
en
code
12
github-code
6
[ { "api_name": "IMP.atom.Hierarchy.get_is_setup", "line_number": 37, "usage_type": "call" }, { "api_name": "IMP.atom", "line_number": 37, "usage_type": "attribute" }, { "api_name": "IMP.atom.Hierarchy", "line_number": 38, "usage_type": "call" }, { "api_name": "IMP....
60843869
# -*- coding:utf-8 -*- import time import pickle from .utils import Logger class Scheduler(object): spider = None def __init__(self, crawler): self.settings = crawler.settings self.logger = Logger.from_crawler(crawler) if self.settings.getbool("CUSTOM_REDIS"): from custom...
ShichaoMa/structure_spider
structor/scheduler.py
scheduler.py
py
2,682
python
en
code
29
github-code
6
[ { "api_name": "utils.Logger.from_crawler", "line_number": 13, "usage_type": "call" }, { "api_name": "utils.Logger", "line_number": 13, "usage_type": "name" }, { "api_name": "redis.Redis", "line_number": 18, "usage_type": "call" }, { "api_name": "pickle.dumps", ...
36229690900
from typing import Optional ''' 1373. 二叉搜索子树的最大键值和 dfs 边统计和边判断是否为搜索树即可。 一旦子树不为搜索树,直接520520。 ''' null = None class TreeNode: def __init__(self, val=0, left=None, right=None): self.val = val self.left = left self.right = right class Solution: def maxSumBST(self, root: Optional[TreeNode]) ...
z-w-wang/Leetcode-Problemlist
DailyProblem/Tree/1373.2023-05-20.py
1373.2023-05-20.py
py
1,207
python
en
code
3
github-code
6
[ { "api_name": "typing.Optional", "line_number": 16, "usage_type": "name" } ]
1336912689
#!/usr/bin/env python3 from http.server import ThreadingHTTPServer from os.path import dirname, realpath from .httpHandler import HTTPApiHandler from .fileCacher import cacheFile from ..query import QueryHandler def startServer(port): HTTPApiHandler.queryHandler = QueryHandler() filesPath = dirname(realpath(__...
wheelerd/uni-chatbot
stockbot/web_frontend/__main__.py
__main__.py
py
1,427
python
en
code
2
github-code
6
[ { "api_name": "httpHandler.HTTPApiHandler.queryHandler", "line_number": 9, "usage_type": "attribute" }, { "api_name": "httpHandler.HTTPApiHandler", "line_number": 9, "usage_type": "name" }, { "api_name": "query.QueryHandler", "line_number": 9, "usage_type": "call" }, ...
1425636890
# -*- coding: utf-8 -*- # import needed modules from requests import get from csv import writer, reader from datetime import date import sys # %% define function for export/save data to *.csv file def write_csv(data, filepath): with open(filepath, 'w', newline='') as csv_file: write = writer(csv_file) ...
filrat2/rain_forecast
rain_forecast.py
rain_forecast.py
py
4,691
python
pl
code
0
github-code
6
[ { "api_name": "csv.writer", "line_number": 14, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 21, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 22, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": ...
71429998588
from django.db.models import Q from django.shortcuts import get_object_or_404 from drf_yasg.utils import swagger_auto_schema from drf_yasg import openapi from rest_framework.views import APIView from rest_framework.permissions import IsAuthenticated from rest_framework.response import Response from rest_framework.excep...
izunaaaaa/CurB_Backend
letterlist/views.py
views.py
py
5,352
python
en
code
0
github-code
6
[ { "api_name": "rest_framework.views.APIView", "line_number": 16, "usage_type": "name" }, { "api_name": "rest_framework.permissions.IsAuthenticated", "line_number": 17, "usage_type": "name" }, { "api_name": "models.Letterlist.objects.filter", "line_number": 29, "usage_type...
21618000912
from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.common.by import By class check_box_single(): def __init__(self): self.driver = webdriver.Chrome('./chromedriver') self.driver.implicitly_wait(10) self.driver.get("ht...
CorozelEmanuel/Luxoft2021-proiect1
Ceausu Ionut Marian/Selenium1/exemple/checkboxsingle.py
checkboxsingle.py
py
1,572
python
en
code
0
github-code
6
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 11, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 11, "usage_type": "name" }, { "api_name": "selenium.webdriver.common.by.By.ID", "line_number": 20, "usage_type": "attribute" }, { ...
30590549707
import numpy as np from pathlib import Path from PIL import Image, ImageDraw, ImageFont from tqdm import tqdm SQSIZE = 60 SPACING = 15 def make_col(start, end, n=5): """Create a column of numbers.""" nums = np.random.choice(np.arange(start, end+1), size=n, replace=False) return nums def generate_card(): ...
Lewistrick/bingogenerator
bingo.py
bingo.py
py
3,060
python
en
code
0
github-code
6
[ { "api_name": "numpy.random.choice", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 11, "usage_type": "attribute" }, { "api_name": "numpy.arange", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.array", ...
6484276041
import os import shutil import time import configparser from PIL import Image STEP = 10 # from lib.utils import Id2name # INPUT_DIR = r"data/MH_01_easy/mav0/cam0/data" # OUTPUT_DIR = r"./imgs" config = configparser.ConfigParser() config.read("config.ini", encoding="utf-8") INPUT_DIR = config["DEFAULT"]["SIMULATOR_...
franioli/COLMAP_SLAM
simulator.py
simulator.py
py
1,283
python
en
code
0
github-code
6
[ { "api_name": "configparser.ConfigParser", "line_number": 15, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 20, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 41, "usage_type": "call" }, { "api_name": "PIL.Image", "...
73029609789
from django.db import models class ShowManager(models.Manager): def basic_validator(self, postData): errors = {} if len(postData['show_title']) < 2: errors["show_title"] = "Show title should be at least 2 characters!" if len(postData['show_network']) < 3: errors["sh...
Jgomez1996/deployment_test
shows_app/models.py
models.py
py
904
python
en
code
0
github-code
6
[ { "api_name": "django.db.models.Manager", "line_number": 4, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 4, "usage_type": "name" }, { "api_name": "django.db.models.Model", "line_number": 16, "usage_type": "attribute" }, { "api_name...
2516918892
import netCDF4 as netCDF from extraction_utils import basic, getCoordinateVariable import json import matplotlib.pyplot as plt import decimal import numpy as np import traceback class ImageStats(object): """docstring for ImageStats""" def __init__(self, filename, variable): super(ImageStats, self).__init__() sel...
pmlrsg/GISportal
plotting/data_extractor/analysis_types/image_stats.py
image_stats.py
py
2,466
python
en
code
71
github-code
6
[ { "api_name": "netCDF4.Dataset", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.ma.array", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.ma", "line_number": 23, "usage_type": "attribute" }, { "api_name": "extraction_utils.getCoor...
75276539706
import numpy as np import pandas as pd import torch from torch.autograd import Variable def testing(group_test, y_test, model): rmse = 0 j = 1 result = [] while j <= 100: x_test = group_test.get_group(j).to_numpy() data_predict = 0 for t in range(x_test.shape[0]): # iterate t...
jiaxiang-cheng/PyTorch-Transformer-for-RUL-Prediction
testing.py
testing.py
py
1,420
python
en
code
140
github-code
6
[ { "api_name": "numpy.append", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 20, "usage_type": "call" }, { "api_name": "torch.autograd.Variable", "line_number": 24, "usage_type": "call" }, { "api_name": "torch.Tensor", "...
26776312630
"""Apply Perl::Critic tool and gather results.""" import argparse import logging import subprocess from typing import List, Optional from statick_tool.issue import Issue from statick_tool.package import Package from statick_tool.tool_plugin import ToolPlugin class PerlCriticToolPlugin(ToolPlugin): """Apply Perl:...
sscpac/statick
statick_tool/plugins/tool/perlcritic_tool_plugin.py
perlcritic_tool_plugin.py
py
3,117
python
en
code
66
github-code
6
[ { "api_name": "statick_tool.tool_plugin.ToolPlugin", "line_number": 12, "usage_type": "name" }, { "api_name": "argparse.Namespace", "line_number": 19, "usage_type": "attribute" }, { "api_name": "typing.List", "line_number": 28, "usage_type": "name" }, { "api_name"...
29279214986
from setuptools import setup, find_packages VERSION = '0.0.19' DESCRIPTION = 'ParkingLot is a Python service imitating a parking lot like system.' LONG_DESCRIPTION = 'The service indicates rather a vehicle allowed or not allowed to enter the parking lot.' # Setting up setup( name="parkinglot", vers...
PsychoRover/parking-lot
setup.py
setup.py
py
935
python
en
code
0
github-code
6
[ { "api_name": "setuptools.setup", "line_number": 9, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 16, "usage_type": "call" } ]
8246901300
""" Module containing the rheologies, fault setup, and ODE cycles code for the 2D subduction case. """ # general imports import json import configparser import numpy as np import pandas as pd from scipy.integrate import solve_ivp from numba import njit, objmode, float64, int64, boolean from scipy.interpolate import in...
tobiscode/seqeas-public
seqeas/subduction2d.py
subduction2d.py
py
145,621
python
en
code
0
github-code
6
[ { "api_name": "abc.ABC", "line_number": 21, "usage_type": "name" }, { "api_name": "numpy.logical_xor", "line_number": 48, "usage_type": "call" }, { "api_name": "numpy.all", "line_number": 160, "usage_type": "call" }, { "api_name": "numpy.diff", "line_number": ...
72908983868
import os import testinfra.utils.ansible_runner import pytest testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( os.environ['MOLECULE_INVENTORY_FILE'] ).get_hosts('all') @pytest.mark.parametrize("name", [ ("apt-transport-https"), ("software-properties-common"), ("unattended-upgrades"), ...
ddrugeon/ansible-pi-bootstrap
roles/unattended-upgrades/molecule/default/tests/test_install_mandatory_tools.py
test_install_mandatory_tools.py
py
607
python
en
code
0
github-code
6
[ { "api_name": "testinfra.utils.ansible_runner.utils.ansible_runner.AnsibleRunner", "line_number": 5, "usage_type": "call" }, { "api_name": "testinfra.utils.ansible_runner.utils", "line_number": 5, "usage_type": "attribute" }, { "api_name": "testinfra.utils.ansible_runner", "l...
41373296282
#!/usr/bin/env python from graph import DiGraph, before_after_calculations import os import json import threading import random from datetime import date def read_graphml_files(): with open('tmp/interesting_graphs.txt') as fh: lines = [line.rstrip() for line in fh] return [(line, DiGraph.from_graphm...
mkapra/graph_measurements_segmentation
simulate_networks.py
simulate_networks.py
py
1,686
python
en
code
0
github-code
6
[ { "api_name": "graph.DiGraph.from_graphml", "line_number": 15, "usage_type": "call" }, { "api_name": "graph.DiGraph", "line_number": 15, "usage_type": "name" }, { "api_name": "random.randrange", "line_number": 20, "usage_type": "call" }, { "api_name": "graph.befor...
27813014463
import numpy as np import gym import cv2 class StackedEnv(gym.Wrapper): def __init__(self, env, width, height, n_img_stack, n_action_repeats): super(StackedEnv, self).__init__(env) self.width = width self.height = height self.n_img_stack = n_img_stack self.n_action_repeats ...
yiliu77/deep_rl_proj
environments/stacked.py
stacked.py
py
1,405
python
en
code
3
github-code
6
[ { "api_name": "gym.Wrapper", "line_number": 6, "usage_type": "attribute" }, { "api_name": "numpy.rollaxis", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.stack", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.rollaxis", "line...
28985728032
import sys,re, os, io, codecs from _collections import defaultdict def loadModelfile(): modelfile = sys.argv[1] features = defaultdict() #load model file into features with open(modelfile,"r", encoding = "ISO-8859-1") as modelhandler: model = modelhandler.readlines() for cldata in mo...
chandrashekar-cv/POS-Tagging
ner/netag.py
netag.py
py
3,029
python
en
code
0
github-code
6
[ { "api_name": "sys.argv", "line_number": 7, "usage_type": "attribute" }, { "api_name": "_collections.defaultdict", "line_number": 8, "usage_type": "call" }, { "api_name": "_collections.defaultdict", "line_number": 18, "usage_type": "call" }, { "api_name": "io.Text...
19124516217
from components import decorators from components import endpoints_webapp2 import webapp2 import api import config import notifications import service import swarming README_MD = ( 'https://chromium.googlesource.com/infra/infra/+/master/' 'appengine/cr-buildbucket/README.md') class MainHandler(webapp2.Request...
mithro/chromium-infra
appengine/cr-buildbucket/handlers.py
handlers.py
py
1,762
python
en
code
0
github-code
6
[ { "api_name": "webapp2.RequestHandler", "line_number": 18, "usage_type": "attribute" }, { "api_name": "webapp2.RequestHandler", "line_number": 25, "usage_type": "attribute" }, { "api_name": "service.reset_expired_builds", "line_number": 30, "usage_type": "call" }, { ...
37877845832
import datetime from PySide2.QtWidgets import QDialog from ui_add_update import Ui_Dialog class addDialog(QDialog): def __init__(self, *args, **kvargs): super().__init__(*args, **kvargs) self.ui = Ui_Dialog() self.ui.setupUi(self) self.ui.OkButton.clicked.connec...
randrust/cashflow_pyside2
dialogs/add_dialog.py
add_dialog.py
py
1,602
python
en
code
0
github-code
6
[ { "api_name": "PySide2.QtWidgets.QDialog", "line_number": 8, "usage_type": "name" }, { "api_name": "ui_add_update.Ui_Dialog", "line_number": 11, "usage_type": "call" }, { "api_name": "datetime.date.today", "line_number": 16, "usage_type": "call" }, { "api_name": "...
5114407056
import numpy as np import pandas as pd from scipy import ndimage from scipy.interpolate import interp1d import astropy.units as u import astropy.coordinates as coord from astropy.cosmology import FlatLambdaCDM from astropy.constants import M_sun import tensorflow as tf from flowpm import utils as ut import copy impo...
pointeee/preheat2022_public
FGPA.py
FGPA.py
py
18,340
python
en
code
0
github-code
6
[ { "api_name": "astropy.units.Mpc", "line_number": 22, "usage_type": "attribute" }, { "api_name": "astropy.units", "line_number": 22, "usage_type": "name" }, { "api_name": "astropy.cosmology.FlatLambdaCDM", "line_number": 61, "usage_type": "call" }, { "api_name": "...
28156199284
from functools import partial from pathlib import Path from typing import Dict, Any, Callable, Tuple, Optional, Sequence import PIL import imageio import numpy as np import torch from PIL import Image from torch import Tensor from torch.nn import Module, Tanh, Parameter from torch.nn.functional import grid_sample, l1_...
akanimax/3inGAN
projects/thre3ingan/singans/image_model.py
image_model.py
py
20,218
python
en
code
3
github-code
6
[ { "api_name": "torch.nn.Module", "line_number": 31, "usage_type": "name" }, { "api_name": "torch.device", "line_number": 38, "usage_type": "attribute" }, { "api_name": "torch.cuda.is_available", "line_number": 39, "usage_type": "call" }, { "api_name": "torch.cuda"...
32599097431
from flask import Flask from flask_restful import Api, Resource app = Flask(__name__) api = Api(app) class Hellocall(Resource): def get(self,name,number): return({'Name':name,'Age':number}) api.add_resource(Hellocall,"/Helloworld/<string:name>/<int:number>") if __name__ == "__main__": app.run(debug=...
somasundaram1702/Flask-basics
main.py
main.py
py
330
python
en
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "flask_restful.Api", "line_number": 5, "usage_type": "call" }, { "api_name": "flask_restful.Resource", "line_number": 7, "usage_type": "name" } ]
3167046119
#!/usr/bin/env python3 import base64 from functions.aes import ( gen_random_bytes, get_blocks, pkcs7_unpad, pkcs7_pad, PKCS7Error, AESCipher, ) _STRINGS = [ base64.b64decode(s) for s in [ "MDAwMDAwTm93IHRoYXQgdGhlIHBhcnR5IGlzIGp1bXBpbmc=", "MDAwMDAxV2l0aCB0aGUgYmFzcyB...
svkirillov/cryptopals-python3
cryptopals/set3/challenge17.py
challenge17.py
py
2,562
python
en
code
0
github-code
6
[ { "api_name": "base64.b64decode", "line_number": 16, "usage_type": "call" }, { "api_name": "functions.aes.gen_random_bytes", "line_number": 31, "usage_type": "call" }, { "api_name": "functions.aes.gen_random_bytes", "line_number": 35, "usage_type": "call" }, { "ap...
29792276111
#!/usr/bin/env python3 import pandas as pd import os import rospy import rospkg from std_msgs.msg import Bool from robo_demo_msgs.srv import RunPlanningTest rospack = rospkg.RosPack() EE_CONTROL_PATH = rospack.get_path('end_effector_control') PLANNING_DATA_PATH = os.path.join(EE_CONTROL_PATH, 'data', 'planning') CO...
dwya222/end_effector_control
scripts/automate_testing_v2.py
automate_testing_v2.py
py
1,922
python
en
code
0
github-code
6
[ { "api_name": "rospkg.RosPack", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_num...
8568584883
# Create class from Tools.Scripts.treesync import raw_input import datetime from datetime import date class Person: def __init__(self, name,year,month,day): self.__name=name self.__year=year self.__month=month self.__day=day def getage(self): now = date...
iWanjugu/Personal-Development-II
Python/getAge.py
getAge.py
py
673
python
en
code
0
github-code
6
[ { "api_name": "datetime.datetime.now", "line_number": 16, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 16, "usage_type": "attribute" }, { "api_name": "datetime.date", "line_number": 21, "usage_type": "call" }, { "api_name": "datetime.d...
6288317611
#! /usr/bin/env python import math import rospy from sensor_msgs.msg import Imu from tf.transformations import euler_from_quaternion def imuCallback(imu): quat = [imu.orientation.w, imu.orientation.x, imu.orientation.y, imu.orientation.z] roll, pitch, yaw = euler_from_quaternion(quat) rospy.loginfo('{} {} {}'.f...
vigneshrajap/UNSW-work
imu_to_yaw/src/imu_to_yaw_node.py
imu_to_yaw_node.py
py
558
python
en
code
2
github-code
6
[ { "api_name": "tf.transformations.euler_from_quaternion", "line_number": 10, "usage_type": "call" }, { "api_name": "rospy.loginfo", "line_number": 11, "usage_type": "call" }, { "api_name": "math.pi", "line_number": 11, "usage_type": "attribute" }, { "api_name": "r...
26113020545
__authors__ = ["T. Vincent"] __license__ = "MIT" __date__ = "03/04/2017" # TODO # keep aspect ratio managed here? # smarter dirty flag handling? import datetime as dt import math import weakref import logging import numbers from typing import Optional, Union from collections import namedtuple import numpy from ......
silx-kit/silx
src/silx/gui/plot/backends/glutils/GLPlotFrame.py
GLPlotFrame.py
py
42,835
python
en
code
106
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 29, "usage_type": "call" }, { "api_name": "GLText.CENTER", "line_number": 42, "usage_type": "name" }, { "api_name": "GLText.CENTER", "line_number": 43, "usage_type": "name" }, { "api_name": "weakref.ref", "line...
28747708713
from django.shortcuts import render # Create your views here. from django.http import HttpResponse from django.template import Context, loader def index(request): omi = "omprakash" import urllib import json resp = urllib.urlopen('https://api.coursera.org/api/courses.v1?q=search&query=malware+undergroun...
aumiom/Educational-Website-Template-with-Coursera-Search-API-Integration
myproject/myapp/views.py
views.py
py
1,090
python
en
code
1
github-code
6
[ { "api_name": "urllib.urlopen", "line_number": 14, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 15, "usage_type": "call" }, { "api_name": "django.template.loader.get_template", "line_number": 16, "usage_type": "call" }, { "api_name": "django....
40413480181
import re import requests from bs4 import BeautifulSoup from time import time as timer __author__ = "Allen Roberts" __credits__ = ["Allen Roberts"] __version__ = "1.0.0" __maintainer__ = "Allen Roberts" def readfile(): with open('KY.txt') as file: lines = file.readlines() print(lines) return line...
AllenRoberts/EmailScraper
main.py
main.py
py
3,463
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 31, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 33, "usage_type": "call" }, { "api_name": "re.search", "line_number": 38, "usage_type": "call" }, { "api_name": "time.time", "line_number...
15060558322
import csv import json species_file = open('./data/union_list.json','r') species_list = json.loads(species_file.read()) country_codes = [ "BG", "HR", "CZ", "DK", "NL", "UK", "EE", "FI", "FR", "DE", "GR", "HU", "IE", "IT", "LV", "LT", "MT", "PL",...
eea/ias-dataflow
scripts/parse_common_names.py
parse_common_names.py
py
1,330
python
en
code
0
github-code
6
[ { "api_name": "json.loads", "line_number": 5, "usage_type": "call" }, { "api_name": "csv.DictReader", "line_number": 39, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 56, "usage_type": "call" } ]
9004329912
# -*- coding: utf-8 -*- from django.conf.urls import patterns, include, url from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.conf import settings from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', # Examples: # url(r'^$', 'siscoer.views.home', name=...
clebersa/2014-1-gps-siscoer
src/siscoer/siscoer/urls.py
urls.py
py
1,206
python
en
code
0
github-code
6
[ { "api_name": "django.contrib.admin.autodiscover", "line_number": 6, "usage_type": "call" }, { "api_name": "django.contrib.admin", "line_number": 6, "usage_type": "name" }, { "api_name": "django.conf.urls.patterns", "line_number": 9, "usage_type": "call" }, { "api...
29478342356
import sys import networkx as nx from assignNetwork import assignNetwork conflicts = [] messageTypes = [] incomingMessages = [] outgoingMessages = [] stableStates = [] graph = {} G = nx.MultiDiGraph() assert len(sys.argv[1:]) <= 2, "Too many arguments" file = sys.argv[1] if(len(sys.argv[1:]) == 2): constraiantFil...
ChingLingYeung/honoursProject
simple_conflict.py
simple_conflict.py
py
10,499
python
en
code
0
github-code
6
[ { "api_name": "networkx.MultiDiGraph", "line_number": 11, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 13, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 14, "usage_type": "attribute" }, { "api_name": "sys.argv", "lin...
17347679642
from django.urls import path, include from .views import LoginView, RegisterView, \ LogoutView, DepartView, JobView, SetPwd, DepartEditView, JobEditView, \ JobRelateUserView, DepartRelateUserView, AppointWorkflowAdmin, IndexView, AppointCommon, AddDepartView, \ DepartRelateUserEditView, AddJobView, JobRela...
cuifeihe/django_WorkFlowProject
app_account/urls.py
urls.py
py
2,353
python
zh
code
0
github-code
6
[ { "api_name": "django.urls.path", "line_number": 12, "usage_type": "call" }, { "api_name": "views.IndexView.as_view", "line_number": 12, "usage_type": "call" }, { "api_name": "views.IndexView", "line_number": 12, "usage_type": "name" }, { "api_name": "django.urls....
21480310570
import bpy import re def get_group_name_from_data_path(data_path): m = re.match(r'^pose\.bones\[\"([^\"]+)"\]', data_path) if m: return m[1] # For pose blender. Should probably not be hardcoded m = re.match(r'^\[\"([^\"]+)"\]$', data_path) if m and m[1].endswith("_pose"): ...
greisane/gret
anim/channels_auto_group.py
channels_auto_group.py
py
2,546
python
en
code
298
github-code
6
[ { "api_name": "re.match", "line_number": 5, "usage_type": "call" }, { "api_name": "re.match", "line_number": 10, "usage_type": "call" }, { "api_name": "bpy.types", "line_number": 16, "usage_type": "attribute" }, { "api_name": "bpy.utils.register_class", "line_...
27251363866
""" 文件名: Code/Chapter07/C02_RNNImgCla/FashionMNISTRNN.py 创建时间: 2023/4/27 8:08 下午 作 者: @空字符 公众号: @月来客栈 知 乎: @月来客栈 https://www.zhihu.com/people/the_lastest """ import torch import torch.nn as nn import sys sys.path.append('../../') from Chapter06.C04_LN.layer_normalization import LayerNormalization class FashionMNIST...
moon-hotel/DeepLearningWithMe
Code/Chapter07/C02_RNNImgCla/FashionMNISTRNN.py
FashionMNISTRNN.py
py
1,754
python
en
code
116
github-code
6
[ { "api_name": "sys.path.append", "line_number": 13, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "torch.nn.Module", "line_number": 17, "usage_type": "attribute" }, { "api_name": "torch.nn", "li...
9830880946
# -*- coding: utf-8 -*- ## # @file __init__.py # @brief Contain paths to information files # @author Gabriel H Riqueti # @email gabrielhriqueti@gmail.com # @date 06/05/2021 # import os from pathlib import Path PATH_NERNST_EQUATION_INFO = Path(os.path.abspath(__file__)).parent / 'nernst_equation.txt' PA...
gabrielriqu3ti/biomedical_signal_processing
biomedical_signal_processing/info/__init__.py
__init__.py
py
670
python
en
code
0
github-code
6
[ { "api_name": "pathlib.Path", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path.abspath", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "pathlib.Path", "line_nu...
29325722402
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ To read sequentially the data from the hard disk, the data format is convert to TFRecord. """ import re from pathlib import Path import pandas as pd import numpy as np import tensorflow as tf from tqdm import tqdm from sklearn.utils import shuffle __d...
ichiro-takahashi/tomoe-realbogus
src/data/make_record.py
make_record.py
py
3,756
python
en
code
2
github-code
6
[ { "api_name": "numpy.load", "line_number": 20, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 21, "usage_type": "call" }, { "api_name": "tensorflow.constant", "line_number": 31, "usage_type": "call" }, { "api_name": "tensorflow.train.Featu...
34199270716
import time import json import requests import datetime import math import sys from pprint import pprint s_time = time.time() path = sys.argv[0].replace('c_timer.py', '') # скважина качает 4м3/ч или 4000л/ч охватывая 10соток или 1000м2, т.е. за час получается 4л/м2 или 4мм with open(path+'json/const_zones.json') as...
sdfim/watering
c_timer.py
c_timer.py
py
2,563
python
ru
code
0
github-code
6
[ { "api_name": "time.time", "line_number": 10, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 11, "usage_type": "attribute" }, { "api_name": "json.load", "line_number": 16, "usage_type": "call" }, { "api_name": "pprint.pprint", "line_number": ...
27321029603
""" Kela Kanta data preprocessing Reads Kela Kanta data, applies the preprocessing steps below and writes the result to files. - remove extra linebreaks - remove empty lines - transform base16 ints to base10 ints - parse dates - replace "," with "." as a decimal point Note: running this script on ePouta takes several...
dsgelab/finregistry-data
finregistry_data/registries/kela_kanta.py
kela_kanta.py
py
5,134
python
en
code
0
github-code
6
[ { "api_name": "functools.partial", "line_number": 33, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 69, "usage_type": "call" }, { "api_name": "functools.partial", "line_number": 86, "usage_type": "call" }, { "api_name": "pandas.read_csv",...
7298829560
import matplotlib.pyplot as plt from astropy.io import fits from astropy.visualization import make_lupton_rgb from matplotlib.colors import LogNorm from astropy.wcs import WCS import numpy as np db_open = [fits.open('frame-g-006793-1-0130.fits'), fits.open('frame-i-006793-1-0130.fits'), fits.ope...
ViniBilck/Astro-Vinicius
Cubos/Codes/Galaxy - 1/Galaxy1.py
Galaxy1.py
py
2,530
python
en
code
0
github-code
6
[ { "api_name": "astropy.io.fits.open", "line_number": 9, "usage_type": "call" }, { "api_name": "astropy.io.fits", "line_number": 9, "usage_type": "name" }, { "api_name": "astropy.io.fits.open", "line_number": 10, "usage_type": "call" }, { "api_name": "astropy.io.fi...
14205447601
#!/usr/bin/env python # coding: utf-8 # ## Single Dimension Array # In[1]: import pandas as pd import matplotlib.pyplot as plt # In[2]: data = [10, 23, 34, 35, 45, 59] df = pd.DataFrame(data, columns=['Score']) df # In[3]: #plt.pie(df) plt.pie(df, labels=df['Score']) plt.title("Students Score") plt.show() ...
AileshC/PythonLearning
python_notebooks/MatPlotLib_Pie_Demo.py
MatPlotLib_Pie_Demo.py
py
1,233
python
en
code
1
github-code
6
[ { "api_name": "pandas.DataFrame", "line_number": 17, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.pie", "line_number": 25, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 25, "usage_type": "name" }, { "api_name": "matplotlib.p...
70264789629
import django, os from django.core.management import call_command from dotenv import load_dotenv def init_db(): """Method to initialize the database with sample data""" os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'FriendsLessonsSystem.settings') load_dotenv() django.setup() from FriendsLesson...
ValentinGiorgetti/Desafio-Backend
FriendsLessonsSystem/init_db.py
init_db.py
py
1,830
python
en
code
0
github-code
6
[ { "api_name": "os.environ.setdefault", "line_number": 8, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 8, "usage_type": "attribute" }, { "api_name": "dotenv.load_dotenv", "line_number": 9, "usage_type": "call" }, { "api_name": "django.setup", ...
22610043366
from django import forms from django.forms.models import inlineformset_factory from crispy_forms.helper import FormHelper from crispy_forms.layout import Layout, Field, Fieldset, Div, HTML, Submit, Button from hybridjango.custom_layout_object import * from hybridjango.mixins import BootstrapFormMixin from .models impor...
hybrida/hybridjango
apps/events/forms.py
forms.py
py
3,382
python
en
code
4
github-code
6
[ { "api_name": "django.forms.ModelForm", "line_number": 10, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 10, "usage_type": "name" }, { "api_name": "django.forms.ModelForm", "line_number": 16, "usage_type": "attribute" }, { "api_name": "...
73811427708
from torch.utils.data import DataLoader from sklearn.model_selection import KFold from .datasets import get_cifar10_datasets, get_cifar100_datasets, get_mnist_datasets, get_image_net_dataset, TruncatedDataset, MergedDataset from .partition import partition_by_class, partition_with_dirichlet_distribution data_path = '...
somcogo/embedding
utils/data_loader.py
data_loader.py
py
3,860
python
en
code
0
github-code
6
[ { "api_name": "datasets.get_cifar10_datasets", "line_number": 11, "usage_type": "call" }, { "api_name": "datasets.get_cifar100_datasets", "line_number": 13, "usage_type": "call" }, { "api_name": "datasets.get_mnist_datasets", "line_number": 15, "usage_type": "call" }, ...
4992423632
from __future__ import annotations import typing from homeassistant.components.switch import ( DOMAIN as PLATFORM_SWITCH, SwitchEntity, ) try: from homeassistant.components.switch import SwitchDeviceClass DEVICE_CLASS_OUTLET = SwitchDeviceClass.OUTLET DEVICE_CLASS_SWITCH = SwitchDeviceClass.SWITC...
ZioTitanok/HomeAssistant-Configuration
custom_components/meross_lan/switch.py
switch.py
py
4,016
python
en
code
0
github-code
6
[ { "api_name": "homeassistant.components.switch.SwitchDeviceClass.OUTLET", "line_number": 12, "usage_type": "attribute" }, { "api_name": "homeassistant.components.switch.SwitchDeviceClass", "line_number": 12, "usage_type": "name" }, { "api_name": "homeassistant.components.switch.S...
6043134873
import logging import certifi import random, string from elasticsearch import Elasticsearch from flask import Flask, render_template, request, redirect, url_for, flash from datetime import datetime from quiz import quiz app = Flask(__name__) app.secret_key = 'dfuy48yerhfjdbsklueio' es = Elasticsearch( ['https://h...
mcascallares/esquiz
main.py
main.py
py
2,109
python
en
code
1
github-code
6
[ { "api_name": "flask.Flask", "line_number": 9, "usage_type": "call" }, { "api_name": "elasticsearch.Elasticsearch", "line_number": 12, "usage_type": "call" }, { "api_name": "certifi.where", "line_number": 17, "usage_type": "call" }, { "api_name": "flask.render_tem...
43095956138
import plugins import sys import data import model plugins.load_all('config.json') target = sys.argv[1] start_node = model.Node('person', target) d = data.Storage(target) d.add_node(start_node) def handle(tokens): if tokens[0].lower() == 'list': # show list of nodes if len(tokens) > 1: ...
tracer-sec/osint
console.py
console.py
py
2,022
python
en
code
8
github-code
6
[ { "api_name": "plugins.load_all", "line_number": 6, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 8, "usage_type": "attribute" }, { "api_name": "model.Node", "line_number": 10, "usage_type": "call" }, { "api_name": "data.Storage", "line_numb...
71780096828
from colorfield.fields import ColorField from django.core.validators import MinValueValidator, RegexValidator from django.db import models from users.models import User class Ingredient(models.Model): """Класс интредиент""" name = models.CharField( verbose_name='Наименование ингредиента', ma...
GirzhuNikolay/foodgram-project-react
backend/recipes/models.py
models.py
py
7,583
python
ru
code
0
github-code
6
[ { "api_name": "django.db.models.Model", "line_number": 8, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 8, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 11, "usage_type": "call" }, { "api_name": ...
31331693062
#! /usr/bin/python3 import os import sys import glob import time import shutil import logging import argparse import subprocess import pandas as pd from pathlib import Path from itertools import repeat from multiprocessing import Pool from nest.bbduk import QualCheck from nest.alignment import Bwa from nest.alignment i...
ohjeyy93/NFNeST
nest.py
nest.py
py
21,367
python
en
code
0
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 53, "usage_type": "call" }, { "api_name": "os.path.abspath", "line_number": 56, "usage_type": "call" }, { "api_name": "os.path", "line_number": 56, "usage_type": "attribute" }, { "api_name": "os.path.exists", "...
6629686746
import tensorflow as tf from tensorflow.compat.v1 import ConfigProto from tensorflow.compat.v1 import InteractiveSession #Configure GPU config = ConfigProto() config.gpu_options.allow_growth = True session = InteractiveSession(config=config) for gpu in tf.config.experimental.list_physical_devices('GPU'): tf.confi...
jfgf11/ml_genn_examples_ssh
Sequential API/mobilenetv1.py
mobilenetv1.py
py
7,524
python
en
code
0
github-code
6
[ { "api_name": "tensorflow.compat.v1.ConfigProto", "line_number": 6, "usage_type": "call" }, { "api_name": "tensorflow.compat.v1.InteractiveSession", "line_number": 8, "usage_type": "call" }, { "api_name": "tensorflow.config.experimental.list_physical_devices", "line_number": ...
70005437309
from __future__ import with_statement from fabric.api import * import os, glob, socket import fabric.contrib.project as project PROD = 'spreadwebm.org' PROD_PATH = 'domains/spreadwebm.com/web/public/' ROOT_PATH = os.path.abspath(os.path.dirname(__file__)) DEPLOY_PATH = os.path.join(ROOT_PATH, 'deploy') def clean(): ...
louquillio/spreadwebm.com
fabfile.py
fabfile.py
py
1,127
python
en
code
1
github-code
6
[ { "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.dirname", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path.join", "line_nu...
1293789301
import numpy as np import onnx from tests.tools import expect class Sqrt: @staticmethod def export(): # type: () -> None node = onnx.helper.make_node( 'Sqrt', inputs=['x'], outputs=['y'], ) x = np.array([1, 4, 9]).astype(np.float32) y = np...
gglin001/onnx-jax
tests/node/test_sqrt.py
test_sqrt.py
py
632
python
en
code
7
github-code
6
[ { "api_name": "onnx.helper.make_node", "line_number": 10, "usage_type": "call" }, { "api_name": "onnx.helper", "line_number": 10, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.float32", ...
28031383283
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import rospy import cv2 import cv_bridge import sensor_msgs.msg import argparse import numpy as np class image_converter: def __init__(self, input_topic, output_topic): self.image_pub = rospy.Publisher( output_topic, sensor_msgs.msg.Im...
kargenk/image_converter
image_converter.py
image_converter.py
py
1,762
python
en
code
0
github-code
6
[ { "api_name": "rospy.Publisher", "line_number": 16, "usage_type": "call" }, { "api_name": "sensor_msgs.msg.msg", "line_number": 17, "usage_type": "attribute" }, { "api_name": "sensor_msgs.msg", "line_number": 17, "usage_type": "name" }, { "api_name": "cv_bridge.Cv...
44713652316
import sys import xmltodict color_names = { 'Foreground Color': 'ForegroundColour', 'Background Color': 'BackgroundColour', 'Cursor Text Color': 'CursorColour', 'Ansi 0 Color': 'Black', 'Ansi 1 Color': 'Red', 'Ansi 2 Color': 'Green', 'Ansi 3 Co...
arcadecoffee/iterm-to-mintty
iterm-to-mintty.py
iterm-to-mintty.py
py
1,706
python
en
code
0
github-code
6
[ { "api_name": "sys.argv", "line_number": 41, "usage_type": "attribute" }, { "api_name": "xmltodict.parse", "line_number": 44, "usage_type": "call" } ]
70501561789
from django.conf.urls import patterns, include, url urlpatterns = patterns('django_sprinkler', url(r"^get_context/?", "views.get_context", name="get_context"), url(r"^logs/?", "views.watering_logs", name="watering_logs"), url(r"^toggle_valve/(\d+)?/?", "views.toggle_valve", name="toggle_valve"), url(r"...
jpardobl/django_sprinkler
django_sprinkler/urls.py
urls.py
py
517
python
en
code
0
github-code
6
[ { "api_name": "django.conf.urls.patterns", "line_number": 3, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 4, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 5, "usage_type": "call" }, { "api_name": "djan...
33967529914
# -*- coding: utf-8 -*- # !/usr/bin/env python # @Time :2020/7/7 15:39 # @Author :Sheng Chen # @Email :sheng.chen@inossem.com import sys sys.path.append(r'/home/chensheng/likou') from typing import List, Tuple class Solution: rows = [{} for i in range(9)] columns = [{} for i in range(9)] boxes = [{} fo...
fqlovetu/likou_python
37解数独/solution1.py
solution1.py
py
2,979
python
en
code
0
github-code
6
[ { "api_name": "sys.path.append", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "typing.List", "line_number": 20, "usage_type": "name" }, { "api_name": "typing.List", "line_numbe...
28765664515
from async_scrape import Scrape import requests import json from selenium.webdriver import Edge from selenium.webdriver.common.by import By from selenium.webdriver.support.wait import WebDriverWait from selenium.webdriver.support import expected_conditions as EC url = "https://order.marstons.co.uk/" base_dir = "C:/Us...
cia05rf/marstons
webscrape/scrape.py
scrape.py
py
1,223
python
en
code
0
github-code
6
[ { "api_name": "selenium.webdriver.Edge", "line_number": 14, "usage_type": "call" }, { "api_name": "selenium.webdriver.support.wait.WebDriverWait", "line_number": 16, "usage_type": "call" }, { "api_name": "selenium.webdriver.support.expected_conditions.presence_of_all_elements_loc...
27214868635
from enum import IntEnum, auto from typing import List, Mapping, Union, Tuple, Optional from .aetg import AETGGenerator from .matrix import MatrixGenerator from ...model import int_enum_loads from ...reflection import progressive_for __all__ = ['tmatrix'] @int_enum_loads(enable_int=False, name_preprocess=str.upper)...
HansBug/hbutils
hbutils/testing/generator/func.py
func.py
py
3,442
python
en
code
7
github-code
6
[ { "api_name": "enum.IntEnum", "line_number": 13, "usage_type": "name" }, { "api_name": "enum.auto", "line_number": 14, "usage_type": "call" }, { "api_name": "enum.auto", "line_number": 15, "usage_type": "call" }, { "api_name": "model.int_enum_loads", "line_num...
28382656931
import cgi import sys import io import genshin.database.operation as gdo form = cgi.FieldStorage() sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8') template = """ <html> <head> <meta charset="utf-8"> <script type="text/javascript"> location.replace('/cgi-bin/characters.py?dname={name...
waigoma/genshin-charatraining-supporter
src/cgi-bin/character_delete.py
character_delete.py
py
628
python
en
code
0
github-code
6
[ { "api_name": "cgi.FieldStorage", "line_number": 6, "usage_type": "call" }, { "api_name": "sys.stdout", "line_number": 7, "usage_type": "attribute" }, { "api_name": "io.TextIOWrapper", "line_number": 7, "usage_type": "call" }, { "api_name": "genshin.database.opera...
72777565307
# Plotting solution of x''(t) + x(t) = 0 equation import numpy as np import matplotlib.pyplot as plt import os from io import StringIO import pandas as pd from find_solution import find_solution from plot_utils import create_dir def plot_solution(plot_dir, t_end, delta_t): data = find_solution(t_end=t_end, delta_...
evgenyneu/ASP3162
03_second_order_ode/plotting/plot_solution.py
plot_solution.py
py
1,130
python
en
code
1
github-code
6
[ { "api_name": "find_solution.find_solution", "line_number": 12, "usage_type": "call" }, { "api_name": "plot_utils.create_dir", "line_number": 14, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 19, "usage_type": "call" }, { "api_name": "io....
9842073923
import redneuronal import random import time import statistics class RedNeuronalGA: def __init__(self, size, config:list, inputsize, mut_rate = 0.01, lastbest_rate = 0.5, tour_size = 10): ''' :param size: :param n_genes: :param config: lista que indica [numero de layers, [numero ...
plt1994/cc5114ne
genalg.py
genalg.py
py
4,234
python
en
code
0
github-code
6
[ { "api_name": "random.random", "line_number": 50, "usage_type": "call" }, { "api_name": "random.random", "line_number": 53, "usage_type": "call" }, { "api_name": "redneuronal.RedN", "line_number": 57, "usage_type": "call" }, { "api_name": "random.randint", "li...
39839377690
#Library import datetime import time from tkinter import * import tkinter.ttk as ttk from urllib.request import urlretrieve import serial import os import RPi.GPIO as GPIO #End Library #Firmwares ultra1 = serial.Serial("/dev/ttyUSB0",baudrate=9600, timeout=1) gsm = serial.Serial("/dev/ttyAMA0",baudrate=9600, timeout=1...
sinameshkini/python_samples
sajab4.py
sajab4.py
py
16,045
python
en
code
0
github-code
6
[ { "api_name": "serial.Serial", "line_number": 13, "usage_type": "call" }, { "api_name": "serial.Serial", "line_number": 14, "usage_type": "call" }, { "api_name": "RPi.GPIO.setwarnings", "line_number": 16, "usage_type": "call" }, { "api_name": "RPi.GPIO", "line...
25004993355
from typing import cast, Any from aea.skills.behaviours import TickerBehaviour from aea.helpers.search.models import Constraint, ConstraintType, Query from packages.fetchai.protocols.oef_search.message import OefSearchMessage from packages.fetchai.skills.tac_control.dialogues import ( OefSearchDialogues, ) from...
DENE-dev/dene-dev
RQ1-data/exp2/1010-OCzarnecki@gdp8-e6988c211a76ac3a2736d49d00f0a6de8b44c3b0/agent_aea/skills/agent_action_each_turn/behaviours.py
behaviours.py
py
3,601
python
en
code
0
github-code
6
[ { "api_name": "aea.skills.behaviours.TickerBehaviour", "line_number": 25, "usage_type": "name" }, { "api_name": "aea.helpers.search.models.Constraint", "line_number": 56, "usage_type": "call" }, { "api_name": "aea.helpers.search.models.ConstraintType", "line_number": 58, ...
7930998505
import numpy as np import matplotlib.pyplot as plt # seulement deux etats def epidemie_1(temps = 50, population = 10**6): propagation = np.array( [[0.9 , 0.1], [0.3, 0.7]]) # 0 -> infecte, 1 -> sain popu = np.array([0, 1]) X_temps = np.linspace(0, temps, temps) Y_infectes = [] for t in range(tem...
kmlst/TIPE-Coding-regions-in-DNA-with-Hidden-Markov-Model
tipe_code.py
tipe_code.py
py
10,617
python
en
code
0
github-code
6
[ { "api_name": "numpy.array", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.dot", "line_number": ...
2282915747
import torch from torch import Tensor from kornia.utils import one_hot import torch.nn.functional as F import numpy as np from matplotlib import pyplot as plt def reg_loss(prediction, ED, ES, device): # print(prediction) prediction_toSyn = prediction.squeeze().detach().cpu().numpy() y_k = synthetic_label(p...
carlesgarciac/regression
regression-cmr/utils/reg_loss.py
reg_loss.py
py
1,707
python
en
code
0
github-code
6
[ { "api_name": "torch.nn.functional.mse_loss", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.nn.functional", "line_number": 18, "usage_type": "name" }, { "api_name": "torch.from_numpy", "line_number": 37, "usage_type": "call" }, { "api_name": "num...
41843852670
# Code courtesy: https://towardsdatascience.com/support-vector-machine-python-example-d67d9b63f1c8 # Theory: https://www.youtube.com/watch?v=_PwhiWxHK8o import numpy as np import cvxopt from sklearn.datasets.samples_generator import make_blobs from sklearn.model_selection import train_test_split from matplotlib import ...
gmortuza/machine-learning-scratch
machine_learning/instance_based/svm/svm.py
svm.py
py
3,218
python
en
code
6
github-code
6
[ { "api_name": "numpy.zeros", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.dot", "line_number": 30, "usage_type": "call" }, { "api_name": "cvxopt.matrix", "line_number": 32, "usage_type": "call" }, { "api_name": "numpy.outer", "line_number": ...
39540715020
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Sep 15 2021 @author: sagrana """ from rest_framework import status from rest_framework.generics import CreateAPIView, RetrieveAPIView from rest_framework.response import Response from rest_framework.permissions import AllowAny from .models import User fr...
theRuthless/stark_ly3000_web_app
backend/users/views.py
views.py
py
1,740
python
en
code
0
github-code
6
[ { "api_name": "rest_framework.generics.CreateAPIView", "line_number": 16, "usage_type": "name" }, { "api_name": "serializers.UserRegistrationSerializer", "line_number": 19, "usage_type": "name" }, { "api_name": "rest_framework.permissions.AllowAny", "line_number": 20, "us...
27643482594
from rest_framework.decorators import api_view from rest_framework.response import Response from base.serializers import ProductSerializer, UserSerializer, UserSerializerWithToken from base.models import Product @api_view(['GET']) def getProducts(request): query = request.query_params.get('keyword') if query...
hitrocs-polito/smart-bozor
base/views/product_views.py
product_views.py
py
917
python
en
code
0
github-code
6
[ { "api_name": "base.models.Product.objects.filter", "line_number": 14, "usage_type": "call" }, { "api_name": "base.models.Product.objects", "line_number": 14, "usage_type": "attribute" }, { "api_name": "base.models.Product", "line_number": 14, "usage_type": "name" }, ...
38169404173
from . import parse as parser from modules import YaraRules, GeoIP, ProjectHoneyPot, LangDetect class Scanner: def __init__(self): self.yara_manager = YaraRules.YaraManager() def parse_email(self, email_content: str): return parser.parse_email(email_content) def scan(self, email: str): # parse it ...
lukasolsen/EmailAnalyser
server/base/service/scan.py
scan.py
py
2,296
python
en
code
0
github-code
6
[ { "api_name": "modules.YaraRules.YaraManager", "line_number": 6, "usage_type": "call" }, { "api_name": "modules.YaraRules", "line_number": 6, "usage_type": "name" }, { "api_name": "modules.LangDetect.detect_language", "line_number": 42, "usage_type": "call" }, { "...
34913449577
import numpy as np import scipy.integrate import scipy.optimize import bokeh.plotting from bokeh.plotting import figure, output_file, show import bokeh.io from bokeh.models import Span def dilute(molecule_diluted,molecules_0,DR=0.2): #input Object want to dilute and where the parameters is stored molecules_0...
william831015/GRN-in-chemostat
scripts/functions.py
functions.py
py
3,004
python
en
code
0
github-code
6
[ { "api_name": "numpy.array", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 33, "usage_type": "call" }, { "api_name": "scipy.integrate.integrate.odeint", "line_number": 36, "usage_type": "call" }, { "api_name": "scipy.int...
35574468725
from collections import defaultdict def createGraph(): g=defaultdict(list) return g def topoSort(g,indeg,q,cnt,n,res): for i in range(n): if indeg[i] is 0: q.append(i) while(q): cur=q.pop(0) for i in g[cur]: indeg[i]-=1 if(indeg...
goyalgaurav64/Graph
topological-sort-kahns-algo-bfs.py
topological-sort-kahns-algo-bfs.py
py
868
python
en
code
1
github-code
6
[ { "api_name": "collections.defaultdict", "line_number": 3, "usage_type": "call" } ]
1149669859
from lib.contents_reader import ContentsReader import asyncio CLEAR_SCREEN = "\u001b[2J" NEW_LINE = "\r\n" class ZineFunctions: def __init__(self, reader, writer, index_file_path): self.reader = reader self.writer = writer self.contents_reader = ContentsReader(index_file_path) asy...
caraesten/dial_a_zine
dialazine/lib/zine_functions.py
zine_functions.py
py
2,161
python
en
code
58
github-code
6
[ { "api_name": "lib.contents_reader.ContentsReader", "line_number": 11, "usage_type": "call" }, { "api_name": "asyncio.sleep", "line_number": 36, "usage_type": "call" } ]
19107028474
"""Extract data on near-Earth objects and close approaches from CSV and JSON files. The `load_neos` function extracts NEO data from a CSV file, formatted as described in the project instructions, into a collection of `NearEarthObject`s. The `load_approaches` function extracts close approach data from a JSON file, for...
rcmadden/Near-Earth-Objects
extract.py
extract.py
py
2,061
python
en
code
0
github-code
6
[ { "api_name": "csv.DictReader", "line_number": 31, "usage_type": "call" }, { "api_name": "models.NearEarthObject", "line_number": 36, "usage_type": "call" }, { "api_name": "json.load", "line_number": 50, "usage_type": "call" }, { "api_name": "models.CloseApproach"...
14988584675
from setuptools import setup package_name = 'leg_controller' setup( name=package_name, version='0.0.0', packages=[package_name], data_files=[ ('share/ament_index/resource_index/packages', ['resource/' + package_name]), ('share/' + package_name, ['package.xml']), ], ...
PetriJF/Hexapod
src/leg_controller/setup.py
setup.py
py
813
python
en
code
2
github-code
6
[ { "api_name": "setuptools.setup", "line_number": 5, "usage_type": "call" } ]
13303958661
from fastapi import APIRouter, Depends from app.dependencies import verify_api_key from app.libraries.libpoller import Poller from app.schemas.poller import PollerModel, PollerUpdateModel, PollerCreateModel router = APIRouter(tags=["poller"]) oPoller = Poller() # Poller Requests ( API_KEY required ) @router.get("/p...
treytose/Pyonet-API
pyonet-api/app/routers/poller.py
poller.py
py
1,534
python
en
code
0
github-code
6
[ { "api_name": "fastapi.APIRouter", "line_number": 6, "usage_type": "call" }, { "api_name": "app.libraries.libpoller.Poller", "line_number": 7, "usage_type": "call" }, { "api_name": "fastapi.Depends", "line_number": 13, "usage_type": "call" }, { "api_name": "app.de...
39253810380
from mangaki.models import Artist, Manga, Genre from django.db.utils import IntegrityError, DataError import re from collections import Counter def run(): with open('../data/manga-news/manga.csv') as f: next(f) artists = {} hipsters = Counter() for i, line in enumerate(f): ...
mangaki/mangaki
mangaki/tools/add_manga.py
add_manga.py
py
2,689
python
en
code
137
github-code
6
[ { "api_name": "collections.Counter", "line_number": 11, "usage_type": "call" }, { "api_name": "re.match", "line_number": 18, "usage_type": "call" }, { "api_name": "mangaki.models.Artist.objects.filter", "line_number": 25, "usage_type": "call" }, { "api_name": "man...
16421467025
# Test the models with LG_chem stock # If the prediction is success, Expand the number of stock import math import os import pdb from datetime import datetime import numpy as np import pandas as pd import matplotlib.pyplot as plt from tqdm import tqdm import torch import torch.nn as nn from torch.utils.data import D...
groundwater98/Miraeasset_Bigdata_Festival
ML/Prediction/predict.py
predict.py
py
13,225
python
en
code
1
github-code
6
[ { "api_name": "os.path.abspath", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path", "line_number": 20, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 26, "usage_type": "call" }, { "api_name": "matplotlib.pypl...
29157516812
#!/usr/bin/env python3 import asyncio from mavsdk import System from mavsdk.gimbal import GimbalMode, ControlMode async def run(): # Init the drone drone = System() await drone.connect(system_address="udp://:14540") # Start printing gimbal position updates print_gimbal_position_task = \ ...
mavlink/MAVSDK-Python
examples/gimbal.py
gimbal.py
py
2,709
python
en
code
246
github-code
6
[ { "api_name": "mavsdk.System", "line_number": 10, "usage_type": "call" }, { "api_name": "asyncio.ensure_future", "line_number": 15, "usage_type": "call" }, { "api_name": "mavsdk.gimbal.ControlMode.PRIMARY", "line_number": 18, "usage_type": "attribute" }, { "api_na...
26023685530
import numpy as np import numpy as np import matplotlib.pyplot as plt from fealpy.mesh.uniform_mesh_2d import UniformMesh2d from scipy.sparse.linalg import spsolve #from ..decorator import cartesian class MembraneOscillationPDEData: # 点击这里可以查看 FEALPy 中的代码 def __init__(self, D=[0, 1, 0, 1], T=[0, 5]): """...
suanhaitech/pythonstudy2023
Mia_wave/wace_2.py
wace_2.py
py
5,381
python
en
code
2
github-code
6
[ { "api_name": "numpy.zeros_like", "line_number": 43, "usage_type": "call" }, { "api_name": "numpy.zeros_like", "line_number": 67, "usage_type": "call" }, { "api_name": "numpy.zeros_like", "line_number": 79, "usage_type": "call" }, { "api_name": "fealpy.mesh.unifor...