index
int64
repo_name
string
branch_name
string
path
string
content
string
import_graph
string
79,982
birgitast/MetaLearning-for-segmentation
refs/heads/master
/test.py
import torch import torch.nn.functional as F from torchmeta.utils.data import BatchMetaDataLoader import json, tkinter, os import matplotlib matplotlib.use('TkAgg') import matplotlib.image as mpimg import matplotlib.pyplot as plt import numpy as np from models import Unet, FCN8, ResUnet from utils import print_tes...
{"/models.py": ["/mymodules.py"], "/test.py": ["/models.py", "/utils.py", "/data.py", "/maml.py"], "/data.py": ["/pairtransforms.py", "/utils.py"], "/maml.py": ["/utils.py"]}
79,983
birgitast/MetaLearning-for-segmentation
refs/heads/master
/pairtransforms.py
import numbers import random from collections.abc import Sequence from typing import Tuple, List, Optional import torch from PIL import Image from torch import Tensor import numpy as np try: import accimage except ImportError: accimage = None import torchvision.transforms.functional as F """-------------...
{"/models.py": ["/mymodules.py"], "/test.py": ["/models.py", "/utils.py", "/data.py", "/maml.py"], "/data.py": ["/pairtransforms.py", "/utils.py"], "/maml.py": ["/utils.py"]}
79,984
birgitast/MetaLearning-for-segmentation
refs/heads/master
/data.py
import torch from myhelper import pascal5i import pairtransforms as pt #from torchmeta.transforms import SegmentationPairTransform from utils import SegmentationPairTransformNorm def get_datasets(name, folder, num_ways=1, num_shots=1, num_shots_test=None, shuffle=True, seed=None, download=False, fold=0, augment=Fals...
{"/models.py": ["/mymodules.py"], "/test.py": ["/models.py", "/utils.py", "/data.py", "/maml.py"], "/data.py": ["/pairtransforms.py", "/utils.py"], "/maml.py": ["/utils.py"]}
79,985
birgitast/MetaLearning-for-segmentation
refs/heads/master
/mymodules.py
import torch.nn as nn import torch.nn.functional as F from collections import OrderedDict from torchmeta.modules.module import MetaModule class MetaConvTranspose2d(nn.ConvTranspose2d, MetaModule): """Applies a 2D transposed convolution operator over an input image composed of several input planes. Adapte...
{"/models.py": ["/mymodules.py"], "/test.py": ["/models.py", "/utils.py", "/data.py", "/maml.py"], "/data.py": ["/pairtransforms.py", "/utils.py"], "/maml.py": ["/utils.py"]}
79,986
birgitast/MetaLearning-for-segmentation
refs/heads/master
/utils.py
import torch import random import matplotlib matplotlib.use('TkAgg') import matplotlib.pyplot as plt import numpy as np from PIL import Image from collections import OrderedDict from torchmeta.modules import MetaModule from torchvision.transforms import Compose, Resize, ToTensor, Normalize import PIL def compute_...
{"/models.py": ["/mymodules.py"], "/test.py": ["/models.py", "/utils.py", "/data.py", "/maml.py"], "/data.py": ["/pairtransforms.py", "/utils.py"], "/maml.py": ["/utils.py"]}
79,987
birgitast/MetaLearning-for-segmentation
refs/heads/master
/maml.py
import torch import numpy as np from tqdm import tqdm from collections import OrderedDict from torchmeta.utils import gradient_update_parameters from utils import tensors_to_device, compute_accuracy, get_dice_score, jaccard_idx, DiceLoss import torch.nn.functional as F __all__ = ['ModelAgnosticMetaLearning', 'MAML'...
{"/models.py": ["/mymodules.py"], "/test.py": ["/models.py", "/utils.py", "/data.py", "/maml.py"], "/data.py": ["/pairtransforms.py", "/utils.py"], "/maml.py": ["/utils.py"]}
80,004
NanoCode012/ChanChanDiscordBot
refs/heads/master
/bot.py
import discord import os import random import firebase_admin from firebase_admin import credentials from firebase_admin import firestore from fantasi import * # Use a service account cred = credentials.Certificate('firebase-adminsdk.json') firebase_admin.initialize_app(cred) db = firestore.client() client = discor...
{"/bot.py": ["/fantasi.py"]}
80,005
NanoCode012/ChanChanDiscordBot
refs/heads/master
/fantasi.py
import json, random class Character: def __init__(self, message=None, author=None, channel=None, content=None, gold=None, level=None): if message: author = User(user=message.author) channel = Channel(channel=message.channel) content = message.content assert auth...
{"/bot.py": ["/fantasi.py"]}
80,006
NanoCode012/ChanChanDiscordBot
refs/heads/master
/catch.py
try: raise Exception('problem') except Exception as e: print(e)
{"/bot.py": ["/fantasi.py"]}
80,012
vladku/bigt
refs/heads/master
/bigt/dictext.py
import re import sys import inspect from copy import deepcopy from collections.abc import Iterable #sphinx-build -b html source build #sphinx-apidoc -f -o source ../bigt # docstr-coverage bigt -m -f # pytest --cov=bigt tests/ --cov-report annotate def _xstr(s): """Get empty str in case of None and str in other ca...
{"/tests/test_sort.py": ["/bigt/dictext.py"], "/tests/test_equel.py": ["/bigt/dictext.py"], "/tests/test_merge.py": ["/bigt/dictext.py"], "/tests/test_dictext.py": ["/bigt/dictext.py"]}
80,013
vladku/bigt
refs/heads/master
/tests/test_sort.py
from bigt.dictext import DictExt def test_simple(): assert DictExt({"aa": 3, "a": 1, "b": 2}) == DictExt({"b": 2, "a": 1, "aa": 3}) def test_nested(): assert DictExt({"aa": 3, "a": [[3,1,8,5], {"b": {"bv": 1, "bc": 2}, "a": 1}]}) == \ DictExt({"a": [{"a": 1, "b": {"bc": 2, "bv": 1}}, [1,3,5,8]], "aa":...
{"/tests/test_sort.py": ["/bigt/dictext.py"], "/tests/test_equel.py": ["/bigt/dictext.py"], "/tests/test_merge.py": ["/bigt/dictext.py"], "/tests/test_dictext.py": ["/bigt/dictext.py"]}
80,014
vladku/bigt
refs/heads/master
/tests/test_equel.py
from bigt.dictext import DictExt def test_simple(): assert DictExt({"a": 1, "b": 2}) == DictExt({"a": 1, "b": 2}) def test_nested(): assert DictExt({"a": {"a": 1}}) == DictExt({"a": {"a": 1}}) def test_different_order(): assert DictExt({"a": 1, "b": 2}) == DictExt({"b": 2, "a": 1}) assert DictExt({"b...
{"/tests/test_sort.py": ["/bigt/dictext.py"], "/tests/test_equel.py": ["/bigt/dictext.py"], "/tests/test_merge.py": ["/bigt/dictext.py"], "/tests/test_dictext.py": ["/bigt/dictext.py"]}
80,015
vladku/bigt
refs/heads/master
/setup.py
import setuptools setuptools.setup( name='Bigt', version='2019.1.0', description='Bigt', py_modules=["bigt"], )
{"/tests/test_sort.py": ["/bigt/dictext.py"], "/tests/test_equel.py": ["/bigt/dictext.py"], "/tests/test_merge.py": ["/bigt/dictext.py"], "/tests/test_dictext.py": ["/bigt/dictext.py"]}
80,016
vladku/bigt
refs/heads/master
/tests/test_merge.py
from bigt.dictext import DictExt def test_merge_simple(): a = {"a":[{'1': '1', '2': '2'},{'1': '1', '2': '2'}]} b = {"a":[{'1': '1', '2': '2'},{'3': '3', '2': '2'}]} #assert DictExt(a, b)['a'][0] == {'1': '1', '2': '2', '3': '3'} m = DictExt(a) + DictExt(b) assert m['a'][1] == DictExt({'1': '1', '...
{"/tests/test_sort.py": ["/bigt/dictext.py"], "/tests/test_equel.py": ["/bigt/dictext.py"], "/tests/test_merge.py": ["/bigt/dictext.py"], "/tests/test_dictext.py": ["/bigt/dictext.py"]}
80,017
vladku/bigt
refs/heads/master
/tests/test_dictext.py
from bigt.dictext import DictExt, _str, _bool, _int, _list def test_skip_path(): a = {"a":[{'b': '1', 'c': {'a': '2'}},{'a': '1', 'b': '2'}]} b = {"a":[{'b': '10', 'c': {'a': '20'}},{'a': '1', 'b': '2'}]} result, not_present, changed = DictExt(a).issubset(b, skip=['a.c.a']) assert not result assert...
{"/tests/test_sort.py": ["/bigt/dictext.py"], "/tests/test_equel.py": ["/bigt/dictext.py"], "/tests/test_merge.py": ["/bigt/dictext.py"], "/tests/test_dictext.py": ["/bigt/dictext.py"]}
80,019
KamiNoSierhej/Technical-Test
refs/heads/master
/users/views/viewset_mixins.py
from django.http import Http404 class GetObjectMixin: """ Get first object filtered out by backend filters from queryset or raise 404 """ def get_object(self): obj = self.filter_queryset(self.get_queryset()).first() if obj: return obj raise Http404
{"/users/views/user.py": ["/users/models.py", "/users/permissions.py"], "/users/views/credit_check.py": ["/users/models.py", "/users/serializers/credit_check.py", "/users/views/viewset_mixins.py", "/users/filters.py"], "/users/tests/test_permission.py": ["/users/permissions.py", "/users/models.py"], "/users/views/profi...
80,020
KamiNoSierhej/Technical-Test
refs/heads/master
/users/filters.py
from rest_framework.filters import BaseFilterBackend class RetrieveForLoggedUserFilter(BaseFilterBackend): """Filter out object related to logged user.""" def filter_queryset(self, request, queryset, view): return queryset.filter(user_id=request.user.id)
{"/users/views/user.py": ["/users/models.py", "/users/permissions.py"], "/users/views/credit_check.py": ["/users/models.py", "/users/serializers/credit_check.py", "/users/views/viewset_mixins.py", "/users/filters.py"], "/users/tests/test_permission.py": ["/users/permissions.py", "/users/models.py"], "/users/views/profi...
80,021
KamiNoSierhej/Technical-Test
refs/heads/master
/users/helpers.py
from requests import post, exceptions from django.conf import settings def credit_check_call(first_name, last_name): """Helper to get credit check from third party provider.""" try: return post( settings.DATA_SOURCE_FOR_CREDIT_INFORMATION, json={'first_name': first_name, 'last...
{"/users/views/user.py": ["/users/models.py", "/users/permissions.py"], "/users/views/credit_check.py": ["/users/models.py", "/users/serializers/credit_check.py", "/users/views/viewset_mixins.py", "/users/filters.py"], "/users/tests/test_permission.py": ["/users/permissions.py", "/users/models.py"], "/users/views/profi...
80,022
KamiNoSierhej/Technical-Test
refs/heads/master
/users/views/user.py
from rest_framework import permissions from rest_framework.viewsets import ReadOnlyModelViewSet from users.models import User from users.permissions import CompletedSignupAndAcceptedCredit from users.serializers.user import UserSerializer class UserListView(ReadOnlyModelViewSet): queryset = User.objects.all() ...
{"/users/views/user.py": ["/users/models.py", "/users/permissions.py"], "/users/views/credit_check.py": ["/users/models.py", "/users/serializers/credit_check.py", "/users/views/viewset_mixins.py", "/users/filters.py"], "/users/tests/test_permission.py": ["/users/permissions.py", "/users/models.py"], "/users/views/profi...
80,023
KamiNoSierhej/Technical-Test
refs/heads/master
/users/views/credit_check.py
from rest_framework import permissions, status from rest_framework.response import Response from rest_framework.viewsets import ModelViewSet from users.models import CreditCheck from users.serializers.credit_check import CreditCheckSerializer from users.views.viewset_mixins import GetObjectMixin from users.filters imp...
{"/users/views/user.py": ["/users/models.py", "/users/permissions.py"], "/users/views/credit_check.py": ["/users/models.py", "/users/serializers/credit_check.py", "/users/views/viewset_mixins.py", "/users/filters.py"], "/users/tests/test_permission.py": ["/users/permissions.py", "/users/models.py"], "/users/views/profi...
80,024
KamiNoSierhej/Technical-Test
refs/heads/master
/users/tests/test_permission.py
from mock import Mock from datetime import datetime from django.test import TestCase from users.permissions import CompletedSignupAndAcceptedCredit from users.models import User, Profile, CreditCheck class CompletedSignupAndAcceptedCreditTest(TestCase): def setUp(self): self.user = User(email='test@tes...
{"/users/views/user.py": ["/users/models.py", "/users/permissions.py"], "/users/views/credit_check.py": ["/users/models.py", "/users/serializers/credit_check.py", "/users/views/viewset_mixins.py", "/users/filters.py"], "/users/tests/test_permission.py": ["/users/permissions.py", "/users/models.py"], "/users/views/profi...
80,025
KamiNoSierhej/Technical-Test
refs/heads/master
/users/views/profile.py
from rest_framework import permissions, status from rest_framework.parsers import JSONParser from rest_framework.response import Response from rest_framework.viewsets import ModelViewSet from users.models import Profile from users.serializers.profile import ProfileSerializer from users.views.viewset_mixins import GetO...
{"/users/views/user.py": ["/users/models.py", "/users/permissions.py"], "/users/views/credit_check.py": ["/users/models.py", "/users/serializers/credit_check.py", "/users/views/viewset_mixins.py", "/users/filters.py"], "/users/tests/test_permission.py": ["/users/permissions.py", "/users/models.py"], "/users/views/profi...
80,026
KamiNoSierhej/Technical-Test
refs/heads/master
/users/tests/test_profile.py
from datetime import datetime from django.test import TestCase from rest_framework import status from rest_framework.test import APIRequestFactory, force_authenticate from users.models import User, Profile from users.views.profile import ProfileView factory = APIRequestFactory() class ProfileModelTest(TestCase): ...
{"/users/views/user.py": ["/users/models.py", "/users/permissions.py"], "/users/views/credit_check.py": ["/users/models.py", "/users/serializers/credit_check.py", "/users/views/viewset_mixins.py", "/users/filters.py"], "/users/tests/test_permission.py": ["/users/permissions.py", "/users/models.py"], "/users/views/profi...
80,027
KamiNoSierhej/Technical-Test
refs/heads/master
/users/serializers/misc.py
from rest_framework import serializers from rest_auth.registration.serializers import RegisterSerializer from rest_auth.serializers import LoginSerializer class CustomRegisterSerializer(RegisterSerializer): username = serializers.CharField(read_only=True) class CustomLoginSerializer(LoginSerializer): userna...
{"/users/views/user.py": ["/users/models.py", "/users/permissions.py"], "/users/views/credit_check.py": ["/users/models.py", "/users/serializers/credit_check.py", "/users/views/viewset_mixins.py", "/users/filters.py"], "/users/tests/test_permission.py": ["/users/permissions.py", "/users/models.py"], "/users/views/profi...
80,028
KamiNoSierhej/Technical-Test
refs/heads/master
/users/tests/test_user.py
from django.test import TestCase from users.models import User, Profile, CreditCheck class UserModelTest(TestCase): def setUp(self): self.user = User(email='test@test.test') self.user.save() def test_parameter_has_profile(self): self.assertFalse(self.user.has_profile) Profi...
{"/users/views/user.py": ["/users/models.py", "/users/permissions.py"], "/users/views/credit_check.py": ["/users/models.py", "/users/serializers/credit_check.py", "/users/views/viewset_mixins.py", "/users/filters.py"], "/users/tests/test_permission.py": ["/users/permissions.py", "/users/models.py"], "/users/views/profi...
80,029
KamiNoSierhej/Technical-Test
refs/heads/master
/users/tests/test_creditcheck.py
import mock from django.test import TestCase from rest_framework import status from rest_framework.test import APIRequestFactory, force_authenticate from users.models import User, Profile, CreditCheck from users.views.credit_check import CreditCheckView factory = APIRequestFactory() class CreditCheckViewTest(TestC...
{"/users/views/user.py": ["/users/models.py", "/users/permissions.py"], "/users/views/credit_check.py": ["/users/models.py", "/users/serializers/credit_check.py", "/users/views/viewset_mixins.py", "/users/filters.py"], "/users/tests/test_permission.py": ["/users/permissions.py", "/users/models.py"], "/users/views/profi...
80,030
KamiNoSierhej/Technical-Test
refs/heads/master
/users/migrations/0002_remove_creditcheck_data.py
# Generated by Django 2.1.4 on 2018-12-14 21:53 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('users', '0001_initial'), ] operations = [ migrations.RemoveField( model_name='creditcheck', name='data', ), ]
{"/users/views/user.py": ["/users/models.py", "/users/permissions.py"], "/users/views/credit_check.py": ["/users/models.py", "/users/serializers/credit_check.py", "/users/views/viewset_mixins.py", "/users/filters.py"], "/users/tests/test_permission.py": ["/users/permissions.py", "/users/models.py"], "/users/views/profi...
80,031
KamiNoSierhej/Technical-Test
refs/heads/master
/users/serializers/credit_check.py
from rest_framework import serializers from users.helpers import credit_check_call from users.models import CreditCheck class CreditCheckDefault: def validate_user(self): user_with_full_name = ( self.user.has_profile and self.user.profile.first_name and self.user.profi...
{"/users/views/user.py": ["/users/models.py", "/users/permissions.py"], "/users/views/credit_check.py": ["/users/models.py", "/users/serializers/credit_check.py", "/users/views/viewset_mixins.py", "/users/filters.py"], "/users/tests/test_permission.py": ["/users/permissions.py", "/users/models.py"], "/users/views/profi...
80,032
KamiNoSierhej/Technical-Test
refs/heads/master
/users/serializers/profile.py
from phonenumber_field.serializerfields import PhoneNumberField from rest_framework import serializers from django.conf import settings from users.models import Profile class ProfileSerializer(serializers.ModelSerializer): first_name = serializers.CharField( required=False, allow_blank=True, max_length=1...
{"/users/views/user.py": ["/users/models.py", "/users/permissions.py"], "/users/views/credit_check.py": ["/users/models.py", "/users/serializers/credit_check.py", "/users/views/viewset_mixins.py", "/users/filters.py"], "/users/tests/test_permission.py": ["/users/permissions.py", "/users/models.py"], "/users/views/profi...
80,033
KamiNoSierhej/Technical-Test
refs/heads/master
/users/permissions.py
from rest_framework.permissions import BasePermission class CompletedSignupAndAcceptedCredit(BasePermission): """ Only user who has filled the whole profile got accepted for credit has access. """ def has_permission(self, request, view): logged_user = request.user return ( ...
{"/users/views/user.py": ["/users/models.py", "/users/permissions.py"], "/users/views/credit_check.py": ["/users/models.py", "/users/serializers/credit_check.py", "/users/views/viewset_mixins.py", "/users/filters.py"], "/users/tests/test_permission.py": ["/users/permissions.py", "/users/models.py"], "/users/views/profi...
80,034
KamiNoSierhej/Technical-Test
refs/heads/master
/users/models.py
from django.contrib.auth.models import AbstractUser from django.db import models from phonenumber_field.modelfields import PhoneNumberField class User(AbstractUser): """Main auth user model.""" @property def has_profile(self): try: self.profile except Profile.DoesNotExist: ...
{"/users/views/user.py": ["/users/models.py", "/users/permissions.py"], "/users/views/credit_check.py": ["/users/models.py", "/users/serializers/credit_check.py", "/users/views/viewset_mixins.py", "/users/filters.py"], "/users/tests/test_permission.py": ["/users/permissions.py", "/users/models.py"], "/users/views/profi...
80,035
KamiNoSierhej/Technical-Test
refs/heads/master
/users/urls.py
from django.conf.urls import url from users.views.user import UserListView from users.views.profile import ProfileView from users.views.credit_check import CreditCheckView urlpatterns = [ url(r'^list/$', UserListView.as_view({'get': 'list'}), name='list'), url( r'^profile/$', ProfileView.as_vi...
{"/users/views/user.py": ["/users/models.py", "/users/permissions.py"], "/users/views/credit_check.py": ["/users/models.py", "/users/serializers/credit_check.py", "/users/views/viewset_mixins.py", "/users/filters.py"], "/users/tests/test_permission.py": ["/users/permissions.py", "/users/models.py"], "/users/views/profi...
80,036
KamiNoSierhej/Technical-Test
refs/heads/master
/interviewapp/urls.py
from django.urls import path from django.contrib import admin from django.conf.urls import include, url urlpatterns = [ url(r'^users/', include('users.urls')), url(r'^admin/', admin.site.urls), path('rest-auth/', include('rest_auth.urls')), path('rest-auth/registration/', include('rest_auth.registrat...
{"/users/views/user.py": ["/users/models.py", "/users/permissions.py"], "/users/views/credit_check.py": ["/users/models.py", "/users/serializers/credit_check.py", "/users/views/viewset_mixins.py", "/users/filters.py"], "/users/tests/test_permission.py": ["/users/permissions.py", "/users/models.py"], "/users/views/profi...
80,038
vitaly-efremov/py-algorithms
refs/heads/master
/tests/test_selection_sort.py
import unittest from selection_sort import selection_sort_v1, selection_sort_v2 from .sort_testing_mixin import TestSortMixin class SelectionSortV1TestCase(TestSortMixin, unittest.TestCase): def setUp(self): self.sort_func = selection_sort_v1 class SelectionSortV2TestCase(TestSortMixin, unittest.TestCas...
{"/tests/test_selection_sort.py": ["/selection_sort.py", "/tests/sort_testing_mixin.py"], "/tests/test_quick_sort.py": ["/quick_sort.py", "/tests/sort_testing_mixin.py"], "/tests/test_bubble_sort.py": ["/bubble_sort.py", "/tests/sort_testing_mixin.py"], "/tests/test_tim_sort.py": ["/tim_sort.py", "/tests/sort_testing_m...
80,039
vitaly-efremov/py-algorithms
refs/heads/master
/tests/test_quick_sort.py
import unittest from quick_sort import quick_sort_classic, quick_sort from .sort_testing_mixin import TestSortMixin class QuickSortClassicTestCase(TestSortMixin, unittest.TestCase): def setUp(self): self.sort_func = quick_sort_classic class QuickSortPythonicTestCase(TestSortMixin, unittest.TestCase): ...
{"/tests/test_selection_sort.py": ["/selection_sort.py", "/tests/sort_testing_mixin.py"], "/tests/test_quick_sort.py": ["/quick_sort.py", "/tests/sort_testing_mixin.py"], "/tests/test_bubble_sort.py": ["/bubble_sort.py", "/tests/sort_testing_mixin.py"], "/tests/test_tim_sort.py": ["/tim_sort.py", "/tests/sort_testing_m...
80,040
vitaly-efremov/py-algorithms
refs/heads/master
/bubble_sort.py
def bubble_sort(array): while True: is_sorted = True for i in range(1, len(array)): if array[i] < array[i-1]: array[i], array[i-1] = array[i-1], array[i] is_sorted = False if is_sorted: return array if __name__ == '__main__': unor...
{"/tests/test_selection_sort.py": ["/selection_sort.py", "/tests/sort_testing_mixin.py"], "/tests/test_quick_sort.py": ["/quick_sort.py", "/tests/sort_testing_mixin.py"], "/tests/test_bubble_sort.py": ["/bubble_sort.py", "/tests/sort_testing_mixin.py"], "/tests/test_tim_sort.py": ["/tim_sort.py", "/tests/sort_testing_m...
80,041
vitaly-efremov/py-algorithms
refs/heads/master
/insertion_sort.py
def insertion_sort_v1(array): n = len(array) for i in range(1, n): x = array[i] j = i while j > 0 and array[j-1] > x: array[j] = array[j-1] j -= 1 array[j] = x return array def insertion_sort_v2(array): for i, x in enumerate(array[1:], 1): ...
{"/tests/test_selection_sort.py": ["/selection_sort.py", "/tests/sort_testing_mixin.py"], "/tests/test_quick_sort.py": ["/quick_sort.py", "/tests/sort_testing_mixin.py"], "/tests/test_bubble_sort.py": ["/bubble_sort.py", "/tests/sort_testing_mixin.py"], "/tests/test_tim_sort.py": ["/tim_sort.py", "/tests/sort_testing_m...
80,042
vitaly-efremov/py-algorithms
refs/heads/master
/trie.py
from typing import List class TrieNode: def __init__(self, is_completed=False, children=None): self.is_completed = is_completed self.children = children or {} def __repr__(self) -> str: return f'TrieNode(is_completed={self.is_completed}, children={self.children})' class Trie: def __init__(self): self.ro...
{"/tests/test_selection_sort.py": ["/selection_sort.py", "/tests/sort_testing_mixin.py"], "/tests/test_quick_sort.py": ["/quick_sort.py", "/tests/sort_testing_mixin.py"], "/tests/test_bubble_sort.py": ["/bubble_sort.py", "/tests/sort_testing_mixin.py"], "/tests/test_tim_sort.py": ["/tim_sort.py", "/tests/sort_testing_m...
80,043
vitaly-efremov/py-algorithms
refs/heads/master
/heap.py
class Heap(object): def __init__(self): self.array = [] self.n = 0 def insert(self, value): self.array.append(value) self.n += 1 child_index = self.n - 1 parent_index = (child_index - 1) // 2 while child_index > 0 and self.array[parent_index] < self.arra...
{"/tests/test_selection_sort.py": ["/selection_sort.py", "/tests/sort_testing_mixin.py"], "/tests/test_quick_sort.py": ["/quick_sort.py", "/tests/sort_testing_mixin.py"], "/tests/test_bubble_sort.py": ["/bubble_sort.py", "/tests/sort_testing_mixin.py"], "/tests/test_tim_sort.py": ["/tim_sort.py", "/tests/sort_testing_m...
80,044
vitaly-efremov/py-algorithms
refs/heads/master
/tests/test_bubble_sort.py
import unittest from bubble_sort import bubble_sort from .sort_testing_mixin import TestSortMixin class TestBubbleSort(TestSortMixin, unittest.TestCase): def setUp(self): self.sort_func = bubble_sort if __name__ == '__main__': unittest.main()
{"/tests/test_selection_sort.py": ["/selection_sort.py", "/tests/sort_testing_mixin.py"], "/tests/test_quick_sort.py": ["/quick_sort.py", "/tests/sort_testing_mixin.py"], "/tests/test_bubble_sort.py": ["/bubble_sort.py", "/tests/sort_testing_mixin.py"], "/tests/test_tim_sort.py": ["/tim_sort.py", "/tests/sort_testing_m...
80,045
vitaly-efremov/py-algorithms
refs/heads/master
/tests/test_tim_sort.py
import unittest from tim_sort import tim_sort from .sort_testing_mixin import TestSortMixin class BubbleSortTestCase(TestSortMixin, unittest.TestCase): def setUp(self): self.sort_func = tim_sort if __name__ == '__main__': unittest.main()
{"/tests/test_selection_sort.py": ["/selection_sort.py", "/tests/sort_testing_mixin.py"], "/tests/test_quick_sort.py": ["/quick_sort.py", "/tests/sort_testing_mixin.py"], "/tests/test_bubble_sort.py": ["/bubble_sort.py", "/tests/sort_testing_mixin.py"], "/tests/test_tim_sort.py": ["/tim_sort.py", "/tests/sort_testing_m...
80,046
vitaly-efremov/py-algorithms
refs/heads/master
/merge_sort.py
from utils import measured_func def merge_parts(left_part, right_part): merged_list = [] while left_part or right_part: x = left_part[0] if left_part else None y = right_part[0] if right_part else None if y is None or (x is not None and x < y): merged_list.append(x) ...
{"/tests/test_selection_sort.py": ["/selection_sort.py", "/tests/sort_testing_mixin.py"], "/tests/test_quick_sort.py": ["/quick_sort.py", "/tests/sort_testing_mixin.py"], "/tests/test_bubble_sort.py": ["/bubble_sort.py", "/tests/sort_testing_mixin.py"], "/tests/test_tim_sort.py": ["/tim_sort.py", "/tests/sort_testing_m...
80,047
vitaly-efremov/py-algorithms
refs/heads/master
/heap_sort.py
from heap import Heap def heap_sort(array, reverse=False): sorted_array = [] heap = Heap() for x in array: heap.insert(x) print(heap.array) while heap.array: sorted_array.append(heap.pop_max()) return sorted_array if reverse else sorted_array[::-1] if __name__ == '__main__':...
{"/tests/test_selection_sort.py": ["/selection_sort.py", "/tests/sort_testing_mixin.py"], "/tests/test_quick_sort.py": ["/quick_sort.py", "/tests/sort_testing_mixin.py"], "/tests/test_bubble_sort.py": ["/bubble_sort.py", "/tests/sort_testing_mixin.py"], "/tests/test_tim_sort.py": ["/tim_sort.py", "/tests/sort_testing_m...
80,048
vitaly-efremov/py-algorithms
refs/heads/master
/tests/test_merge_sort.py
import unittest from merge_sort import merge_sort_v1, merge_sort_v2 from .sort_testing_mixin import TestSortMixin class MergeSortV1TestCase(TestSortMixin, unittest.TestCase): def setUp(self): self.sort_func = merge_sort_v1 class MergeSortV2TestCase(TestSortMixin, unittest.TestCase): def setUp(self):...
{"/tests/test_selection_sort.py": ["/selection_sort.py", "/tests/sort_testing_mixin.py"], "/tests/test_quick_sort.py": ["/quick_sort.py", "/tests/sort_testing_mixin.py"], "/tests/test_bubble_sort.py": ["/bubble_sort.py", "/tests/sort_testing_mixin.py"], "/tests/test_tim_sort.py": ["/tim_sort.py", "/tests/sort_testing_m...
80,049
vitaly-efremov/py-algorithms
refs/heads/master
/tests/test_heap.py
import unittest from heap import Heap class HeapTestCase(unittest.TestCase): def setUp(self): self.array = [5, 3, 0, 1, 2] self.heap = Heap() def test_insert(self): for x in [5, 3, 0, 1, 2]: self.heap.insert(x) self.assertEqual(self.heap.array, [5, 3, 0, 1, 2]) ...
{"/tests/test_selection_sort.py": ["/selection_sort.py", "/tests/sort_testing_mixin.py"], "/tests/test_quick_sort.py": ["/quick_sort.py", "/tests/sort_testing_mixin.py"], "/tests/test_bubble_sort.py": ["/bubble_sort.py", "/tests/sort_testing_mixin.py"], "/tests/test_tim_sort.py": ["/tim_sort.py", "/tests/sort_testing_m...
80,050
vitaly-efremov/py-algorithms
refs/heads/master
/binary_search.py
def binary_search(items, element): start_index = 0 end_index = len(items) - 1 while start_index <= end_index: mid_index = (start_index + end_index) // 2 value = items[mid_index] if value == element: return mid_index if value > element: end_index = mid_index - 1 else: start_index = mid_index + 1 ...
{"/tests/test_selection_sort.py": ["/selection_sort.py", "/tests/sort_testing_mixin.py"], "/tests/test_quick_sort.py": ["/quick_sort.py", "/tests/sort_testing_mixin.py"], "/tests/test_bubble_sort.py": ["/bubble_sort.py", "/tests/sort_testing_mixin.py"], "/tests/test_tim_sort.py": ["/tim_sort.py", "/tests/sort_testing_m...
80,051
vitaly-efremov/py-algorithms
refs/heads/master
/tests/test_insert_sort.py
import unittest from insertion_sort import insertion_sort_v1, insertion_sort_v2 from .sort_testing_mixin import TestSortMixin class InsertSortV1TestCase(TestSortMixin, unittest.TestCase): def setUp(self): self.sort_func = insertion_sort_v1 class InsertSortV2TestCase(TestSortMixin, unittest.TestCase): ...
{"/tests/test_selection_sort.py": ["/selection_sort.py", "/tests/sort_testing_mixin.py"], "/tests/test_quick_sort.py": ["/quick_sort.py", "/tests/sort_testing_mixin.py"], "/tests/test_bubble_sort.py": ["/bubble_sort.py", "/tests/sort_testing_mixin.py"], "/tests/test_tim_sort.py": ["/tim_sort.py", "/tests/sort_testing_m...
80,052
vitaly-efremov/py-algorithms
refs/heads/master
/tests/sort_testing_mixin.py
class TestSortMixin(object): def setUp(self): raise NotImplementedError('Merge function is not specified.') def test_empty_array(self): sorted_list = self.sort_func([]) self.assertListEqual(sorted_list, []) def test_one_element(self): sorted_list = self.sort_func([1]) ...
{"/tests/test_selection_sort.py": ["/selection_sort.py", "/tests/sort_testing_mixin.py"], "/tests/test_quick_sort.py": ["/quick_sort.py", "/tests/sort_testing_mixin.py"], "/tests/test_bubble_sort.py": ["/bubble_sort.py", "/tests/sort_testing_mixin.py"], "/tests/test_tim_sort.py": ["/tim_sort.py", "/tests/sort_testing_m...
80,053
vitaly-efremov/py-algorithms
refs/heads/master
/tests/test_heap_sort.py
import unittest from heap_sort import heap_sort from .sort_testing_mixin import TestSortMixin class HeapSortTestCase(TestSortMixin, unittest.TestCase): def setUp(self): self.sort_func = heap_sort if __name__ == '__main__': unittest.main()
{"/tests/test_selection_sort.py": ["/selection_sort.py", "/tests/sort_testing_mixin.py"], "/tests/test_quick_sort.py": ["/quick_sort.py", "/tests/sort_testing_mixin.py"], "/tests/test_bubble_sort.py": ["/bubble_sort.py", "/tests/sort_testing_mixin.py"], "/tests/test_tim_sort.py": ["/tim_sort.py", "/tests/sort_testing_m...
80,054
vitaly-efremov/py-algorithms
refs/heads/master
/tim_sort.py
from insertion_sort import insertion_sort_v1 from merge_sort import merge_parts def get_min_run(n): r = 0 while n >= 64: r |= n & 1 n >>= 1 return n + r def tim_sort(array): def cmp(a, b): return (a > b) - (a < b) n = len(array) if n < 2: return array mi...
{"/tests/test_selection_sort.py": ["/selection_sort.py", "/tests/sort_testing_mixin.py"], "/tests/test_quick_sort.py": ["/quick_sort.py", "/tests/sort_testing_mixin.py"], "/tests/test_bubble_sort.py": ["/bubble_sort.py", "/tests/sort_testing_mixin.py"], "/tests/test_tim_sort.py": ["/tim_sort.py", "/tests/sort_testing_m...
80,055
vitaly-efremov/py-algorithms
refs/heads/master
/quick_sort.py
from utils import measured_func def quick_sort_classic(array, start_i=0, last_i=None): if last_i is None: last_i = len(array) - 1 if start_i >= last_i: return array median = array[(last_i + start_i) // 2] left_i, right_i = start_i, last_i while right_i > left_i: while a...
{"/tests/test_selection_sort.py": ["/selection_sort.py", "/tests/sort_testing_mixin.py"], "/tests/test_quick_sort.py": ["/quick_sort.py", "/tests/sort_testing_mixin.py"], "/tests/test_bubble_sort.py": ["/bubble_sort.py", "/tests/sort_testing_mixin.py"], "/tests/test_tim_sort.py": ["/tim_sort.py", "/tests/sort_testing_m...
80,056
vitaly-efremov/py-algorithms
refs/heads/master
/selection_sort.py
def selection_sort_v1(array): n = len(array) for i in range(n): min_j = i for j in range(i+1, n): if array[j] < array[min_j]: min_j = j if min_j != i: array[i], array[min_j] = array[min_j], array[i] return array def selection_sort_v2(array):...
{"/tests/test_selection_sort.py": ["/selection_sort.py", "/tests/sort_testing_mixin.py"], "/tests/test_quick_sort.py": ["/quick_sort.py", "/tests/sort_testing_mixin.py"], "/tests/test_bubble_sort.py": ["/bubble_sort.py", "/tests/sort_testing_mixin.py"], "/tests/test_tim_sort.py": ["/tim_sort.py", "/tests/sort_testing_m...
80,058
WiillyWonka/CIAO2Re
refs/heads/main
/main.py
import re import argparse from graph_creator import make_graph from regex_creator import make_regex def parseFile(data): data = data.casefold() data = re.sub(r"end(\n)+", r"end", data) row_sm_list = [i for i in data.casefold().split('end') if i != ''] sm_list = [] for row_sm in row_sm_list: ...
{"/main.py": ["/graph_creator.py", "/regex_creator.py"]}
80,059
WiillyWonka/CIAO2Re
refs/heads/main
/regex_creator.py
from queue import Queue ''' Далее представлена функция построения регулярного выражения из графа-источника make_regex. На вход получаем описание графа источника: names - имена врешин neighbours - список смежности для каждой вершины d - индексы стоков s - индекс начальной вершины На выходе получаем массив заполненный...
{"/main.py": ["/graph_creator.py", "/regex_creator.py"]}
80,060
WiillyWonka/CIAO2Re
refs/heads/main
/graph_creator.py
''' Здесь представлен набор функций необходимых для построения графа-источника из описания конечных автоматов Основной функцией является make_graph Построение имеет следующие этапы: 1) Выделим все предоставляемые интерфейсы (и внешние, и внутренние) - это будут вершины графа источника. 2) Проверим для каждой из ком...
{"/main.py": ["/graph_creator.py", "/regex_creator.py"]}
80,062
sayaadit/captcha_breaker
refs/heads/master
/captcha_recognizer.py
import tensorflow as tf import glob, os import numpy as np import cv2 import random class OCR_recognizer(object): def __init__(self, model_filename, num_classes=36, num_channels=1, num_chars=5, resize_height=24, resize_width=88): self.model_filename = model_filename self.num_classes = num_classes ...
{"/captcha_accuracy.py": ["/captcha_recognizer.py"], "/captcha_train.py": ["/captcha_data.py"], "/captcha_app.py": ["/captcha_crawl.py", "/captcha_recognizer.py"]}
80,063
sayaadit/captcha_breaker
refs/heads/master
/captcha_data.py
import glob, os import numpy as np import cv2 import random class OCR_data(object): def __init__(self, num, data_dir, num_classes, batch_size=50, len_code=5, height=60, width=180, resize_height=24, resize_width=88, num_channels=1): self.num = num self.data_dir = data_dir s...
{"/captcha_accuracy.py": ["/captcha_recognizer.py"], "/captcha_train.py": ["/captcha_data.py"], "/captcha_app.py": ["/captcha_crawl.py", "/captcha_recognizer.py"]}
80,064
sayaadit/captcha_breaker
refs/heads/master
/captcha_crawl.py
from pyquery import PyQuery as pq from urllib.request import urlopen def curl(url): """ return content at url. return empty string if response raise an HTTPError (not found, 500...) """ try: print("retrieving url... %s") % (url) req = urllib2.Request(url) response = urllib2...
{"/captcha_accuracy.py": ["/captcha_recognizer.py"], "/captcha_train.py": ["/captcha_data.py"], "/captcha_app.py": ["/captcha_crawl.py", "/captcha_recognizer.py"]}
80,065
sayaadit/captcha_breaker
refs/heads/master
/captcha_accuracy.py
import glob, os from captcha_recognizer import OCR_recognizer recognizer = OCR_recognizer('models/sintegra_sc_model.ckpt') def calculate_accuracy(dir, pattern): corrects = 0 total = 0 for pathAndFilename in glob.iglob(os.path.join(dir, pattern)): label, ext = os.path.splitext(os.path.basename(pat...
{"/captcha_accuracy.py": ["/captcha_recognizer.py"], "/captcha_train.py": ["/captcha_data.py"], "/captcha_app.py": ["/captcha_crawl.py", "/captcha_recognizer.py"]}
80,066
sayaadit/captcha_breaker
refs/heads/master
/captcha_train.py
import tensorflow as tf import time import numpy as np from captcha_data import OCR_data # Parameters initial_learning_rate = 0.01 decay_steps = 1000 decay_rate = 0.9 momentum = 0.9 l2_beta_param = 3e-4 dropout_keep_prob = 0.5 training_iters = 500000 batch_size = 64 display_step = 100 summaries_dir = 'logs' # Network...
{"/captcha_accuracy.py": ["/captcha_recognizer.py"], "/captcha_train.py": ["/captcha_data.py"], "/captcha_app.py": ["/captcha_crawl.py", "/captcha_recognizer.py"]}
80,067
sayaadit/captcha_breaker
refs/heads/master
/captcha_app.py
from urllib.request import urlopen import time, os import captcha_crawl from captcha_recognizer import OCR_recognizer from flask import Flask, render_template, request, send_from_directory, make_response app = Flask(__name__, static_url_path='') app.initialized = False @app.route("/") def index(): return render_...
{"/captcha_accuracy.py": ["/captcha_recognizer.py"], "/captcha_train.py": ["/captcha_data.py"], "/captcha_app.py": ["/captcha_crawl.py", "/captcha_recognizer.py"]}
80,068
sayaadit/captcha_breaker
refs/heads/master
/renamer.py
import glob, os def rename(dir, pattern): for pathAndFilename in glob.iglob(os.path.join(dir, pattern)): title, ext = os.path.splitext(os.path.basename(pathAndFilename)) newTitle = title.split(':')[3] newName = os.path.join(dir, newTitle + ext) print 'Old: ' + pathAndFilena...
{"/captcha_accuracy.py": ["/captcha_recognizer.py"], "/captcha_train.py": ["/captcha_data.py"], "/captcha_app.py": ["/captcha_crawl.py", "/captcha_recognizer.py"]}
80,069
glacierck/textplusplus
refs/heads/master
/app/config.py
dbuser = 'root' dbpw = 'thunlp'
{"/app/view.py": ["/app/__init__.py"], "/app/api.py": ["/app/__init__.py"]}
80,070
glacierck/textplusplus
refs/heads/master
/app/view.py
from flask import * import os from app import app def handle_static(res, name): return send_from_directory(os.path.dirname(os.path.realpath(__file__))+"/templates/"+res, name) @app.route("/js/<path:name>") def static_js(name): return handle_static("js", name) @app.route("/css/<path:name>") def static_c...
{"/app/view.py": ["/app/__init__.py"], "/app/api.py": ["/app/__init__.py"]}
80,071
glacierck/textplusplus
refs/heads/master
/update.py
import MySQLdb import time conn=MySQLdb.connect(host='127.0.0.1',user='root',passwd='thunlp',port=3306) conn.select_db('thunlp') cursor=conn.cursor() dt = 'd'+time.strftime('%Y%m%d',time.localtime(time.time())) cursor.execute('alter table lac add column ' + dt + ' integer;') conn.commit() conn.close()
{"/app/view.py": ["/app/__init__.py"], "/app/api.py": ["/app/__init__.py"]}
80,072
glacierck/textplusplus
refs/heads/master
/app/semantic.py
from flask import Flask,json,request,abort,url_for import time,random,string from app import app from config import * import socket import MySQLdb def check_token(token): conn=MySQLdb.connect(host='127.0.0.1',user=dbuser,passwd=dbpw,port=3306) conn.select_db('thunlp') cursor=conn.cursor() cursor.execute('select *...
{"/app/view.py": ["/app/__init__.py"], "/app/api.py": ["/app/__init__.py"]}
80,073
glacierck/textplusplus
refs/heads/master
/app/__init__.py
from flask import Flask import MySQLdb app = Flask(__name__) app.config['SECRET_KEY'] = 'youguessguess' from app import view,api,console,semantic,user
{"/app/view.py": ["/app/__init__.py"], "/app/api.py": ["/app/__init__.py"]}
80,074
glacierck/textplusplus
refs/heads/master
/app/api.py
from flask import Flask,json,request,abort,url_for import time,random,string from app import app from config import * import MySQLdb import socket import os def check_token(token): conn=MySQLdb.connect(host='127.0.0.1',user=dbuser,passwd=dbpw,port=3306) conn.select_db('thunlp') cursor=conn.cursor()...
{"/app/view.py": ["/app/__init__.py"], "/app/api.py": ["/app/__init__.py"]}
80,075
glacierck/textplusplus
refs/heads/master
/app/user.py
from flask import * import time, random, string, hashlib, re from app import app from config import * import MySQLdb def token(): slcNum = [random.choice(string.digits) for i in range(10)] slcLetter = [random.choice(string.ascii_letters) for i in range(10)] slcChar = slcNum + slcLetter random.shuffle(slc...
{"/app/view.py": ["/app/__init__.py"], "/app/api.py": ["/app/__init__.py"]}
80,076
glacierck/textplusplus
refs/heads/master
/initsql.py
import MySQLdb import time,hashlib t = time.time() md5 = hashlib.md5() md5.update('admintpp') password = md5.hexdigest() conn=MySQLdb.connect(host='127.0.0.1',user='root',passwd='thunlp',port=3306) conn.select_db('thunlp') cursor=conn.cursor() cursor.execute("INSERT INTO user(id, email, token, admin, password, crea...
{"/app/view.py": ["/app/__init__.py"], "/app/api.py": ["/app/__init__.py"]}
80,077
glacierck/textplusplus
refs/heads/master
/app/algorithm/__init__.py
from thulac import Thulac thulac = Thulac()
{"/app/view.py": ["/app/__init__.py"], "/app/api.py": ["/app/__init__.py"]}
80,078
glacierck/textplusplus
refs/heads/master
/app/console.py
from flask import * import time, random, string, hashlib, re from app import app from config import * import MySQLdb @app.route('/api/console/tag_info', methods=['GET','POST']) def tag_info(): uid = session['id'] conn=MySQLdb.connect(host='127.0.0.1',user=dbuser,passwd=dbpw,port=3306) conn.select_db('thunlp') cur...
{"/app/view.py": ["/app/__init__.py"], "/app/api.py": ["/app/__init__.py"]}
80,079
folreams/SerialAssistant
refs/heads/master
/Util.py
#*-coding utf8-* from binascii import hexlify, unhexlify def checkData(data, _type): if data == '': return False, u"数据不能为空" errch, msg = None, "success" if _type == "hex": data = ''.join(data.split()) if len(data) % 2 != 0: errch, msg = True, u"HEX模式下,数据长度必须为偶数" ...
{"/MainWindow.py": ["/Util.py", "/myserial.py", "/ui_handle.py"], "/Main.py": ["/MainWindow.py"], "/ui_handle.py": ["/ui_mainwindows.py", "/ui_settings.py"]}
80,080
folreams/SerialAssistant
refs/heads/master
/myserial.py
# -*- coding : utf-8 -*- from serial import Serial import threading from time import sleep from PyQt4 import QtCore class MySerial(threading.Thread): def __init__(self): threading.Thread.__init__(self) self.__terminate = False self.__exit = True self.qtobj = QtCore.QObject() ...
{"/MainWindow.py": ["/Util.py", "/myserial.py", "/ui_handle.py"], "/Main.py": ["/MainWindow.py"], "/ui_handle.py": ["/ui_mainwindows.py", "/ui_settings.py"]}
80,081
folreams/SerialAssistant
refs/heads/master
/ui_settings.py
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'ui_settings.ui' # # Created: Wed Jun 15 13:37:20 2016 # by: PyQt4 UI code generator 4.11.2 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except At...
{"/MainWindow.py": ["/Util.py", "/myserial.py", "/ui_handle.py"], "/Main.py": ["/MainWindow.py"], "/ui_handle.py": ["/ui_mainwindows.py", "/ui_settings.py"]}
80,082
folreams/SerialAssistant
refs/heads/master
/MainWindow.py
# -*- coding : utf-8 -*- __Version__ = "V0.1" __Author__ = "DayuZhang" __Email__ = "folreams@gmail.com" import os import Util from time import ctime from myserial import MySerial from ui_handle import UiHandle,DlgHandle from PyQt4 import QtGui, QtCore class MainWindows(QtGui.QMainWindow, UiHandle): NextId = 1 ...
{"/MainWindow.py": ["/Util.py", "/myserial.py", "/ui_handle.py"], "/Main.py": ["/MainWindow.py"], "/ui_handle.py": ["/ui_mainwindows.py", "/ui_settings.py"]}
80,083
folreams/SerialAssistant
refs/heads/master
/Main.py
# -*---------coding utf8----------------*- import sys from PyQt4 import QtGui from MainWindow import MainWindows if __name__ == "__main__": app=QtGui.QApplication(sys.argv) app.setOrganizationName("Allsine") app.setOrganizationDomain("www.allsine.com") app.setApplicationName("Serial Assistant") app...
{"/MainWindow.py": ["/Util.py", "/myserial.py", "/ui_handle.py"], "/Main.py": ["/MainWindow.py"], "/ui_handle.py": ["/ui_mainwindows.py", "/ui_settings.py"]}
80,084
folreams/SerialAssistant
refs/heads/master
/ui_handle.py
# -*- coding:utf-8 -*- from PyQt4 import QtGui from PyQt4 import QtCore from ui_mainwindows import Ui_Form from ui_settings import Ui_Dialog from serial.tools.list_ports import comports from qrc_resources import * class UiHandle(Ui_Form): def __init__(self): Ui_Form.__init__(self) def setupwidget(...
{"/MainWindow.py": ["/Util.py", "/myserial.py", "/ui_handle.py"], "/Main.py": ["/MainWindow.py"], "/ui_handle.py": ["/ui_mainwindows.py", "/ui_settings.py"]}
80,085
folreams/SerialAssistant
refs/heads/master
/ui_mainwindows.py
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'ui_mainwindows.ui' # # Created: Wed Oct 26 17:02:04 2016 # by: PyQt4 UI code generator 4.11.2 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except...
{"/MainWindow.py": ["/Util.py", "/myserial.py", "/ui_handle.py"], "/Main.py": ["/MainWindow.py"], "/ui_handle.py": ["/ui_mainwindows.py", "/ui_settings.py"]}
80,086
Flinx-LY/Anime-Annotation-Tool
refs/heads/master
/apps/base.py
from pathlib import Path rootPath: Path = None def Patha(path): return Path(rootPath, path)
{"/apps/opencv2.py": ["/apps/base.py"], "/apps/__init__.py": ["/apps/project.py", "/apps/base.py"], "/apps/project.py": ["/apps/__init__.py", "/apps/base.py"], "/anime.py": ["/apps/__init__.py", "/apps/base.py"], "/apps/opencv1.py": ["/apps/base.py"]}
80,087
Flinx-LY/Anime-Annotation-Tool
refs/heads/master
/apps/opencv2.py
import cv2 import os import numpy as np from threading import Thread from multiprocessing import Process from .base import Patha # cv2.VideoCapture.get(0) 视频文件的当前位置(播放)以毫秒为单位 # cv2.VideoCapture.get(1) 基于以0开始的被捕获或解码的帧索引 # cv2.VideoCapture.get(2) 视频文件的相对位置(播放):0=电影开始,1=影片的结尾。 # cv2.VideoCapture.get(3) 在视频流的帧的宽度 # cv2.Vi...
{"/apps/opencv2.py": ["/apps/base.py"], "/apps/__init__.py": ["/apps/project.py", "/apps/base.py"], "/apps/project.py": ["/apps/__init__.py", "/apps/base.py"], "/anime.py": ["/apps/__init__.py", "/apps/base.py"], "/apps/opencv1.py": ["/apps/base.py"]}
80,088
Flinx-LY/Anime-Annotation-Tool
refs/heads/master
/apps/__init__.py
from flask import Flask, render_template, Response, make_response, request from flask import Blueprint, render_template, request, jsonify, current_app, flash, g from concurrent.futures import ThreadPoolExecutor import json import base64 import time import importlib from .project import Project from .base import Patha ...
{"/apps/opencv2.py": ["/apps/base.py"], "/apps/__init__.py": ["/apps/project.py", "/apps/base.py"], "/apps/project.py": ["/apps/__init__.py", "/apps/base.py"], "/anime.py": ["/apps/__init__.py", "/apps/base.py"], "/apps/opencv1.py": ["/apps/base.py"]}
80,089
Flinx-LY/Anime-Annotation-Tool
refs/heads/master
/apps/project.py
import cv2 from PIL import Image import numpy as np from concurrent.futures import ThreadPoolExecutor import json import base64 import zlib import re import io import time from pathlib import Path from . import opencv1, opencv2 from .base import Patha executor = ThreadPoolExecutor() class Project: def __init__(s...
{"/apps/opencv2.py": ["/apps/base.py"], "/apps/__init__.py": ["/apps/project.py", "/apps/base.py"], "/apps/project.py": ["/apps/__init__.py", "/apps/base.py"], "/anime.py": ["/apps/__init__.py", "/apps/base.py"], "/apps/opencv1.py": ["/apps/base.py"]}
80,090
Flinx-LY/Anime-Annotation-Tool
refs/heads/master
/anime.py
from flask import Flask, render_template, Response, make_response, request, send_from_directory from flask_cors import CORS from pathlib import Path from apps import api, creatProject import apps.base app = Flask(__name__, static_folder="./static", template_folder="./dist") # app.config['SEND_...
{"/apps/opencv2.py": ["/apps/base.py"], "/apps/__init__.py": ["/apps/project.py", "/apps/base.py"], "/apps/project.py": ["/apps/__init__.py", "/apps/base.py"], "/anime.py": ["/apps/__init__.py", "/apps/base.py"], "/apps/opencv1.py": ["/apps/base.py"]}
80,091
Flinx-LY/Anime-Annotation-Tool
refs/heads/master
/apps/opencv1.py
import cv2 import os import numpy as np from queue import Queue from threading import Thread from multiprocessing import Process from concurrent.futures import ThreadPoolExecutor from .base import Patha def nothing(x): pass class Video: def __init__(self, path): self.cap = cv2.VideoCapture(path) ...
{"/apps/opencv2.py": ["/apps/base.py"], "/apps/__init__.py": ["/apps/project.py", "/apps/base.py"], "/apps/project.py": ["/apps/__init__.py", "/apps/base.py"], "/anime.py": ["/apps/__init__.py", "/apps/base.py"], "/apps/opencv1.py": ["/apps/base.py"]}
80,097
matias101-blip/app-thehunters-web
refs/heads/master
/app/views.py
from django.shortcuts import render # Create your views here. def hello (request): return render(request, 'app/hello.html') def memes (request): return render(request, 'app/memes.html')
{"/app/urls.py": ["/app/views.py"], "/home/urls.py": ["/home/views.py"]}
80,098
matias101-blip/app-thehunters-web
refs/heads/master
/app/models.py
from django.db import models # Create your models here. class Marca(models.Model): nombre = models.CharField(max_length=50) def __str__(self): return self.nombre class Producto(models.Model): nombre = models.CharField(max_length=50) precio = models.FloatField() #models.IntegerField() descripcion = models....
{"/app/urls.py": ["/app/views.py"], "/home/urls.py": ["/home/views.py"]}
80,099
matias101-blip/app-thehunters-web
refs/heads/master
/home/views.py
from django.shortcuts import render # Create your views here. def home (request): return render(request, 'app/inicio.html') def proyectos (request): return render(request, 'app/proyectos.html')
{"/app/urls.py": ["/app/views.py"], "/home/urls.py": ["/home/views.py"]}
80,100
matias101-blip/app-thehunters-web
refs/heads/master
/app/urls.py
from django.urls import path from . views import hello, memes urlpatterns = [ path('hola/', hello, name="hello" ), path('memes/', memes, name="memes"), ]
{"/app/urls.py": ["/app/views.py"], "/home/urls.py": ["/home/views.py"]}
80,101
matias101-blip/app-thehunters-web
refs/heads/master
/home/urls.py
from django.urls import path from . views import home, proyectos urlpatterns = [ path('', home, name="home"), path('Proyectos/', proyectos, name="proyectos") ]
{"/app/urls.py": ["/app/views.py"], "/home/urls.py": ["/home/views.py"]}
80,121
vkopey/BallValveAbaqus
refs/heads/master
/script.py
# -*- coding: CP1251 -*- from part import * from material import * from section import * from optimization import * from assembly import * from step import * from interaction import * from load import * from mesh import * from job import * from sketch import * from visualization import * from connectorBeha...
{"/script.py": ["/pickleIPC.py"]}
80,122
vkopey/BallValveAbaqus
refs/heads/master
/pickleIPC.py
# -*- coding: CP1251 -*- """ IPC. ̳ , ' python """ import os, pickle, tempfile def writeSocket(_socket, data): """³ ' python (data) """ f = _socket.makefile('wb') #,buffer_size # pickle.dump(data, f, pickle.HIGHEST_PROTOCOL) # f.close() # def readSocket(_socket): """...
{"/script.py": ["/pickleIPC.py"]}
80,123
vkopey/BallValveAbaqus
refs/heads/master
/server.py
# -*- coding: CP1251 -*- import csv,pickleIPC,subprocess,datetime csv_file=open("results.csv", "wb") # CSV writer = csv.writer(csv_file,delimiter = ';') # ' CSV for h in [0.04,0.05]: # h pickleIPC.writeTempFile(h) # print datetime.datetime.now().isoformat() # print "Abaqu...
{"/script.py": ["/pickleIPC.py"]}
80,124
MLIUKF/Character-Collector
refs/heads/master
/main.py
from PyQt5.QtCore import QUrl, QObject, pyqtSlot, pyqtSignal from PyQt5.QtGui import QGuiApplication from PyQt5.QtQuick import QQuickView import mnistMethod path = 'mainWindow.qml' app = QGuiApplication([]) view = QQuickView() view.engine().quit.connect(app.quit) view.setHeight(700) view.setWidth(1200) view.setSource(...
{"/main.py": ["/mnistMethod.py"]}
80,125
MLIUKF/Character-Collector
refs/heads/master
/mnistMethod.py
# encoding: utf-8 from PyQt5.QtCore import pyqtSlot, QObject import numpy as np from PIL import Image import os import time class MnistHandler(QObject): mnistImgWidth = 28 #mnist数据集中图片的宽度 mnistImgHeight = 28 #mnist数据集中图片的高度 mnistData = np.zeros((mnistImgHeight,mnistImgWidth)).astype('uint8'...
{"/main.py": ["/mnistMethod.py"]}
80,127
alloynetworks/xrpl_toml
refs/heads/main
/checkaddress.py
import codecs def checkaddress(address): from hashlib import sha256 digits58 = 'rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz' def to_bytes(n, length, endianess='big'): h = '%x' % n s = codecs.decode(('0'*(len(h) % 2) + h).zfill(length*2), "hex_codec") return s if end...
{"/fetch_toml.py": ["/address_domain.py"], "/address_domain.py": ["/checkaddress.py"]}
80,128
alloynetworks/xrpl_toml
refs/heads/main
/fetch_toml.py
#!/usr/bin/env python # coding: utf-8 import datetime import requests import toml import json from urllib.parse import urlparse import ssl import socket import urllib3 import re import dns.resolver import tldextract from address_domain import address_domain # Required, since we fetch from domains with invalid SSL cer...
{"/fetch_toml.py": ["/address_domain.py"], "/address_domain.py": ["/checkaddress.py"]}
80,129
alloynetworks/xrpl_toml
refs/heads/main
/address_domain.py
import json import requests import checkaddress import websockets import asyncio @asyncio.coroutine def account_info(xrpaddress, wsserver): websocket = yield from websockets.connect( wsserver) try: query = { 'command': 'account_info', 'account': xrp...
{"/fetch_toml.py": ["/address_domain.py"], "/address_domain.py": ["/checkaddress.py"]}
80,132
firecracker-microvm/firecracker
refs/heads/main
/tests/integration_tests/performance/test_block_performance.py
# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """Performance benchmark for block device emulation.""" import concurrent import json import os import shutil from enum import Enum import pytest import framework.stats as st import host_tools.drive as dri...
{"/tests/framework/stats/core.py": ["/tests/framework/stats/consumer.py", "/tests/framework/stats/producer.py"], "/tests/framework/stats/metadata.py": ["/tests/framework/stats/baseline.py", "/tests/framework/stats/criteria.py", "/tests/framework/stats/function.py", "/tests/framework/stats/types.py"], "/tests/framework/...
80,133
firecracker-microvm/firecracker
refs/heads/main
/tests/integration_tests/functional/test_cpu_features.py
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """Tests for the CPU topology emulation feature.""" # pylint: disable=too-many-lines import os import platform import re import shutil import sys import time from difflib import unified_diff from pathlib im...
{"/tests/framework/stats/core.py": ["/tests/framework/stats/consumer.py", "/tests/framework/stats/producer.py"], "/tests/framework/stats/metadata.py": ["/tests/framework/stats/baseline.py", "/tests/framework/stats/criteria.py", "/tests/framework/stats/function.py", "/tests/framework/stats/types.py"], "/tests/framework/...