index
int64
repo_name
string
branch_name
string
path
string
content
string
import_graph
string
66,851
drunkpig/django-background-job
refs/heads/main
/background_job/apps.py
from django.apps import AppConfig class BackgroundJobConfig(AppConfig): name = 'background_job'
{"/background_job/Scheduler.py": ["/background_job/models.py", "/background_job/utils.py"], "/background_job/utils.py": ["/background_job/models.py"], "/background_job/job.py": ["/background_job/models.py", "/background_job/utils.py"], "/background_job/models.py": ["/background_job/Trigger.py"], "/background_job/manage...
66,852
drunkpig/django-background-job
refs/heads/main
/background_job/migrations/0004_auto_20210225_0921.py
# Generated by Django 3.1.6 on 2021-02-25 09:21 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('background_job', '0003_auto_20210224_2354'), ] operations = [ migrations.AlterField( model_name='actionlog', name='o...
{"/background_job/Scheduler.py": ["/background_job/models.py", "/background_job/utils.py"], "/background_job/utils.py": ["/background_job/models.py"], "/background_job/job.py": ["/background_job/models.py", "/background_job/utils.py"], "/background_job/models.py": ["/background_job/Trigger.py"], "/background_job/manage...
66,853
drunkpig/django-background-job
refs/heads/main
/background_job/utils.py
import logging, socket from django.db.models import Max from background_job.models import DjangoJob, JobExecHistory, ActionLog logger = logging.getLogger() def get_max_job_version(): max_version = DjangoJob.objects.aggregate(Max('version')) # {'version__max': 5} if max_version: max_version = max_v...
{"/background_job/Scheduler.py": ["/background_job/models.py", "/background_job/utils.py"], "/background_job/utils.py": ["/background_job/models.py"], "/background_job/job.py": ["/background_job/models.py", "/background_job/utils.py"], "/background_job/models.py": ["/background_job/Trigger.py"], "/background_job/manage...
66,854
drunkpig/django-background-job
refs/heads/main
/background_job/job.py
import functools, inspect import logging, hashlib, json from datetime import datetime from background_job.models import DjangoJob, DelayedJob from background_job.utils import get_max_job_version, log_action logger = logging.getLogger(__name__) JOB_VERSION = get_max_job_version() + 1 def md5(astring): x = hashl...
{"/background_job/Scheduler.py": ["/background_job/models.py", "/background_job/utils.py"], "/background_job/utils.py": ["/background_job/models.py"], "/background_job/job.py": ["/background_job/models.py", "/background_job/utils.py"], "/background_job/models.py": ["/background_job/Trigger.py"], "/background_job/manage...
66,855
drunkpig/django-background-job
refs/heads/main
/background_job/migrations/0003_auto_20210224_2354.py
# Generated by Django 2.2.13 on 2021-02-24 23:54 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('background_job', '0002_auto_20210224_2353'), ] operations = [ migrations.AlterField( model_name='jobexechistory', n...
{"/background_job/Scheduler.py": ["/background_job/models.py", "/background_job/utils.py"], "/background_job/utils.py": ["/background_job/models.py"], "/background_job/job.py": ["/background_job/models.py", "/background_job/utils.py"], "/background_job/models.py": ["/background_job/Trigger.py"], "/background_job/manage...
66,856
drunkpig/django-background-job
refs/heads/main
/background_job/models.py
import copy import datetime import json import uuid from django.db import models # Create your models here. from django.utils.safestring import mark_safe from background_job.Trigger import CronJobTrigger, IntervalJobTrigger, OnceJobTrigger class DjangoJob(models.Model): """ 定时任务执行情况 """ id = models...
{"/background_job/Scheduler.py": ["/background_job/models.py", "/background_job/utils.py"], "/background_job/utils.py": ["/background_job/models.py"], "/background_job/job.py": ["/background_job/models.py", "/background_job/utils.py"], "/background_job/models.py": ["/background_job/Trigger.py"], "/background_job/manage...
66,857
drunkpig/django-background-job
refs/heads/main
/background_job/management/commands/process_tasks.py
# -*- coding: utf-8 -*- import logging import queue import random import sys import time from importlib import import_module from logging.config import fileConfig from django import VERSION from django.core.management.base import BaseCommand from django.utils import autoreload from background_job.JobProcessor import ...
{"/background_job/Scheduler.py": ["/background_job/models.py", "/background_job/utils.py"], "/background_job/utils.py": ["/background_job/models.py"], "/background_job/job.py": ["/background_job/models.py", "/background_job/utils.py"], "/background_job/models.py": ["/background_job/Trigger.py"], "/background_job/manage...
66,858
drunkpig/django-background-job
refs/heads/main
/background_job/migrations/0002_auto_20210224_2353.py
# Generated by Django 2.2.13 on 2021-02-24 23:53 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('background_job', '0001_initial'), ] operations = [ migrations.AlterField( model_name='jobexechistory', name='result...
{"/background_job/Scheduler.py": ["/background_job/models.py", "/background_job/utils.py"], "/background_job/utils.py": ["/background_job/models.py"], "/background_job/job.py": ["/background_job/models.py", "/background_job/utils.py"], "/background_job/models.py": ["/background_job/Trigger.py"], "/background_job/manage...
66,859
drunkpig/django-background-job
refs/heads/main
/background_job/admin.py
import datetime from django.contrib import admin from django.db.models import Avg from django.urls import reverse from django.utils.html import format_html from django.utils.timezone import now from .models import DjangoJob, JobExecHistory, DelayedJob, ActionLog admin.ModelAdmin.list_per_page = 20 @admin.register(D...
{"/background_job/Scheduler.py": ["/background_job/models.py", "/background_job/utils.py"], "/background_job/utils.py": ["/background_job/models.py"], "/background_job/job.py": ["/background_job/models.py", "/background_job/utils.py"], "/background_job/models.py": ["/background_job/Trigger.py"], "/background_job/manage...
66,860
drunkpig/django-background-job
refs/heads/main
/example/jobs.py
from background_job.job import cron_job, delayed_job, interval_job, once_job, boot_job @cron_job(name="my_func3", cron="*/1 * * * *") def my_func3(): print("my_func3()") return "this is func3" @cron_job(name="my_func", cron="*/2 * * * *", args=('X parameter',), kwargs={"name":"Jin", "age":23}) def my_func(x...
{"/background_job/Scheduler.py": ["/background_job/models.py", "/background_job/utils.py"], "/background_job/utils.py": ["/background_job/models.py"], "/background_job/job.py": ["/background_job/models.py", "/background_job/utils.py"], "/background_job/models.py": ["/background_job/Trigger.py"], "/background_job/manage...
66,861
drunkpig/django-background-job
refs/heads/main
/setup.py
from setuptools import find_packages, setup setup( name='django-background-job', version='0.0.1', description='APScheduler for Django', classifiers=[ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Django", "License :: OSI Approved :: MI...
{"/background_job/Scheduler.py": ["/background_job/models.py", "/background_job/utils.py"], "/background_job/utils.py": ["/background_job/models.py"], "/background_job/job.py": ["/background_job/models.py", "/background_job/utils.py"], "/background_job/models.py": ["/background_job/Trigger.py"], "/background_job/manage...
66,862
drunkpig/django-background-job
refs/heads/main
/background_job/JobProcessor.py
import threading from queue import Queue from concurrent.futures import ThreadPoolExecutor, Future import importlib, json, logging import multiprocessing from background_job.models import JobExecHistory from background_job.utils import log_job_history_by_id, log_job_history class JobProcessor(threading.Thread): ...
{"/background_job/Scheduler.py": ["/background_job/models.py", "/background_job/utils.py"], "/background_job/utils.py": ["/background_job/models.py"], "/background_job/job.py": ["/background_job/models.py", "/background_job/utils.py"], "/background_job/models.py": ["/background_job/Trigger.py"], "/background_job/manage...
66,863
drunkpig/django-background-job
refs/heads/main
/example/test2.py
import logging from logging.config import fileConfig from example.jobs import * if __name__=="__main__": fileConfig("../logging.ini") logger = logging.getLogger() print("***********************") my_func(3, name="xu") print("---------------------------") my_func(5) print("%%%%%%%%%%%%%%...
{"/background_job/Scheduler.py": ["/background_job/models.py", "/background_job/utils.py"], "/background_job/utils.py": ["/background_job/models.py"], "/background_job/job.py": ["/background_job/models.py", "/background_job/utils.py"], "/background_job/models.py": ["/background_job/Trigger.py"], "/background_job/manage...
66,879
bwalkowi/pypageobject
refs/heads/master
/pypageobject/_page_objects.py
from contextlib import suppress class PageObject: _id = None _click_area = None def __init__(self, driver, web_elem=None, parent=None): self.driver = driver self.web_elem = web_elem if web_elem is not None else driver self.parent = parent self._ignore_id = False def i...
{"/pypageobject/__init__.py": ["/pypageobject/_page_objects.py", "/pypageobject/_page_elements.py"], "/pypageobject/_page_elements.py": ["/pypageobject/__init__.py"]}
66,880
bwalkowi/pypageobject
refs/heads/master
/pypageobject/__init__.py
from functools import partial from ._page_objects import (PageObject, Button as ButtonPageObject, NamedButton as NamedButtonPageObject) from ._page_elements import (Selector, AbstractPageElement, Element, Elements, Label, Input) Button = partial(Element, cls=Bu...
{"/pypageobject/__init__.py": ["/pypageobject/_page_objects.py", "/pypageobject/_page_elements.py"], "/pypageobject/_page_elements.py": ["/pypageobject/__init__.py"]}
66,881
bwalkowi/pypageobject
refs/heads/master
/pypageobject/_page_elements.py
from enum import Enum from time import sleep from typing import Optional, Type from abc import ABC, abstractmethod from selenium.webdriver.common.by import By from selenium.common.exceptions import NoSuchElementException from . import PageObject class Selector(Enum): CSS = By.CSS_SELECTOR ID = By.ID NAM...
{"/pypageobject/__init__.py": ["/pypageobject/_page_objects.py", "/pypageobject/_page_elements.py"], "/pypageobject/_page_elements.py": ["/pypageobject/__init__.py"]}
66,882
bwalkowi/pypageobject
refs/heads/master
/setup.py
from setuptools import setup setup( name='pypageobject', version='0.1.0', description='framework for creating page objects in python', long_description=open('README.rst').read(), author='bwalkowi', url='https://github.com/bwalkowi/pypageobject', packages=['pypageobject'], install_requi...
{"/pypageobject/__init__.py": ["/pypageobject/_page_objects.py", "/pypageobject/_page_elements.py"], "/pypageobject/_page_elements.py": ["/pypageobject/__init__.py"]}
66,940
doldol1/Crawlaper
refs/heads/master
/ntis_scraper_selenium.py
from selenium import webdriver from selenium.webdriver.support.ui import Select from collections import defaultdict import bs4 import sys import re ''' chrome_driver=webdriver.Chrome('D:/scrapper/web_driver/chromedriver.exe') other_page=webdriver.Chrome('D:/scrapper/web_driver/chromedriver.exe') #chrome_driver.implici...
{"/all_scraper/naver_scraper/admin.py": ["/all_scraper/naver_scraper/models.py"], "/all_scraper/naver_scraper/views.py": ["/all_scraper/naver_scraper/models.py", "/all_scraper/naver_scraper/Urllist_server.py"]}
66,941
doldol1/Crawlaper
refs/heads/master
/chbio_scraper.py
from selenium import webdriver from selenium.webdriver.support.ui import Select from selenium.webdriver.support.ui import WebDriverWait as EC from collections import defaultdict from seleniumrequests import Firefox import bs4 import sys import re from bs4 import BeautifulSoup import time # url='http://qy1.sfda.gov.cn/...
{"/all_scraper/naver_scraper/admin.py": ["/all_scraper/naver_scraper/models.py"], "/all_scraper/naver_scraper/views.py": ["/all_scraper/naver_scraper/models.py", "/all_scraper/naver_scraper/Urllist_server.py"]}
66,942
doldol1/Crawlaper
refs/heads/master
/noun_parser.py
from konlpy.tag import Hannanum import xlwt import xlrd file_name='D:\scrapper\사회적기업\원본\\2000~2010년 사회적기업 뉴스 스크래핑.xls' def parser(): wt_sheetnum=1 #엑셀 읽기 rd_workbook=xlrd.open_workbook(file_name) rd_worksheet=rd_workbook.sheet_by_index(0) #엑셀 쓰기 wt_workbook=xlwt.Workbook(encoding='utf-8'...
{"/all_scraper/naver_scraper/admin.py": ["/all_scraper/naver_scraper/models.py"], "/all_scraper/naver_scraper/views.py": ["/all_scraper/naver_scraper/models.py", "/all_scraper/naver_scraper/Urllist_server.py"]}
66,943
doldol1/Crawlaper
refs/heads/master
/project_saewol/Naver_crawler_partial.py
# from Urllist import Urllist from bs4 import BeautifulSoup import urllib.request import urllib.parse import urllib import re import xlsxwriter import xlrd import datetime target_url='https://search.naver.com/search.naver?&where=news&'\ 'query=%EC%84%B8%EC%9B%94%ED%98%B8&'\ 'sm=tab_pge&sort=0&photo=0&field=1&reporter_...
{"/all_scraper/naver_scraper/admin.py": ["/all_scraper/naver_scraper/models.py"], "/all_scraper/naver_scraper/views.py": ["/all_scraper/naver_scraper/models.py", "/all_scraper/naver_scraper/Urllist_server.py"]}
66,944
doldol1/Crawlaper
refs/heads/master
/Urlist.py
from bs4 import BeautifulSoup import urllib.request import datetime import re #이상한 검색어: asdkfdsl # target_url='http://search.naver.com/search.naver?sm=tab_hty.top&where=news&'\ # 'query=asdkfdsl&'\ # 'oquery=%EA%B8%B0%EB%8A%A5%EC%84%B1%EC%8B%9D%ED%92%88&'\ # 'ie=utf8&tqi=TiH03spySDossvJNudwssssssvs-266552' # https://...
{"/all_scraper/naver_scraper/admin.py": ["/all_scraper/naver_scraper/models.py"], "/all_scraper/naver_scraper/views.py": ["/all_scraper/naver_scraper/models.py", "/all_scraper/naver_scraper/Urllist_server.py"]}
66,945
doldol1/Crawlaper
refs/heads/master
/all_scraper/naver_scraper/models.py
from django.db import models # Create your models here. ##############Value###################### ##SearchCondition class ##pk: auto-generated primary key ##keyword: keyword of crawler ##ds: start date, DateField. ##de: end date, DateField. ##search_mode: condition flag, 0 is subject only search, 1is subject+body se...
{"/all_scraper/naver_scraper/admin.py": ["/all_scraper/naver_scraper/models.py"], "/all_scraper/naver_scraper/views.py": ["/all_scraper/naver_scraper/models.py", "/all_scraper/naver_scraper/Urllist_server.py"]}
66,946
doldol1/Crawlaper
refs/heads/master
/refiner.py
#string refiner: remove special character import re import xlrd import xlwt import os #file_name='D:\scrapper\노화\\2007~2008년 노화 뉴스 스크래핑.xls' def refiner(file_name): #사용할 엑셀 sheet번호 wt_sheetnum=1 #엑셀 읽기 rd_workbook=xlrd.open_workbook(file_name) rd_worksheet=rd_workbook.sheet_by_index(0) #...
{"/all_scraper/naver_scraper/admin.py": ["/all_scraper/naver_scraper/models.py"], "/all_scraper/naver_scraper/views.py": ["/all_scraper/naver_scraper/models.py", "/all_scraper/naver_scraper/Urllist_server.py"]}
66,947
doldol1/Crawlaper
refs/heads/master
/all_scraper/naver_scraper/Urlmake_server.py
import urllib.parse from datetime import datetime def url_make(condition): sample_url='https://search.naver.com/search.naver?&where=news&'\ 'query=%EC%84%B8%EC%9B%94%ED%98%B8&'\ 'sm=tab_pge&sort=0&photo=0&field=1&reporter_article=&pd=3&'\ 'ds=2014.04.14&de=2018.03.05&docid=&'\ 'nso=so:r,p:from20140414to20180305,a...
{"/all_scraper/naver_scraper/admin.py": ["/all_scraper/naver_scraper/models.py"], "/all_scraper/naver_scraper/views.py": ["/all_scraper/naver_scraper/models.py", "/all_scraper/naver_scraper/Urllist_server.py"]}
66,948
doldol1/Crawlaper
refs/heads/master
/all_scraper/naver_scraper/apps.py
from django.apps import AppConfig class NaverScraperConfig(AppConfig): name = 'naver_scraper'
{"/all_scraper/naver_scraper/admin.py": ["/all_scraper/naver_scraper/models.py"], "/all_scraper/naver_scraper/views.py": ["/all_scraper/naver_scraper/models.py", "/all_scraper/naver_scraper/Urllist_server.py"]}
66,949
doldol1/Crawlaper
refs/heads/master
/scrapper_ver2.2_distributed.py
from bs4 import BeautifulSoup import urllib.request import xlwt import datetime import re #-*- coding: utf-8 -*- ##네이버 검색 url쿼리 규칙 # exist: 언론사 코드가 들어가는 곳 # ie: 인코딩인 듯, 확인 필요 # query: 검색어 # sm: title.basic이면 제목에서만, all.basic이면 제목+본문 곳에서 # startDate, endDate: 시작 날자와 끝 날자, 만약 아무 것도 안들어갔다면 startDate는 1960년 1월 1일, endD...
{"/all_scraper/naver_scraper/admin.py": ["/all_scraper/naver_scraper/models.py"], "/all_scraper/naver_scraper/views.py": ["/all_scraper/naver_scraper/models.py", "/all_scraper/naver_scraper/Urllist_server.py"]}
66,950
doldol1/Crawlaper
refs/heads/master
/naver_scraper_ver0.1.py
#다시 만들어야 된다.. 젠장... #변경된 스크래퍼는 GET방식으로 쿼리문이 비교적 간단해짐.. 여전히 4,000개 검색이 한계치임 #cluster_rank라는 요상한 쿼리가 생겼는데... hop의 횟수를 확인하는 파라미터인듯 하다... 만약 계속적인 정보 수집시 문제가 될 수 있으므로 0으로 초기화하는 것이 좋을 듯 #페이지 이동과 끝 from bs4 import BeautifulSoup import urllib.request import xlwt import datetime import re ''' https://search.naver.com/search.n...
{"/all_scraper/naver_scraper/admin.py": ["/all_scraper/naver_scraper/models.py"], "/all_scraper/naver_scraper/views.py": ["/all_scraper/naver_scraper/models.py", "/all_scraper/naver_scraper/Urllist_server.py"]}
66,951
doldol1/Crawlaper
refs/heads/master
/all_scraper/naver_scraper/admin.py
from django.contrib import admin from .models import SearchCondition, SearchResult # Register your models here. admin.site.register(SearchCondition) admin.site.register(SearchResult)
{"/all_scraper/naver_scraper/admin.py": ["/all_scraper/naver_scraper/models.py"], "/all_scraper/naver_scraper/views.py": ["/all_scraper/naver_scraper/models.py", "/all_scraper/naver_scraper/Urllist_server.py"]}
66,952
doldol1/Crawlaper
refs/heads/master
/all_scraper/naver_scraper/urls.py
from django.urls import path from . import views app_name='naver_scraper' urlpatterns=[ path('', views.index, name='index'), path('crawling/', views.crawling, name='naver_crawling'), ]
{"/all_scraper/naver_scraper/admin.py": ["/all_scraper/naver_scraper/models.py"], "/all_scraper/naver_scraper/views.py": ["/all_scraper/naver_scraper/models.py", "/all_scraper/naver_scraper/Urllist_server.py"]}
66,953
doldol1/Crawlaper
refs/heads/master
/file_integrate.py
import xlsxwriter import xlrd import os def filter(file_names): #통합할 파일 wt_app_sheetnum=1 wt_app_workbook=xlsxwriter.Workbook('integrated_file.xlsx', {'strings_to_urls':False}) wt_app_worksheet=wt_app_workbook.add_worksheet() #쓸 파일의 row, col wt_row=0 wt_col=0 for file_name in fil...
{"/all_scraper/naver_scraper/admin.py": ["/all_scraper/naver_scraper/models.py"], "/all_scraper/naver_scraper/views.py": ["/all_scraper/naver_scraper/models.py", "/all_scraper/naver_scraper/Urllist_server.py"]}
66,954
doldol1/Crawlaper
refs/heads/master
/all_scraper/naver_scraper/Urllist_server.py
from bs4 import BeautifulSoup import urllib.request import requests import datetime import re import http.cookiejar #이상한 검색어: asdkfdsl # target_url='http://search.naver.com/search.naver?sm=tab_hty.top&where=news&'\ # 'query=asdkfdsl&'\ # 'oquery=%EA%B8%B0%EB%8A%A5%EC%84%B1%EC%8B%9D%ED%92%88&'\ # 'ie=utf8&tqi=TiH03spySD...
{"/all_scraper/naver_scraper/admin.py": ["/all_scraper/naver_scraper/models.py"], "/all_scraper/naver_scraper/views.py": ["/all_scraper/naver_scraper/models.py", "/all_scraper/naver_scraper/Urllist_server.py"]}
66,955
doldol1/Crawlaper
refs/heads/master
/all_scraper/naver_scraper/migrations/0001_initial.py
# Generated by Django 2.0 on 2018-02-24 08:49 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='SearchCondition', fields=[ ...
{"/all_scraper/naver_scraper/admin.py": ["/all_scraper/naver_scraper/models.py"], "/all_scraper/naver_scraper/views.py": ["/all_scraper/naver_scraper/models.py", "/all_scraper/naver_scraper/Urllist_server.py"]}
66,956
doldol1/Crawlaper
refs/heads/master
/all_scraper/naver_scraper/views.py
from django.http import HttpResponse from django.shortcuts import render from datetime import datetime from .models import SearchCondition from .Urllist_server import Urllist from .file_integrate_server import filter from .Naver_crawler_server import Naver_crawler from .Naver_crawler_server import Naver_scraper from...
{"/all_scraper/naver_scraper/admin.py": ["/all_scraper/naver_scraper/models.py"], "/all_scraper/naver_scraper/views.py": ["/all_scraper/naver_scraper/models.py", "/all_scraper/naver_scraper/Urllist_server.py"]}
67,018
Karan-S-Mittal/DataFlair-News-Aggregator
refs/heads/master
/news/models.py
from django.db import models # Create your models here. # Scrape data coming from websites # The posts will contain images, urls and titles class Headline(models.Model): title = models.CharField(max_length=300) image = models.URLField(max_length=1000, blank=True) url = models.URLField(max_length=500) ...
{"/news/admin.py": ["/news/models.py"]}
67,019
Karan-S-Mittal/DataFlair-News-Aggregator
refs/heads/master
/news/urls.py
from django.urls import path from news.views import scrape, news_list urlpatterns = [ path('scrape/', scrape, name="scrape"), path('', news_list, name="home"), ]
{"/news/admin.py": ["/news/models.py"]}
67,020
Karan-S-Mittal/DataFlair-News-Aggregator
refs/heads/master
/news/admin.py
from django.contrib import admin from news.models import Headline # Register your models here. admin.site.register(Headline)
{"/news/admin.py": ["/news/models.py"]}
67,021
prostomusa/Factory
refs/heads/main
/poll/views.py
from django.shortcuts import render from rest_framework import status from rest_framework.response import Response from rest_framework.permissions import IsAuthenticated, AllowAny from rest_framework.decorators import api_view, permission_classes from rest_framework import generics from django.http import HttpResponse,...
{"/poll/views.py": ["/poll/serializer.py", "/poll/models.py"], "/poll/serializer.py": ["/poll/models.py"], "/poll/urls.py": ["/poll/views.py"]}
67,022
prostomusa/Factory
refs/heads/main
/poll/serializer.py
from rest_framework import serializers from .models import * class QuestionDisplaySerializer(serializers.ModelSerializer): type_of_question = serializers.CharField(source='get_t_question_display') class Meta: model = Question fields = ['id', 'question', 'type_of_question'] class QuestionsSeria...
{"/poll/views.py": ["/poll/serializer.py", "/poll/models.py"], "/poll/serializer.py": ["/poll/models.py"], "/poll/urls.py": ["/poll/views.py"]}
67,023
prostomusa/Factory
refs/heads/main
/poll/migrations/0002_auto_20210214_2229.py
# Generated by Django 2.2.10 on 2021-02-14 22:29 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('poll', '0001_initial'), ] operations = [ migrations.AlterField( model_name='polls', name='date_end', fi...
{"/poll/views.py": ["/poll/serializer.py", "/poll/models.py"], "/poll/serializer.py": ["/poll/models.py"], "/poll/urls.py": ["/poll/views.py"]}
67,024
prostomusa/Factory
refs/heads/main
/poll/models.py
from django.db import models from django.contrib.auth.models import AbstractBaseUser, BaseUserManager from django.conf import settings from django.db.models.signals import post_save from django.dispatch import receiver from rest_framework.authtoken.models import Token @receiver(post_save, sender=settings.AUTH_USER_MOD...
{"/poll/views.py": ["/poll/serializer.py", "/poll/models.py"], "/poll/serializer.py": ["/poll/models.py"], "/poll/urls.py": ["/poll/views.py"]}
67,025
prostomusa/Factory
refs/heads/main
/poll/migrations/0001_initial.py
# Generated by Django 2.2.10 on 2021-02-14 20:37 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Answer', fields=[ ...
{"/poll/views.py": ["/poll/serializer.py", "/poll/models.py"], "/poll/serializer.py": ["/poll/models.py"], "/poll/urls.py": ["/poll/views.py"]}
67,026
prostomusa/Factory
refs/heads/main
/poll/urls.py
from django.urls import re_path, path, include from .views import * from rest_framework.authtoken.views import obtain_auth_token urlpatterns = [ path('poll/answer/<int:id_poll>/<int:id_user>', answer_question), path('poll/<int:id_poll>/get_question', get_question), path('poll/question/<int:id_question>', qu...
{"/poll/views.py": ["/poll/serializer.py", "/poll/models.py"], "/poll/serializer.py": ["/poll/models.py"], "/poll/urls.py": ["/poll/views.py"]}
67,029
mariabenitocst/oPDF
refs/heads/master
/PotentialProf.py
""" This file creates the potential and cumulative density profile templates for a given DM file""" from oPDF import * from myutils import * import h5py import os import sys from scipy.stats import chi2 # plt.ion() # set units if needed hubble = 0.73 Globals.set_units(1e10 * hubble, hubble, 1.) #set ...
{"/PotentialProf.py": ["/oPDF.py"], "/FitNFWProfML.py": ["/oPDF.py"]}
67,030
mariabenitocst/oPDF
refs/heads/master
/oPDF.py
""" Python interface to the C code for oPDF modelling. It wraps the C functions into python classes with ctypes. """ from math import * import numpy as np import ctypes import os from myutils import Chi2Sig, AD2Sig, density_of_points, get_extent, NamedValues, NamedEnum # from myutils import fmin_gsl # from scipy.optim...
{"/PotentialProf.py": ["/oPDF.py"], "/FitNFWProfML.py": ["/oPDF.py"]}
67,031
mariabenitocst/oPDF
refs/heads/master
/FitNFWProfML.py
import matplotlib # matplotlib.use('Agg') from oPDF import * from myutils import * import h5py import os import sys from scipy.stats import chi2 plt.ion() npart = int(1e6) for halo in 'ABCDE': with Tracer(halo + '2') as F: with F.copy(0, npart) as S: S.mP *= float(F.nP) /S.nP resu...
{"/PotentialProf.py": ["/oPDF.py"], "/FitNFWProfML.py": ["/oPDF.py"]}
67,034
cds-snc/domain-scan
refs/heads/master
/gatherers/censys.py
import csv import json import logging import os from typing import List from google.cloud import bigquery from google.oauth2 import service_account import google.api_core.exceptions from gatherers.gathererabc import Gatherer from utils import utils # Options: # # --timeout: Override the 10 minute job timeout (specif...
{"/gatherers/censys.py": ["/gatherers/gathererabc.py"], "/tests/test_scan_utils.py": ["/tests/context.py"], "/tests/test_utils.py": ["/tests/context.py"], "/gatherers/url.py": ["/gatherers/gathererabc.py"], "/tests/test_gatherers_censys.py": ["/tests/context.py"], "/tests/test_gatherers_rdns.py": ["/tests/context.py"],...
67,035
cds-snc/domain-scan
refs/heads/master
/scanners/csp.py
import logging import requests from scanners import utils ### # CSP Scanner - check the presence of CSP headers # # Set a default number of workers for a particular scan type. # Overridden by a --workers flag. workers = 2 # default to a custom user agent, can be overridden user_agent = "github.com/18f/domain-scan,...
{"/gatherers/censys.py": ["/gatherers/gathererabc.py"], "/tests/test_scan_utils.py": ["/tests/context.py"], "/tests/test_utils.py": ["/tests/context.py"], "/gatherers/url.py": ["/gatherers/gathererabc.py"], "/tests/test_gatherers_censys.py": ["/tests/context.py"], "/tests/test_gatherers_rdns.py": ["/tests/context.py"],...
67,036
cds-snc/domain-scan
refs/heads/master
/tests/test_scan_utils.py
import os import sys from collections import namedtuple from pathlib import Path from .context import utils, scanners # noqa from utils import scan_utils from scanners import analytics, noop import pytest MockScanner = namedtuple("MockScanner", ["workers"]) @pytest.mark.parametrize("names,expected", [ ( ...
{"/gatherers/censys.py": ["/gatherers/gathererabc.py"], "/tests/test_scan_utils.py": ["/tests/context.py"], "/tests/test_utils.py": ["/tests/context.py"], "/gatherers/url.py": ["/gatherers/gathererabc.py"], "/tests/test_gatherers_censys.py": ["/tests/context.py"], "/tests/test_gatherers_rdns.py": ["/tests/context.py"],...
67,037
cds-snc/domain-scan
refs/heads/master
/tests/test_runner.py
import csv import pytest from runner import runner class MockScanner: headers = ['field_a', 'field_b'] @pytest.fixture def output_file(tmpdir): return str(tmpdir.join('output.csv')) def test_write_rows(output_file): data = [ ['value 1', 'value 2'], ['value 3', 'value 4'], ] wit...
{"/gatherers/censys.py": ["/gatherers/gathererabc.py"], "/tests/test_scan_utils.py": ["/tests/context.py"], "/tests/test_utils.py": ["/tests/context.py"], "/gatherers/url.py": ["/gatherers/gathererabc.py"], "/tests/test_gatherers_censys.py": ["/tests/context.py"], "/tests/test_gatherers_rdns.py": ["/tests/context.py"],...
67,038
cds-snc/domain-scan
refs/heads/master
/tests/test_utils.py
import argparse import sys import pytest from .context import utils # noqa from utils import utils as subutils from utils import scan_utils def get_default_values(parser): # Get these from the parser rather than having to keep a manual list. optional_actions = parser._get_optional_actions() default_value...
{"/gatherers/censys.py": ["/gatherers/gathererabc.py"], "/tests/test_scan_utils.py": ["/tests/context.py"], "/tests/test_utils.py": ["/tests/context.py"], "/gatherers/url.py": ["/gatherers/gathererabc.py"], "/tests/test_gatherers_censys.py": ["/tests/context.py"], "/tests/test_gatherers_rdns.py": ["/tests/context.py"],...
67,039
cds-snc/domain-scan
refs/heads/master
/scanners/analytics.py
import argparse import logging import os from pathlib import Path from typing import Tuple from urllib.parse import urlparse from utils import utils, scan_utils # Check whether a domain is present in a CSV, set in --analytics. # The domains in --analytics will have been downloaded and # loaded in options['analytics...
{"/gatherers/censys.py": ["/gatherers/gathererabc.py"], "/tests/test_scan_utils.py": ["/tests/context.py"], "/tests/test_utils.py": ["/tests/context.py"], "/gatherers/url.py": ["/gatherers/gathererabc.py"], "/tests/test_gatherers_censys.py": ["/tests/context.py"], "/tests/test_gatherers_rdns.py": ["/tests/context.py"],...
67,040
cds-snc/domain-scan
refs/heads/master
/scanners/scannerabc.py
from abc import ABCMeta, abstractmethod import os class ScannerABC(metaclass=ABCMeta): lambda_support = False def __init__(self, environment: dict, options: dict) -> None: self.environment = environment self.options = options self.report_dir = self.options.get("output", "./") ...
{"/gatherers/censys.py": ["/gatherers/gathererabc.py"], "/tests/test_scan_utils.py": ["/tests/context.py"], "/tests/test_utils.py": ["/tests/context.py"], "/gatherers/url.py": ["/gatherers/gathererabc.py"], "/tests/test_gatherers_censys.py": ["/tests/context.py"], "/tests/test_gatherers_rdns.py": ["/tests/context.py"],...
67,041
cds-snc/domain-scan
refs/heads/master
/process_a11y/a11y/process_a11y.py
import argparse import csv import json from collections import defaultdict from statistics import mean from utils.utils import mkdir_p, results_dir class A11yProcessor(object): ERRORS = { '1_1': 'Missing Image Descriptions', '1_3': 'Form - Initial Findings', '1_4': 'Color Contrast - Init...
{"/gatherers/censys.py": ["/gatherers/gathererabc.py"], "/tests/test_scan_utils.py": ["/tests/context.py"], "/tests/test_utils.py": ["/tests/context.py"], "/gatherers/url.py": ["/gatherers/gathererabc.py"], "/tests/test_gatherers_censys.py": ["/tests/context.py"], "/tests/test_gatherers_rdns.py": ["/tests/context.py"],...
67,042
cds-snc/domain-scan
refs/heads/master
/scanners/noop.py
import logging from typing import Tuple from utils.scan_utils import ArgumentParser, make_values_single ### # Testing scan function. Does nothing time consuming or destructive, # but exercises many of the main hooks of domain-scan. # Set a default number of workers for a particular scan type. # Overridden by a --wor...
{"/gatherers/censys.py": ["/gatherers/gathererabc.py"], "/tests/test_scan_utils.py": ["/tests/context.py"], "/tests/test_utils.py": ["/tests/context.py"], "/gatherers/url.py": ["/gatherers/gathererabc.py"], "/tests/test_gatherers_censys.py": ["/tests/context.py"], "/tests/test_gatherers_rdns.py": ["/tests/context.py"],...
67,043
cds-snc/domain-scan
refs/heads/master
/scanners/trustymail.py
import logging ### # Inspect a site's DNS Mail configuration using DHS NCATS' trustymail tool. ### # default to a long timeout default_timeout = 30 # This is the same default timeout used in trustymail/scripts/trustymail default_smtp_timeout = 5 # These are the same default ports used in trustymail/scripts/trustyma...
{"/gatherers/censys.py": ["/gatherers/gathererabc.py"], "/tests/test_scan_utils.py": ["/tests/context.py"], "/tests/test_utils.py": ["/tests/context.py"], "/gatherers/url.py": ["/gatherers/gathererabc.py"], "/tests/test_gatherers_censys.py": ["/tests/context.py"], "/tests/test_gatherers_rdns.py": ["/tests/context.py"],...
67,044
cds-snc/domain-scan
refs/heads/master
/lambda/lambda_handler.py
import importlib import sys import logging from utils import utils # Central handler for all Lambda events. def handler(event, context): start_time = utils.local_now() domain = event.get('domain') options = event.get('options') name = event.get('scanner') environment = event.get('environment') ...
{"/gatherers/censys.py": ["/gatherers/gathererabc.py"], "/tests/test_scan_utils.py": ["/tests/context.py"], "/tests/test_utils.py": ["/tests/context.py"], "/gatherers/url.py": ["/gatherers/gathererabc.py"], "/tests/test_gatherers_censys.py": ["/tests/context.py"], "/tests/test_gatherers_rdns.py": ["/tests/context.py"],...
67,045
cds-snc/domain-scan
refs/heads/master
/tests/context.py
import os import sys sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) import gatherers # noqa import scanners # noqa import utils # noqa
{"/gatherers/censys.py": ["/gatherers/gathererabc.py"], "/tests/test_scan_utils.py": ["/tests/context.py"], "/tests/test_utils.py": ["/tests/context.py"], "/gatherers/url.py": ["/gatherers/gathererabc.py"], "/tests/test_gatherers_censys.py": ["/tests/context.py"], "/tests/test_gatherers_rdns.py": ["/tests/context.py"],...
67,046
cds-snc/domain-scan
refs/heads/master
/scanners/third_parties.py
import logging from utils import utils # Evaluate third party service usage using Chrome headless. # Can also be run in Lambda. lambda_support = True # Signal that this is a JS-based scan using headless Chrome. # The scan method will be defined in third_parties.js instead. scan_headless = True # Use pshtt data if...
{"/gatherers/censys.py": ["/gatherers/gathererabc.py"], "/tests/test_scan_utils.py": ["/tests/context.py"], "/tests/test_utils.py": ["/tests/context.py"], "/gatherers/url.py": ["/gatherers/gathererabc.py"], "/tests/test_gatherers_censys.py": ["/tests/context.py"], "/tests/test_gatherers_rdns.py": ["/tests/context.py"],...
67,047
cds-snc/domain-scan
refs/heads/master
/runner/runner.py
from utils import utils def write_rows(rows, domain, base_domain, scanner, csv_writer, meta=None): # If we didn't get any info, we'll still output information about why the scan failed. if rows is None: empty_row = [None] * len(scanner.headers) rows = [empty_row] # Always output Domain a...
{"/gatherers/censys.py": ["/gatherers/gathererabc.py"], "/tests/test_scan_utils.py": ["/tests/context.py"], "/tests/test_utils.py": ["/tests/context.py"], "/gatherers/url.py": ["/gatherers/gathererabc.py"], "/tests/test_gatherers_censys.py": ["/tests/context.py"], "/tests/test_gatherers_rdns.py": ["/tests/context.py"],...
67,048
cds-snc/domain-scan
refs/heads/master
/gatherers/url.py
import os import logging import requests from gatherers.gathererabc import Gatherer from utils import utils class Gatherer(Gatherer): def gather(self): # Defaults to --url, but can be overridden. name = self.extra.get("name", "url") url = self.options.get(name) if url is None: ...
{"/gatherers/censys.py": ["/gatherers/gathererabc.py"], "/tests/test_scan_utils.py": ["/tests/context.py"], "/tests/test_utils.py": ["/tests/context.py"], "/gatherers/url.py": ["/gatherers/gathererabc.py"], "/tests/test_gatherers_censys.py": ["/tests/context.py"], "/tests/test_gatherers_rdns.py": ["/tests/context.py"],...
67,049
cds-snc/domain-scan
refs/heads/master
/process_a11y/tests/test_process_a11y.py
import unittest from .context import a11y # noqa from a11y.process_a11y import A11yProcessor class ProcessA11yTestCase(unittest.TestCase): a11y_filename = 'tests/data/a11y.csv' domain_filename = 'tests/data/domains.csv' def setUp(self): self.a11y = A11yProcessor(self.a11y_filename, self.domain...
{"/gatherers/censys.py": ["/gatherers/gathererabc.py"], "/tests/test_scan_utils.py": ["/tests/context.py"], "/tests/test_utils.py": ["/tests/context.py"], "/gatherers/url.py": ["/gatherers/gathererabc.py"], "/tests/test_gatherers_censys.py": ["/tests/context.py"], "/tests/test_gatherers_rdns.py": ["/tests/context.py"],...
67,050
cds-snc/domain-scan
refs/heads/master
/tests/test_gatherers_censys.py
import pytest from .context import gatherers # noqa from gatherers import censys CENSYS_ONE_SUFFIX_QUERY = "\n".join([ "SELECT", " parsed.subject.common_name,", " parsed.extensions.subject_alt_name.dns_names", "FROM", " `censys-io.certificates_public.certificates`,", " UNNEST(pars...
{"/gatherers/censys.py": ["/gatherers/gathererabc.py"], "/tests/test_scan_utils.py": ["/tests/context.py"], "/tests/test_utils.py": ["/tests/context.py"], "/gatherers/url.py": ["/gatherers/gathererabc.py"], "/tests/test_gatherers_censys.py": ["/tests/context.py"], "/tests/test_gatherers_rdns.py": ["/tests/context.py"],...
67,051
cds-snc/domain-scan
refs/heads/master
/gatherers/gathererabc.py
from abc import ABCMeta, abstractmethod import os from typing import List class Gatherer(metaclass=ABCMeta): def __init__(self, suffixes: List[str], options: dict, extra: dict={}): self.suffixes = suffixes self.options = options self.extra = extra self.report_dir = self.options.ge...
{"/gatherers/censys.py": ["/gatherers/gathererabc.py"], "/tests/test_scan_utils.py": ["/tests/context.py"], "/tests/test_utils.py": ["/tests/context.py"], "/gatherers/url.py": ["/gatherers/gathererabc.py"], "/tests/test_gatherers_censys.py": ["/tests/context.py"], "/tests/test_gatherers_rdns.py": ["/tests/context.py"],...
67,052
cds-snc/domain-scan
refs/heads/master
/scanners/headless/local_bridge.py
import logging import json from utils import scan_utils ### # Local Python bridge to the JS bridge to the JS scanner. # Shells out to run Node on base.js, which runs headless Chrome # and then pulls in the scanner-specific JS scanning function. # Resulting data is serialized and returned via STDOUT. ### def headles...
{"/gatherers/censys.py": ["/gatherers/gathererabc.py"], "/tests/test_scan_utils.py": ["/tests/context.py"], "/tests/test_utils.py": ["/tests/context.py"], "/gatherers/url.py": ["/gatherers/gathererabc.py"], "/tests/test_gatherers_censys.py": ["/tests/context.py"], "/tests/test_gatherers_rdns.py": ["/tests/context.py"],...
67,053
cds-snc/domain-scan
refs/heads/master
/scanners/a11y.py
import json import logging import os import requests import yaml from utils import utils workers = 3 pa11y = os.environ.get("PA11Y_PATH", "pa11y") redirects = {} config = "" def init(environment, options): global redirects global config cache_dir = options.get("_", {}).get("cache_dir", "./cache") ...
{"/gatherers/censys.py": ["/gatherers/gathererabc.py"], "/tests/test_scan_utils.py": ["/tests/context.py"], "/tests/test_utils.py": ["/tests/context.py"], "/gatherers/url.py": ["/gatherers/gathererabc.py"], "/tests/test_gatherers_censys.py": ["/tests/context.py"], "/tests/test_gatherers_rdns.py": ["/tests/context.py"],...
67,054
cds-snc/domain-scan
refs/heads/master
/scanners/missing_scanner.py
# This lives in the scanners directory and is purely for making # testing easier. command = "hopefully_not_a_real_command_on_some_system_somewhere"
{"/gatherers/censys.py": ["/gatherers/gathererabc.py"], "/tests/test_scan_utils.py": ["/tests/context.py"], "/tests/test_utils.py": ["/tests/context.py"], "/gatherers/url.py": ["/gatherers/gathererabc.py"], "/tests/test_gatherers_censys.py": ["/tests/context.py"], "/tests/test_gatherers_rdns.py": ["/tests/context.py"],...
67,055
cds-snc/domain-scan
refs/heads/master
/tests/test_gatherers_rdns.py
import pytest from .context import gatherers # noqa from gatherers import rdns @pytest.mark.parametrize("data,expected", [ ( [ '{"value": "18f.gov"}', '{"value": "123.112.18f.gov"}', '{"value": "123.112.23.23"}', '{"value": "u-123.112.23.23"}', ...
{"/gatherers/censys.py": ["/gatherers/gathererabc.py"], "/tests/test_scan_utils.py": ["/tests/context.py"], "/tests/test_utils.py": ["/tests/context.py"], "/gatherers/url.py": ["/gatherers/gathererabc.py"], "/tests/test_gatherers_censys.py": ["/tests/context.py"], "/tests/test_gatherers_rdns.py": ["/tests/context.py"],...
67,056
cds-snc/domain-scan
refs/heads/master
/scanners/noopabc.py
import logging from typing import List from scanners.scannerabc import ScannerABC ### # Testing scan class. Does nothing time consuming or destructive, # but exercises many of the main hooks of domain-scan. class Scanner(ScannerABC): # CSV headers for each row of data. Referenced locally. headers = ["Comple...
{"/gatherers/censys.py": ["/gatherers/gathererabc.py"], "/tests/test_scan_utils.py": ["/tests/context.py"], "/tests/test_utils.py": ["/tests/context.py"], "/gatherers/url.py": ["/gatherers/gathererabc.py"], "/tests/test_gatherers_censys.py": ["/tests/context.py"], "/tests/test_gatherers_rdns.py": ["/tests/context.py"],...
67,057
cds-snc/domain-scan
refs/heads/master
/tests/test_scanners_analytics.py
import pytest from argparse import ArgumentTypeError from scanners import analytics @pytest.mark.parametrize("opts,args,correct_opts, correct_unknown", [ ( ["--analytics", "tests/data/domains.csv"], {}, {"analytics_domains": ["achp.gov", "acus.gov"]}, [], ), ( ["--...
{"/gatherers/censys.py": ["/gatherers/gathererabc.py"], "/tests/test_scan_utils.py": ["/tests/context.py"], "/tests/test_utils.py": ["/tests/context.py"], "/gatherers/url.py": ["/gatherers/gathererabc.py"], "/tests/test_gatherers_censys.py": ["/tests/context.py"], "/tests/test_gatherers_rdns.py": ["/tests/context.py"],...
67,058
cds-snc/domain-scan
refs/heads/master
/gatherers/rdns.py
import json import logging import re from typing import Generator, List, Pattern from gatherers.gathererabc import Gatherer # Reverse DNS # # Given a path to a (local) "JSON Lines" formatted file, # based on Rapid7's Reverse DNS data, pull out the domains # that match the given suffixes. # # Bearing in mind that the ...
{"/gatherers/censys.py": ["/gatherers/gathererabc.py"], "/tests/test_scan_utils.py": ["/tests/context.py"], "/tests/test_utils.py": ["/tests/context.py"], "/gatherers/url.py": ["/gatherers/gathererabc.py"], "/tests/test_gatherers_censys.py": ["/tests/context.py"], "/tests/test_gatherers_rdns.py": ["/tests/context.py"],...
67,059
ZEYINWU/Singel-Cell
refs/heads/master
/project.py
import numpy as np import scipy.io as sio def projsplx(y,x): m = y.shape[0] n = y.shape[1] s = np.repeat(0.0,m).reshape(m,1) vs = np.repeat(0.0,m).reshape(m,1) for k in range(n): means = 0.0 mins = 100000.0 for j in range(m): s[j,0] = y[j,k] means...
{"/SILMR.py": ["/network.py", "/multikernel.py", "/util_silmr.py", "/tsne.py", "/project.py"], "/demo.py": ["/network.py", "/multikernel.py", "/util_silmr.py", "/tsne.py", "/project.py", "/SILMR.py"]}
67,060
ZEYINWU/Singel-Cell
refs/heads/master
/util_silmr.py
import scipy.io as sio import sys import numpy as np from numpy import linalg as LA def eig1(A,c,isMax): if c>A.shape[0]: c = A.shape[0] isSym = 1 if isSym==1: eigen_A = LA.eigh(A) else: eigen_A = LA.eig(A) v = eigen_A[1] d = eigen_A[0] if isMax==0: ei...
{"/SILMR.py": ["/network.py", "/multikernel.py", "/util_silmr.py", "/tsne.py", "/project.py"], "/demo.py": ["/network.py", "/multikernel.py", "/util_silmr.py", "/tsne.py", "/project.py", "/SILMR.py"]}
67,061
ZEYINWU/Singel-Cell
refs/heads/master
/tsne.py
import numpy as np import scipy.io as sio import random def tsne(X,k,initial_config): max_iter = 3000 min_cost = 0.0 epoch = 100 momentum = 0.8 final_momentum = 0.7 mom_switch_iter = 250 epsilon = 500.0 min_gain = 0.01 initial_P_gain = 4.0 n = (X.shape[0]) eps = np.f...
{"/SILMR.py": ["/network.py", "/multikernel.py", "/util_silmr.py", "/tsne.py", "/project.py"], "/demo.py": ["/network.py", "/multikernel.py", "/util_silmr.py", "/tsne.py", "/project.py", "/SILMR.py"]}
67,062
ZEYINWU/Singel-Cell
refs/heads/master
/network.py
import scipy.io as sio import numpy as np import math from numpy import linalg as LA def networkDiffusion(A,K): np.fill_diagonal(A,0) sign_A = A sign_A = sign_A>0 sign_A = (sign_A -1) + sign_A P = np.array(dominateSet((np.absolute(A)),min(K,A.shape[0]-1))) * np.array(sign_A) DD = np.sum(n...
{"/SILMR.py": ["/network.py", "/multikernel.py", "/util_silmr.py", "/tsne.py", "/project.py"], "/demo.py": ["/network.py", "/multikernel.py", "/util_silmr.py", "/tsne.py", "/project.py", "/SILMR.py"]}
67,063
ZEYINWU/Singel-Cell
refs/heads/master
/readdata.py
import numpy as np data = open("/Users/Zeyin/Desktop/Study/Bioinformatics/project/data1.txt",'r') f=data.next() k=0 res = list() for line in data: if(k==4): break s = line.split(" ") l = len(s) curl = list() for i in range(1,l): curl.append(float(s[i])) res.append(res) k = k...
{"/SILMR.py": ["/network.py", "/multikernel.py", "/util_silmr.py", "/tsne.py", "/project.py"], "/demo.py": ["/network.py", "/multikernel.py", "/util_silmr.py", "/tsne.py", "/project.py", "/SILMR.py"]}
67,064
ZEYINWU/Singel-Cell
refs/heads/master
/multikernel.py
import numpy as np from scipy.stats import norm import math from handythread import foreach import scipy.io as sio ## input: matrix x, and integer thread def multiKernel(x,threads): kernelType = list(); kernelType.append("poly"); kernelParams = list(); kernelParams.append(0); N = x.shape[0]; ...
{"/SILMR.py": ["/network.py", "/multikernel.py", "/util_silmr.py", "/tsne.py", "/project.py"], "/demo.py": ["/network.py", "/multikernel.py", "/util_silmr.py", "/tsne.py", "/project.py", "/SILMR.py"]}
67,065
ZEYINWU/Singel-Cell
refs/heads/master
/SILMR.py
import numpy as np import network as nw import multikernel as mk from numpy import linalg as LA import scipy.io as sio import util_silmr as us import tsne as ts from scipy.cluster.vq import vq, kmeans, whiten import project as pj def SIMLR(X,c,no_dim ,k=10, if_impute = False,normalize = False,cores_ratio=5): #pri...
{"/SILMR.py": ["/network.py", "/multikernel.py", "/util_silmr.py", "/tsne.py", "/project.py"], "/demo.py": ["/network.py", "/multikernel.py", "/util_silmr.py", "/tsne.py", "/project.py", "/SILMR.py"]}
67,066
ZEYINWU/Singel-Cell
refs/heads/master
/demo.py
import numpy as np import network as nw import multikernel as mk from numpy import linalg as LA import scipy.io as sio import util_silmr as us import tsne as ts from scipy.cluster.vq import vq, kmeans, whiten import project as pj import SILMR as silmr data = sio.loadmat('/Users/Zeyin/Desktop/Study/Bioinformatics/SIMLR...
{"/SILMR.py": ["/network.py", "/multikernel.py", "/util_silmr.py", "/tsne.py", "/project.py"], "/demo.py": ["/network.py", "/multikernel.py", "/util_silmr.py", "/tsne.py", "/project.py", "/SILMR.py"]}
67,067
ZEYINWU/Singel-Cell
refs/heads/master
/eig1.py
from numpy import linalg as LA def eig1(A): eigen_A = LA.eig(A) v = eigen_A[1] d = eigen_A[0] d1 = -np.sort(-d) idx = np.argsort(-d) idx1 = idx eigval = d[idx1] eigvec = v[,idx1].real eigval_full = d[idx] res=list() res.append(eigval) res.append(eigvec) res.append...
{"/SILMR.py": ["/network.py", "/multikernel.py", "/util_silmr.py", "/tsne.py", "/project.py"], "/demo.py": ["/network.py", "/multikernel.py", "/util_silmr.py", "/tsne.py", "/project.py", "/SILMR.py"]}
67,068
Hellowlol/torrentool
refs/heads/master
/torrentool/cli.py
import click from os import path, getcwd from sys import exit from torrentool import VERSION from torrentool.api import Torrent @click.group() @click.version_option(version='.'.join(map(str, VERSION))) def start(): """Torrentool command line utilities.""" @start.group() def torrent(): """Torrent-related co...
{"/torrentool/cli.py": ["/torrentool/api.py"], "/torrentool/api.py": ["/torrentool/torrent.py"], "/torrentool/torrent.py": ["/torrentool/utils.py"], "/tests/test_etc.py": ["/torrentool/utils.py"]}
67,069
Hellowlol/torrentool
refs/heads/master
/torrentool/api.py
from .bencode import Bencode from .torrent import Torrent
{"/torrentool/cli.py": ["/torrentool/api.py"], "/torrentool/api.py": ["/torrentool/torrent.py"], "/torrentool/torrent.py": ["/torrentool/utils.py"], "/tests/test_etc.py": ["/torrentool/utils.py"]}
67,070
Hellowlol/torrentool
refs/heads/master
/torrentool/torrent.py
from os.path import join, isdir, getsize, normpath, basename from os import walk, sep from hashlib import sha1 from datetime import datetime from calendar import timegm from functools import reduce from .bencode import Bencode from .exceptions import TorrentError from .utils import get_app_version class Torrent(obje...
{"/torrentool/cli.py": ["/torrentool/api.py"], "/torrentool/api.py": ["/torrentool/torrent.py"], "/torrentool/torrent.py": ["/torrentool/utils.py"], "/tests/test_etc.py": ["/torrentool/utils.py"]}
67,071
Hellowlol/torrentool
refs/heads/master
/tests/test_etc.py
# -*- encoding: utf-8 -*- from torrentool.utils import get_app_version def test_get_app_version(): assert 'torrentool' in get_app_version()
{"/torrentool/cli.py": ["/torrentool/api.py"], "/torrentool/api.py": ["/torrentool/torrent.py"], "/torrentool/torrent.py": ["/torrentool/utils.py"], "/tests/test_etc.py": ["/torrentool/utils.py"]}
67,072
Hellowlol/torrentool
refs/heads/master
/torrentool/utils.py
def get_app_version(): """Returns full version string including application name suitable for putting into Torrent.created_by. """ from torrentool import VERSION return 'torrentool/%s' % '.'.join(map(str, VERSION))
{"/torrentool/cli.py": ["/torrentool/api.py"], "/torrentool/api.py": ["/torrentool/torrent.py"], "/torrentool/torrent.py": ["/torrentool/utils.py"], "/tests/test_etc.py": ["/torrentool/utils.py"]}
67,080
arjun-krishna1/BitHolmes
refs/heads/main
/crytpoaddrverification/__init__.py
import requests def verify_bitcoin(public_key): public_key = public_key.strip() for i in public_key: value = ord(i) if value < 48 or value > 122 or (value > 57 and value < 65) or (value > 91 and value < 96): return False page = requests.get(f'https://www.blockchain.com/btc/addre...
{"/app.py": ["/data.py", "/ai_predictions/__init__.py", "/qrcodefunctions/__init__.py", "/rq/__init__.py", "/crytpoaddrverification/__init__.py"]}
67,081
arjun-krishna1/BitHolmes
refs/heads/main
/ai_predictions/__init__.py
import tensorflow as tf import numpy as np import requests import pandas as pd import json class AddressClassifier: # 1 is for sure fraud, 0 is for sure not fraud THRESHOLD = 0.3 BASE_API = "https://blockchain.info/rawaddr/" MODEL_PATH = "dnn_model" STATS_PATH = "dataset_stats.json" ID_FEATU...
{"/app.py": ["/data.py", "/ai_predictions/__init__.py", "/qrcodefunctions/__init__.py", "/rq/__init__.py", "/crytpoaddrverification/__init__.py"]}
67,082
arjun-krishna1/BitHolmes
refs/heads/main
/qrcodefunctions/__init__.py
from qrcode import make from time import time import os, glob from pathlib import Path static_path = os.path.join(Path(__file__).parents[1], 'static') def make_qr(data): code = make(data) name = str(time()) + ".png" code.save("static/" + name) return name def make_website_link_qr(public_key, host_url...
{"/app.py": ["/data.py", "/ai_predictions/__init__.py", "/qrcodefunctions/__init__.py", "/rq/__init__.py", "/crytpoaddrverification/__init__.py"]}
67,083
arjun-krishna1/BitHolmes
refs/heads/main
/data.py
fraud_level_to_value = { -1: "broken", 0: "unknown", 1: "fraud", 2: "suspected fraud", 3: "not fraud" }
{"/app.py": ["/data.py", "/ai_predictions/__init__.py", "/qrcodefunctions/__init__.py", "/rq/__init__.py", "/crytpoaddrverification/__init__.py"]}
67,084
arjun-krishna1/BitHolmes
refs/heads/main
/rq/__init__.py
import requests def get_token(): with open('new_secrets.txt', 'r') as f: t = f.read() f.close() return t def check_addr(address): key = get_token() call = f"https://www.bitcoinabuse.com/api/reports/check?address={address}&api_token={key}" response_json = requests.api.get(call...
{"/app.py": ["/data.py", "/ai_predictions/__init__.py", "/qrcodefunctions/__init__.py", "/rq/__init__.py", "/crytpoaddrverification/__init__.py"]}
67,085
arjun-krishna1/BitHolmes
refs/heads/main
/app.py
from flask import * import data, os from ai_predictions import AddressClassifier import qrcodefunctions as qrfunc from rq import check_addr from crytpoaddrverification import verify_bitcoin from datetime import timedelta from flask_sqlalchemy import SQLAlchemy from flask_marshmallow import Marshmallow CL = AddressCl...
{"/app.py": ["/data.py", "/ai_predictions/__init__.py", "/qrcodefunctions/__init__.py", "/rq/__init__.py", "/crytpoaddrverification/__init__.py"]}
67,101
thefunkjunky/CodeSF-Suggest-v2
refs/heads/master
/codesf_suggest/config.py
import json import urllib import sys import os class DevelopmentConfig(object): # try: # with open("config_variables.json", 'r') as cfg_file: # cfg_params = json.load(cfg_file) # except Exception as e: # sys.exit() # SECRET_KEY = cfg_params['secret_key'] DEBUG = True clas...
{"/codesf_suggest/api.py": ["/codesf_suggest/main.py"], "/codesf_suggest/utils.py": ["/codesf_suggest/main.py"], "/tests/api_tests.py": ["/codesf_suggest/main.py"]}
67,102
thefunkjunky/CodeSF-Suggest-v2
refs/heads/master
/codesf_suggest/models.py
from google.appengine.ext import ndb from werkzeug.security import generate_password_hash, check_password_hash class User(ndb.Expando): """ Base User Class """ password_ = ndb.StringProperty() name = ndb.StringProperty() username = ndb.StringProperty() email = ndb.StringProperty() organizati...
{"/codesf_suggest/api.py": ["/codesf_suggest/main.py"], "/codesf_suggest/utils.py": ["/codesf_suggest/main.py"], "/tests/api_tests.py": ["/codesf_suggest/main.py"]}
67,103
thefunkjunky/CodeSF-Suggest-v2
refs/heads/master
/codesf_suggest/main.py
import os import sys from flask import Flask from google.appengine.ext import vendor # Add any libraries installed in the "lib" folder. vendor.add('lib') sys.path.insert(0, 'lib') app = Flask(__name__) config_path = os.environ.get("CONFIG_PATH", "codesf_suggest.config.DevelopmentConfig") app.config.fro...
{"/codesf_suggest/api.py": ["/codesf_suggest/main.py"], "/codesf_suggest/utils.py": ["/codesf_suggest/main.py"], "/tests/api_tests.py": ["/codesf_suggest/main.py"]}
67,104
thefunkjunky/CodeSF-Suggest-v2
refs/heads/master
/config_wizard.py
import os from base64 import b64encode import json import getpass # Using json config file to avoid uploading passwords to git, and dealing with different # PostgreSQL usernames on different machines def main(): # I was taught to use this as an environment variable, but I don't # like that for some reason. ...
{"/codesf_suggest/api.py": ["/codesf_suggest/main.py"], "/codesf_suggest/utils.py": ["/codesf_suggest/main.py"], "/tests/api_tests.py": ["/codesf_suggest/main.py"]}
67,105
thefunkjunky/CodeSF-Suggest-v2
refs/heads/master
/codesf_suggest/api.py
import os.path import json from flask import request, Response, url_for, send_from_directory from werkzeug.utils import secure_filename from jsonschema import validate, ValidationError from google.appengine.ext import ndb from . import models from . import decorators from .main import app # JSON scheme validator...
{"/codesf_suggest/api.py": ["/codesf_suggest/main.py"], "/codesf_suggest/utils.py": ["/codesf_suggest/main.py"], "/tests/api_tests.py": ["/codesf_suggest/main.py"]}
67,106
thefunkjunky/CodeSF-Suggest-v2
refs/heads/master
/codesf_suggest/utils.py
import os.path from codesf_suggest.main import app
{"/codesf_suggest/api.py": ["/codesf_suggest/main.py"], "/codesf_suggest/utils.py": ["/codesf_suggest/main.py"], "/tests/api_tests.py": ["/codesf_suggest/main.py"]}
67,107
thefunkjunky/CodeSF-Suggest-v2
refs/heads/master
/tests/api_tests.py
import unittest import json try: from urllib.parse import urlparse except ImportError: from urlparse import urlparse # Py2 compatibility from google.appengine.ext import ndb from google.appengine.ext import testbed # Configure our app to use the testing databse # os.environ["CONFIG_PATH"] = "codesf_suggest.config.T...
{"/codesf_suggest/api.py": ["/codesf_suggest/main.py"], "/codesf_suggest/utils.py": ["/codesf_suggest/main.py"], "/tests/api_tests.py": ["/codesf_suggest/main.py"]}
67,135
Alfiesan/earthquakePrediction
refs/heads/master
/library/TestIO.py
import numpy as np import logging, dill, fnmatch, os from embedding.EmbeddingIO import EmbeddingIO class TestIO: def __init__(self, embeddingType = 'one-stats-test'): """ self.sourceSSD = '/home/exx/muktadir/data/train.csv' self.sourceHDD = '/home/exx/muktadir/data/train.csv' ...
{"/library/TestIO.py": ["/embedding/EmbeddingIO.py"], "/TinyFFNWithStats.py": ["/library/MultipleBinDataGenerator.py", "/library/LivePlotKeras.py"], "/library/MultipleBinDataGenerator.py": ["/data_analysis/library/Bin.py", "/data_analysis/library/BinIO.py", "/data_analysis/library/Scalers.py", "/embedding/OneStatsEmbed...
67,136
Alfiesan/earthquakePrediction
refs/heads/master
/estimator/EstimatorManager.py
from estimator.EstimatorIO import EstimatorIO class EstimatorManager: def __init__(self): self.io = EstimatorIO()
{"/library/TestIO.py": ["/embedding/EmbeddingIO.py"], "/TinyFFNWithStats.py": ["/library/MultipleBinDataGenerator.py", "/library/LivePlotKeras.py"], "/library/MultipleBinDataGenerator.py": ["/data_analysis/library/Bin.py", "/data_analysis/library/BinIO.py", "/data_analysis/library/Scalers.py", "/embedding/OneStatsEmbed...