index int64 | repo_name string | branch_name string | path string | content string | import_graph string |
|---|---|---|---|---|---|
79,005 | branson2015/PyMaze | refs/heads/master | /disjoint_set.py | class DisjointSet:
def __init__(self, nSets):
self.Sets = [[i] for i in range(nSets)]
self.Cells = [i for i in range(nSets)]
self.nsets = nSets
def __iter__(self):
for s in self.Sets:
if s == None:
continue
yield s
def add(sel... | {"/algorithms.py": ["/PyMaze.py", "/disjoint_set.py"], "/benchmark.py": ["/PyMaze.py", "/algorithms.py"], "/main.py": ["/PyMaze.py", "/algorithms.py"]} |
79,025 | Raminov228/GasSimulator | refs/heads/master | /Gas_simulation.py | import Objects
import ScreenGenerator
import pygame
from pygame.draw import *
pygame.init()
FPS = 30
screen = pygame.display.set_mode((400, 400))
gas = Objects.Gas()
screen_gen = ScreenGenerator.ScreenGenerator(gas.get_space())
clock = pygame.time.Clock()
finished = False
while not finished:
clock.tick(FPS)
... | {"/Gas_simulation.py": ["/Objects.py", "/ScreenGenerator.py"], "/ScreenGenerator.py": ["/constants.py"], "/Objects.py": ["/constants.py"]} |
79,026 | Raminov228/GasSimulator | refs/heads/master | /ScreenGenerator.py | import pygame
from constants import *
class ScreenGenerator():
def __init__(self, space):
self.space = space
self.molmap = space.get_map()
self.size = self.molmap.get_size()
self.screen = pygame.Surface(SCREEN_SIZE)
def update(self):
self.screen.fill((255, 255, 255))
for m in self.space.get_all_molecul... | {"/Gas_simulation.py": ["/Objects.py", "/ScreenGenerator.py"], "/ScreenGenerator.py": ["/constants.py"], "/Objects.py": ["/constants.py"]} |
79,027 | Raminov228/GasSimulator | refs/heads/master | /Objects.py | from constants import *
import itertools
import copy
import random
class Molecula():
def __init__(self, coords, velocity, mass=NULL_MASS):
self.coords = coords
self.velocity = velocity
self.mass = mass
self.momentum = mass * velocity
self.energy = mass * sum(v**2 for v in velocity) / 2
self.a = (0, 0)
d... | {"/Gas_simulation.py": ["/Objects.py", "/ScreenGenerator.py"], "/ScreenGenerator.py": ["/constants.py"], "/Objects.py": ["/constants.py"]} |
79,028 | Raminov228/GasSimulator | refs/heads/master | /constants.py | NULL_MASS = 1
NULL_METRIX = 0.5
NULL_SIZE = (10, 10)
NULL_CONCETRATION = 0.1
SCREEN_SIZE = (400, 400)
TIME_STEP = 0.01
EPSILON = 10000000
SIGMA = 1 | {"/Gas_simulation.py": ["/Objects.py", "/ScreenGenerator.py"], "/ScreenGenerator.py": ["/constants.py"], "/Objects.py": ["/constants.py"]} |
79,170 | tfoxy/graphene-django-optimizer | refs/heads/master | /tests/test_resolver.py | import pytest
from django.db.models import Prefetch
import graphene_django_optimizer as gql_optimizer
from .graphql_utils import create_resolve_info
from .models import Item
from .schema import schema
from .test_utils import assert_query_equality
@pytest.mark.django_db
def test_should_optimize_non_django_field_if_i... | {"/tests/test_resolver.py": ["/graphene_django_optimizer/__init__.py", "/tests/graphql_utils.py", "/tests/models.py", "/tests/schema.py", "/tests/test_utils.py"], "/tests/test_types.py": ["/tests/graphql_utils.py", "/tests/models.py", "/tests/schema.py"], "/tests/test_query.py": ["/graphene_django_optimizer/__init__.py... |
79,171 | tfoxy/graphene-django-optimizer | refs/heads/master | /tests/test_types.py | import pytest
from graphql_relay import to_global_id
from mock import patch
from .graphql_utils import create_resolve_info
from .models import SomeOtherItem, Item
from .schema import schema, SomeOtherItemType, DummyItemMutation
@pytest.mark.django_db
@patch("graphene_django_optimizer.types.query", return_value=SomeO... | {"/tests/test_resolver.py": ["/graphene_django_optimizer/__init__.py", "/tests/graphql_utils.py", "/tests/models.py", "/tests/schema.py", "/tests/test_utils.py"], "/tests/test_types.py": ["/tests/graphql_utils.py", "/tests/models.py", "/tests/schema.py"], "/tests/test_query.py": ["/graphene_django_optimizer/__init__.py... |
79,172 | tfoxy/graphene-django-optimizer | refs/heads/master | /graphene_django_optimizer/utils.py | import graphql
from graphql import GraphQLSchema, GraphQLObjectType, FieldNode
from graphql.execution.execute import get_field_def
noop = lambda *args, **kwargs: None
def is_iterable(obj):
return hasattr(obj, "__iter__") and not isinstance(obj, str)
def get_field_def_compat(
schema: GraphQLSchema, parent_t... | {"/tests/test_resolver.py": ["/graphene_django_optimizer/__init__.py", "/tests/graphql_utils.py", "/tests/models.py", "/tests/schema.py", "/tests/test_utils.py"], "/tests/test_types.py": ["/tests/graphql_utils.py", "/tests/models.py", "/tests/schema.py"], "/tests/test_query.py": ["/graphene_django_optimizer/__init__.py... |
79,173 | tfoxy/graphene-django-optimizer | refs/heads/master | /tests/test_query.py | import pytest
from django.test.utils import CaptureQueriesContext
from django.db import connection
from django.db.models import Prefetch
import graphene_django_optimizer as gql_optimizer
from .graphql_utils import create_resolve_info
from .models import (
Item,
OtherItem,
RelatedOneToManyItem,
)
from .sch... | {"/tests/test_resolver.py": ["/graphene_django_optimizer/__init__.py", "/tests/graphql_utils.py", "/tests/models.py", "/tests/schema.py", "/tests/test_utils.py"], "/tests/test_types.py": ["/tests/graphql_utils.py", "/tests/models.py", "/tests/schema.py"], "/tests/test_query.py": ["/graphene_django_optimizer/__init__.py... |
79,174 | tfoxy/graphene-django-optimizer | refs/heads/master | /graphene_django_optimizer/__init__.py | from .field import field # noqa: F401
from .query import query # noqa: F401
from .resolver import resolver_hints # noqa: F401
from .types import OptimizedDjangoObjectType # noqa: F401
| {"/tests/test_resolver.py": ["/graphene_django_optimizer/__init__.py", "/tests/graphql_utils.py", "/tests/models.py", "/tests/schema.py", "/tests/test_utils.py"], "/tests/test_types.py": ["/tests/graphql_utils.py", "/tests/models.py", "/tests/schema.py"], "/tests/test_query.py": ["/graphene_django_optimizer/__init__.py... |
79,175 | tfoxy/graphene-django-optimizer | refs/heads/master | /tests/test_field.py | import pytest
import graphene_django_optimizer as gql_optimizer
from .graphql_utils import create_resolve_info
from .models import Item
from .schema import schema
from .test_utils import assert_query_equality
@pytest.mark.django_db
def test_should_optimize_non_django_field_if_it_has_an_optimization_hint_in_the_field... | {"/tests/test_resolver.py": ["/graphene_django_optimizer/__init__.py", "/tests/graphql_utils.py", "/tests/models.py", "/tests/schema.py", "/tests/test_utils.py"], "/tests/test_types.py": ["/tests/graphql_utils.py", "/tests/models.py", "/tests/schema.py"], "/tests/test_query.py": ["/graphene_django_optimizer/__init__.py... |
79,176 | tfoxy/graphene-django-optimizer | refs/heads/master | /graphene_django_optimizer/hints.py | from .utils import is_iterable, noop
def _normalize_model_field(value):
if not callable(value):
return_value = value
value = lambda *args, **kwargs: return_value
return value
def _normalize_hint_value(value):
if not callable(value):
if not is_iterable(value):
value = ... | {"/tests/test_resolver.py": ["/graphene_django_optimizer/__init__.py", "/tests/graphql_utils.py", "/tests/models.py", "/tests/schema.py", "/tests/test_utils.py"], "/tests/test_types.py": ["/tests/graphql_utils.py", "/tests/models.py", "/tests/schema.py"], "/tests/test_query.py": ["/graphene_django_optimizer/__init__.py... |
79,177 | tfoxy/graphene-django-optimizer | refs/heads/master | /graphene_django_optimizer/field.py | import types
from graphene.types.field import Field
from graphene.types.unmountedtype import UnmountedType
from .hints import OptimizationHints
def field(field_type, *args, **kwargs):
if isinstance(field_type, UnmountedType):
field_type = Field.mounted(field_type)
optimization_hints = OptimizationHi... | {"/tests/test_resolver.py": ["/graphene_django_optimizer/__init__.py", "/tests/graphql_utils.py", "/tests/models.py", "/tests/schema.py", "/tests/test_utils.py"], "/tests/test_types.py": ["/tests/graphql_utils.py", "/tests/models.py", "/tests/schema.py"], "/tests/test_query.py": ["/graphene_django_optimizer/__init__.py... |
79,178 | tfoxy/graphene-django-optimizer | refs/heads/master | /graphene_django_optimizer/query.py | import functools
from django.core.exceptions import FieldDoesNotExist
from django.db.models import ForeignKey, Prefetch
from django.db.models.constants import LOOKUP_SEP
from django.db.models.fields.reverse_related import ManyToOneRel
from graphene import InputObjectType
from graphene.types.generic import GenericScala... | {"/tests/test_resolver.py": ["/graphene_django_optimizer/__init__.py", "/tests/graphql_utils.py", "/tests/models.py", "/tests/schema.py", "/tests/test_utils.py"], "/tests/test_types.py": ["/tests/graphql_utils.py", "/tests/models.py", "/tests/schema.py"], "/tests/test_query.py": ["/graphene_django_optimizer/__init__.py... |
79,179 | tfoxy/graphene-django-optimizer | refs/heads/master | /tests/schema.py | from django.db.models import Prefetch
import graphene
from graphene import ConnectionField, relay
from graphene_django.fields import DjangoConnectionField
import graphene_django_optimizer as gql_optimizer
from graphene_django_optimizer import OptimizedDjangoObjectType
from .models import (
DetailedItem,
ExtraD... | {"/tests/test_resolver.py": ["/graphene_django_optimizer/__init__.py", "/tests/graphql_utils.py", "/tests/models.py", "/tests/schema.py", "/tests/test_utils.py"], "/tests/test_types.py": ["/tests/graphql_utils.py", "/tests/models.py", "/tests/schema.py"], "/tests/test_query.py": ["/graphene_django_optimizer/__init__.py... |
79,180 | tfoxy/graphene-django-optimizer | refs/heads/master | /graphene_django_optimizer/resolver.py | from .hints import OptimizationHints
def resolver_hints(*args, **kwargs):
optimization_hints = OptimizationHints(*args, **kwargs)
def apply_resolver_hints(resolver):
resolver.optimization_hints = optimization_hints
return resolver
return apply_resolver_hints
| {"/tests/test_resolver.py": ["/graphene_django_optimizer/__init__.py", "/tests/graphql_utils.py", "/tests/models.py", "/tests/schema.py", "/tests/test_utils.py"], "/tests/test_types.py": ["/tests/graphql_utils.py", "/tests/models.py", "/tests/schema.py"], "/tests/test_query.py": ["/graphene_django_optimizer/__init__.py... |
79,181 | tfoxy/graphene-django-optimizer | refs/heads/master | /setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
from setuptools import setup
needs_pytest = {"pytest", "test", "ptr"}.intersection(sys.argv)
pytest_runner = ["pytest-runner >=4.0,<5dev"] if needs_pytest else []
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()... | {"/tests/test_resolver.py": ["/graphene_django_optimizer/__init__.py", "/tests/graphql_utils.py", "/tests/models.py", "/tests/schema.py", "/tests/test_utils.py"], "/tests/test_types.py": ["/tests/graphql_utils.py", "/tests/models.py", "/tests/schema.py"], "/tests/test_query.py": ["/graphene_django_optimizer/__init__.py... |
79,182 | tfoxy/graphene-django-optimizer | refs/heads/master | /tests/models.py | from django.db import models
class Item(models.Model):
name = models.CharField(max_length=100, blank=True)
parent = models.ForeignKey(
"Item", on_delete=models.SET_NULL, null=True, related_name="children"
)
item = models.ForeignKey("Item", on_delete=models.SET_NULL, null=True)
value = mode... | {"/tests/test_resolver.py": ["/graphene_django_optimizer/__init__.py", "/tests/graphql_utils.py", "/tests/models.py", "/tests/schema.py", "/tests/test_utils.py"], "/tests/test_types.py": ["/tests/graphql_utils.py", "/tests/models.py", "/tests/schema.py"], "/tests/test_query.py": ["/graphene_django_optimizer/__init__.py... |
79,183 | tfoxy/graphene-django-optimizer | refs/heads/master | /tests/test_relay.py | import pytest
import graphene_django_optimizer as gql_optimizer
from .graphql_utils import create_resolve_info
from .models import Item
from .schema import schema
from .test_utils import assert_query_equality
@pytest.mark.django_db
def test_should_return_valid_result_in_a_relay_query():
Item.objects.create(id=7... | {"/tests/test_resolver.py": ["/graphene_django_optimizer/__init__.py", "/tests/graphql_utils.py", "/tests/models.py", "/tests/schema.py", "/tests/test_utils.py"], "/tests/test_types.py": ["/tests/graphql_utils.py", "/tests/models.py", "/tests/schema.py"], "/tests/test_query.py": ["/graphene_django_optimizer/__init__.py... |
79,184 | tfoxy/graphene-django-optimizer | refs/heads/master | /graphene_django_optimizer/types.py | from graphene.types.definitions import GrapheneObjectType
from graphene_django.types import DjangoObjectType
from .query import query
class OptimizedDjangoObjectType(DjangoObjectType):
class Meta:
abstract = True
@classmethod
def can_optimize_resolver(cls, resolver_info):
return (
... | {"/tests/test_resolver.py": ["/graphene_django_optimizer/__init__.py", "/tests/graphql_utils.py", "/tests/models.py", "/tests/schema.py", "/tests/test_utils.py"], "/tests/test_types.py": ["/tests/graphql_utils.py", "/tests/models.py", "/tests/schema.py"], "/tests/test_query.py": ["/graphene_django_optimizer/__init__.py... |
79,185 | tfoxy/graphene-django-optimizer | refs/heads/master | /tests/graphql_utils.py | import graphql.version
from graphql import (
GraphQLResolveInfo,
Source,
Undefined,
parse,
)
from graphql.execution.collect_fields import collect_fields
from graphql.execution.execute import ExecutionContext
from graphql.utilities import get_operation_root_type
from collections import defaultdict
from ... | {"/tests/test_resolver.py": ["/graphene_django_optimizer/__init__.py", "/tests/graphql_utils.py", "/tests/models.py", "/tests/schema.py", "/tests/test_utils.py"], "/tests/test_types.py": ["/tests/graphql_utils.py", "/tests/models.py", "/tests/schema.py"], "/tests/test_query.py": ["/graphene_django_optimizer/__init__.py... |
79,186 | tfoxy/graphene-django-optimizer | refs/heads/master | /tests/test_utils.py | from django.db.models import Prefetch
def assert_query_equality(left_query, right_query):
assert str(left_query.query) == str(right_query.query)
assert len(left_query._prefetch_related_lookups) == len(
right_query._prefetch_related_lookups
)
for (i, lookup) in enumerate(left_query._prefetch_re... | {"/tests/test_resolver.py": ["/graphene_django_optimizer/__init__.py", "/tests/graphql_utils.py", "/tests/models.py", "/tests/schema.py", "/tests/test_utils.py"], "/tests/test_types.py": ["/tests/graphql_utils.py", "/tests/models.py", "/tests/schema.py"], "/tests/test_query.py": ["/graphene_django_optimizer/__init__.py... |
79,194 | kaidic/HAR | refs/heads/main | /models/__init__.py | from .resnet_s import * | {"/weight_est.py": ["/heteroskedastic_cifar.py"]} |
79,195 | kaidic/HAR | refs/heads/main | /weight_est.py | import numpy as np
import pickle
import torch
import torchvision.datasets as datasets
import torch.nn as nn
import matplotlib.pyplot as plt
from scipy.special import softmax
from heteroskedastic_cifar import HETEROSKEDASTICCIFAR10, HETEROSKEDASTICCIFAR100
import argparse
parser = argparse.ArgumentParser(description='... | {"/weight_est.py": ["/heteroskedastic_cifar.py"]} |
79,196 | kaidic/HAR | refs/heads/main | /heteroskedastic_cifar.py | import torch
import torchvision
from PIL import Image
import torchvision.transforms as transforms
import numpy as np
import copy
import warnings
from numpy.testing import assert_array_almost_equal
def multiclass_noisify(y, P, random_state=0):
""" Flip classes according to transition probability matrix T.
It ex... | {"/weight_est.py": ["/heteroskedastic_cifar.py"]} |
79,197 | callum-gill/Civil-cases-web-application | refs/heads/main | /config.py |
class DatabaseConfig(object):
dbhost = 'localhost'
dbuser = 'root'
dbpassword = 'Skipper2605'
dbname = 'civil_crime_database'
class Config(object):
PORT = 5000
DEBUG = True
threaded = True
class DevelopmentConfig(object):
ENV='development'
DEVELOPMENT = True
... | {"/app.py": ["/config.py", "/static/views/views.py"]} |
79,198 | callum-gill/Civil-cases-web-application | refs/heads/main | /static/views/views.py | import hashlib
import sys
from flask import url_for, abort
# Recursive quick sort function
def sort_tuple(items, column_num):
def parition(array, low, high):
i = (low - 1)
pivot = array[high][column_num]
for j in range(low, high):
if array[j][column_num] <= pivot:
... | {"/app.py": ["/config.py", "/static/views/views.py"]} |
79,199 | callum-gill/Civil-cases-web-application | refs/heads/main | /app.py | from flask import Flask, render_template, request, redirect, url_for, flash
from flask_mysqldb import MySQL
import config
import os
from static.views.views import Login, Barrister, Solicitor, Court, Admin, execute_command, select_record, sort_tuple, binary_search, get_unfinished_cases
app = Flask(__name__)
ap... | {"/app.py": ["/config.py", "/static/views/views.py"]} |
79,200 | callum-gill/Civil-cases-web-application | refs/heads/main | /static/views/NLP.py | import nltk
import re
import string
from pprint import pprint
class NLP(object):
def __init__(self):
self.CONTRACTION_MAP = {
"isn't": "is not",
"aren't": "are not",
"can't": "cannot",
"can't've": "cannot have",
"could've": "could ha... | {"/app.py": ["/config.py", "/static/views/views.py"]} |
79,201 | Haykeau/Cancash | refs/heads/master | /readFiles.py | from video import Video
from Endpoint import Endpoint
import random
global content
def cutLine(nbLine):
array, cutedLine = [],[]
array = content[nbLine].split(" ") #Split everytime the character " " appears
for char in range(0,len(array)):
cutedLine.append(array[char]) #Append each size in the get... | {"/main.py": ["/cacheServer.py", "/Endpoint.py", "/video.py", "/readFiles.py", "/submission.py"], "/submission.py": ["/readFiles.py", "/cacheServer.py"], "/Voiture.py": ["/Endpoint.py"]} |
79,202 | Haykeau/Cancash | refs/heads/master | /File_exp.py | # -*- coding: utf-8 -*-
## Librairie destiné a l'export de texte dans un fichier texte.
def ecrireFichier(tableau):
fichier = open('fichier_export.txt', 'w')
for ligne in tableau:
for colonne in ligne:
fichier.write(str(colonne))
fichier.write('\n')
fichier.close()
def lireFichier():
fichier = ... | {"/main.py": ["/cacheServer.py", "/Endpoint.py", "/video.py", "/readFiles.py", "/submission.py"], "/submission.py": ["/readFiles.py", "/cacheServer.py"], "/Voiture.py": ["/Endpoint.py"]} |
79,203 | Haykeau/Cancash | refs/heads/master | /cacheServer.py |
class CacheServer:
def __init__ (self, numero, taille, endPoints):
self.numero = numero
self.endPoints = endPoints
self.classementVideo = []
self.videoAGarder = []
self.tailleRestante = taille
self.nombreVideo = 0
def classement():
for i in self.endPoin... | {"/main.py": ["/cacheServer.py", "/Endpoint.py", "/video.py", "/readFiles.py", "/submission.py"], "/submission.py": ["/readFiles.py", "/cacheServer.py"], "/Voiture.py": ["/Endpoint.py"]} |
79,204 | Haykeau/Cancash | refs/heads/master | /main.py | from cacheServer import *
from Endpoint import *
from video import *
from readFiles import *
from submission import *
nbRequete = [2333,58884,5455,2]
tpsCache = [122, 56, 55, 5]
infoVideos = [25,65,9,45]
videos = []
i = 0
for j in videos:
videos.append(Video(i, j))
i += 1
endpoints = Endpoint(nbRequete,tpsCac... | {"/main.py": ["/cacheServer.py", "/Endpoint.py", "/video.py", "/readFiles.py", "/submission.py"], "/submission.py": ["/readFiles.py", "/cacheServer.py"], "/Voiture.py": ["/Endpoint.py"]} |
79,205 | Haykeau/Cancash | refs/heads/master | /Endpoint.py | class Endpoint():
def __init__(self, nbRequete,tpsCache, tpsDataCenter):
self.nbRequete = nbRequete
self.tpsCache = tpsCache
self.tpsDataCenter = tpsDataCenter
self.tpsGagne = self.tempsGagne(tpsCache,tpsDataCenter)
self.cacheChoisi = self.chooseCache(tpsCache)
def ch... | {"/main.py": ["/cacheServer.py", "/Endpoint.py", "/video.py", "/readFiles.py", "/submission.py"], "/submission.py": ["/readFiles.py", "/cacheServer.py"], "/Voiture.py": ["/Endpoint.py"]} |
79,206 | Haykeau/Cancash | refs/heads/master | /video.py | # -*- coding: utf-8 -*-
class Video:
def __init__(self, numero, taille):
self.numero = numero
self.taille = taille
def getInformation(self):
return "There are " + self.numero + " videos"
| {"/main.py": ["/cacheServer.py", "/Endpoint.py", "/video.py", "/readFiles.py", "/submission.py"], "/submission.py": ["/readFiles.py", "/cacheServer.py"], "/Voiture.py": ["/Endpoint.py"]} |
79,207 | Haykeau/Cancash | refs/heads/master | /test.py | from video import Video
from Endpoint import Endpoint
import random
global content
def cutLine(nbLine):
array, cutedLine = [],[]
array = content[nbLine].split(" ") #Split everytime the character " " appears
for char in range(0,len(array)):
cutedLine.append(array[char]) #Append each size in the get... | {"/main.py": ["/cacheServer.py", "/Endpoint.py", "/video.py", "/readFiles.py", "/submission.py"], "/submission.py": ["/readFiles.py", "/cacheServer.py"], "/Voiture.py": ["/Endpoint.py"]} |
79,208 | Haykeau/Cancash | refs/heads/master | /submission.py | from readFiles import *
from cacheServer import *
class submission:
def __init__(self,nmbCacheServer, videosContenu):
self.nmbCacheServer = nmbCacheServer
self.videosContenu = videosContenu
fichier = open("submission.txt", "w")
fichier.write(nmbCacheServer)
fichier.write("... | {"/main.py": ["/cacheServer.py", "/Endpoint.py", "/video.py", "/readFiles.py", "/submission.py"], "/submission.py": ["/readFiles.py", "/cacheServer.py"], "/Voiture.py": ["/Endpoint.py"]} |
79,209 | Haykeau/Cancash | refs/heads/master | /Voiture.py | from Endpoint import*
nbRequete = [1500,10000,300]
tpsCache = [230,111,340,245]
tpsDataCenter = 1000
endpoint = Endpoint(nbRequete,tpsCache,tpsDataCenter)
cacheChoisi = endpoint.chooseCache(tpsCache)
temps = endpoint.tpsGagne(tpsCache,tpsDataCenter)
print(cacheChoisi)
print(temps)
| {"/main.py": ["/cacheServer.py", "/Endpoint.py", "/video.py", "/readFiles.py", "/submission.py"], "/submission.py": ["/readFiles.py", "/cacheServer.py"], "/Voiture.py": ["/Endpoint.py"]} |
79,234 | zhaohonggang/smalldata | refs/heads/master | /businessadmin/migrations/0001_initial.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-03-08 19:54
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Invent... | {"/api/serializers.py": ["/api/models.py"], "/api/views.py": ["/api/serializers.py", "/api/models.py"], "/api/urls.py": ["/api/views.py"], "/frontend/views.py": ["/api/utils.py"]} |
79,235 | zhaohonggang/smalldata | refs/heads/master | /api/serializers.py | from rest_framework import serializers
#from blog.models import Article, Tag, Comment
from django.contrib.auth.models import User
from django.contrib.auth import authenticate
from django.utils import timezone
from .models import SoldSummary, HouseCategory, CityArea, HouseForSale, HouseSold
class DateTimeFieldWihTZ(ser... | {"/api/serializers.py": ["/api/models.py"], "/api/views.py": ["/api/serializers.py", "/api/models.py"], "/api/urls.py": ["/api/views.py"], "/frontend/views.py": ["/api/utils.py"]} |
79,236 | zhaohonggang/smalldata | refs/heads/master | /api/views.py | from rest_framework.response import Response
from rest_framework import status
from rest_framework.authentication import TokenAuthentication
from rest_framework_expiring_authtoken.authentication import ExpiringTokenAuthentication
#from .serializers import ArticleSerializer, CommentSerializer, TagSerializer
from rest_fr... | {"/api/serializers.py": ["/api/models.py"], "/api/views.py": ["/api/serializers.py", "/api/models.py"], "/api/urls.py": ["/api/views.py"], "/frontend/views.py": ["/api/utils.py"]} |
79,237 | zhaohonggang/smalldata | refs/heads/master | /api/urls.py | from django.conf.urls import url, include
from .views import UserLoginAPIView, request_user, sold_summary_list, city_area_list, city_list, area_list, house_category_list, house_for_sale_list, house_sold_list, house_report, test
from rest_framework.authtoken import views
from django.views.generic.base import RedirectVie... | {"/api/serializers.py": ["/api/models.py"], "/api/views.py": ["/api/serializers.py", "/api/models.py"], "/api/urls.py": ["/api/views.py"], "/frontend/views.py": ["/api/utils.py"]} |
79,238 | zhaohonggang/smalldata | refs/heads/master | /frontend/views.py | from django.http import HttpResponse
from django.shortcuts import render, get_object_or_404, redirect
from django.template.response import TemplateResponse
from payments import get_payment_model, RedirectNeeded
import api.utils as utils
from django.conf import settings
import os
'''
def history(request):
return ... | {"/api/serializers.py": ["/api/models.py"], "/api/views.py": ["/api/serializers.py", "/api/models.py"], "/api/urls.py": ["/api/views.py"], "/frontend/views.py": ["/api/utils.py"]} |
79,239 | zhaohonggang/smalldata | refs/heads/master | /api/utils.py | import os
import os.path
import imp
import datetime
import json
import ast
from os import listdir
from os.path import isfile, join
import pickle
# from selenium import webdriver
import time
import psycopg2
# from bs4 import BeautifulSoup
import re
import requests
'''
import utils
imp.reload(utils)
refresh('utils')
fro... | {"/api/serializers.py": ["/api/models.py"], "/api/views.py": ["/api/serializers.py", "/api/models.py"], "/api/urls.py": ["/api/views.py"], "/frontend/views.py": ["/api/utils.py"]} |
79,240 | zhaohonggang/smalldata | refs/heads/master | /smalldata/urls.py | """smalldata URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-... | {"/api/serializers.py": ["/api/models.py"], "/api/views.py": ["/api/serializers.py", "/api/models.py"], "/api/urls.py": ["/api/views.py"], "/frontend/views.py": ["/api/utils.py"]} |
79,241 | zhaohonggang/smalldata | refs/heads/master | /businessadmin/__init__.py | default_app_config = 'businessadmin.apps.BusinessAdminConfig'
| {"/api/serializers.py": ["/api/models.py"], "/api/views.py": ["/api/serializers.py", "/api/models.py"], "/api/urls.py": ["/api/views.py"], "/frontend/views.py": ["/api/utils.py"]} |
79,242 | zhaohonggang/smalldata | refs/heads/master | /api/models.py | from django.db import models
# Create your models here.
class SoldSummary(models.Model):
city = models.CharField(max_length=1000, blank=True, null=True)
area = models.CharField(max_length=100, blank=True, null=True)
category = models.CharField(max_length=1000, blank=True, null=True)
year = models.Float... | {"/api/serializers.py": ["/api/models.py"], "/api/views.py": ["/api/serializers.py", "/api/models.py"], "/api/urls.py": ["/api/views.py"], "/frontend/views.py": ["/api/utils.py"]} |
79,243 | zhaohonggang/smalldata | refs/heads/master | /api/migrations/0001_initial.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-05-15 20:10
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='CityAr... | {"/api/serializers.py": ["/api/models.py"], "/api/views.py": ["/api/serializers.py", "/api/models.py"], "/api/urls.py": ["/api/views.py"], "/frontend/views.py": ["/api/utils.py"]} |
79,281 | mahdixabid/AirBnB_clone | refs/heads/main | /models/engine/file_storage.py | #!/usr/bin/python3
"""Module Storage """
from models.base_model import BaseModel
import json
from models.user import User
from models.amenity import Amenity
from models.state import State
from models.city import City
from models.review import Review
class FileStorage:
"""serializes instances to a JSON file
a... | {"/models/engine/file_storage.py": ["/models/base_model.py"], "/tests/test_models/test_city.py": ["/models/base_model.py"], "/console.py": ["/models/base_model.py"], "/tests/test_models/test_engine/test_file_storage.py": ["/models/engine/file_storage.py"], "/tests/test_models/test_base_model.py": ["/models/base_model.p... |
79,282 | mahdixabid/AirBnB_clone | refs/heads/main | /tests/test_models/test_city.py | #!/usr/bin/python3
"""
unittests for City class
"""
import unittest
from models.city import City
from models.base_model import BaseModel
class testfile(unittest.TestCase):
""" unittests for City class """
def test_inheritance(self):
""" checks if it inherits from BaseModel """
self.assertTrue(... | {"/models/engine/file_storage.py": ["/models/base_model.py"], "/tests/test_models/test_city.py": ["/models/base_model.py"], "/console.py": ["/models/base_model.py"], "/tests/test_models/test_engine/test_file_storage.py": ["/models/engine/file_storage.py"], "/tests/test_models/test_base_model.py": ["/models/base_model.p... |
79,283 | mahdixabid/AirBnB_clone | refs/heads/main | /console.py | #!/usr/bin/python3
"""Command interpreter Module"""
import cmd
import models
from models.base_model import BaseModel
from models import storage
from models.user import User
from models.amenity import Amenity
from models.state import State
from models.city import City
from models.review import Review
from models.place ... | {"/models/engine/file_storage.py": ["/models/base_model.py"], "/tests/test_models/test_city.py": ["/models/base_model.py"], "/console.py": ["/models/base_model.py"], "/tests/test_models/test_engine/test_file_storage.py": ["/models/engine/file_storage.py"], "/tests/test_models/test_base_model.py": ["/models/base_model.p... |
79,284 | mahdixabid/AirBnB_clone | refs/heads/main | /tests/test_models/test_engine/test_file_storage.py | #!/usr/bin/python3
"""
Unittest for FileStorage class
"""
import unittest
from models.engine.file_storage import FileStorage
class testfile(unittest.TestCase):
"""
unittests for FileStorage class
"""
def test_obj(self):
"""
check obj
"""
storage = FileStorage()
... | {"/models/engine/file_storage.py": ["/models/base_model.py"], "/tests/test_models/test_city.py": ["/models/base_model.py"], "/console.py": ["/models/base_model.py"], "/tests/test_models/test_engine/test_file_storage.py": ["/models/engine/file_storage.py"], "/tests/test_models/test_base_model.py": ["/models/base_model.p... |
79,285 | mahdixabid/AirBnB_clone | refs/heads/main | /tests/test_models/test_base_model.py | #!/usr/bin/python3
"""Unittest class BaseModel
"""
import unittest
import models
from models.base_model import BaseModel
from datetime import datetime
class BaseModelTest(unittest.TestCase):
""" basemodels test """
def test_attrb(self):
"""test atttr"""
bm = BaseModel()
bm1 = BaseMod... | {"/models/engine/file_storage.py": ["/models/base_model.py"], "/tests/test_models/test_city.py": ["/models/base_model.py"], "/console.py": ["/models/base_model.py"], "/tests/test_models/test_engine/test_file_storage.py": ["/models/engine/file_storage.py"], "/tests/test_models/test_base_model.py": ["/models/base_model.p... |
79,286 | mahdixabid/AirBnB_clone | refs/heads/main | /models/base_model.py | #!/usr/bin/python3
"""Module base """
import uuid
from datetime import datetime
import models
class BaseModel:
"""Base class"""
def __init__(self, *args, **kwargs):
"""class constructor"""
self.id = str(uuid.uuid4())
self.created_at = datetime.now()
self.updated_at = datetime... | {"/models/engine/file_storage.py": ["/models/base_model.py"], "/tests/test_models/test_city.py": ["/models/base_model.py"], "/console.py": ["/models/base_model.py"], "/tests/test_models/test_engine/test_file_storage.py": ["/models/engine/file_storage.py"], "/tests/test_models/test_base_model.py": ["/models/base_model.p... |
79,287 | mahdixabid/AirBnB_clone | refs/heads/main | /tests/test_models/test_amenity.py | #!/usr/bin/python3
"""
unittests for Amenity class
"""
import unittest
from models.amenity import Amenity
from models.base_model import BaseModel
class testfile(unittest.TestCase):
""" unittests for Amenity class """
def test_inheritance(self):
""" checks if it inherits from BaseModel """
self... | {"/models/engine/file_storage.py": ["/models/base_model.py"], "/tests/test_models/test_city.py": ["/models/base_model.py"], "/console.py": ["/models/base_model.py"], "/tests/test_models/test_engine/test_file_storage.py": ["/models/engine/file_storage.py"], "/tests/test_models/test_base_model.py": ["/models/base_model.p... |
79,288 | berendkleinhaneveld/data-inspector | refs/heads/master | /DataInspector.py | """
DataInspector is a simple application for (medical) data inspection.
Small amount of controls, should be just enough to quickly get a sense
of the data. Uses volume rendering with some simple sliders to control
some predefined transfer functions.
:Authors:
Berend Klein Haneveld <berendkleinhaneveld@gmail.com>... | {"/DataInspector.py": ["/ui/RenderWidget.py"]} |
79,289 | berendkleinhaneveld/data-inspector | refs/heads/master | /ui/RenderWidget.py | """
RenderWidget
:Authors:
Berend Klein Haneveld
"""
from PySide.QtGui import QGridLayout, QWidget
from vtk import (vtkColorTransferFunction, vtkGPUVolumeRayCastMapper,
vtkInteractorStyleTrackballCamera, vtkPiecewiseFunction,
vtkRenderer, vtkVolume, vtkVolumeProperty)
from core.... | {"/DataInspector.py": ["/ui/RenderWidget.py"]} |
79,294 | KeithYue/WebTopicModel | refs/heads/master | /topic_viewer.py | # coding=utf-8
# generate the topic picture
from jinja2 import Template, FileSystemLoader, Environment
from db_helper import connect_db
def make_demo(data):
'''
given one topic data, generate the topic chart
'''
t_loader = FileSystemLoader(searchpath= './')
env = Environment(loader = t_loader)
... | {"/topic_viewer.py": ["/db_helper.py"], "/topic.py": ["/db_helper.py", "/utils.py"], "/dict.py": ["/db_helper.py"]} |
79,295 | KeithYue/WebTopicModel | refs/heads/master | /topic.py | # coding=utf-8
from db_helper import connect_db
from gensim.corpora import Dictionary
from gensim.models import TfidfModel, LsiModel
from datetime import datetime, timedelta
from itertools import tee
from utils import timeit, append_or_extend
import math
import logging
import argparse
import os
import glob
# config t... | {"/topic_viewer.py": ["/db_helper.py"], "/topic.py": ["/db_helper.py", "/utils.py"], "/dict.py": ["/db_helper.py"]} |
79,296 | KeithYue/WebTopicModel | refs/heads/master | /db_helper.py | # coding=utf-8
from pymongo import MongoClient
HOST = '183.57.42.116'
PORT = 27017
def connect_db():
client = MongoClient(HOST, PORT)
return client['pingan']
| {"/topic_viewer.py": ["/db_helper.py"], "/topic.py": ["/db_helper.py", "/utils.py"], "/dict.py": ["/db_helper.py"]} |
79,297 | KeithYue/WebTopicModel | refs/heads/master | /dict.py | # coding=utf-8
from db_helper import connect_db
from gensim.corpora import Dictionary
from gensim.models import TfidfModel, LsiModel
from datetime import datetime
from itertools import tee
import logging
class Dict():
'''
the dictionary of the corpus
'''
def __init__(self, s_time, e_time, source):
... | {"/topic_viewer.py": ["/db_helper.py"], "/topic.py": ["/db_helper.py", "/utils.py"], "/dict.py": ["/db_helper.py"]} |
79,298 | KeithYue/WebTopicModel | refs/heads/master | /utils.py | # coding=utf-8
import time
import logging
def timeit(func):
'''
This function is used to evaluate the execution time of a function
'''
def timed_function(*args, **kwargs):
t1 = time.time()
func(*args, **kwargs)
t2 = time.time()
logging.info('function {} has spend {} seco... | {"/topic_viewer.py": ["/db_helper.py"], "/topic.py": ["/db_helper.py", "/utils.py"], "/dict.py": ["/db_helper.py"]} |
79,299 | KeithYue/WebTopicModel | refs/heads/master | /arg_test.py | # coding=utf-8
import argparse
parser = argparse.ArgumentParser(description='''
the argparse module test
''')
parser.add_argument('-l', '--list', help='a list', nargs='*', default=[])
args = parser.parse_args()
print(args.list)
| {"/topic_viewer.py": ["/db_helper.py"], "/topic.py": ["/db_helper.py", "/utils.py"], "/dict.py": ["/db_helper.py"]} |
79,303 | gorel/SCALE-MAMBA | refs/heads/master | /Compiler/compilerLib.py | from __future__ import print_function
from past.builtins import execfile
from Compiler.program import Program
from Compiler.config import *
from Compiler.exceptions import *
import Compiler.instructions
import Compiler.instructions_base
import Compiler.types
import Compiler.comparison
import random
import time
import ... | {"/Compiler/__init__.py": ["/Compiler/compilerLib.py"]} |
79,304 | gorel/SCALE-MAMBA | refs/heads/master | /Compiler/__init__.py | import Compiler.compilerLib
import Compiler.program
import Compiler.instructions
import Compiler.types
import Compiler.library
import Compiler.floatingpoint
import Compiler.mpc_math
import inspect
from Compiler.config import *
from Compiler.compilerLib import run
# add all instructions to the program VARS dictionary
... | {"/Compiler/__init__.py": ["/Compiler/compilerLib.py"]} |
79,306 | georgewatts/pytrader | refs/heads/master | /main.py | #!/usr/bin/python
import wx
import traceback
from threading import *
from igbroker import IGBroker
from lightstreamer import LSClient, Subscription
node_dictionary = {}
list_dictionary = {}
market_dictionary = {}
merge_sub_dictionary = {}
live_market_dictionary = {}
live_data = []
class MyFram... | {"/main.py": ["/igbroker.py"]} |
79,307 | georgewatts/pytrader | refs/heads/master | /igbroker.py | import json
import requests
"""
An interface for interacting with the IG trading platform
"""
class IGBroker(object):
# Connection to IG API
valid = 0
# Endpoints TODO Tidy up
base_point = 'https://demo-api.ig.com/gateway/deal/'
login = base_point + 'session/'
markets = base_point + ... | {"/main.py": ["/igbroker.py"]} |
79,308 | georgewatts/pytrader | refs/heads/master | /lightstreamer/version.py | __author__ = "Weswit s.r.l."
__copyright__ = "Copyright 2015, http://www.weswit.com/"
__credits__ = [""]
__license__ = "Apache"
__version__ = "0.0.1"
__maintainer__ = "Weswit"
__email__ = ""
__status__ = "Development"
__url__ = 'https://github.com/Weswit/Lightstreamer-example-StockList-client-python'
__credits__ = ''
| {"/main.py": ["/igbroker.py"]} |
79,313 | anhpt1997/api_document_alignment | refs/heads/main | /a.py | import sys
from pyvi import ViTokenizer
# def isDoc(line):
# if line == '\n':
# return True
# else:
# line = line.replace("\n","").strip()
# if '------' in line:
# return False
# else:
# return True
# f_in = sys.argv[1]
# f_out = sys.argv[2... | {"/utils.py": ["/handleVnText.py"], "/handleVnText.py": ["/utils.py", "/w2vec.py"], "/api.py": ["/utils.py", "/cosin_sim.py", "/w2vec.py", "/segment.py", "/comparePairDoc.py"], "/comparePairDoc.py": ["/handleVnText.py", "/cosin_sim.py", "/w2vec.py", "/utils.py"], "/w2vec.py": ["/handleVnText.py"], "/documentAlign.py": ... |
79,314 | anhpt1997/api_document_alignment | refs/heads/main | /utils.py | from handleVnText import *
from sklearn.metrics import accuracy_score
import numpy as np
import random
listPuncKhrme =['ៗ', '។' ,'៕']
def splitDocByPunctuation(doc, listPunc, segment_length):
doc = doc.replace("\n"," ")
for punc in listPunc:
doc = doc.replace(punc , "\n")
listSegment = [ t for t ... | {"/utils.py": ["/handleVnText.py"], "/handleVnText.py": ["/utils.py", "/w2vec.py"], "/api.py": ["/utils.py", "/cosin_sim.py", "/w2vec.py", "/segment.py", "/comparePairDoc.py"], "/comparePairDoc.py": ["/handleVnText.py", "/cosin_sim.py", "/w2vec.py", "/utils.py"], "/w2vec.py": ["/handleVnText.py"], "/documentAlign.py": ... |
79,315 | anhpt1997/api_document_alignment | refs/heads/main | /handleVnText.py | import string
import re
import unicodedata
from utils import *
from pyvi import ViTokenizer as annotator
from w2vec import *
def norm_text(text):
text = unicodedata.normalize('NFC', text)
text = re.sub(r"òa", "oà", text)
text = re.sub(r"óa", "oá", text)
text = re.sub(r"ỏa", "oả", text)
text = re.sub(r"õa", "oã",... | {"/utils.py": ["/handleVnText.py"], "/handleVnText.py": ["/utils.py", "/w2vec.py"], "/api.py": ["/utils.py", "/cosin_sim.py", "/w2vec.py", "/segment.py", "/comparePairDoc.py"], "/comparePairDoc.py": ["/handleVnText.py", "/cosin_sim.py", "/w2vec.py", "/utils.py"], "/w2vec.py": ["/handleVnText.py"], "/documentAlign.py": ... |
79,316 | anhpt1997/api_document_alignment | refs/heads/main | /api.py | import sys
from utils import *
from cosin_sim import *
from w2vec import *
from segment import *
from google_translate.run_translate import *
from comparePairDoc import *
from pyvi import ViTokenizer as annotator
def document_align_api():
file_vn_raw = sys.argv[1]
file_khme_raw = sys.argv[2]
src_lg ... | {"/utils.py": ["/handleVnText.py"], "/handleVnText.py": ["/utils.py", "/w2vec.py"], "/api.py": ["/utils.py", "/cosin_sim.py", "/w2vec.py", "/segment.py", "/comparePairDoc.py"], "/comparePairDoc.py": ["/handleVnText.py", "/cosin_sim.py", "/w2vec.py", "/utils.py"], "/w2vec.py": ["/handleVnText.py"], "/documentAlign.py": ... |
79,317 | anhpt1997/api_document_alignment | refs/heads/main | /translate.py | from google_translate.run_translate import *
def translate(file_in , file_out):
translate_file(file_in = file_in , file_out = file_out) | {"/utils.py": ["/handleVnText.py"], "/handleVnText.py": ["/utils.py", "/w2vec.py"], "/api.py": ["/utils.py", "/cosin_sim.py", "/w2vec.py", "/segment.py", "/comparePairDoc.py"], "/comparePairDoc.py": ["/handleVnText.py", "/cosin_sim.py", "/w2vec.py", "/utils.py"], "/w2vec.py": ["/handleVnText.py"], "/documentAlign.py": ... |
79,318 | anhpt1997/api_document_alignment | refs/heads/main | /segment.py | from vncorenlp import VnCoreNLP
def getAnnotator():
annotator = VnCoreNLP(address="http://127.0.0.1", port=9000)
return annotator
| {"/utils.py": ["/handleVnText.py"], "/handleVnText.py": ["/utils.py", "/w2vec.py"], "/api.py": ["/utils.py", "/cosin_sim.py", "/w2vec.py", "/segment.py", "/comparePairDoc.py"], "/comparePairDoc.py": ["/handleVnText.py", "/cosin_sim.py", "/w2vec.py", "/utils.py"], "/w2vec.py": ["/handleVnText.py"], "/documentAlign.py": ... |
79,319 | anhpt1997/api_document_alignment | refs/heads/main | /comparePairDoc.py | from collections import Counter
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.metrics.pairwise import cosine_similarity
import rouge
import numpy as np
from handleVnText import *
from cosin_sim import *
from w2vec import *
from utils import *
def get_cosine_sim(text):
vectors = [t for... | {"/utils.py": ["/handleVnText.py"], "/handleVnText.py": ["/utils.py", "/w2vec.py"], "/api.py": ["/utils.py", "/cosin_sim.py", "/w2vec.py", "/segment.py", "/comparePairDoc.py"], "/comparePairDoc.py": ["/handleVnText.py", "/cosin_sim.py", "/w2vec.py", "/utils.py"], "/w2vec.py": ["/handleVnText.py"], "/documentAlign.py": ... |
79,320 | anhpt1997/api_document_alignment | refs/heads/main | /w2vec.py | import gensim
from gensim.models import KeyedVectors
from handleVnText import *
import numpy as np
def getWord2Vec():
word2vec_model = KeyedVectors.load_word2vec_format("../baomoi.model.bin", binary=True)
return word2vec_model
def listWordToVec(list_word , vocab , handleOOV = False):
if handleOOV == False:... | {"/utils.py": ["/handleVnText.py"], "/handleVnText.py": ["/utils.py", "/w2vec.py"], "/api.py": ["/utils.py", "/cosin_sim.py", "/w2vec.py", "/segment.py", "/comparePairDoc.py"], "/comparePairDoc.py": ["/handleVnText.py", "/cosin_sim.py", "/w2vec.py", "/utils.py"], "/w2vec.py": ["/handleVnText.py"], "/documentAlign.py": ... |
79,321 | anhpt1997/api_document_alignment | refs/heads/main | /documentAlign.py | from handleVnText import *
import pickle
import numpy as np
from w2vec import *
from utils import *
from segment_api import *
def computeMatrixSim(listDoc1 , listDoc2):
vocab = readWord2Vec()
stopWords = readAndNormStopword()
punc = creatPunc()
annotator = getAnnotator()
s2 = get_listWord... | {"/utils.py": ["/handleVnText.py"], "/handleVnText.py": ["/utils.py", "/w2vec.py"], "/api.py": ["/utils.py", "/cosin_sim.py", "/w2vec.py", "/segment.py", "/comparePairDoc.py"], "/comparePairDoc.py": ["/handleVnText.py", "/cosin_sim.py", "/w2vec.py", "/utils.py"], "/w2vec.py": ["/handleVnText.py"], "/documentAlign.py": ... |
79,322 | anhpt1997/api_document_alignment | refs/heads/main | /test.py |
from utils import *
from w2vec import *
from handleVnText import *
from comparePairDoc import *
import numpy as np
from pyvi import ViTokenizer as annotator
# w2vecmodel = getWord2Vec()
"""
path_src = 'test_raw_vn.txt'
path_tgt = 'data/file_vn_translated_indexed.txt'
text1 = readAndProcessDocForCosinBoW(path_src)... | {"/utils.py": ["/handleVnText.py"], "/handleVnText.py": ["/utils.py", "/w2vec.py"], "/api.py": ["/utils.py", "/cosin_sim.py", "/w2vec.py", "/segment.py", "/comparePairDoc.py"], "/comparePairDoc.py": ["/handleVnText.py", "/cosin_sim.py", "/w2vec.py", "/utils.py"], "/w2vec.py": ["/handleVnText.py"], "/documentAlign.py": ... |
79,323 | anhpt1997/api_document_alignment | refs/heads/main | /cosin_sim.py | from scipy import spatial
from w2vec import *
def cosinSimilarity(vec1 , vec2):
return 1 - spatial.distance.cosine(vec1, vec2)
def computeMatrixSimilarityPairListDoc(listdoc1 , listDoc2, annotator , vocab, handleOOV = False):
result = np.zeros(shape =(len(listdoc1) , len(listDoc2)))
for i in range(len(listdoc1)):... | {"/utils.py": ["/handleVnText.py"], "/handleVnText.py": ["/utils.py", "/w2vec.py"], "/api.py": ["/utils.py", "/cosin_sim.py", "/w2vec.py", "/segment.py", "/comparePairDoc.py"], "/comparePairDoc.py": ["/handleVnText.py", "/cosin_sim.py", "/w2vec.py", "/utils.py"], "/w2vec.py": ["/handleVnText.py"], "/documentAlign.py": ... |
79,326 | nihao545720/apiTestIHRM | refs/heads/master | /utils.py | import json
import pymysql
from requests import Response
import app
#通用断言工具
def assert_common(self, response,http_code, success, code, message):
'''
@type response:Response
'''
jsonData = response.json() #type:dict
# 断言返回状态码
self.assertEqual(http_code, response.status_code)
# 断言返回json数据中的s... | {"/script/test_ihrm_emp.py": ["/api/emp_api.py", "/utils.py"], "/script/test_ihrm_emp_parametrized.py": ["/api/emp_api.py", "/utils.py"], "/run_suite.py": ["/script/test_ihrm_emp.py", "/script/test_ihrm_emp_parametrized.py", "/script/test_loginihrm.py"], "/script/test_ihrm_login_parametrized.py": ["/utils.py"], "/scrip... |
79,327 | nihao545720/apiTestIHRM | refs/heads/master | /script/test_ihrm_emp.py | import logging
import unittest
import pymysql
import app
from api.emp_api import EmpApi
from utils import assert_common, DBUtils
class TeatEmp(unittest.TestCase):
def setUp(self):
pass
@classmethod
def setUpClass(cls):
cls.emp_api = EmpApi()
pass
def tearDown(self):
... | {"/script/test_ihrm_emp.py": ["/api/emp_api.py", "/utils.py"], "/script/test_ihrm_emp_parametrized.py": ["/api/emp_api.py", "/utils.py"], "/run_suite.py": ["/script/test_ihrm_emp.py", "/script/test_ihrm_emp_parametrized.py", "/script/test_loginihrm.py"], "/script/test_ihrm_login_parametrized.py": ["/utils.py"], "/scrip... |
79,328 | nihao545720/apiTestIHRM | refs/heads/master | /script/test_ihrm_emp_parametrized.py | import logging
import unittest
from parameterized import parameterized
import app
from api.emp_api import EmpApi
from utils import assert_common, read_add_emp_data, DBUtils, read_query_emp_data, read_modify_emp_data, \
read_delete_emp_data
class TeatEmpPa(unittest.TestCase):
def setUp(self):
pass
... | {"/script/test_ihrm_emp.py": ["/api/emp_api.py", "/utils.py"], "/script/test_ihrm_emp_parametrized.py": ["/api/emp_api.py", "/utils.py"], "/run_suite.py": ["/script/test_ihrm_emp.py", "/script/test_ihrm_emp_parametrized.py", "/script/test_loginihrm.py"], "/script/test_ihrm_login_parametrized.py": ["/utils.py"], "/scrip... |
79,329 | nihao545720/apiTestIHRM | refs/heads/master | /run_suite.py | # 导包
import unittest
import time
import app
from script.test_ihrm_emp import TeatEmp
from script.test_ihrm_emp_parametrized import TeatEmpPa
from script.test_loginihrm import TestLoginIhrm
from tools.HTMLTestRunner import HTMLTestRunner
# 初始化测试套件
suite = unittest.TestSuite()
# 将测试用例添加到测试套件
suite.addTest(unittest.make... | {"/script/test_ihrm_emp.py": ["/api/emp_api.py", "/utils.py"], "/script/test_ihrm_emp_parametrized.py": ["/api/emp_api.py", "/utils.py"], "/run_suite.py": ["/script/test_ihrm_emp.py", "/script/test_ihrm_emp_parametrized.py", "/script/test_loginihrm.py"], "/script/test_ihrm_login_parametrized.py": ["/utils.py"], "/scrip... |
79,330 | nihao545720/apiTestIHRM | refs/heads/master | /api/emp_api.py | import requests
import app
class EmpApi():
def __init__(self):
self.emp_url = "http://182.92.81.159" + "/api/sys/user" # 员工管理的url
def add_emp(self,username,mobile):
data = {
"username": username,
"mobile": mobile,
"timeOfEntry": "2019-11-05",
... | {"/script/test_ihrm_emp.py": ["/api/emp_api.py", "/utils.py"], "/script/test_ihrm_emp_parametrized.py": ["/api/emp_api.py", "/utils.py"], "/run_suite.py": ["/script/test_ihrm_emp.py", "/script/test_ihrm_emp_parametrized.py", "/script/test_loginihrm.py"], "/script/test_ihrm_login_parametrized.py": ["/utils.py"], "/scrip... |
79,331 | nihao545720/apiTestIHRM | refs/heads/master | /api/__init__.py | import logging
import app
#调用自己封装的的日志初始化
app.init_logger()
#调试
# logging.info("test") | {"/script/test_ihrm_emp.py": ["/api/emp_api.py", "/utils.py"], "/script/test_ihrm_emp_parametrized.py": ["/api/emp_api.py", "/utils.py"], "/run_suite.py": ["/script/test_ihrm_emp.py", "/script/test_ihrm_emp_parametrized.py", "/script/test_loginihrm.py"], "/script/test_ihrm_login_parametrized.py": ["/utils.py"], "/scrip... |
79,332 | nihao545720/apiTestIHRM | refs/heads/master | /script/test_ihrm_login_parametrized.py |
#参数化执行用例
# 导包
import logging
import unittest
from parameterized import parameterized
from api.loginapi import LoginApi
from utils import assert_common, read_login_data
class TestLoginIhrm(unittest.TestCase):
def setUp(self):
pass
@classmethod
def setUpClass(cls):
cls.login_api = LoginA... | {"/script/test_ihrm_emp.py": ["/api/emp_api.py", "/utils.py"], "/script/test_ihrm_emp_parametrized.py": ["/api/emp_api.py", "/utils.py"], "/run_suite.py": ["/script/test_ihrm_emp.py", "/script/test_ihrm_emp_parametrized.py", "/script/test_loginihrm.py"], "/script/test_ihrm_login_parametrized.py": ["/utils.py"], "/scrip... |
79,333 | nihao545720/apiTestIHRM | refs/heads/master | /script/test_loginihrm.py | # 导包
import logging
import unittest
import app
from api.loginapi import LoginApi
from utils import assert_common
class TestLoginIhrm(unittest.TestCase):
def setUp(self):
pass
@classmethod
def setUpClass(cls):
cls.login_api = LoginApi()
pass
def tearDown(self):
pass
... | {"/script/test_ihrm_emp.py": ["/api/emp_api.py", "/utils.py"], "/script/test_ihrm_emp_parametrized.py": ["/api/emp_api.py", "/utils.py"], "/run_suite.py": ["/script/test_ihrm_emp.py", "/script/test_ihrm_emp_parametrized.py", "/script/test_loginihrm.py"], "/script/test_ihrm_login_parametrized.py": ["/utils.py"], "/scrip... |
79,334 | webclinic017/gym-stock-trading | refs/heads/master | /gym_stock_trading/envs/stock_trading_env.py | """
This module is a stock trading environment for OpenAI gym
including matplotlib visualizations. See the StockTradingEnv
class for a description of how the environment operates.
"""
import datetime
import os
import random
import gym
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
... | {"/gym_stock_trading/envs/__init__.py": ["/gym_stock_trading/envs/stock_trading_env.py", "/gym_stock_trading/envs/alpaca_stock_trading_env.py"]} |
79,335 | webclinic017/gym-stock-trading | refs/heads/master | /gym_stock_trading/envs/__init__.py | from gym_stock_trading.envs.stock_trading_env import StockTradingEnv
from gym_stock_trading.envs.alpaca_stock_trading_env import AlpacaStockTradingEnv
| {"/gym_stock_trading/envs/__init__.py": ["/gym_stock_trading/envs/stock_trading_env.py", "/gym_stock_trading/envs/alpaca_stock_trading_env.py"]} |
79,336 | webclinic017/gym-stock-trading | refs/heads/master | /tests/test_stock_trading_env.py | import os
import unittest
import gym
import numpy as np
import pandas as pd
import pytest
from tests.test_data.AAPL import stock_data
# test submit order for qty pos, neg, and 0
# test close position
# test websocket
# test correct observations
# test await market open (already created)
# test more without volume ena... | {"/gym_stock_trading/envs/__init__.py": ["/gym_stock_trading/envs/stock_trading_env.py", "/gym_stock_trading/envs/alpaca_stock_trading_env.py"]} |
79,337 | webclinic017/gym-stock-trading | refs/heads/master | /gym_stock_trading/__init__.py | from gym.envs.registration import register
register(
id='StockTrading-v0',
entry_point='gym_stock_trading.envs.stock_trading_env:StockTradingEnv'
)
register(
id='AlpacaStockTrading-v0',
entry_point='gym_stock_trading.envs.alpaca_stock_trading_env:AlpacaStockTradingEnv'
)
| {"/gym_stock_trading/envs/__init__.py": ["/gym_stock_trading/envs/stock_trading_env.py", "/gym_stock_trading/envs/alpaca_stock_trading_env.py"]} |
79,338 | webclinic017/gym-stock-trading | refs/heads/master | /gym_stock_trading/envs/alpaca_stock_trading_env.py | """
This module is a stock trading environment for OpenAI gym
utilizing Alpaca for live and paper trading.
"""
import datetime
import logging
import os
import random
import threading
import time
import alpaca_trade_api as tradeapi
import gym
import numpy as np
import pandas as pd
from datetime import timedelta
from g... | {"/gym_stock_trading/envs/__init__.py": ["/gym_stock_trading/envs/stock_trading_env.py", "/gym_stock_trading/envs/alpaca_stock_trading_env.py"]} |
79,339 | webclinic017/gym-stock-trading | refs/heads/master | /setup.py | from setuptools import setup
setup(
name='gym_stock_trading',
version='0.0.1',
install_requires=[
'gym',
'pandas',
'matplotlib',
'mplfinance',
'alpaca-trade-api'
]
)
| {"/gym_stock_trading/envs/__init__.py": ["/gym_stock_trading/envs/stock_trading_env.py", "/gym_stock_trading/envs/alpaca_stock_trading_env.py"]} |
79,343 | openshift/openshift-tools | refs/heads/prod | /ansible/roles/lib_oa_utils/test/test_master_check_paths_in_config.py | '''
Unit tests for the master_check_paths_in_config action plugin
'''
import os
import sys
from ansible import errors
import pytest
MODULE_PATH = os.path.realpath(os.path.join(__file__, os.pardir, os.pardir, 'action_plugins'))
sys.path.insert(1, MODULE_PATH)
# pylint: disable=import-error,wrong-import-position,mis... | {"/scripts/monitoring/cron-send-node-labels-status.py": ["/openshift_tools/monitoring/ocutil.py", "/openshift_tools/monitoring/metric_sender.py"], "/scripts/monitoring/cron-send-aws-instance-health.py": ["/openshift_tools/monitoring/metric_sender.py", "/openshift_tools/cloud/aws/base.py"], "/scripts/monitoring/cron-sen... |
79,344 | openshift/openshift-tools | refs/heads/prod | /openshift/installer/vendored/openshift-ansible-3.9.40/roles/lib_vendored_deps/library/oc_adm_registry.py | ../../lib_openshift/library/oc_adm_registry.py | {"/scripts/monitoring/cron-send-node-labels-status.py": ["/openshift_tools/monitoring/ocutil.py", "/openshift_tools/monitoring/metric_sender.py"], "/scripts/monitoring/cron-send-aws-instance-health.py": ["/openshift_tools/monitoring/metric_sender.py", "/openshift_tools/cloud/aws/base.py"], "/scripts/monitoring/cron-sen... |
79,345 | openshift/openshift-tools | refs/heads/prod | /openshift/installer/vendored/openshift-ansible-3.10.0-0.29.0/roles/lib_openshift/src/ansible/oc_adm_router.py | # pylint: skip-file
# flake8: noqa
def main():
'''
ansible oc module for router
'''
module = AnsibleModule(
argument_spec=dict(
state=dict(default='present', type='str',
choices=['present', 'absent']),
debug=dict(default=False, type='bool'),
... | {"/scripts/monitoring/cron-send-node-labels-status.py": ["/openshift_tools/monitoring/ocutil.py", "/openshift_tools/monitoring/metric_sender.py"], "/scripts/monitoring/cron-send-aws-instance-health.py": ["/openshift_tools/monitoring/metric_sender.py", "/openshift_tools/cloud/aws/base.py"], "/scripts/monitoring/cron-sen... |
79,346 | openshift/openshift-tools | refs/heads/prod | /ansible/roles/lib_gcloud/library/gcloud_dm_resource_builder.py | #!/usr/bin/env python
# ___ ___ _ _ ___ ___ _ _____ ___ ___
# / __| __| \| | __| _ \ /_\_ _| __| \
# | (_ | _|| .` | _|| / / _ \| | | _|| |) |
# \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____
# | \ / _ \ | \| |/ _ \_ _| | __| \_ _|_ _|
# | |) | (_) | | .` | (_) || | | _|| |) | | ... | {"/scripts/monitoring/cron-send-node-labels-status.py": ["/openshift_tools/monitoring/ocutil.py", "/openshift_tools/monitoring/metric_sender.py"], "/scripts/monitoring/cron-send-aws-instance-health.py": ["/openshift_tools/monitoring/metric_sender.py", "/openshift_tools/cloud/aws/base.py"], "/scripts/monitoring/cron-sen... |
79,347 | openshift/openshift-tools | refs/heads/prod | /ansible/roles/lib_timedatectl/library/timedatectl.py | #!/usr/bin/env python
'''
timedatectl ansible module
This module supports setting ntp enabled
'''
import subprocess
def do_timedatectl(options=None):
''' subprocess timedatectl '''
cmd = ['/usr/bin/timedatectl']
if options:
cmd += options.split()
proc = subprocess.Popen(cmd, stdin... | {"/scripts/monitoring/cron-send-node-labels-status.py": ["/openshift_tools/monitoring/ocutil.py", "/openshift_tools/monitoring/metric_sender.py"], "/scripts/monitoring/cron-send-aws-instance-health.py": ["/openshift_tools/monitoring/metric_sender.py", "/openshift_tools/cloud/aws/base.py"], "/scripts/monitoring/cron-sen... |
79,348 | openshift/openshift-tools | refs/heads/prod | /openshift_tools/monitoring/gcputil.py | #!/usr/bin/env python
# vim: expandtab:tabstop=4:shiftwidth=4
'''
Interface to gcloud
'''
#
# Copyright 2015 Red Hat Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... | {"/scripts/monitoring/cron-send-node-labels-status.py": ["/openshift_tools/monitoring/ocutil.py", "/openshift_tools/monitoring/metric_sender.py"], "/scripts/monitoring/cron-send-aws-instance-health.py": ["/openshift_tools/monitoring/metric_sender.py", "/openshift_tools/cloud/aws/base.py"], "/scripts/monitoring/cron-sen... |
79,349 | openshift/openshift-tools | refs/heads/prod | /scripts/cloudhealth/add_billing_role.py | #!/usr/bin/env python
# Copyright 2017 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use
# this file except in compliance with the License. You may obtain a copy of the
# License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | {"/scripts/monitoring/cron-send-node-labels-status.py": ["/openshift_tools/monitoring/ocutil.py", "/openshift_tools/monitoring/metric_sender.py"], "/scripts/monitoring/cron-send-aws-instance-health.py": ["/openshift_tools/monitoring/metric_sender.py", "/openshift_tools/cloud/aws/base.py"], "/scripts/monitoring/cron-sen... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.