index int64 | repo_name string | branch_name string | path string | content string | import_graph string |
|---|---|---|---|---|---|
8,845 | TestaVuota/COCO-Style-Dataset-Generator-GUI | refs/heads/master | /coco_dataset_generator/utils/visualize_json_file.py | import json
import cv2
import argparse
import os
import numpy as np
if __name__=='__main__':
ap = argparse.ArgumentParser()
ap.add_argument('json_file', help="Path to the JSON dataset file to visualize")
ap.add_argument('--save', help='Save a few results to disk to accommodate non-display environments... | {"/coco_dataset_generator/extras/cut_objects.py": ["/coco_dataset_generator/gui/contours.py"], "/coco_dataset_generator/gui/segment.py": ["/coco_dataset_generator/gui/contours.py"], "/coco_dataset_generator/extras/occlusion_transforms.py": ["/coco_dataset_generator/gui/contours.py"], "/coco_dataset_generator/utils/crea... |
8,846 | TestaVuota/COCO-Style-Dataset-Generator-GUI | refs/heads/master | /coco_dataset_generator/gui/segment_bbox_only.py | from matplotlib import pyplot as plt
from matplotlib.collections import PatchCollection
from matplotlib.patches import Polygon
from matplotlib.widgets import RadioButtons
from matplotlib.path import Path
import matplotlib.patches as patches
from PIL import Image
import matplotlib
import argparse
import num... | {"/coco_dataset_generator/extras/cut_objects.py": ["/coco_dataset_generator/gui/contours.py"], "/coco_dataset_generator/gui/segment.py": ["/coco_dataset_generator/gui/contours.py"], "/coco_dataset_generator/extras/occlusion_transforms.py": ["/coco_dataset_generator/gui/contours.py"], "/coco_dataset_generator/utils/crea... |
8,847 | TestaVuota/COCO-Style-Dataset-Generator-GUI | refs/heads/master | /coco_dataset_generator/extras/split_json_file.py | import json
import argparse
def contains(splits):
# Returns 1D binary map of images to take such that access is O(1)
MAX, MIN = max([int(x.split('-')[-1]) for x in splits]), min([int(x.split('-')[0]) for x in splits])
A = [0 for _ in range(MAX-MIN+1)]
for sp in splits:
if '-' in sp:
beg... | {"/coco_dataset_generator/extras/cut_objects.py": ["/coco_dataset_generator/gui/contours.py"], "/coco_dataset_generator/gui/segment.py": ["/coco_dataset_generator/gui/contours.py"], "/coco_dataset_generator/extras/occlusion_transforms.py": ["/coco_dataset_generator/gui/contours.py"], "/coco_dataset_generator/utils/crea... |
8,848 | TestaVuota/COCO-Style-Dataset-Generator-GUI | refs/heads/master | /coco_dataset_generator/extras/create_binary_dataset.py | import argparse
import json
if __name__=='__main__':
ap = argparse.ArgumentParser()
ap.add_argument('json', help='Path to original multi-class JSON file')
args = ap.parse_args()
with open(args.json, 'r') as f:
obj = json.load(f)
obj['classes'] = ['object']
for idx in range(... | {"/coco_dataset_generator/extras/cut_objects.py": ["/coco_dataset_generator/gui/contours.py"], "/coco_dataset_generator/gui/segment.py": ["/coco_dataset_generator/gui/contours.py"], "/coco_dataset_generator/extras/occlusion_transforms.py": ["/coco_dataset_generator/gui/contours.py"], "/coco_dataset_generator/utils/crea... |
8,849 | TestaVuota/COCO-Style-Dataset-Generator-GUI | refs/heads/master | /setup.py | from setuptools import setup, find_packages
import os
import sys
import subprocess
def install(package):
subprocess.call([sys.executable, "-m", "pip", "install", package])
if os.getenv('MASK_RCNN'):
fl = 'requirements_maskrcnn.txt'
else:
fl = 'requirements.txt'
with open(fl, 'r') as f:
packs = [x.str... | {"/coco_dataset_generator/extras/cut_objects.py": ["/coco_dataset_generator/gui/contours.py"], "/coco_dataset_generator/gui/segment.py": ["/coco_dataset_generator/gui/contours.py"], "/coco_dataset_generator/extras/occlusion_transforms.py": ["/coco_dataset_generator/gui/contours.py"], "/coco_dataset_generator/utils/crea... |
8,850 | TestaVuota/COCO-Style-Dataset-Generator-GUI | refs/heads/master | /coco_dataset_generator/utils/delete_images.py | import argparse
import json
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as patches
def press(event):
if event.key.lower() == 'q':
exit()
if event.key.lower() == 'd':
for ann in anns:
new_anns.remove(ann)
print ('Deleted image:', new... | {"/coco_dataset_generator/extras/cut_objects.py": ["/coco_dataset_generator/gui/contours.py"], "/coco_dataset_generator/gui/segment.py": ["/coco_dataset_generator/gui/contours.py"], "/coco_dataset_generator/extras/occlusion_transforms.py": ["/coco_dataset_generator/gui/contours.py"], "/coco_dataset_generator/utils/crea... |
8,851 | TestaVuota/COCO-Style-Dataset-Generator-GUI | refs/heads/master | /coco_dataset_generator/utils/create_json_file.py | #coding: utf8
import xml.etree.cElementTree as ET
import glob
import argparse
import os
import numpy as np
import json
import unicodedata
from PIL import Image
from ..gui.segment import COCO_dataset_generator as cocogen
if __name__=='__main__':
ap = argparse.ArgumentParser()
ap.add_argument("-i", "--image_di... | {"/coco_dataset_generator/extras/cut_objects.py": ["/coco_dataset_generator/gui/contours.py"], "/coco_dataset_generator/gui/segment.py": ["/coco_dataset_generator/gui/contours.py"], "/coco_dataset_generator/extras/occlusion_transforms.py": ["/coco_dataset_generator/gui/contours.py"], "/coco_dataset_generator/utils/crea... |
8,855 | Daiding-Hu/Exclecode | refs/heads/master | /pymysql.py | import pymssql
# 连接数据库
connect = pymssql.connect(
host='localhost',
port=3306,
user='root',
passwd='hu12580WEI',
db='python',
charset='utf8'
)
# 获取游标
cursor = connect.cursor()
# 插入数据
sql = "INSERT INTO trade (name, account, saving) VALUES ( '%s', '%s', %.2f )"
data = ('雷军', '13512345678', 1000... | {"/Excle-pandas.py": ["/pymysql.py"]} |
8,856 | Daiding-Hu/Exclecode | refs/heads/master | /Excle-xlwt.py | import xlwt
workbook = xlwt.Workbook(encoding='utf-8')
worksheet = workbook.add_sheet('表格1')
# worksheet.write(0, 0, 'this is test') # 在0,0处写入数据
# workbook.save('练习2.xlsx')
list_num = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
for i in range(len(list_num)):
worksheet.write(0, i, list_num[i])
style = xlwt.XFStyle() # 初始化样式
... | {"/Excle-pandas.py": ["/pymysql.py"]} |
8,857 | Daiding-Hu/Exclecode | refs/heads/master | /Excle-openpyxl.py | import openpyxl
from openpyxl import Workbook
from openpyxl import load_workbook
# # 实例化
# wb = Workbook()
# # 激活 worksheet,这个函数使用_active_sheet_index这个属性,默认设置的值是0,除非你指定一个值,否则总是获取到第一个worksheet。
# ws = wb.active
#
# # 单元格直接赋值
# ws['A1'] = 42
# ws['A2'] = '=sum(B2:C2)'
# wb.save('练习3.xlsx')
#
# print(ws['A2'].value)
# # w... | {"/Excle-pandas.py": ["/pymysql.py"]} |
8,858 | Daiding-Hu/Exclecode | refs/heads/master | /Excle-xlrd.py | import openpyxl
import xlrd
import xlwt
import datetime
import pymssql
workbook = xlrd.open_workbook('练习.xlsx')
sheet_names = workbook.sheet_names()
print(sheet_names)
sheets = workbook.sheets() # 获取sheet对象,赋给sheets
print(sheets)
sheet1 = workbook.sheet_by_index(0) # 获取sheet中第一张表,0代表第一张
print(sheet1)
sheet2 = workbo... | {"/Excle-pandas.py": ["/pymysql.py"]} |
8,859 | Daiding-Hu/Exclecode | refs/heads/master | /Excle-pandas.py | import numpy as np
import pandas as pd
import pymysql
| {"/Excle-pandas.py": ["/pymysql.py"]} |
8,860 | samuelcolvin/sasstastic | refs/heads/master | /sasstastic/logs.py | import logging
import logging.config
import click
class ClickHandler(logging.Handler):
formats = {
logging.DEBUG: {'fg': 'white', 'dim': True},
logging.INFO: {'fg': 'green'},
logging.WARN: {'fg': 'yellow'},
}
def emit(self, record):
log_entry = self.format(record)
... | {"/sasstastic/config.py": ["/sasstastic/common.py"], "/sasstastic/compile.py": ["/sasstastic/common.py", "/sasstastic/config.py"], "/sasstastic/cli.py": ["/sasstastic/config.py", "/sasstastic/logs.py", "/sasstastic/main.py"], "/sasstastic/__init__.py": ["/sasstastic/common.py", "/sasstastic/compile.py", "/sasstastic/co... |
8,861 | samuelcolvin/sasstastic | refs/heads/master | /sasstastic/config.py | import logging
import re
from pathlib import Path
from typing import Any, Dict, List, Optional, Pattern
import yaml
from pydantic import BaseModel, HttpUrl, ValidationError, validator
from pydantic.error_wrappers import display_errors
from .common import SasstasticError, is_file_path
try:
from yaml import CLoade... | {"/sasstastic/config.py": ["/sasstastic/common.py"], "/sasstastic/compile.py": ["/sasstastic/common.py", "/sasstastic/config.py"], "/sasstastic/cli.py": ["/sasstastic/config.py", "/sasstastic/logs.py", "/sasstastic/main.py"], "/sasstastic/__init__.py": ["/sasstastic/common.py", "/sasstastic/compile.py", "/sasstastic/co... |
8,862 | samuelcolvin/sasstastic | refs/heads/master | /sasstastic/compile.py | import hashlib
import json
import logging
import re
import shutil
import tempfile
from contextlib import contextmanager
from pathlib import Path
from time import time
from typing import Optional, Union
import click
import sass
from .common import SasstasticError
from .config import ConfigModel
__all__ = ('compile_sa... | {"/sasstastic/config.py": ["/sasstastic/common.py"], "/sasstastic/compile.py": ["/sasstastic/common.py", "/sasstastic/config.py"], "/sasstastic/cli.py": ["/sasstastic/config.py", "/sasstastic/logs.py", "/sasstastic/main.py"], "/sasstastic/__init__.py": ["/sasstastic/common.py", "/sasstastic/compile.py", "/sasstastic/co... |
8,863 | samuelcolvin/sasstastic | refs/heads/master | /sasstastic/cli.py | import logging
from pathlib import Path
from typing import Optional
import typer
from .config import SasstasticError, load_config
from .logs import setup_logging
from .main import download_and_compile, watch
from .version import VERSION
cli = typer.Typer()
logger = logging.getLogger('sasstastic.cli')
def version_c... | {"/sasstastic/config.py": ["/sasstastic/common.py"], "/sasstastic/compile.py": ["/sasstastic/common.py", "/sasstastic/config.py"], "/sasstastic/cli.py": ["/sasstastic/config.py", "/sasstastic/logs.py", "/sasstastic/main.py"], "/sasstastic/__init__.py": ["/sasstastic/common.py", "/sasstastic/compile.py", "/sasstastic/co... |
8,864 | samuelcolvin/sasstastic | refs/heads/master | /sasstastic/__init__.py | # flake8: noqa
from .common import SasstasticError
from .compile import compile_sass
from .config import ConfigModel, load_config
from .download import download_sass
from .main import download_and_compile
from .version import VERSION
__all__ = (
'download_sass',
'compile_sass',
'SasstasticError',
'load... | {"/sasstastic/config.py": ["/sasstastic/common.py"], "/sasstastic/compile.py": ["/sasstastic/common.py", "/sasstastic/config.py"], "/sasstastic/cli.py": ["/sasstastic/config.py", "/sasstastic/logs.py", "/sasstastic/main.py"], "/sasstastic/__init__.py": ["/sasstastic/common.py", "/sasstastic/compile.py", "/sasstastic/co... |
8,865 | samuelcolvin/sasstastic | refs/heads/master | /sasstastic/common.py | import re
from pathlib import Path
from typing import Optional
__all__ = ('SasstasticError', 'is_file_path')
class SasstasticError(RuntimeError):
pass
def is_file_path(p: Optional[Path]) -> bool:
return p is not None and re.search(r'\.[a-zA-Z0-9]{1,5}$', p.name)
| {"/sasstastic/config.py": ["/sasstastic/common.py"], "/sasstastic/compile.py": ["/sasstastic/common.py", "/sasstastic/config.py"], "/sasstastic/cli.py": ["/sasstastic/config.py", "/sasstastic/logs.py", "/sasstastic/main.py"], "/sasstastic/__init__.py": ["/sasstastic/common.py", "/sasstastic/compile.py", "/sasstastic/co... |
8,866 | samuelcolvin/sasstastic | refs/heads/master | /setup.py | from importlib.machinery import SourceFileLoader
from pathlib import Path
from setuptools import setup
description = 'Fantastic SASS and SCSS compilation for python'
THIS_DIR = Path(__file__).resolve().parent
try:
long_description = THIS_DIR.joinpath('README.md').read_text()
except FileNotFoundError:
long_des... | {"/sasstastic/config.py": ["/sasstastic/common.py"], "/sasstastic/compile.py": ["/sasstastic/common.py", "/sasstastic/config.py"], "/sasstastic/cli.py": ["/sasstastic/config.py", "/sasstastic/logs.py", "/sasstastic/main.py"], "/sasstastic/__init__.py": ["/sasstastic/common.py", "/sasstastic/compile.py", "/sasstastic/co... |
8,867 | samuelcolvin/sasstastic | refs/heads/master | /sasstastic/main.py | import asyncio
import logging
from pathlib import Path
from typing import Optional
import watchgod
from .compile import compile_sass
from .config import ConfigModel, load_config
from .download import Downloader, download_sass
logger = logging.getLogger('sasstastic.main')
__all__ = 'download_and_compile', 'watch', 'a... | {"/sasstastic/config.py": ["/sasstastic/common.py"], "/sasstastic/compile.py": ["/sasstastic/common.py", "/sasstastic/config.py"], "/sasstastic/cli.py": ["/sasstastic/config.py", "/sasstastic/logs.py", "/sasstastic/main.py"], "/sasstastic/__init__.py": ["/sasstastic/common.py", "/sasstastic/compile.py", "/sasstastic/co... |
8,868 | samuelcolvin/sasstastic | refs/heads/master | /sasstastic/download.py | import asyncio
import hashlib
import json
import logging
import re
import zipfile
from io import BytesIO
from itertools import chain
from pathlib import Path
from typing import Dict, Set, Tuple
from httpx import AsyncClient
from .common import SasstasticError, is_file_path
from .config import ConfigModel, SourceModel... | {"/sasstastic/config.py": ["/sasstastic/common.py"], "/sasstastic/compile.py": ["/sasstastic/common.py", "/sasstastic/config.py"], "/sasstastic/cli.py": ["/sasstastic/config.py", "/sasstastic/logs.py", "/sasstastic/main.py"], "/sasstastic/__init__.py": ["/sasstastic/common.py", "/sasstastic/compile.py", "/sasstastic/co... |
8,869 | samuelcolvin/sasstastic | refs/heads/master | /tests/test_cli.py | from typer.testing import CliRunner
from sasstastic.cli import cli
runner = CliRunner()
def test_print_commands():
result = runner.invoke(cli, ['--help'])
assert result.exit_code == 0
assert 'Fantastic SASS and SCSS compilation' in result.output
| {"/sasstastic/config.py": ["/sasstastic/common.py"], "/sasstastic/compile.py": ["/sasstastic/common.py", "/sasstastic/config.py"], "/sasstastic/cli.py": ["/sasstastic/config.py", "/sasstastic/logs.py", "/sasstastic/main.py"], "/sasstastic/__init__.py": ["/sasstastic/common.py", "/sasstastic/compile.py", "/sasstastic/co... |
8,870 | aleksandr-rakov/workdays_calendar | refs/heads/master | /workdays_calendar/scripts/init_db.py | # -*- coding: utf8 -*-
import sys
import os
from pyramid.paster import bootstrap
from pymongo import MongoClient
import workdays_calendar.users
import workdays_calendar.tags
import workdays_calendar.days_calendar
db=None
def setup(settings):
global db
db=MongoClient(settings['mongo.uri'])[settings['mongo.db']... | {"/workdays_calendar/scripts/init_db.py": ["/workdays_calendar/users.py", "/workdays_calendar/tags.py", "/workdays_calendar/days_calendar.py"], "/workdays_calendar/tags.py": ["/workdays_calendar/api.py", "/workdays_calendar/collection_names.py"], "/workdays_calendar/scripts/gen_year.py": ["/workdays_calendar/days_calen... |
8,871 | aleksandr-rakov/workdays_calendar | refs/heads/master | /workdays_calendar/tags.py | # -*- coding: utf8 -*-
import workdays_calendar.api as api
import colander
from bson import ObjectId
from workdays_calendar.collection_names import TAGS_COLLECTION
HOLIDAY_TAG='holiday'
def init_db(db,settings):
required_tags=[HOLIDAY_TAG]
for tag in required_tags:
if db[TAGS_COLLECTION].find_one({'na... | {"/workdays_calendar/scripts/init_db.py": ["/workdays_calendar/users.py", "/workdays_calendar/tags.py", "/workdays_calendar/days_calendar.py"], "/workdays_calendar/tags.py": ["/workdays_calendar/api.py", "/workdays_calendar/collection_names.py"], "/workdays_calendar/scripts/gen_year.py": ["/workdays_calendar/days_calen... |
8,872 | aleksandr-rakov/workdays_calendar | refs/heads/master | /workdays_calendar/scripts/gen_year.py | # -*- coding: utf8 -*-
import sys
import os
from pyramid.paster import bootstrap
from pymongo import MongoClient
from workdays_calendar.days_calendar import gen_year
db=None
def setup(settings):
global db
db=MongoClient(settings['mongo.uri'])[settings['mongo.db']]
def usage(argv):
cmd = os.path.basename(... | {"/workdays_calendar/scripts/init_db.py": ["/workdays_calendar/users.py", "/workdays_calendar/tags.py", "/workdays_calendar/days_calendar.py"], "/workdays_calendar/tags.py": ["/workdays_calendar/api.py", "/workdays_calendar/collection_names.py"], "/workdays_calendar/scripts/gen_year.py": ["/workdays_calendar/days_calen... |
8,873 | aleksandr-rakov/workdays_calendar | refs/heads/master | /workdays_calendar/api.py | # -*- coding: utf8 -*-
import colander
from pyramid.security import NO_PERMISSION_REQUIRED
from pyramid.view import view_config
from pyramid.decorator import reify
from pyramid.i18n import get_localizer
def translate(request):
def translator(msg):
if msg=="":
return ""
elif hasattr(msg,... | {"/workdays_calendar/scripts/init_db.py": ["/workdays_calendar/users.py", "/workdays_calendar/tags.py", "/workdays_calendar/days_calendar.py"], "/workdays_calendar/tags.py": ["/workdays_calendar/api.py", "/workdays_calendar/collection_names.py"], "/workdays_calendar/scripts/gen_year.py": ["/workdays_calendar/days_calen... |
8,874 | aleksandr-rakov/workdays_calendar | refs/heads/master | /workdays_calendar/app_api.py | # -*- coding: utf8 -*-
from workdays_calendar.collection_names import CALENDAR_COLLECTION,TAGS_COLLECTION
from workdays_calendar.days_calendar import get_day_int
from workdays_calendar.tags import HOLIDAY_TAG
import datetime
def get_tag(db,tag_name):
return db[TAGS_COLLECTION].find_one({'name': tag_name})
def day... | {"/workdays_calendar/scripts/init_db.py": ["/workdays_calendar/users.py", "/workdays_calendar/tags.py", "/workdays_calendar/days_calendar.py"], "/workdays_calendar/tags.py": ["/workdays_calendar/api.py", "/workdays_calendar/collection_names.py"], "/workdays_calendar/scripts/gen_year.py": ["/workdays_calendar/days_calen... |
8,875 | aleksandr-rakov/workdays_calendar | refs/heads/master | /workdays_calendar/auth.py | # -*- coding: utf8 -*-
from pyramid.authorization import ACLAuthorizationPolicy
from pyramid.security import Allow
import hashlib
from bson import ObjectId
LOGGED_IN_PERMISSION='admin'
class Hasher:
#работа с подсолеными хешами
@classmethod
def salt(cls):
return unicode(ObjectId())
@classmetho... | {"/workdays_calendar/scripts/init_db.py": ["/workdays_calendar/users.py", "/workdays_calendar/tags.py", "/workdays_calendar/days_calendar.py"], "/workdays_calendar/tags.py": ["/workdays_calendar/api.py", "/workdays_calendar/collection_names.py"], "/workdays_calendar/scripts/gen_year.py": ["/workdays_calendar/days_calen... |
8,876 | aleksandr-rakov/workdays_calendar | refs/heads/master | /workdays_calendar/collection_names.py | # -*- coding: utf8 -*-
CALENDAR_COLLECTION='workdays_calendar'
TAGS_COLLECTION='workdays_tags'
USERS_COLLECTION='workdays_users'
| {"/workdays_calendar/scripts/init_db.py": ["/workdays_calendar/users.py", "/workdays_calendar/tags.py", "/workdays_calendar/days_calendar.py"], "/workdays_calendar/tags.py": ["/workdays_calendar/api.py", "/workdays_calendar/collection_names.py"], "/workdays_calendar/scripts/gen_year.py": ["/workdays_calendar/days_calen... |
8,877 | aleksandr-rakov/workdays_calendar | refs/heads/master | /workdays_calendar/days_calendar.py | # -*- coding: utf8 -*-
import workdays_calendar.api as api
import calendar
import colander
import datetime
from workdays_calendar.collection_names import CALENDAR_COLLECTION,TAGS_COLLECTION
def init_db(db,settings):
gen_year(db,datetime.datetime.now().year)
def chunkify(lst,n):
return [ lst[i*n:i*n+n] for i ... | {"/workdays_calendar/scripts/init_db.py": ["/workdays_calendar/users.py", "/workdays_calendar/tags.py", "/workdays_calendar/days_calendar.py"], "/workdays_calendar/tags.py": ["/workdays_calendar/api.py", "/workdays_calendar/collection_names.py"], "/workdays_calendar/scripts/gen_year.py": ["/workdays_calendar/days_calen... |
8,878 | aleksandr-rakov/workdays_calendar | refs/heads/master | /workdays_calendar/users.py | # -*- coding: utf8 -*-
import workdays_calendar.api as api
import colander
from pyramid.httpexceptions import HTTPNotFound,HTTPForbidden
from bson import ObjectId
from time import sleep
from workdays_calendar.auth import Hasher
from pyramid.security import NO_PERMISSION_REQUIRED
from workdays_calendar.collection_names ... | {"/workdays_calendar/scripts/init_db.py": ["/workdays_calendar/users.py", "/workdays_calendar/tags.py", "/workdays_calendar/days_calendar.py"], "/workdays_calendar/tags.py": ["/workdays_calendar/api.py", "/workdays_calendar/collection_names.py"], "/workdays_calendar/scripts/gen_year.py": ["/workdays_calendar/days_calen... |
8,879 | aleksandr-rakov/workdays_calendar | refs/heads/master | /workdays_calendar/__init__.py | # -*- coding: utf8 -*-
from pyramid.config import Configurator
from bson.objectid import ObjectId
import datetime
from pyramid.renderers import JSON
from pyramid.events import NewRequest
from pymongo import MongoClient
def add_request_properties(event):
"""Сделаем некоторые параметры конфигурации атрибутами reques... | {"/workdays_calendar/scripts/init_db.py": ["/workdays_calendar/users.py", "/workdays_calendar/tags.py", "/workdays_calendar/days_calendar.py"], "/workdays_calendar/tags.py": ["/workdays_calendar/api.py", "/workdays_calendar/collection_names.py"], "/workdays_calendar/scripts/gen_year.py": ["/workdays_calendar/days_calen... |
8,881 | martincalvert/MongoDB-3-New-Relic-Plugin | refs/heads/master | /newrelic_plugin_agent/plugins/__init__.py | """
Plugins are responsible for fetching and parsing the stats from the service
being profiled.
"""
available = {
'mongodb': 'newrelic_plugin_agent.plugins.mongodb.MongoDB',
}
| {"/newrelic_plugin_agent/plugins/mongodb.py": ["/newrelic_plugin_agent/plugins/__init__.py"]} |
8,882 | martincalvert/MongoDB-3-New-Relic-Plugin | refs/heads/master | /newrelic_plugin_agent/plugins/mongodb.py | """
MongoDB Support
"""
import datetime
from pymongo import errors
import logging
import pymongo
import re
from newrelic_plugin_agent.plugins import base
LOGGER = logging.getLogger(__name__)
class MongoDB(base.Plugin):
# SETUP: Set this GUID to something unique.
GUID = 'CHANGE.ME'
def add_datapoints(se... | {"/newrelic_plugin_agent/plugins/mongodb.py": ["/newrelic_plugin_agent/plugins/__init__.py"]} |
8,885 | yanpeipan/scrapy | refs/heads/master | /Scrapy/spiders/cntv.py | # -*- coding: utf-8 -*-
import scrapy
class CntvSpider(scrapy.Spider):
name = "cntv"
allowed_domains = ["http://tv.cntv.cn"]
videoset_search='http://tv.cntv.cn/videoset/search'
#init
def __init__(self, *args, **kwargs):
pass
#start request
def start_requests(self):
return [scrapy.http.Request(url=getattr(s... | {"/Scrapy/spiders/windj007.py": ["/Scrapy/items.py"], "/Scrapy/spiders/Baidupan.py": ["/Scrapy/items.py"], "/Scrapy/spiders/proxy.py": ["/Scrapy/items.py"], "/Scrapy/pipelines.py": ["/Scrapy/items.py"], "/Scrapy/spiders/douban.py": ["/Scrapy/items.py"]} |
8,886 | yanpeipan/scrapy | refs/heads/master | /Scrapy/spiders/tudou.py | #coding=utf-8
from scrapy.spiders import CrawlSpider, Spider
from scrapy.loader import ItemLoader
from scrapy.loader.processors import TakeFirst, MapCompose, Join
from scrapy.exceptions import CloseSpider
from scrapy.selector import Selector
from scrapy.http import FormRequest
from scrapy.http import Request
from Scrap... | {"/Scrapy/spiders/windj007.py": ["/Scrapy/items.py"], "/Scrapy/spiders/Baidupan.py": ["/Scrapy/items.py"], "/Scrapy/spiders/proxy.py": ["/Scrapy/items.py"], "/Scrapy/pipelines.py": ["/Scrapy/items.py"], "/Scrapy/spiders/douban.py": ["/Scrapy/items.py"]} |
8,887 | yanpeipan/scrapy | refs/heads/master | /Scrapy/spiders/windj007.py | from scrapy.linkextractors import LinkExtractor
from scrapy.spiders import CrawlSpider, Rule
from Scrapy.items import ProxyItem
import re
class Windj007Spider(CrawlSpider):
name = 'Windj007'
start_urls = ['http://www.google.ru/search?q=%2B%94%3A8080+%2B%94%3A3128+%2B%94%3A80+filetype%3Atxt&hl=ru&source=hp&btn... | {"/Scrapy/spiders/windj007.py": ["/Scrapy/items.py"], "/Scrapy/spiders/Baidupan.py": ["/Scrapy/items.py"], "/Scrapy/spiders/proxy.py": ["/Scrapy/items.py"], "/Scrapy/pipelines.py": ["/Scrapy/items.py"], "/Scrapy/spiders/douban.py": ["/Scrapy/items.py"]} |
8,888 | yanpeipan/scrapy | refs/heads/master | /Scrapy/spiders/Baidupan.py | # -*- coding: utf-8 -*-
from scrapy.spiders import CrawlSpider
from scrapy.http import Request
from Scrapy.items import *
import json
class BaidupanSpider(CrawlSpider):
name = 'baidupan'
uks = []
allowed_domins = ['https://pan.baidu.com']
URL_HOT = 'https://pan.baidu.com/pcloud/friend/gethotuserlist?start={st... | {"/Scrapy/spiders/windj007.py": ["/Scrapy/items.py"], "/Scrapy/spiders/Baidupan.py": ["/Scrapy/items.py"], "/Scrapy/spiders/proxy.py": ["/Scrapy/items.py"], "/Scrapy/pipelines.py": ["/Scrapy/items.py"], "/Scrapy/spiders/douban.py": ["/Scrapy/items.py"]} |
8,889 | yanpeipan/scrapy | refs/heads/master | /Scrapy/settings.py | # Scrapy settings for Scrapy project
#
# For simplicity, this file contains only the most important settings by
# default. All the other settings are documented here:
#
# http://doc.scrapy.org/en/latest/topics/settings.html
#
BOT_NAME = 'Scrapy'
SPIDER_MODULES = ['Scrapy.spiders']
NEWSPIDER_MODULE = 'Scrapy.spide... | {"/Scrapy/spiders/windj007.py": ["/Scrapy/items.py"], "/Scrapy/spiders/Baidupan.py": ["/Scrapy/items.py"], "/Scrapy/spiders/proxy.py": ["/Scrapy/items.py"], "/Scrapy/pipelines.py": ["/Scrapy/items.py"], "/Scrapy/spiders/douban.py": ["/Scrapy/items.py"]} |
8,890 | yanpeipan/scrapy | refs/heads/master | /Scrapy/spiders/proxy.py | from scrapy.spiders import Spider, Request
from scrapy.selector import Selector
from Scrapy.items import ProxyItem
from selenium import webdriver
from scrapy.selector import HtmlXPathSelector
import time
class ProxySpider(Spider):
name = 'proxy'
pipelines = ['ProxySpider']
middlewares = ['Selenium']
start_url... | {"/Scrapy/spiders/windj007.py": ["/Scrapy/items.py"], "/Scrapy/spiders/Baidupan.py": ["/Scrapy/items.py"], "/Scrapy/spiders/proxy.py": ["/Scrapy/items.py"], "/Scrapy/pipelines.py": ["/Scrapy/items.py"], "/Scrapy/spiders/douban.py": ["/Scrapy/items.py"]} |
8,891 | yanpeipan/scrapy | refs/heads/master | /Scrapy/middlewares.py | from urlparse import urlparse,parse_qs
from pymongo import MongoClient
from scrapy.downloadermiddlewares.useragent import UserAgentMiddleware
from selenium import webdriver
import time
import random
import json
class ProxyMiddleware(object):
def process_request(self, request, spider):
url = urlparse(reques... | {"/Scrapy/spiders/windj007.py": ["/Scrapy/items.py"], "/Scrapy/spiders/Baidupan.py": ["/Scrapy/items.py"], "/Scrapy/spiders/proxy.py": ["/Scrapy/items.py"], "/Scrapy/pipelines.py": ["/Scrapy/items.py"], "/Scrapy/spiders/douban.py": ["/Scrapy/items.py"]} |
8,892 | yanpeipan/scrapy | refs/heads/master | /Scrapy/items.py | # Define here the models for your scraped items
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/items.html
from scrapy.item import Item, Field
from scrapy.loader import ItemLoader
from scrapy.loader.processors import Join, MapCompose, TakeFirst,Identity,Compose
from datetime import datetime
class V... | {"/Scrapy/spiders/windj007.py": ["/Scrapy/items.py"], "/Scrapy/spiders/Baidupan.py": ["/Scrapy/items.py"], "/Scrapy/spiders/proxy.py": ["/Scrapy/items.py"], "/Scrapy/pipelines.py": ["/Scrapy/items.py"], "/Scrapy/spiders/douban.py": ["/Scrapy/items.py"]} |
8,893 | yanpeipan/scrapy | refs/heads/master | /Scrapy/spiders/youku.py | #coding=utf-8
from scrapy.spiders import CrawlSpider, Spider
from scrapy.loader import ItemLoader
from scrapy.loader.processors import TakeFirst, MapCompose, Join
from scrapy.exceptions import CloseSpider
from scrapy.selector import Selector
from scrapy.http import FormRequest
from scrapy.http import Request
from Scrap... | {"/Scrapy/spiders/windj007.py": ["/Scrapy/items.py"], "/Scrapy/spiders/Baidupan.py": ["/Scrapy/items.py"], "/Scrapy/spiders/proxy.py": ["/Scrapy/items.py"], "/Scrapy/pipelines.py": ["/Scrapy/items.py"], "/Scrapy/spiders/douban.py": ["/Scrapy/items.py"]} |
8,894 | yanpeipan/scrapy | refs/heads/master | /Scrapy/pipelines.py | #coding=utf-8
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html import os
import pymongo
from Scrapy.items import *
from os import path
from datetime import datetime
from scrapy.exporters import BaseItem... | {"/Scrapy/spiders/windj007.py": ["/Scrapy/items.py"], "/Scrapy/spiders/Baidupan.py": ["/Scrapy/items.py"], "/Scrapy/spiders/proxy.py": ["/Scrapy/items.py"], "/Scrapy/pipelines.py": ["/Scrapy/items.py"], "/Scrapy/spiders/douban.py": ["/Scrapy/items.py"]} |
8,895 | yanpeipan/scrapy | refs/heads/master | /Scrapy/spiders/douban.py | # -*- coding: utf-8 -*-
from scrapy.spiders import CrawlSpider, Spider
from scrapy.exceptions import CloseSpider
from scrapy .selector import Selector
from pymongo import MongoClient
from scrapy.http import Request
from Scrapy.items import *
import urlparse
import urllib
import json
from datetime import datetime, date... | {"/Scrapy/spiders/windj007.py": ["/Scrapy/items.py"], "/Scrapy/spiders/Baidupan.py": ["/Scrapy/items.py"], "/Scrapy/spiders/proxy.py": ["/Scrapy/items.py"], "/Scrapy/pipelines.py": ["/Scrapy/items.py"], "/Scrapy/spiders/douban.py": ["/Scrapy/items.py"]} |
8,936 | Chalermwutst/basicpython | refs/heads/master | /Car.py | class Car:
#Properties
color = ""
brand = ""
number_of_wheels = 4
number_of_seats = 4
maxspeed = 0
#Constuctor
def __init__(self,color,brand,number_of_wheels,number_of_seats,maxspeed):
self.color = color
self.brand = brand
self.number_of_wheels = number_of_wheels... | {"/usecar.py": ["/Car.py"]} |
8,937 | Chalermwutst/basicpython | refs/heads/master | /ifcondition.py | age = 15
if(age==18)
print("Allow to access")
else:
print("Not allow")
user = "admin"
pwd = "1234"
| {"/usecar.py": ["/Car.py"]} |
8,938 | Chalermwutst/basicpython | refs/heads/master | /Number/calculate.py | def plus(number1=0, number2=0):
total = number1 + number2
return total
def fibonacci(n): # return Fibonacci series up to n
result = []
a, b = 0, 1
while b < n:
result.append(b)
a, b = b, a + b
return result
| {"/usecar.py": ["/Car.py"]} |
8,939 | Chalermwutst/basicpython | refs/heads/master | /usecar.py | from Car import*
#สร้าง Obuject หรือ Instance ของ Class Car
objcar1 = Car('red','Toyota',4,4,180)
objcar1.printdata()
print()
objcar2 = Car('Yellow','Honda',4,4,180)
# objcar2.setbrand="Honda"
# objcar2.setcolor="Yellow"
# objcar2.setspeed=200
objcar2.printdata() | {"/usecar.py": ["/Car.py"]} |
8,940 | Chalermwutst/basicpython | refs/heads/master | /variable.py | a = 3
b = 4.92
c = "itgenius"
print(a)
print(b)
print(c)
print(a, b, c)
x = y = z = 10
j, k = 5, 15
print(x, y, z)
print(j, k)
# Boolean
status = True
msg = False
print(status, msg)
# ตัวแปรแสดงผลร่วมกับข้อความ
| {"/usecar.py": ["/Car.py"]} |
8,941 | Chalermwutst/basicpython | refs/heads/master | /main.py | age = 15
| {"/usecar.py": ["/Car.py"]} |
8,943 | gulsumsr/receipt-reader | refs/heads/master | /app.py | import os
import numpy as np
from flask import Flask, render_template, jsonify, request
from preprocess import preprocess_image
from read_receipt_image import read_receipt
import io
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
# curl -F "file=@../data/receipt.jpg" https://receipt-reader-bk.... | {"/app.py": ["/preprocess.py", "/read_receipt_image.py"]} |
8,944 | gulsumsr/receipt-reader | refs/heads/master | /read_receipt_image.py | import sys
import http.client, urllib.request, urllib.parse, urllib.error, base64
import json
import os
import numpy as np
from skimage.transform import rescale
# from skimage.color import rgb2gray
from skimage.measure import LineModelND, ransac
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
... | {"/app.py": ["/preprocess.py", "/read_receipt_image.py"]} |
8,945 | gulsumsr/receipt-reader | refs/heads/master | /preprocess.py | import numpy as np
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
from skimage.color import rgb2gray
from skimage.morphology import disk
from skimage.filters import rank
from skimage.transform import ProjectiveTransform, warp
from skimage.filters import gabor_kernel
from scipy.signal import fft... | {"/app.py": ["/preprocess.py", "/read_receipt_image.py"]} |
8,950 | spidezad/filesdownloader | refs/heads/master | /filesdownloader/dl_files_to_dir.py | """
filesdownloader
Function to download files from web to target directory.
Enable async download of multiple files.
Required: requests, grequests
"""
import os, sys, re
import string
import random
import requests, grequests
from functools import partial
USER_AGENT = 'Mozilla/5.0 (Windows NT 6... | {"/filesdownloader/__init__.py": ["/filesdownloader/dl_files_to_dir.py"]} |
8,951 | spidezad/filesdownloader | refs/heads/master | /filesdownloader/__init__.py | from .dl_files_to_dir import dl_files_to_dir | {"/filesdownloader/__init__.py": ["/filesdownloader/dl_files_to_dir.py"]} |
8,956 | dorajam/few-shot-link-prediction | refs/heads/main | /models/rgcn_model.py | """
File based off of dgl tutorial on RGCN
Source: https://github.com/dmlc/dgl/tree/master/examples/pytorch/rgcn
"""
import abc
import torch
import torch.nn as nn
import torch.nn.functional as F
import dgl
class RGCN(nn.Module):
def __init__(self, parameter, is_module=True):
super(RGCN, self).__init__()
... | {"/models/relation_meta_learner.py": ["/models/modules.py"], "/models/meta_learner.py": ["/models/relation_meta_learner.py", "/models/rgcn_model.py"], "/trainer.py": ["/utils.py"], "/models/modules.py": ["/models/rgcn_model.py"], "/main.py": ["/data_loader.py", "/trainer.py", "/models/meta_learner.py", "/utils.py"]} |
8,957 | dorajam/few-shot-link-prediction | refs/heads/main | /data_loader.py | import copy
import json
import random
import dgl
import numpy as np
import pandas as pd
import torch
from networkx.algorithms.components import connected_components
import community as community_louvain
def read_dataset(dataset, data_mode, add_inverse_edges):
data_path = "./data/" + dataset
data_dir = {
... | {"/models/relation_meta_learner.py": ["/models/modules.py"], "/models/meta_learner.py": ["/models/relation_meta_learner.py", "/models/rgcn_model.py"], "/trainer.py": ["/utils.py"], "/models/modules.py": ["/models/rgcn_model.py"], "/main.py": ["/data_loader.py", "/trainer.py", "/models/meta_learner.py", "/utils.py"]} |
8,958 | dorajam/few-shot-link-prediction | refs/heads/main | /utils.py | import os
import json
import logging
def get_lr(optimizer):
for param_group in optimizer.param_groups:
return param_group['lr']
def initialize_experiment(params):
params['ckpt_dir'] = os.path.join(params['state_dir'], params['experiment_name'], 'checkpoint')
if not os.path.isdir(params['ckpt_dir... | {"/models/relation_meta_learner.py": ["/models/modules.py"], "/models/meta_learner.py": ["/models/relation_meta_learner.py", "/models/rgcn_model.py"], "/trainer.py": ["/utils.py"], "/models/modules.py": ["/models/rgcn_model.py"], "/main.py": ["/data_loader.py", "/trainer.py", "/models/meta_learner.py", "/utils.py"]} |
8,959 | dorajam/few-shot-link-prediction | refs/heads/main | /models/relation_meta_learner.py | from collections import OrderedDict
import torch
from torch import nn
from .modules import MLPModule, RGCNModule
class SimplePrototype(nn.Module):
def __init__(self, parameter):
super(SimplePrototype, self).__init__()
self.embedding_dim = parameter['embed_dim']
self.device = parameter['d... | {"/models/relation_meta_learner.py": ["/models/modules.py"], "/models/meta_learner.py": ["/models/relation_meta_learner.py", "/models/rgcn_model.py"], "/trainer.py": ["/utils.py"], "/models/modules.py": ["/models/rgcn_model.py"], "/main.py": ["/data_loader.py", "/trainer.py", "/models/meta_learner.py", "/utils.py"]} |
8,960 | dorajam/few-shot-link-prediction | refs/heads/main | /models/meta_learner.py | import functools
import numpy as np
import torch
from torch import nn
from .relation_meta_learner import MetaR, ModularPrototypes, SimplePrototype
from .rgcn_model import RGCN
class MetaLearner(nn.Module):
def __init__(self, parameter, background_graph=None):
super(MetaLearner, self).__init__()
s... | {"/models/relation_meta_learner.py": ["/models/modules.py"], "/models/meta_learner.py": ["/models/relation_meta_learner.py", "/models/rgcn_model.py"], "/trainer.py": ["/utils.py"], "/models/modules.py": ["/models/rgcn_model.py"], "/main.py": ["/data_loader.py", "/trainer.py", "/models/meta_learner.py", "/utils.py"]} |
8,961 | dorajam/few-shot-link-prediction | refs/heads/main | /trainer.py | import os
import sys
import shutil
import logging
import time
import torch
import wandb
import numpy as np
from json import load
from collections import Counter
from tensorboardX import SummaryWriter
from utils import get_lr
class Trainer:
def __init__(self, model, data_loaders, parameter):
self.parameter = para... | {"/models/relation_meta_learner.py": ["/models/modules.py"], "/models/meta_learner.py": ["/models/relation_meta_learner.py", "/models/rgcn_model.py"], "/trainer.py": ["/utils.py"], "/models/modules.py": ["/models/rgcn_model.py"], "/main.py": ["/data_loader.py", "/trainer.py", "/models/meta_learner.py", "/utils.py"]} |
8,962 | dorajam/few-shot-link-prediction | refs/heads/main | /models/modules.py | from collections import OrderedDict
import numpy as np
import torch
from torch import nn
from .rgcn_model import RGCN
class MLPModule(nn.Module):
def __init__(self, parameter):
super(MLPModule, self).__init__()
self.embedding_dim = parameter['embed_dim']
self.out_dim = 1
self.re... | {"/models/relation_meta_learner.py": ["/models/modules.py"], "/models/meta_learner.py": ["/models/relation_meta_learner.py", "/models/rgcn_model.py"], "/trainer.py": ["/utils.py"], "/models/modules.py": ["/models/rgcn_model.py"], "/main.py": ["/data_loader.py", "/trainer.py", "/models/meta_learner.py", "/utils.py"]} |
8,963 | dorajam/few-shot-link-prediction | refs/heads/main | /main.py | import argparse
import logging
import random
import numpy as np
import torch
import wandb # dashboard
from data_loader import read_dataset, DataLoader, SyntheticDataLoader
from trainer import Trainer
from models.meta_learner import MetaLearner
from utils import initialize_experiment
if __name__ == '__main__':
... | {"/models/relation_meta_learner.py": ["/models/modules.py"], "/models/meta_learner.py": ["/models/relation_meta_learner.py", "/models/rgcn_model.py"], "/trainer.py": ["/utils.py"], "/models/modules.py": ["/models/rgcn_model.py"], "/main.py": ["/data_loader.py", "/trainer.py", "/models/meta_learner.py", "/utils.py"]} |
8,975 | OmarElraies/green-hub-api | refs/heads/master | /greenhub_api/garden/serializers.py | from rest_framework import serializers
from .models import Plants, Category, SubCategory, Places
from django.contrib.auth.models import User
class PlantsSerializer(serializers.HyperlinkedModelSerializer):
owner = serializers.ReadOnlyField(source='owner.username')
class Meta:
model = Plants
fie... | {"/greenhub_api/plants/admin.py": ["/greenhub_api/plants/models.py"], "/greenhub_api/plants/serializers.py": ["/greenhub_api/plants/models.py"]} |
8,976 | OmarElraies/green-hub-api | refs/heads/master | /greenhub_api/plants/models.py | from django.db import models
from model_utils.models import TimeStampedModel
from model_utils import Choices
from django.contrib.auth.models import User
class Plants(TimeStampedModel):
name = models.CharField(max_length=255)
owner = models.ForeignKey('auth.User', related_name='plants', on_delete=models.CASCADE... | {"/greenhub_api/plants/admin.py": ["/greenhub_api/plants/models.py"], "/greenhub_api/plants/serializers.py": ["/greenhub_api/plants/models.py"]} |
8,977 | OmarElraies/green-hub-api | refs/heads/master | /greenhub_api/garden/migrations/0001_initial.py | # Generated by Django 2.1.5 on 2019-03-12 15:37
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... | {"/greenhub_api/plants/admin.py": ["/greenhub_api/plants/models.py"], "/greenhub_api/plants/serializers.py": ["/greenhub_api/plants/models.py"]} |
8,978 | OmarElraies/green-hub-api | refs/heads/master | /greenhub_api/accounts/serializers.py | from rest_framework import serializers
from django.contrib.auth.models import User
class UserSerializer(serializers.HyperlinkedModelSerializer):
plants = serializers.HyperlinkedRelatedField(many=True, view_name='plants-detail', read_only=True)
class Meta:
model = User
fields = ('url', 'id', 'u... | {"/greenhub_api/plants/admin.py": ["/greenhub_api/plants/models.py"], "/greenhub_api/plants/serializers.py": ["/greenhub_api/plants/models.py"]} |
8,979 | OmarElraies/green-hub-api | refs/heads/master | /greenhub_api/plants/urls.py | from django.urls import path, include
from rest_framework.routers import DefaultRouter
from plants import views
# Create a router and register our viewsets with it.
router = DefaultRouter()
router.register(r'plants', views.PlantsViewSet)
router.register(r'category', views.CategoryViewSet)
# The API URLs are now determ... | {"/greenhub_api/plants/admin.py": ["/greenhub_api/plants/models.py"], "/greenhub_api/plants/serializers.py": ["/greenhub_api/plants/models.py"]} |
8,980 | OmarElraies/green-hub-api | refs/heads/master | /greenhub_api/plants/admin.py | from django.contrib import admin
# Register your models here.
from .models import Plants, Category, Places
admin.site.register(Plants)
admin.site.register(Category)
admin.site.register(Places)
| {"/greenhub_api/plants/admin.py": ["/greenhub_api/plants/models.py"], "/greenhub_api/plants/serializers.py": ["/greenhub_api/plants/models.py"]} |
8,981 | OmarElraies/green-hub-api | refs/heads/master | /greenhub_api/accounts/urls.py | from django.urls import include, path, re_path
from rest_auth.views import PasswordResetConfirmView
from rest_framework.routers import DefaultRouter
from accounts import views
# Create a router and register our viewsets with it.
router = DefaultRouter()
router.register(r'user', views.UserViewSet)
# The API URLs are n... | {"/greenhub_api/plants/admin.py": ["/greenhub_api/plants/models.py"], "/greenhub_api/plants/serializers.py": ["/greenhub_api/plants/models.py"]} |
8,982 | OmarElraies/green-hub-api | refs/heads/master | /greenhub_api/garden/urls.py | from django.urls import path, include
from rest_framework.routers import DefaultRouter
from garden import views
# Create a router and register our viewsets with it.
router = DefaultRouter()
router.register(r'garden', views.PlantsViewSet)
router.register(r'category', views.CategoryViewSet)
router.register(r'users', vie... | {"/greenhub_api/plants/admin.py": ["/greenhub_api/plants/models.py"], "/greenhub_api/plants/serializers.py": ["/greenhub_api/plants/models.py"]} |
8,983 | OmarElraies/green-hub-api | refs/heads/master | /greenhub_api/plants/views.py | from plants.models import Plants, Places, Category
from plants.permissions import IsOwnerOrReadOnly
from plants.serializers import PlantsSerializer, PlacesSerializer, CategorySerializer
from django.contrib.auth.models import User
from rest_framework import permissions
from rest_framework import renderers
from rest_fram... | {"/greenhub_api/plants/admin.py": ["/greenhub_api/plants/models.py"], "/greenhub_api/plants/serializers.py": ["/greenhub_api/plants/models.py"]} |
8,984 | OmarElraies/green-hub-api | refs/heads/master | /greenhub_api/accounts/views.py | from django.contrib.auth.models import User
from rest_framework import viewsets
from accounts.serializers import UserSerializer
class UserViewSet(viewsets.ReadOnlyModelViewSet):
queryset = User.objects.all()
serializer_class = UserSerializer
| {"/greenhub_api/plants/admin.py": ["/greenhub_api/plants/models.py"], "/greenhub_api/plants/serializers.py": ["/greenhub_api/plants/models.py"]} |
8,985 | OmarElraies/green-hub-api | refs/heads/master | /greenhub_api/plants/serializers.py | from rest_framework import serializers
from .models import Plants, Category, Places
class PlantsSerializer(serializers.HyperlinkedModelSerializer):
owner = serializers.ReadOnlyField(source='owner.username')
class Meta:
model = Plants
fields = '__all__'
class CategorySerializer(serializers.Hyp... | {"/greenhub_api/plants/admin.py": ["/greenhub_api/plants/models.py"], "/greenhub_api/plants/serializers.py": ["/greenhub_api/plants/models.py"]} |
8,986 | OmarElraies/green-hub-api | refs/heads/master | /greenhub_api/garden/views.py | from garden.models import Plants, Places, Category, SubCategory
from garden.permissions import IsOwnerOrReadOnly
from garden.serializers import PlantsSerializer, SubCategorySerializer
from garden.serializers import UserSerializer, PlacesSerializer, CategorySerializer
from django.contrib.auth.models import User
from res... | {"/greenhub_api/plants/admin.py": ["/greenhub_api/plants/models.py"], "/greenhub_api/plants/serializers.py": ["/greenhub_api/plants/models.py"]} |
8,990 | altdesktop/python-dbus-next | refs/heads/master | /test/service/test_methods.py | from dbus_next.service import ServiceInterface, method
from dbus_next.aio import MessageBus
from dbus_next import Message, MessageType, ErrorType, Variant, SignatureTree, DBusError, MessageFlag
import pytest
class ExampleInterface(ServiceInterface):
def __init__(self, name):
super().__init__(name)
@... | {"/test/service/test_methods.py": ["/dbus_next/service.py", "/dbus_next/aio/__init__.py", "/dbus_next/__init__.py"], "/dbus_next/glib/proxy_object.py": ["/dbus_next/proxy_object.py", "/dbus_next/message_bus.py", "/dbus_next/message.py", "/dbus_next/errors.py", "/dbus_next/signature.py", "/dbus_next/constants.py", "/dbu... |
8,991 | altdesktop/python-dbus-next | refs/heads/master | /dbus_next/glib/proxy_object.py | from ..proxy_object import BaseProxyObject, BaseProxyInterface
from ..message_bus import BaseMessageBus
from ..message import Message
from ..errors import DBusError
from ..signature import Variant
from ..constants import ErrorType
from .. import introspection as intr
import xml.etree.ElementTree as ET
from typing impo... | {"/test/service/test_methods.py": ["/dbus_next/service.py", "/dbus_next/aio/__init__.py", "/dbus_next/__init__.py"], "/dbus_next/glib/proxy_object.py": ["/dbus_next/proxy_object.py", "/dbus_next/message_bus.py", "/dbus_next/message.py", "/dbus_next/errors.py", "/dbus_next/signature.py", "/dbus_next/constants.py", "/dbu... |
8,992 | altdesktop/python-dbus-next | refs/heads/master | /test/service/test_properties.py | from dbus_next.service import ServiceInterface, dbus_property, method
from dbus_next.aio import MessageBus
from dbus_next import Message, MessageType, PropertyAccess, ErrorType, Variant, DBusError
import pytest
import asyncio
class ExampleInterface(ServiceInterface):
def __init__(self, name):
super().__i... | {"/test/service/test_methods.py": ["/dbus_next/service.py", "/dbus_next/aio/__init__.py", "/dbus_next/__init__.py"], "/dbus_next/glib/proxy_object.py": ["/dbus_next/proxy_object.py", "/dbus_next/message_bus.py", "/dbus_next/message.py", "/dbus_next/errors.py", "/dbus_next/signature.py", "/dbus_next/constants.py", "/dbu... |
8,993 | altdesktop/python-dbus-next | refs/heads/master | /test/client/test_signals.py | from dbus_next.service import ServiceInterface, signal
from dbus_next.aio import MessageBus
from dbus_next import Message
from dbus_next.introspection import Node
from dbus_next.constants import RequestNameReply
import pytest
class ExampleInterface(ServiceInterface):
def __init__(self):
super().__init__(... | {"/test/service/test_methods.py": ["/dbus_next/service.py", "/dbus_next/aio/__init__.py", "/dbus_next/__init__.py"], "/dbus_next/glib/proxy_object.py": ["/dbus_next/proxy_object.py", "/dbus_next/message_bus.py", "/dbus_next/message.py", "/dbus_next/errors.py", "/dbus_next/signature.py", "/dbus_next/constants.py", "/dbu... |
8,994 | altdesktop/python-dbus-next | refs/heads/master | /dbus_next/auth.py | from .errors import AuthError
import enum
import os
# The auth interface here is unstable. I would like to eventually open this up
# for people to define their own custom authentication protocols, but I'm not
# familiar with what's needed for that exactly. To work with any message bus
# implementation would require ab... | {"/test/service/test_methods.py": ["/dbus_next/service.py", "/dbus_next/aio/__init__.py", "/dbus_next/__init__.py"], "/dbus_next/glib/proxy_object.py": ["/dbus_next/proxy_object.py", "/dbus_next/message_bus.py", "/dbus_next/message.py", "/dbus_next/errors.py", "/dbus_next/signature.py", "/dbus_next/constants.py", "/dbu... |
8,995 | altdesktop/python-dbus-next | refs/heads/master | /dbus_next/glib/message_bus.py | from .._private.unmarshaller import Unmarshaller
from ..constants import BusType
from ..message import Message
from ..constants import MessageType, MessageFlag, NameFlag, RequestNameReply, ReleaseNameReply
from ..message_bus import BaseMessageBus
from ..errors import AuthError
from .proxy_object import ProxyObject
from... | {"/test/service/test_methods.py": ["/dbus_next/service.py", "/dbus_next/aio/__init__.py", "/dbus_next/__init__.py"], "/dbus_next/glib/proxy_object.py": ["/dbus_next/proxy_object.py", "/dbus_next/message_bus.py", "/dbus_next/message.py", "/dbus_next/errors.py", "/dbus_next/signature.py", "/dbus_next/constants.py", "/dbu... |
8,996 | altdesktop/python-dbus-next | refs/heads/master | /dbus_next/_private/unmarshaller.py | from typing import Any, Callable, Dict, List, Optional, Tuple
from ..message import Message
from .constants import (
HeaderField,
LITTLE_ENDIAN,
BIG_ENDIAN,
PROTOCOL_VERSION,
HEADER_NAME_MAP,
)
from ..constants import MessageType, MessageFlag, MESSAGE_FLAG_MAP, MESSAGE_TYPE_MAP
from ..signature impo... | {"/test/service/test_methods.py": ["/dbus_next/service.py", "/dbus_next/aio/__init__.py", "/dbus_next/__init__.py"], "/dbus_next/glib/proxy_object.py": ["/dbus_next/proxy_object.py", "/dbus_next/message_bus.py", "/dbus_next/message.py", "/dbus_next/errors.py", "/dbus_next/signature.py", "/dbus_next/constants.py", "/dbu... |
8,997 | altdesktop/python-dbus-next | refs/heads/master | /dbus_next/_private/constants.py | from enum import Enum
PROTOCOL_VERSION = 1
LITTLE_ENDIAN = ord('l')
BIG_ENDIAN = ord('B')
class HeaderField(Enum):
PATH = 1
INTERFACE = 2
MEMBER = 3
ERROR_NAME = 4
REPLY_SERIAL = 5
DESTINATION = 6
SENDER = 7
SIGNATURE = 8
UNIX_FDS = 9
HEADER_NAME_MAP = {field.value: field.name ... | {"/test/service/test_methods.py": ["/dbus_next/service.py", "/dbus_next/aio/__init__.py", "/dbus_next/__init__.py"], "/dbus_next/glib/proxy_object.py": ["/dbus_next/proxy_object.py", "/dbus_next/message_bus.py", "/dbus_next/message.py", "/dbus_next/errors.py", "/dbus_next/signature.py", "/dbus_next/constants.py", "/dbu... |
8,998 | altdesktop/python-dbus-next | refs/heads/master | /examples/aio-tcp-notification.py | #!/usr/bin/env python3
# In order for this to work a local tcp connection to the DBus a port
# must be opened to forward to the dbus socket file. The easiest way
# to achieve this is using "socat":
# socat TCP-LISTEN:55556,reuseaddr,fork,range=127.0.0.1/32 UNIX-CONNECT:$(echo $DBUS_SESSION_BUS_ADDRESS | sed 's/unix:pa... | {"/test/service/test_methods.py": ["/dbus_next/service.py", "/dbus_next/aio/__init__.py", "/dbus_next/__init__.py"], "/dbus_next/glib/proxy_object.py": ["/dbus_next/proxy_object.py", "/dbus_next/message_bus.py", "/dbus_next/message.py", "/dbus_next/errors.py", "/dbus_next/signature.py", "/dbus_next/constants.py", "/dbu... |
8,999 | altdesktop/python-dbus-next | refs/heads/master | /dbus_next/introspection.py | from .constants import PropertyAccess, ArgDirection
from .signature import SignatureTree, SignatureType
from .validators import assert_member_name_valid, assert_interface_name_valid
from .errors import InvalidIntrospectionError
from typing import List, Union
import xml.etree.ElementTree as ET
# https://dbus.freedesk... | {"/test/service/test_methods.py": ["/dbus_next/service.py", "/dbus_next/aio/__init__.py", "/dbus_next/__init__.py"], "/dbus_next/glib/proxy_object.py": ["/dbus_next/proxy_object.py", "/dbus_next/message_bus.py", "/dbus_next/message.py", "/dbus_next/errors.py", "/dbus_next/signature.py", "/dbus_next/constants.py", "/dbu... |
9,000 | altdesktop/python-dbus-next | refs/heads/master | /dbus_next/aio/__init__.py | from .message_bus import MessageBus
from .proxy_object import ProxyObject, ProxyInterface
| {"/test/service/test_methods.py": ["/dbus_next/service.py", "/dbus_next/aio/__init__.py", "/dbus_next/__init__.py"], "/dbus_next/glib/proxy_object.py": ["/dbus_next/proxy_object.py", "/dbus_next/message_bus.py", "/dbus_next/message.py", "/dbus_next/errors.py", "/dbus_next/signature.py", "/dbus_next/constants.py", "/dbu... |
9,001 | altdesktop/python-dbus-next | refs/heads/master | /test/test_glib_low_level.py | from dbus_next.glib import MessageBus
from dbus_next import Message, MessageType, MessageFlag
from test.util import check_gi_repository, skip_reason_no_gi
import pytest
has_gi = check_gi_repository()
if has_gi:
from gi.repository import GLib
@pytest.mark.skipif(not has_gi, reason=skip_reason_no_gi)
def test_st... | {"/test/service/test_methods.py": ["/dbus_next/service.py", "/dbus_next/aio/__init__.py", "/dbus_next/__init__.py"], "/dbus_next/glib/proxy_object.py": ["/dbus_next/proxy_object.py", "/dbus_next/message_bus.py", "/dbus_next/message.py", "/dbus_next/errors.py", "/dbus_next/signature.py", "/dbus_next/constants.py", "/dbu... |
9,002 | altdesktop/python-dbus-next | refs/heads/master | /dbus_next/proxy_object.py | from .validators import assert_object_path_valid, assert_bus_name_valid
from . import message_bus
from .message import Message
from .constants import MessageType, ErrorType
from . import introspection as intr
from .errors import DBusError, InterfaceNotFoundError
from ._private.util import replace_idx_with_fds
from typ... | {"/test/service/test_methods.py": ["/dbus_next/service.py", "/dbus_next/aio/__init__.py", "/dbus_next/__init__.py"], "/dbus_next/glib/proxy_object.py": ["/dbus_next/proxy_object.py", "/dbus_next/message_bus.py", "/dbus_next/message.py", "/dbus_next/errors.py", "/dbus_next/signature.py", "/dbus_next/constants.py", "/dbu... |
9,003 | altdesktop/python-dbus-next | refs/heads/master | /dbus_next/service.py | from .constants import PropertyAccess
from .signature import SignatureTree, SignatureBodyMismatchError, Variant
from . import introspection as intr
from .errors import SignalDisabledError
from ._private.util import signature_contains_type, replace_fds_with_idx, replace_idx_with_fds, parse_annotation
from functools imp... | {"/test/service/test_methods.py": ["/dbus_next/service.py", "/dbus_next/aio/__init__.py", "/dbus_next/__init__.py"], "/dbus_next/glib/proxy_object.py": ["/dbus_next/proxy_object.py", "/dbus_next/message_bus.py", "/dbus_next/message.py", "/dbus_next/errors.py", "/dbus_next/signature.py", "/dbus_next/constants.py", "/dbu... |
9,004 | altdesktop/python-dbus-next | refs/heads/master | /test/service/test_export.py | from dbus_next.service import ServiceInterface, method
from dbus_next.aio import MessageBus
from dbus_next import Message, MessageType, introspection as intr
import pytest
standard_interfaces_count = len(intr.Node.default().interfaces)
class ExampleInterface(ServiceInterface):
def __init__(self, name):
... | {"/test/service/test_methods.py": ["/dbus_next/service.py", "/dbus_next/aio/__init__.py", "/dbus_next/__init__.py"], "/dbus_next/glib/proxy_object.py": ["/dbus_next/proxy_object.py", "/dbus_next/message_bus.py", "/dbus_next/message.py", "/dbus_next/errors.py", "/dbus_next/signature.py", "/dbus_next/constants.py", "/dbu... |
9,005 | altdesktop/python-dbus-next | refs/heads/master | /test/test_fd_passing.py | """This tests the ability to send and receive file descriptors in dbus messages"""
from dbus_next.service import ServiceInterface, method, signal, dbus_property
from dbus_next.signature import SignatureTree, Variant
from dbus_next.aio import MessageBus
from dbus_next import Message, MessageType
import os
import pytest... | {"/test/service/test_methods.py": ["/dbus_next/service.py", "/dbus_next/aio/__init__.py", "/dbus_next/__init__.py"], "/dbus_next/glib/proxy_object.py": ["/dbus_next/proxy_object.py", "/dbus_next/message_bus.py", "/dbus_next/message.py", "/dbus_next/errors.py", "/dbus_next/signature.py", "/dbus_next/constants.py", "/dbu... |
9,006 | altdesktop/python-dbus-next | refs/heads/master | /test/client/test_methods.py | from dbus_next.message import MessageFlag
from dbus_next.service import ServiceInterface, method
import dbus_next.introspection as intr
from dbus_next import aio, glib, DBusError
from test.util import check_gi_repository, skip_reason_no_gi
import pytest
has_gi = check_gi_repository()
class ExampleInterface(ServiceI... | {"/test/service/test_methods.py": ["/dbus_next/service.py", "/dbus_next/aio/__init__.py", "/dbus_next/__init__.py"], "/dbus_next/glib/proxy_object.py": ["/dbus_next/proxy_object.py", "/dbus_next/message_bus.py", "/dbus_next/message.py", "/dbus_next/errors.py", "/dbus_next/signature.py", "/dbus_next/constants.py", "/dbu... |
9,007 | altdesktop/python-dbus-next | refs/heads/master | /test/service/test_standard_interfaces.py | from dbus_next.service import ServiceInterface, dbus_property, PropertyAccess
from dbus_next.signature import Variant
from dbus_next.aio import MessageBus
from dbus_next import Message, MessageType, introspection as intr
from dbus_next.constants import ErrorType
import pytest
standard_interfaces_count = len(intr.Node... | {"/test/service/test_methods.py": ["/dbus_next/service.py", "/dbus_next/aio/__init__.py", "/dbus_next/__init__.py"], "/dbus_next/glib/proxy_object.py": ["/dbus_next/proxy_object.py", "/dbus_next/message_bus.py", "/dbus_next/message.py", "/dbus_next/errors.py", "/dbus_next/signature.py", "/dbus_next/constants.py", "/dbu... |
9,008 | altdesktop/python-dbus-next | refs/heads/master | /test/test_validators.py | from dbus_next import (is_bus_name_valid, is_object_path_valid, is_interface_name_valid,
is_member_name_valid)
def test_object_path_validator():
valid_paths = ['/', '/foo', '/foo/bar', '/foo/bar/bat']
invalid_paths = [
None, '', 'foo', 'foo/bar', '/foo/bar/', '/$/foo/bar', '/foo... | {"/test/service/test_methods.py": ["/dbus_next/service.py", "/dbus_next/aio/__init__.py", "/dbus_next/__init__.py"], "/dbus_next/glib/proxy_object.py": ["/dbus_next/proxy_object.py", "/dbus_next/message_bus.py", "/dbus_next/message.py", "/dbus_next/errors.py", "/dbus_next/signature.py", "/dbus_next/constants.py", "/dbu... |
9,009 | altdesktop/python-dbus-next | refs/heads/master | /test/test_disconnect.py | from dbus_next.aio import MessageBus
from dbus_next import Message
import os
import pytest
import functools
@pytest.mark.asyncio
async def test_bus_disconnect_before_reply(event_loop):
'''In this test, the bus disconnects before the reply comes in. Make sure
the caller receives a reply with the error instead... | {"/test/service/test_methods.py": ["/dbus_next/service.py", "/dbus_next/aio/__init__.py", "/dbus_next/__init__.py"], "/dbus_next/glib/proxy_object.py": ["/dbus_next/proxy_object.py", "/dbus_next/message_bus.py", "/dbus_next/message.py", "/dbus_next/errors.py", "/dbus_next/signature.py", "/dbus_next/constants.py", "/dbu... |
9,010 | altdesktop/python-dbus-next | refs/heads/master | /test/test_request_name.py | from dbus_next import aio, glib, Message, MessageType, NameFlag, RequestNameReply, ReleaseNameReply
from test.util import check_gi_repository, skip_reason_no_gi
import pytest
has_gi = check_gi_repository()
@pytest.mark.asyncio
async def test_name_requests():
test_name = 'aio.test.request.name'
bus1 = await... | {"/test/service/test_methods.py": ["/dbus_next/service.py", "/dbus_next/aio/__init__.py", "/dbus_next/__init__.py"], "/dbus_next/glib/proxy_object.py": ["/dbus_next/proxy_object.py", "/dbus_next/message_bus.py", "/dbus_next/message.py", "/dbus_next/errors.py", "/dbus_next/signature.py", "/dbus_next/constants.py", "/dbu... |
9,011 | altdesktop/python-dbus-next | refs/heads/master | /examples/mpris.py | #!/usr/bin/env python3
import sys
import os
sys.path.append(os.path.abspath(os.path.dirname(__file__) + '/..'))
from dbus_next.aio import MessageBus
import asyncio
loop = asyncio.get_event_loop()
async def main():
bus = await MessageBus().connect()
# the introspection xml would normally be included in you... | {"/test/service/test_methods.py": ["/dbus_next/service.py", "/dbus_next/aio/__init__.py", "/dbus_next/__init__.py"], "/dbus_next/glib/proxy_object.py": ["/dbus_next/proxy_object.py", "/dbus_next/message_bus.py", "/dbus_next/message.py", "/dbus_next/errors.py", "/dbus_next/signature.py", "/dbus_next/constants.py", "/dbu... |
9,012 | altdesktop/python-dbus-next | refs/heads/master | /dbus_next/signature.py | from .validators import is_object_path_valid
from .errors import InvalidSignatureError, SignatureBodyMismatchError
from functools import lru_cache
from typing import Any, List, Union
class SignatureType:
"""A class that represents a single complete type within a signature.
This class is not meant to be cons... | {"/test/service/test_methods.py": ["/dbus_next/service.py", "/dbus_next/aio/__init__.py", "/dbus_next/__init__.py"], "/dbus_next/glib/proxy_object.py": ["/dbus_next/proxy_object.py", "/dbus_next/message_bus.py", "/dbus_next/message.py", "/dbus_next/errors.py", "/dbus_next/signature.py", "/dbus_next/constants.py", "/dbu... |
9,013 | altdesktop/python-dbus-next | refs/heads/master | /test/service/test_signals.py | from dbus_next.service import ServiceInterface, signal, SignalDisabledError, dbus_property
from dbus_next.aio import MessageBus
from dbus_next import Message, MessageType
from dbus_next.constants import PropertyAccess
from dbus_next.signature import Variant
import pytest
import asyncio
class ExampleInterface(Service... | {"/test/service/test_methods.py": ["/dbus_next/service.py", "/dbus_next/aio/__init__.py", "/dbus_next/__init__.py"], "/dbus_next/glib/proxy_object.py": ["/dbus_next/proxy_object.py", "/dbus_next/message_bus.py", "/dbus_next/message.py", "/dbus_next/errors.py", "/dbus_next/signature.py", "/dbus_next/constants.py", "/dbu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.