index int64 | repo_name string | branch_name string | path string | content string | import_graph string |
|---|---|---|---|---|---|
29,989 | seung-lab/DynamicAnnotationDB | refs/heads/master | /dynamicannotationdb/annotation.py | import datetime
import logging
from typing import List
from marshmallow import INCLUDE
from sqlalchemy import DDL, event
from .database import DynamicAnnotationDB
from .errors import (
AnnotationInsertLimitExceeded,
NoAnnotationsFoundWithID,
UpdateAnnotationError,
TableNameNotFound,
)
from .models imp... | {"/dynamicannotationdb/database.py": ["/dynamicannotationdb/errors.py", "/dynamicannotationdb/models.py", "/dynamicannotationdb/schema.py"], "/dynamicannotationdb/__init__.py": ["/dynamicannotationdb/interface.py"], "/dynamicannotationdb/migration/__init__.py": ["/dynamicannotationdb/migration/migrate.py"], "/dynamican... |
29,990 | seung-lab/DynamicAnnotationDB | refs/heads/master | /tests/test_annotation.py | import logging
import pytest
from emannotationschemas import type_mapping
from emannotationschemas.schemas.base import ReferenceAnnotation
def test_create_table(dadb_interface, annotation_metadata):
table_name = annotation_metadata["table_name"]
schema_type = annotation_metadata["schema_type"]
vx = annot... | {"/dynamicannotationdb/database.py": ["/dynamicannotationdb/errors.py", "/dynamicannotationdb/models.py", "/dynamicannotationdb/schema.py"], "/dynamicannotationdb/__init__.py": ["/dynamicannotationdb/interface.py"], "/dynamicannotationdb/migration/__init__.py": ["/dynamicannotationdb/migration/migrate.py"], "/dynamican... |
30,017 | subhamkumarmal/images | refs/heads/master | /uploadapp/urls.py | from django.urls import path,include
from . import views
urlpatterns=[
path('',views.StudentDetailsView,name="studentsdetails"),
path('getinfo',views.GetInfoView,name='getinfo'),
path('getallvalue',views.getAll,name='getall'),
path('accounts/',include("django.contrib.auth.urls"))
] | {"/uploadapp/views.py": ["/uploadapp/forms.py", "/uploadapp/models.py"], "/uploadapp/forms.py": ["/uploadapp/models.py"]} |
30,018 | subhamkumarmal/images | refs/heads/master | /uploadapp/views.py | from django.shortcuts import render,redirect
from .forms import StudentsDetailsForm,Login
from django.http import HttpResponse,JsonResponse
from .models import StudentsDeails
from django.contrib.auth.decorators import login_required
# Create your views here.
def StudentDetailsView(request):
if request.method=="P... | {"/uploadapp/views.py": ["/uploadapp/forms.py", "/uploadapp/models.py"], "/uploadapp/forms.py": ["/uploadapp/models.py"]} |
30,019 | subhamkumarmal/images | refs/heads/master | /uploadapp/forms.py |
from django import forms
from .models import StudentsDeails
class StudentsDetailsForm(forms.ModelForm):
class Meta:
model=StudentsDeails
fields="__all__"
class Login(forms.Form):
email=forms.EmailField(widget=forms.EmailInput)
password=forms.CharField(widget=forms.PasswordInput) | {"/uploadapp/views.py": ["/uploadapp/forms.py", "/uploadapp/models.py"], "/uploadapp/forms.py": ["/uploadapp/models.py"]} |
30,020 | subhamkumarmal/images | refs/heads/master | /uploadapp/models.py | from django.db import models
# Create your models here.
class StudentsDeails(models.Model):
name=models.CharField(max_length=40)
age=models.IntegerField()
phone=models.CharField(max_length=11)
email=models.EmailField()
password=models.CharField(max_length=20)
img_filed=models.ImageField(upload_... | {"/uploadapp/views.py": ["/uploadapp/forms.py", "/uploadapp/models.py"], "/uploadapp/forms.py": ["/uploadapp/models.py"]} |
30,029 | Diareich/My-realization-algorithm-Floyd-Warshall-with-GUI | refs/heads/master | /logic.py | # Floyd Warshall Algorithm in python
# The number of vertices
nV = 4
INF = 999
# Algorithm implementation
def floyd_warshall(G):
distance = list(map(lambda i: list(map(lambda j: j, i)), G))
# Adding vertices individually
for k in range(nV):
for i in range(nV):
for j in range(nV):
distance[i][j] = min(... | {"/main.py": ["/logic.py"]} |
30,030 | Diareich/My-realization-algorithm-Floyd-Warshall-with-GUI | refs/heads/master | /main.py | from tkinter import *
from logic import floyd_warshall
# функция расчета алгоритма флойда-уоршела
def solve():
nV = dimention_entry.get()
graph = graph_entry.get()
path = path_entry.get()
INF = 999
new_graph = [x.replace("[", "").replace("],", "").replace("]]", "") for x in graph.split (" [")]
new_graph = [x... | {"/main.py": ["/logic.py"]} |
30,036 | MrLawes/awspycli | refs/heads/master | /awspycli/model/emr_cli.py | # -*- coding:utf-8 -*-
import json
import os
class EMR(object):
def __init__(self):
pass
def add_steps(self, **kwargs):
""" Add a list of steps to a cluster.
:param kwargs:
cluster_id: string
steps: [
{},.....
]
:return:
... | {"/awspycli/__init__.py": ["/awspycli/model/emr_cli.py", "/awspycli/model/s3_cli.py"]} |
30,037 | MrLawes/awspycli | refs/heads/master | /awspycli/model/s3_cli.py | # -*- coding:utf-8 -*-
import json
import os
class S3(object):
def __init__(self):
pass
def exec_command(self, emr_command, **kwargs):
""" change kwargs to aws command, and run it
:param command:
:param kwargs:
:return:
"""
aws_command = 'aws s3 {comma... | {"/awspycli/__init__.py": ["/awspycli/model/emr_cli.py", "/awspycli/model/s3_cli.py"]} |
30,038 | MrLawes/awspycli | refs/heads/master | /awspycli/__init__.py | from awspycli.model.emr_cli import emr
from awspycli.model.s3_cli import s3
VERSION = '1.0.2.1' | {"/awspycli/__init__.py": ["/awspycli/model/emr_cli.py", "/awspycli/model/s3_cli.py"]} |
30,053 | dagron/pyspec | refs/heads/master | /spec/impl/util/strings.py | def a_or_an(s: str) -> str:
particle = "an" if s[0] in set('AEIOUaeiou') else "a"
return "{} {}".format(particle, s) | {"/spec/impl/iterables.py": ["/spec/impl/core.py"], "/tests/spec/test_core.py": ["/spec/core.py", "/spec/impl/core.py", "/tests/spec/support.py"], "/spec/impl/specs.py": ["/spec/impl/core.py", "/spec/impl/util/strings.py"], "/spec/impl/records/core.py": ["/spec/core.py", "/spec/impl/dicts.py", "/spec/impl/records/annot... |
30,054 | dagron/pyspec | refs/heads/master | /spec/impl/iterables.py | from typing import Iterable, List
from spec.impl.core import Spec, SpecResult, Problem, Path, isinvalid, INVALID
class CollOf(Spec):
def __init__(self, itemspec: Spec):
super().__init__()
self._itemspec = itemspec
def conform(self, xs: Iterable) -> SpecResult:
if not hasattr(xs, '__i... | {"/spec/impl/iterables.py": ["/spec/impl/core.py"], "/tests/spec/test_core.py": ["/spec/core.py", "/spec/impl/core.py", "/tests/spec/support.py"], "/spec/impl/specs.py": ["/spec/impl/core.py", "/spec/impl/util/strings.py"], "/spec/impl/records/core.py": ["/spec/core.py", "/spec/impl/dicts.py", "/spec/impl/records/annot... |
30,055 | dagron/pyspec | refs/heads/master | /spec/impl/util/callables.py | import inspect
from typing import Callable
def can_be_called_with_one_argument(c: Callable) -> bool:
argspec = inspect.getfullargspec(c)
default_arg_count = len(argspec.defaults) if argspec.defaults else 0
non_default_arg_count = len(argspec.args) - default_arg_count
if not (inspect.isbuiltin(c) or i... | {"/spec/impl/iterables.py": ["/spec/impl/core.py"], "/tests/spec/test_core.py": ["/spec/core.py", "/spec/impl/core.py", "/tests/spec/support.py"], "/spec/impl/specs.py": ["/spec/impl/core.py", "/spec/impl/util/strings.py"], "/spec/impl/records/core.py": ["/spec/core.py", "/spec/impl/dicts.py", "/spec/impl/records/annot... |
30,056 | dagron/pyspec | refs/heads/master | /tests/spec/test_core.py | from typing import Callable
from spec.core import conform, explain_data, equal_to, any_, is_instance, even, odd, is_none, specize, coerce, \
in_range, gt, lt, lte, gte, describe, is_in, assert_spec, isinvalid, isvalid, coll_of
from spec.impl.core import path, Problem, Explanation, SpecError
from tests.spec.support... | {"/spec/impl/iterables.py": ["/spec/impl/core.py"], "/tests/spec/test_core.py": ["/spec/core.py", "/spec/impl/core.py", "/tests/spec/support.py"], "/spec/impl/specs.py": ["/spec/impl/core.py", "/spec/impl/util/strings.py"], "/spec/impl/records/core.py": ["/spec/core.py", "/spec/impl/dicts.py", "/spec/impl/records/annot... |
30,057 | dagron/pyspec | refs/heads/master | /spec/impl/specs.py | from typing import Callable, List, Iterable
from spec.impl.core import Spec, SpecResult, SimpleSpec, DelegatingSpec, Problem, Path, INVALID, isvalid, \
isinvalid
from spec.impl.util.strings import a_or_an
class Any(Spec):
def conform(self, x) -> SpecResult:
return x
def explain(self, p: Path, x:... | {"/spec/impl/iterables.py": ["/spec/impl/core.py"], "/tests/spec/test_core.py": ["/spec/core.py", "/spec/impl/core.py", "/tests/spec/support.py"], "/spec/impl/specs.py": ["/spec/impl/core.py", "/spec/impl/util/strings.py"], "/spec/impl/records/core.py": ["/spec/core.py", "/spec/impl/dicts.py", "/spec/impl/records/annot... |
30,058 | dagron/pyspec | refs/heads/master | /spec/impl/records/core.py | from typing import TypeVar, Union, List, _ForwardRef, Any
from spec.core import is_instance, all_of, one_of, coll_of, any_
from spec.impl.dicts import DictSpec
from spec.impl.records.annotations import AnnotationContext, extract_annotations
from spec.impl.records.forwardrefs import resolve_forward_ref, DeferredSpecFro... | {"/spec/impl/iterables.py": ["/spec/impl/core.py"], "/tests/spec/test_core.py": ["/spec/core.py", "/spec/impl/core.py", "/tests/spec/support.py"], "/spec/impl/specs.py": ["/spec/impl/core.py", "/spec/impl/util/strings.py"], "/spec/impl/records/core.py": ["/spec/core.py", "/spec/impl/dicts.py", "/spec/impl/records/annot... |
30,059 | dagron/pyspec | refs/heads/master | /spec/coercions.py | from urllib.parse import urlparse, ParseResult
from uuid import UUID
from spec.core import coerce
def coerce_uuid(x):
return x if isinstance(x, UUID) else UUID(x)
Uuid = coerce(coerce_uuid, UUID)
def coerce_int(x):
return x if isinstance(x, int) else int(x)
Int = coerce(coerce_int, int)
def parse_url... | {"/spec/impl/iterables.py": ["/spec/impl/core.py"], "/tests/spec/test_core.py": ["/spec/core.py", "/spec/impl/core.py", "/tests/spec/support.py"], "/spec/impl/specs.py": ["/spec/impl/core.py", "/spec/impl/util/strings.py"], "/spec/impl/records/core.py": ["/spec/core.py", "/spec/impl/dicts.py", "/spec/impl/records/annot... |
30,060 | dagron/pyspec | refs/heads/master | /spec/core.py | from typing import Callable, Optional, Set, Iterable, Dict
import spec.impl.core as impl
from spec.impl.core import Spec, SpecResult, SimpleSpec, Explanation, path
from spec.impl.dicts import DictSpec
from spec.impl.iterables import CollOf
from spec.impl.specs import Any, EqualTo, IsInstance, Even, Odd, IsNone, Coerce... | {"/spec/impl/iterables.py": ["/spec/impl/core.py"], "/tests/spec/test_core.py": ["/spec/core.py", "/spec/impl/core.py", "/tests/spec/support.py"], "/spec/impl/specs.py": ["/spec/impl/core.py", "/spec/impl/util/strings.py"], "/spec/impl/records/core.py": ["/spec/core.py", "/spec/impl/dicts.py", "/spec/impl/records/annot... |
30,061 | dagron/pyspec | refs/heads/master | /spec/impl/records/annotations.py | from typing import Any, Dict, _ForwardRef
from spec.impl.records.typevars import generic_class_typevars
Hint = Any
class AnnotationContext:
annotation: Hint
class_annotation_was_on: type
typevars_from_class: Dict[str, Hint]
def __init__(self,
annotation: Hint,
klas... | {"/spec/impl/iterables.py": ["/spec/impl/core.py"], "/tests/spec/test_core.py": ["/spec/core.py", "/spec/impl/core.py", "/tests/spec/support.py"], "/spec/impl/specs.py": ["/spec/impl/core.py", "/spec/impl/util/strings.py"], "/spec/impl/records/core.py": ["/spec/core.py", "/spec/impl/dicts.py", "/spec/impl/records/annot... |
30,062 | dagron/pyspec | refs/heads/master | /spec/impl/records/typevars.py | from pprint import pformat
from typing import TypeVar, List, Mapping
from spec.impl import specs as sis
from spec.impl.core import Spec, Path, Problem, SpecResult, INVALID, isinvalid
def generic_class_typevars(cls: type):
typevars = {}
for klass in cls.mro():
for orig_base in getattr(klass, '__orig_... | {"/spec/impl/iterables.py": ["/spec/impl/core.py"], "/tests/spec/test_core.py": ["/spec/core.py", "/spec/impl/core.py", "/tests/spec/support.py"], "/spec/impl/specs.py": ["/spec/impl/core.py", "/spec/impl/util/strings.py"], "/spec/impl/records/core.py": ["/spec/core.py", "/spec/impl/dicts.py", "/spec/impl/records/annot... |
30,063 | dagron/pyspec | refs/heads/master | /spec/impl/records/forwardrefs.py | import sys
from typing import _ForwardRef, Callable, List, Union
from spec.impl.core import Spec, Path, Problem, SpecResult
from spec.impl.records.annotations import AnnotationContext
def resolve_forward_ref(ac: AnnotationContext):
typeref = ac.annotation
if isinstance(typeref, _ForwardRef):
typeref ... | {"/spec/impl/iterables.py": ["/spec/impl/core.py"], "/tests/spec/test_core.py": ["/spec/core.py", "/spec/impl/core.py", "/tests/spec/support.py"], "/spec/impl/specs.py": ["/spec/impl/core.py", "/spec/impl/util/strings.py"], "/spec/impl/records/core.py": ["/spec/core.py", "/spec/impl/dicts.py", "/spec/impl/records/annot... |
30,064 | dagron/pyspec | refs/heads/master | /tests/spec/test_coercions.py | from urllib.parse import ParseResult
from spec.coercions import Url
def test_url():
parsed = Url.conform("http://google.com") # type:ParseResult
assert parsed.scheme == "http"
| {"/spec/impl/iterables.py": ["/spec/impl/core.py"], "/tests/spec/test_core.py": ["/spec/core.py", "/spec/impl/core.py", "/tests/spec/support.py"], "/spec/impl/specs.py": ["/spec/impl/core.py", "/spec/impl/util/strings.py"], "/spec/impl/records/core.py": ["/spec/core.py", "/spec/impl/dicts.py", "/spec/impl/records/annot... |
30,065 | dagron/pyspec | refs/heads/master | /spec/impl/core.py | from abc import ABCMeta, abstractmethod
from pprint import pformat
from typing import Callable, Union, List, Iterable, Set, NamedTuple, Dict
from typing import Tuple
from spec.impl.util.callables import can_be_called_with_one_argument
class Invalid:
def __str__(self, *args, **kwargs):
return repr(self)
... | {"/spec/impl/iterables.py": ["/spec/impl/core.py"], "/tests/spec/test_core.py": ["/spec/core.py", "/spec/impl/core.py", "/tests/spec/support.py"], "/spec/impl/specs.py": ["/spec/impl/core.py", "/spec/impl/util/strings.py"], "/spec/impl/records/core.py": ["/spec/core.py", "/spec/impl/dicts.py", "/spec/impl/records/annot... |
30,066 | dagron/pyspec | refs/heads/master | /tests/spec/test_records.py | import pytest
from typing import List, Optional, TypeVar, Generic, Any, ClassVar
from spec.core import assert_spec
from spec.impl.core import SpecError
from spec.impl.records.core import spec_from, Record
def check_spec_error(s, value, expected_error_text):
try:
assert_spec(s, value)
assert False... | {"/spec/impl/iterables.py": ["/spec/impl/core.py"], "/tests/spec/test_core.py": ["/spec/core.py", "/spec/impl/core.py", "/tests/spec/support.py"], "/spec/impl/specs.py": ["/spec/impl/core.py", "/spec/impl/util/strings.py"], "/spec/impl/records/core.py": ["/spec/core.py", "/spec/impl/dicts.py", "/spec/impl/records/annot... |
30,067 | dagron/pyspec | refs/heads/master | /tests/spec/test_dict.py | from uuid import UUID
import spec.coercions as sc
from spec.core import equal_to, in_range, dict_spec, dict_example
from spec.impl.core import Problem, path
from tests.spec.support import check_spec
def test_dict_example_treats_values_as_equal_to_spec():
expected_value = UUID('80b71e04-9862-462b-ac0c-0c34dc272c7... | {"/spec/impl/iterables.py": ["/spec/impl/core.py"], "/tests/spec/test_core.py": ["/spec/core.py", "/spec/impl/core.py", "/tests/spec/support.py"], "/spec/impl/specs.py": ["/spec/impl/core.py", "/spec/impl/util/strings.py"], "/spec/impl/records/core.py": ["/spec/core.py", "/spec/impl/dicts.py", "/spec/impl/records/annot... |
30,068 | dagron/pyspec | refs/heads/master | /tests/spec/support.py | from typing import Optional, Iterable
from spec.core import conform, explain_data, INVALID, specize, Speccable
from spec.impl.core import Problem, path, Explanation
UNDEFINED = object()
def check_spec(s: Speccable,
value: object,
expected_problems: Optional[Iterable[Problem]] = None,
... | {"/spec/impl/iterables.py": ["/spec/impl/core.py"], "/tests/spec/test_core.py": ["/spec/core.py", "/spec/impl/core.py", "/tests/spec/support.py"], "/spec/impl/specs.py": ["/spec/impl/core.py", "/spec/impl/util/strings.py"], "/spec/impl/records/core.py": ["/spec/core.py", "/spec/impl/dicts.py", "/spec/impl/records/annot... |
30,069 | dagron/pyspec | refs/heads/master | /spec/impl/dicts.py | import pprint
from typing import Dict, List
from spec.impl.core import Spec, SpecResult, Path, Problem, path, INVALID, isinvalid
from spec.impl.specs import EqualTo
def isspec(x: object):
return isinstance(x, Spec)
def _value_spec(possibly_a_spec):
if isspec(possibly_a_spec):
return possibly_a_spec... | {"/spec/impl/iterables.py": ["/spec/impl/core.py"], "/tests/spec/test_core.py": ["/spec/core.py", "/spec/impl/core.py", "/tests/spec/support.py"], "/spec/impl/specs.py": ["/spec/impl/core.py", "/spec/impl/util/strings.py"], "/spec/impl/records/core.py": ["/spec/core.py", "/spec/impl/dicts.py", "/spec/impl/records/annot... |
30,102 | jingl3s/domoticz_hydroquebec | refs/heads/master | /common/configuration_loader.py | #-*-coding:utf8;-*-
# qpy:3
'''
@author: 2017 jingl3s at yopmail dot com
'''
# license
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE (see the file
# LICENSE included with the distribution).
import json
import os
import s... | {"/hydroquebec.py": ["/common/configuration_loader.py", "/common/logger_config.py"]} |
30,103 | jingl3s/domoticz_hydroquebec | refs/heads/master | /common/logger_config.py | #-*-coding:utf8;-*-
# qpy:3
'''
@author: 2017 jingl3s at yopmail dot com
'''
# license
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE (see the file
# LICENSE included with the distribution).
import os
# import time
import... | {"/hydroquebec.py": ["/common/configuration_loader.py", "/common/logger_config.py"]} |
30,104 | jingl3s/domoticz_hydroquebec | refs/heads/master | /hydroquebec.py | #!/usr/bin/python3
# -*- coding: latin-1 -*-
'''
@author: 2017 jingl3s at yopmail dot com
'''
# license
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE (see the file
# LICENSE included with the distribution).
from datetime ... | {"/hydroquebec.py": ["/common/configuration_loader.py", "/common/logger_config.py"]} |
30,105 | ckrapu/rwfmm | refs/heads/master | /models.py | import pymc3 as pm
import numpy as np
import scipy as sp
import theano.tensor as tt
import patsy as p
import utilities
def cross_validate_rwfmm(rwfmm_args,rwfmm_kwargs,param_for_tuning,tuning_set,criterion='LOO'):
model_dict = {}
trace_list = []
for param_val in tuning_set:
modified_kwargs = rwf... | {"/models.py": ["/utilities.py"]} |
30,106 | ckrapu/rwfmm | refs/heads/master | /setup.py | from setuptools import setup
setup(
name='rwfmm',
version='0.1',
description='Code for random-walk functional mixed model',
author='Christopher Krapu',
author_email='ckrapu@gmail.com',
py_modules=["models",'utilities'],
install_requires=['theano','numpy','pymc3','matplotlib','pandas']
)
| {"/models.py": ["/utilities.py"]} |
30,107 | ckrapu/rwfmm | refs/heads/master | /utilities.py | import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
import numpy as np
import pandas as pd
import theano
import theano.tensor as tt
theano.config.compute_test_value = 'ignore'
def ar1(beta,sd,length):
'''Creates a realization of a AR(1) process with autoregresssion
coefficient 'beta', a ju... | {"/models.py": ["/utilities.py"]} |
30,112 | Valrvn/Butler-Bot | refs/heads/main | /fun_zone_bot.py | #fun_zone_bot.py
import os
import random
import xlrd #Excel File read library for Rules of Acquisition
from google_images_search import GoogleImagesSearch #Google Images API
import discord
#Apig routine
async def apig_message(message):
if '... | {"/bot.py": ["/fun_zone_bot.py", "/moderation_zone_bot.py", "/embed_routine.py"]} |
30,113 | Valrvn/Butler-Bot | refs/heads/main | /bot.py | # bot.py
import fun_zone_bot as fzb #Fun Zone implementations for the bot
import moderation_zone_bot as mzb #Moderation Zonde implementations for the bot
import embed_routine as ezb #Embed-based-communication
... | {"/bot.py": ["/fun_zone_bot.py", "/moderation_zone_bot.py", "/embed_routine.py"]} |
30,114 | Valrvn/Butler-Bot | refs/heads/main | /embed_routine.py | import discord
#API for this functionality
#To be called for a Message that is the !start command
async def start(message):
if '!start' == message.content.lower():
sessionMessage = await message.channel.send(embed = await embed_selector("start"))
for r in await embed_reaction_selector("start... | {"/bot.py": ["/fun_zone_bot.py", "/moderation_zone_bot.py", "/embed_routine.py"]} |
30,115 | Valrvn/Butler-Bot | refs/heads/main | /moderation_zone_bot.py | #moderation_zone_bot.py
#Fine-tuned method to copy all new messages from a certain message channel to another channel
#In the UPIG server:
#copy all new messages from #rules (team zone) to #rules (member zone)
async def copy_new_message_to_channel(message):
id_from = 698422697100574770 #rules (team zone)... | {"/bot.py": ["/fun_zone_bot.py", "/moderation_zone_bot.py", "/embed_routine.py"]} |
30,124 | yanqiangmiffy/bank-marketing | refs/heads/master | /ensemble_mean.py | # !/usr/bin/env python
# -*- coding:utf-8 _*-
"""
@Author:yanqiang
@File: ensemble_mean.py
@Time: 2018/11/9 16:59
@Software: PyCharm
@Description:
"""
import pandas as pd
import numpy as np
from sklearn.naive_bayes import GaussianNB
from sklearn.svm import SVC, LinearSVC
from sklearn.neighbors import KNeighbor... | {"/ensemble_mean.py": ["/main.py"]} |
30,125 | yanqiangmiffy/bank-marketing | refs/heads/master | /main.py | # !/usr/bin/env python
# -*- coding:utf-8 _*-
"""
@Author:yanqiang
@File: main.py
@Time: 2018/11/5 17:11
@Software: PyCharm
@Description:
"""
import gc # 垃圾回收
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.preprocessing import LabelEncoder
from sklearn.... | {"/ensemble_mean.py": ["/main.py"]} |
30,168 | igornfaustino/APS_Grafos | refs/heads/master | /get_data_api.py | import anapioficeandfire
import json
import re
api = anapioficeandfire.API()
books = api.get_books()
data = []
# Get all books
for book in books:
# Get data of all characters in the book
for character in book.characters:
# get the character ID
characterId = re.search(r'(\d+)$', character).g... | {"/main.py": ["/get_data.py", "/graph.py"]} |
30,169 | igornfaustino/APS_Grafos | refs/heads/master | /get_data.py | import json
def get_data():
with open('data.json') as json_file:
data = json.load(json_file)
return data
| {"/main.py": ["/get_data.py", "/graph.py"]} |
30,170 | igornfaustino/APS_Grafos | refs/heads/master | /main.py | import get_data
import graph
import copy
gp = graph.Graph(directed=True)
characters = get_data.get_data()
characters_valid = []
house_allegiances = {}
for character in characters:
if (character['name']):
# if("Season 6" in character['tvSeries']):
characters_valid.append(character)
... | {"/main.py": ["/get_data.py", "/graph.py"]} |
30,171 | igornfaustino/APS_Grafos | refs/heads/master | /graph.py | '''
Graph Class
'''
import queue
import vertex
import edge
import graph_utils
class Graph(object):
"""Class to store a edges's array and a vertex's dictionary"""
def __init__(self, directed=False):
"""create a object graph
directed (bool, optional): Defaults to False.
... | {"/main.py": ["/get_data.py", "/graph.py"]} |
30,172 | mamerisawesome/gyakujinton | refs/heads/master | /gyakujinton/Shape/Shape.py | class Shape():
def __new__(cls, points):
import numpy as np
return np.array([points], np.int32)
| {"/gyakujinton/Shape/__init__.py": ["/gyakujinton/Shape/Shape.py"], "/gyakujinton/__init__.py": ["/gyakujinton/functions/draw.py", "/gyakujinton/functions/skew.py"], "/gyakujinton/cli.py": ["/gyakujinton/functions/draw.py", "/gyakujinton/functions/skew.py"], "/gyakujinton/functions/draw.py": ["/gyakujinton/Shape/__init... |
30,173 | mamerisawesome/gyakujinton | refs/heads/master | /gyakujinton/functions/rotate.py | import cv2
from gyakujinton.Window import Window
def rotate_image(
image_path,
output_path=None,
angle=40,
scale=1.0,
patch=None
):
image = Window(image_path=image_path)
(height, width, _) = image.window.shape
if patch is None:
patch = [
[0, 0],
[0, hei... | {"/gyakujinton/Shape/__init__.py": ["/gyakujinton/Shape/Shape.py"], "/gyakujinton/__init__.py": ["/gyakujinton/functions/draw.py", "/gyakujinton/functions/skew.py"], "/gyakujinton/cli.py": ["/gyakujinton/functions/draw.py", "/gyakujinton/functions/skew.py"], "/gyakujinton/functions/draw.py": ["/gyakujinton/Shape/__init... |
30,174 | mamerisawesome/gyakujinton | refs/heads/master | /gyakujinton/Shape/__init__.py | from .Shape import Shape
| {"/gyakujinton/Shape/__init__.py": ["/gyakujinton/Shape/Shape.py"], "/gyakujinton/__init__.py": ["/gyakujinton/functions/draw.py", "/gyakujinton/functions/skew.py"], "/gyakujinton/cli.py": ["/gyakujinton/functions/draw.py", "/gyakujinton/functions/skew.py"], "/gyakujinton/functions/draw.py": ["/gyakujinton/Shape/__init... |
30,175 | mamerisawesome/gyakujinton | refs/heads/master | /gyakujinton/__init__.py | from .functions.draw import generate_superimposition
from .functions.draw import draw_on_image
from .functions.skew import skew_image
| {"/gyakujinton/Shape/__init__.py": ["/gyakujinton/Shape/Shape.py"], "/gyakujinton/__init__.py": ["/gyakujinton/functions/draw.py", "/gyakujinton/functions/skew.py"], "/gyakujinton/cli.py": ["/gyakujinton/functions/draw.py", "/gyakujinton/functions/skew.py"], "/gyakujinton/functions/draw.py": ["/gyakujinton/Shape/__init... |
30,176 | mamerisawesome/gyakujinton | refs/heads/master | /gyakujinton/Window/Window.py | import cv2
import numpy as np
class Window():
def __init__(
self,
name="Gyaku Jinton",
width=512,
height=512,
image_path=None
):
self.name = name
if not image_path:
dims = (height, width, 3)
self.window = np.zeros(dims, dtype="ui... | {"/gyakujinton/Shape/__init__.py": ["/gyakujinton/Shape/Shape.py"], "/gyakujinton/__init__.py": ["/gyakujinton/functions/draw.py", "/gyakujinton/functions/skew.py"], "/gyakujinton/cli.py": ["/gyakujinton/functions/draw.py", "/gyakujinton/functions/skew.py"], "/gyakujinton/functions/draw.py": ["/gyakujinton/Shape/__init... |
30,177 | mamerisawesome/gyakujinton | refs/heads/master | /gyakujinton/functions/skew.py | import numpy as np
import cv2
from gyakujinton.Window import Window
def skew_image(image_path, output_path=None, patch=None):
import random
image = Window(image_path=image_path)
if patch is not None:
image.window = image.window[
patch[0][1]: patch[1][1],
patch[0][0]: patc... | {"/gyakujinton/Shape/__init__.py": ["/gyakujinton/Shape/Shape.py"], "/gyakujinton/__init__.py": ["/gyakujinton/functions/draw.py", "/gyakujinton/functions/skew.py"], "/gyakujinton/cli.py": ["/gyakujinton/functions/draw.py", "/gyakujinton/functions/skew.py"], "/gyakujinton/functions/draw.py": ["/gyakujinton/Shape/__init... |
30,178 | mamerisawesome/gyakujinton | refs/heads/master | /gyakujinton/cli.py | import argparse
import sys
def cli():
commands = {
"draw_on_image": shape_on_image,
"distort": skew_image,
"batch_distort": batch_skew,
}
options = {
"prog": "gyakujinton",
"usage": '%(prog)s [options]',
"description": "OpenCV wrapper to handle shapes and i... | {"/gyakujinton/Shape/__init__.py": ["/gyakujinton/Shape/Shape.py"], "/gyakujinton/__init__.py": ["/gyakujinton/functions/draw.py", "/gyakujinton/functions/skew.py"], "/gyakujinton/cli.py": ["/gyakujinton/functions/draw.py", "/gyakujinton/functions/skew.py"], "/gyakujinton/functions/draw.py": ["/gyakujinton/Shape/__init... |
30,179 | mamerisawesome/gyakujinton | refs/heads/master | /gyakujinton/functions/draw.py | from gyakujinton.Window import Window
from gyakujinton.Shape import Shape
def draw_on_image(image_path, points, output_path=None, color=(20, 100, 20)):
from pathlib import Path
if not Path(image_path).is_file():
raise FileNotFoundError(
"The path `{}` is not valid".format(image_path)
... | {"/gyakujinton/Shape/__init__.py": ["/gyakujinton/Shape/Shape.py"], "/gyakujinton/__init__.py": ["/gyakujinton/functions/draw.py", "/gyakujinton/functions/skew.py"], "/gyakujinton/cli.py": ["/gyakujinton/functions/draw.py", "/gyakujinton/functions/skew.py"], "/gyakujinton/functions/draw.py": ["/gyakujinton/Shape/__init... |
30,184 | Khayel/qPost | refs/heads/main | /qpost/views.py | from flask import render_template, url_for, request, session, redirect, jsonify
from flask.blueprints import Blueprint
from .db_funcs import *
from .decorators import login_required, teacher_required
from http import HTTPStatus
views = Blueprint('views', __name__)
@views.route('/')
@login_required
def index():
"... | {"/qpost/views.py": ["/qpost/db_funcs.py", "/qpost/decorators.py"], "/qpost/db_funcs.py": ["/qpost/questions.py"], "/qpost/app.py": ["/qpost/login.py"], "/qpost/__init__.py": ["/qpost/views.py"], "/qpost/login.py": ["/qpost/questions.py"], "/qpost/api.py": ["/qpost/login.py"]} |
30,185 | Khayel/qPost | refs/heads/main | /qpost/questions.py | class Question(dict):
"""
Extended dict for questions
{ 'q_id': '1',
'user_id': '2',
'question': 'What is a number between 1 and 3?',
'answer': [(answer, a_id, is_answer)]
answer - answer string
a_id - answer unique id
is_answer - true if the an... | {"/qpost/views.py": ["/qpost/db_funcs.py", "/qpost/decorators.py"], "/qpost/db_funcs.py": ["/qpost/questions.py"], "/qpost/app.py": ["/qpost/login.py"], "/qpost/__init__.py": ["/qpost/views.py"], "/qpost/login.py": ["/qpost/questions.py"], "/qpost/api.py": ["/qpost/login.py"]} |
30,186 | Khayel/qPost | refs/heads/main | /qpost/db_funcs.py | from config import CONNECTION_CONFIG
import mysql.connector
from mysql.connector import errorcode
from .questions import Question
import hashlib
import copy
import os
def select_query(query_string, *q_vars):
"""Helper function for SELECT statements.
Takes query string and tuple q_vars for values in query
... | {"/qpost/views.py": ["/qpost/db_funcs.py", "/qpost/decorators.py"], "/qpost/db_funcs.py": ["/qpost/questions.py"], "/qpost/app.py": ["/qpost/login.py"], "/qpost/__init__.py": ["/qpost/views.py"], "/qpost/login.py": ["/qpost/questions.py"], "/qpost/api.py": ["/qpost/login.py"]} |
30,187 | Khayel/qPost | refs/heads/main | /qpost/app.py | from flask import Flask, render_template, url_for, request, session
from flask_restful import Resource, Api
from .login import verify_login, create_user, select_query
class loginAction(Resource):
def post(self):
status = verify_login(request.form.get('username'),
request.form... | {"/qpost/views.py": ["/qpost/db_funcs.py", "/qpost/decorators.py"], "/qpost/db_funcs.py": ["/qpost/questions.py"], "/qpost/app.py": ["/qpost/login.py"], "/qpost/__init__.py": ["/qpost/views.py"], "/qpost/login.py": ["/qpost/questions.py"], "/qpost/api.py": ["/qpost/login.py"]} |
30,188 | Khayel/qPost | refs/heads/main | /qpost/__init__.py | from flask import Flask
from .views import views
def create_app():
"""
Create Flask object and register views
.views contains endpoints
.api contains api calls used
"""
app = Flask(__name__)
app.config.from_object('config')
app.register_blueprint(views)
return app
| {"/qpost/views.py": ["/qpost/db_funcs.py", "/qpost/decorators.py"], "/qpost/db_funcs.py": ["/qpost/questions.py"], "/qpost/app.py": ["/qpost/login.py"], "/qpost/__init__.py": ["/qpost/views.py"], "/qpost/login.py": ["/qpost/questions.py"], "/qpost/api.py": ["/qpost/login.py"]} |
30,189 | Khayel/qPost | refs/heads/main | /qpost/decorators.py | from functools import wraps
from flask import redirect, session, url_for
def login_required(f):
"""
Decorator function to verify login session of a user
"""
@wraps(f)
def decorated_function(*args, **kwargs):
print("LOGIN REQUIRED CHECK")
if 'username' not in session or 'user_id' n... | {"/qpost/views.py": ["/qpost/db_funcs.py", "/qpost/decorators.py"], "/qpost/db_funcs.py": ["/qpost/questions.py"], "/qpost/app.py": ["/qpost/login.py"], "/qpost/__init__.py": ["/qpost/views.py"], "/qpost/login.py": ["/qpost/questions.py"], "/qpost/api.py": ["/qpost/login.py"]} |
30,196 | ollyjc99/Cards | refs/heads/master | /bus.py | import pygame
import random
def setup(win, bus_len):
w, h = win.get_size()
card_width = round(w*.098)
card_height = round(h*.167)
x_spacing = round(w-(card_width * bus_len))
x_bord = 242
x_btwn = 10
y = round((h // 2) - card_height / 2)
grid = [[x, y] for x in range(x_bord, w-x_bor... | {"/main.py": ["/pairs.py", "/bus.py", "/sandbox.py", "/pattern_gen.py", "/cards.py"], "/sandbox.py": ["/cards.py", "/misc.py"], "/pairs.py": ["/misc.py"]} |
30,197 | ollyjc99/Cards | refs/heads/master | /main.py | from pairs import *
from bus import bus
from sandbox import sandbox
import pattern_gen
from cards import *
def setup(win):
suits = ['spades', 'clubs', 'diamonds', 'hearts']
faces = ['A', '2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K']
list_of_cards = [[face, suit] for face in faces for suit i... | {"/main.py": ["/pairs.py", "/bus.py", "/sandbox.py", "/pattern_gen.py", "/cards.py"], "/sandbox.py": ["/cards.py", "/misc.py"], "/pairs.py": ["/misc.py"]} |
30,198 | ollyjc99/Cards | refs/heads/master | /sandbox.py | import pygame
import random
import time
from cards import *
from misc import *
def setup(win, deck):
w, h = win.get_size()
card_width = round(w*.098)
card_height = round(h*.167)
for card in deck.cards:
card.width = card_width
card.height = card_height
def sandbox(w, h, deck, clock)... | {"/main.py": ["/pairs.py", "/bus.py", "/sandbox.py", "/pattern_gen.py", "/cards.py"], "/sandbox.py": ["/cards.py", "/misc.py"], "/pairs.py": ["/misc.py"]} |
30,199 | ollyjc99/Cards | refs/heads/master | /pattern_gen.py | import os
import pygame
import random
from PIL import Image, ImageDraw, ImageFont, ImageEnhance
def main():
faces = ['A','2','3','4','5','6','7','8','9','10','J','Q','K']
suits = ['hearts','diamonds','spades','clubs']
for suit in suits:
for face in faces:
template = Image.open('static... | {"/main.py": ["/pairs.py", "/bus.py", "/sandbox.py", "/pattern_gen.py", "/cards.py"], "/sandbox.py": ["/cards.py", "/misc.py"], "/pairs.py": ["/misc.py"]} |
30,200 | ollyjc99/Cards | refs/heads/master | /pairs.py | import pygame
import random
from misc import *
def setup(win, deck):
width, height = win.get_size()
card_width = round(width*.07)
card_height = round(height*.15)
x_spacing = width-(card_width*13)
x_bord = round((x_spacing*.33) / 2)
x_btwn = round((x_spacing*.66) / 13)
y_spacing = height... | {"/main.py": ["/pairs.py", "/bus.py", "/sandbox.py", "/pattern_gen.py", "/cards.py"], "/sandbox.py": ["/cards.py", "/misc.py"], "/pairs.py": ["/misc.py"]} |
30,201 | ollyjc99/Cards | refs/heads/master | /cards.py | import pygame
import time
from threading import Thread
class Deck(object):
def __init__(self, win, cards):
self.win = win
self.x = 0
self.y = 0
self.cards = cards
self.image = pygame.image.load('static/img/template/deck.png')
self.rect = self.image.get_rect(x=self.x... | {"/main.py": ["/pairs.py", "/bus.py", "/sandbox.py", "/pattern_gen.py", "/cards.py"], "/sandbox.py": ["/cards.py", "/misc.py"], "/pairs.py": ["/misc.py"]} |
30,202 | ollyjc99/Cards | refs/heads/master | /test.py | from threading import Thread
class Test(Thread):
def __init__(self, no):
Thread.__init__(self)
self.daemon = True
self.no = no
self.start()
def run(self):
while True:
self.no += 1
print(self.no)
def main():
number = 10
test = Test(numb... | {"/main.py": ["/pairs.py", "/bus.py", "/sandbox.py", "/pattern_gen.py", "/cards.py"], "/sandbox.py": ["/cards.py", "/misc.py"], "/pairs.py": ["/misc.py"]} |
30,203 | ollyjc99/Cards | refs/heads/master | /misc.py | def card_check(card, pos):
if card.image.get_rect(x=card.rect.x, y=card.rect.y).collidepoint(pos):
return True
else:
return False
def flip(card):
card.flipped = not card.flipped
card.image = card.flip()
| {"/main.py": ["/pairs.py", "/bus.py", "/sandbox.py", "/pattern_gen.py", "/cards.py"], "/sandbox.py": ["/cards.py", "/misc.py"], "/pairs.py": ["/misc.py"]} |
30,206 | zhaohuilong0808/apiTestIHRM | refs/heads/master | /weidaima.py | # 员工管理模块登录
import requests
# 发送登录接口
response = requests.post(url="http://ihrm-test.itheima.net/api/sys/login",
json={"mobile": "13800000002", "password": "123456"},
headers={"Content-Type": "application/json"})
# 查看登录结果
print("登录结果为: ", response.json())
| {"/scrpt/test_ihrm_employee.py": ["/app.py", "/utils.py", "/api/employee_api.py"], "/api/__init__.py": ["/utils.py"], "/scrpt/test_ihrm_login.py": ["/utils.py"], "/run_suite.py": ["/app.py"], "/utils.py": ["/app.py"]} |
30,207 | zhaohuilong0808/apiTestIHRM | refs/heads/master | /scrpt/test_ihrm_employee.py | # 导包
import unittest, logging, app
from utils import assert_common
from api.ihrm_login_api import LoginApi
from api.employee_api import EmployeeApi
# 创建测试类
class TestIHRMEmployee(unittest.TestCase):
def setUp(self) -> None:
# 实例化登录
self.login_api = LoginApi()
# 实例化员工
self.emp_api =... | {"/scrpt/test_ihrm_employee.py": ["/app.py", "/utils.py", "/api/employee_api.py"], "/api/__init__.py": ["/utils.py"], "/scrpt/test_ihrm_login.py": ["/utils.py"], "/run_suite.py": ["/app.py"], "/utils.py": ["/app.py"]} |
30,208 | zhaohuilong0808/apiTestIHRM | refs/heads/master | /api/__init__.py | # 初始化日志
import logging
import utils
utils.init_loging()
logging.info("打印日志")
| {"/scrpt/test_ihrm_employee.py": ["/app.py", "/utils.py", "/api/employee_api.py"], "/api/__init__.py": ["/utils.py"], "/scrpt/test_ihrm_login.py": ["/utils.py"], "/run_suite.py": ["/app.py"], "/utils.py": ["/app.py"]} |
30,209 | zhaohuilong0808/apiTestIHRM | refs/heads/master | /scrpt/test_ihrm_login.py | # 导包
import unittest, logging
from api.ihrm_login_api import LoginApi
from utils import assert_common
# 创建类
class TestLHRMLogin(unittest.TestCase):
# 进行初始化
def setUp(self) -> None:
self.login_api = LoginApi()
def tearDown(self) -> None:
pass
# 编写函数
# 1.登录成功
def test01_login... | {"/scrpt/test_ihrm_employee.py": ["/app.py", "/utils.py", "/api/employee_api.py"], "/api/__init__.py": ["/utils.py"], "/scrpt/test_ihrm_login.py": ["/utils.py"], "/run_suite.py": ["/app.py"], "/utils.py": ["/app.py"]} |
30,210 | zhaohuilong0808/apiTestIHRM | refs/heads/master | /app.py | # 导入os模块
import os
# 定义全局变量BASE_DIR,通过BASR_DIR定位到项目根目录
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
# 定义请求头
HEADERS = None
# 定义员ID
EMP_ID = None | {"/scrpt/test_ihrm_employee.py": ["/app.py", "/utils.py", "/api/employee_api.py"], "/api/__init__.py": ["/utils.py"], "/scrpt/test_ihrm_login.py": ["/utils.py"], "/run_suite.py": ["/app.py"], "/utils.py": ["/app.py"]} |
30,211 | zhaohuilong0808/apiTestIHRM | refs/heads/master | /weidaima_emp.py | # 导包
import requests
# 发送登录请求
response = requests.post(url="http://ihrm-test.itheima.net/api/sys/login",
json={"mobile": "13800000002", "password": "123456"},
headers={"Content-Type": "application/json"})
# 打印登录结果
print("登录结果为: ", response.json())
# 提取登录返回的令牌
token = "... | {"/scrpt/test_ihrm_employee.py": ["/app.py", "/utils.py", "/api/employee_api.py"], "/api/__init__.py": ["/utils.py"], "/scrpt/test_ihrm_login.py": ["/utils.py"], "/run_suite.py": ["/app.py"], "/utils.py": ["/app.py"]} |
30,212 | zhaohuilong0808/apiTestIHRM | refs/heads/master | /run_suite.py | # 1.导包
import time
import unittest
from app import BASE_DIR
from BeautifulReport import BeautifulReport
# 2.组织测试套件
suite = unittest.TestLoader().discover(BASE_DIR + "/scrpt", "*csh.py")
# 3.定义测试报告文件名
report_file = "IHRM".format()
# 4.使用BeautifulReport批量运行用例生成测试报告
BeautifulReport(suite).report(filename=report_fi... | {"/scrpt/test_ihrm_employee.py": ["/app.py", "/utils.py", "/api/employee_api.py"], "/api/__init__.py": ["/utils.py"], "/scrpt/test_ihrm_login.py": ["/utils.py"], "/run_suite.py": ["/app.py"], "/utils.py": ["/app.py"]} |
30,213 | zhaohuilong0808/apiTestIHRM | refs/heads/master | /api/employee_api.py | # 导包
import requests
# 创建封装员工类
class EmployeeApi:
def __init__(self):
# 定义员工模块url
self.emp_url = "http://ihrm-test.itheima.net/api/sys/user/"
def add_emp(self, username, mobile, headers):
jsonData = {
"username": username,
"mobile": mobile,
"timeOf... | {"/scrpt/test_ihrm_employee.py": ["/app.py", "/utils.py", "/api/employee_api.py"], "/api/__init__.py": ["/utils.py"], "/scrpt/test_ihrm_login.py": ["/utils.py"], "/run_suite.py": ["/app.py"], "/utils.py": ["/app.py"]} |
30,214 | zhaohuilong0808/apiTestIHRM | refs/heads/master | /utils.py | # 导包
import json
import app
import logging
from logging import handlers
# 编写初始化日志代码
# 定义一个初始化日志函数
def init_loging():
# 在函数中,设置日志器
logger = logging.getLogger()
# 设置日志等级
logger.setLevel(logging.INFO)
# 设置日志台处理器
sh = logging.StreamHandler()
# 设置文件处理器
log_path = app.BASE_DIR + "/log/ih... | {"/scrpt/test_ihrm_employee.py": ["/app.py", "/utils.py", "/api/employee_api.py"], "/api/__init__.py": ["/utils.py"], "/scrpt/test_ihrm_login.py": ["/utils.py"], "/run_suite.py": ["/app.py"], "/utils.py": ["/app.py"]} |
30,215 | ysuurme/game_snakebattle | refs/heads/master | /snakebattle/snack.py | from .config import COLORS, SNACK
class Snack:
def __init__(self, x, y, color=COLORS['WHITE']):
self.x = x # x position in the game 'grid'
self.y = y # y position in the game 'grid'
self.color = color
self.image = SNACK
| {"/snakebattle/snack.py": ["/snakebattle/config.py"], "/snakebattle/game.py": ["/snakebattle/config.py", "/snakebattle/snake.py", "/snakebattle/snack.py"], "/main.py": ["/snakebattle/config.py", "/snakebattle/game.py"], "/snakebattle/snake.py": ["/snakebattle/config.py"]} |
30,216 | ysuurme/game_snakebattle | refs/heads/master | /snakebattle/game.py | import pygame
import random
from .config import QUIT, BACKGROUND, COLS, ROWS, WIDTH, HEIGHT, SQ_SIZE, COLORS, FONT_SCORE, FONT_WINNER,\
SOUND_MUNCH, SOUND_HIT
from .snake import Player1, Player2
from .snack import Snack
class Game:
def __init__(self, win):
self.win = win
self.game_over = Fals... | {"/snakebattle/snack.py": ["/snakebattle/config.py"], "/snakebattle/game.py": ["/snakebattle/config.py", "/snakebattle/snake.py", "/snakebattle/snack.py"], "/main.py": ["/snakebattle/config.py", "/snakebattle/game.py"], "/snakebattle/snake.py": ["/snakebattle/config.py"]} |
30,217 | ysuurme/game_snakebattle | refs/heads/master | /main.py | import pygame
import sys
from snakebattle.config import QUIT, WIDTH, HEIGHT, DELAY, FPS
from snakebattle.game import Game
def init_game():
win = pygame.display.set_mode((WIDTH, HEIGHT))
pygame.display.set_caption('Snake Battle!') # todo implement AI
game = Game(win)
return game
def run(game):
... | {"/snakebattle/snack.py": ["/snakebattle/config.py"], "/snakebattle/game.py": ["/snakebattle/config.py", "/snakebattle/snake.py", "/snakebattle/snack.py"], "/main.py": ["/snakebattle/config.py", "/snakebattle/game.py"], "/snakebattle/snake.py": ["/snakebattle/config.py"]} |
30,218 | ysuurme/game_snakebattle | refs/heads/master | /snakebattle/config.py | # Configuration file holding constant values used throughout the project.
import pygame
pygame.font.init()
pygame.mixer.init()
# pygame window:
SQ_SIZE = 25
ROWS, COLS = 25, 25
WIDTH, HEIGHT = COLS*SQ_SIZE, ROWS*SQ_SIZE
DELAY = 50 # game delay in ms, hence a higher value is a slower gameplay
FPS = 10 # game frames p... | {"/snakebattle/snack.py": ["/snakebattle/config.py"], "/snakebattle/game.py": ["/snakebattle/config.py", "/snakebattle/snake.py", "/snakebattle/snack.py"], "/main.py": ["/snakebattle/config.py", "/snakebattle/game.py"], "/snakebattle/snake.py": ["/snakebattle/config.py"]} |
30,219 | ysuurme/game_snakebattle | refs/heads/master | /snakebattle/snake.py | from snakebattle.config import COLORS, COLOR_P1, COLOR_P2, ROWS, COLS
class Snake:
def __init__(self):
self.color = None
self.head = None
self.length = 1
self.body = []
self.dir = (0, 0)
def move_snake_body(self):
x = self.head.x
y = self.head.y
... | {"/snakebattle/snack.py": ["/snakebattle/config.py"], "/snakebattle/game.py": ["/snakebattle/config.py", "/snakebattle/snake.py", "/snakebattle/snack.py"], "/main.py": ["/snakebattle/config.py", "/snakebattle/game.py"], "/snakebattle/snake.py": ["/snakebattle/config.py"]} |
30,220 | kirankh7/clean_flask_app | refs/heads/master | /app/diag/diag.py | # import boto3
from flask import render_template
import boto.utils
import boto.ec2
from . import diag
import requests
@diag.route('/diag')
def diagnose_metrics():
data = boto.utils.get_instance_identity()
region_name = data['document']['region']
conn = boto.ec2.connect_to_region(region_name)
count = 0
... | {"/app/diag/diag.py": ["/app/diag/__init__.py"], "/app/hello/hello.py": ["/app/hello/__init__.py", "/app/models.py"], "/app/health/health.py": ["/app/models.py", "/app/health/__init__.py"], "/app/__init__.py": ["/app/config.py", "/app/models.py", "/app/hello/hello.py", "/app/health/health.py", "/app/diag/diag.py"], "/a... |
30,221 | kirankh7/clean_flask_app | refs/heads/master | /app/hello/__init__.py | from flask import Blueprint
hello = Blueprint('hello', __name__)
| {"/app/diag/diag.py": ["/app/diag/__init__.py"], "/app/hello/hello.py": ["/app/hello/__init__.py", "/app/models.py"], "/app/health/health.py": ["/app/models.py", "/app/health/__init__.py"], "/app/__init__.py": ["/app/config.py", "/app/models.py", "/app/hello/hello.py", "/app/health/health.py", "/app/diag/diag.py"], "/a... |
30,222 | kirankh7/clean_flask_app | refs/heads/master | /app/health/__init__.py | from flask import Blueprint
health = Blueprint('health', __name__)
| {"/app/diag/diag.py": ["/app/diag/__init__.py"], "/app/hello/hello.py": ["/app/hello/__init__.py", "/app/models.py"], "/app/health/health.py": ["/app/models.py", "/app/health/__init__.py"], "/app/__init__.py": ["/app/config.py", "/app/models.py", "/app/hello/hello.py", "/app/health/health.py", "/app/diag/diag.py"], "/a... |
30,223 | kirankh7/clean_flask_app | refs/heads/master | /app/config.py | import json
import os
basedir = os.path.abspath(os.path.dirname(__file__))
with open('./config.json') as config_file:
config = json.load(config_file)
class Config:
# DB Connection settings
SQLALCHEMY_TRACK_MODIFICATIONS = False
SECRET_KEY = "someshabasednumberlkira"
# SQLALCHEMY_DATABASE_URI = co... | {"/app/diag/diag.py": ["/app/diag/__init__.py"], "/app/hello/hello.py": ["/app/hello/__init__.py", "/app/models.py"], "/app/health/health.py": ["/app/models.py", "/app/health/__init__.py"], "/app/__init__.py": ["/app/config.py", "/app/models.py", "/app/hello/hello.py", "/app/health/health.py", "/app/diag/diag.py"], "/a... |
30,224 | kirankh7/clean_flask_app | refs/heads/master | /app/hello/hello.py | from flask import render_template,request, current_app
from datetime import datetime
import pytz
from . import hello
from ..models import DatabaseTables,db
from random import randint
# First / root of the flask app
@hello.route('/')
def hello_world():
message = "Hello World! {}".format(get_pst_time())
im... | {"/app/diag/diag.py": ["/app/diag/__init__.py"], "/app/hello/hello.py": ["/app/hello/__init__.py", "/app/models.py"], "/app/health/health.py": ["/app/models.py", "/app/health/__init__.py"], "/app/__init__.py": ["/app/config.py", "/app/models.py", "/app/hello/hello.py", "/app/health/health.py", "/app/diag/diag.py"], "/a... |
30,225 | kirankh7/clean_flask_app | refs/heads/master | /app/health/health.py | from flask import render_template,request, current_app
from ..models import DatabaseTables,db
from . import health
@health.route("/health")
def check_rds_conn():
validation = ""
try:
db.session.query("1").from_statement("SELECT 1").all()
validation = 'OK'
except:
validation = 'ERR... | {"/app/diag/diag.py": ["/app/diag/__init__.py"], "/app/hello/hello.py": ["/app/hello/__init__.py", "/app/models.py"], "/app/health/health.py": ["/app/models.py", "/app/health/__init__.py"], "/app/__init__.py": ["/app/config.py", "/app/models.py", "/app/hello/hello.py", "/app/health/health.py", "/app/diag/diag.py"], "/a... |
30,226 | kirankh7/clean_flask_app | refs/heads/master | /app/__init__.py | from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from app.config import Config
from app.models import db
from flask_migrate import Migrate
# # Creating an instance of the Flask(kind of module)
# app = Flask(__name__)
# # Passing configs from Json file
# app.config.from_object(Config)
# pass db instanc... | {"/app/diag/diag.py": ["/app/diag/__init__.py"], "/app/hello/hello.py": ["/app/hello/__init__.py", "/app/models.py"], "/app/health/health.py": ["/app/models.py", "/app/health/__init__.py"], "/app/__init__.py": ["/app/config.py", "/app/models.py", "/app/hello/hello.py", "/app/health/health.py", "/app/diag/diag.py"], "/a... |
30,227 | kirankh7/clean_flask_app | refs/heads/master | /app/routes.py | from flask import Flask,render_template,request, current_app
from app import db
from datetime import datetime
import pytz
# First / root of the flask app
@app.route('/hello.html') # same hello_world
@app.route('/')
def hello_world():
message = "Hello World! {}".format(get_pst_time())
image_src = "https://s3.... | {"/app/diag/diag.py": ["/app/diag/__init__.py"], "/app/hello/hello.py": ["/app/hello/__init__.py", "/app/models.py"], "/app/health/health.py": ["/app/models.py", "/app/health/__init__.py"], "/app/__init__.py": ["/app/config.py", "/app/models.py", "/app/hello/hello.py", "/app/health/health.py", "/app/diag/diag.py"], "/a... |
30,228 | kirankh7/clean_flask_app | refs/heads/master | /app/models.py | from flask_sqlalchemy import SQLAlchemy
from flask import current_app
db = SQLAlchemy()
class DatabaseTables(db.Model):
__tablename__ = 'flask_app'
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(80), nullable=False)
def __init__(self, id, name):
self.id = id
... | {"/app/diag/diag.py": ["/app/diag/__init__.py"], "/app/hello/hello.py": ["/app/hello/__init__.py", "/app/models.py"], "/app/health/health.py": ["/app/models.py", "/app/health/__init__.py"], "/app/__init__.py": ["/app/config.py", "/app/models.py", "/app/hello/hello.py", "/app/health/health.py", "/app/diag/diag.py"], "/a... |
30,229 | kirankh7/clean_flask_app | refs/heads/master | /app/diag/__init__.py | from flask import Blueprint
diag = Blueprint("diag", __name__)
# ^^^^ coming
from . import diag
| {"/app/diag/diag.py": ["/app/diag/__init__.py"], "/app/hello/hello.py": ["/app/hello/__init__.py", "/app/models.py"], "/app/health/health.py": ["/app/models.py", "/app/health/__init__.py"], "/app/__init__.py": ["/app/config.py", "/app/models.py", "/app/hello/hello.py", "/app/health/health.py", "/app/diag/diag.py"], "/a... |
30,230 | kirankh7/clean_flask_app | refs/heads/master | /run.py | from app import create_app
app = create_app()
# db.create_all()
# Run the file direct... do not import to anything else
if __name__ == '__main__':
# db.create_all()
app.run(host='0.0.0.0', port=8000, debug=True)
| {"/app/diag/diag.py": ["/app/diag/__init__.py"], "/app/hello/hello.py": ["/app/hello/__init__.py", "/app/models.py"], "/app/health/health.py": ["/app/models.py", "/app/health/__init__.py"], "/app/__init__.py": ["/app/config.py", "/app/models.py", "/app/hello/hello.py", "/app/health/health.py", "/app/diag/diag.py"], "/a... |
30,236 | vaziozio/sentiment-analysis-app | refs/heads/master | /hourcounter.py | import datetime
#json to count
tweets_count = {0:{'Negativo':0,'Neutro':0,'Positivo':0},
1:{'Negativo':0,'Neutro':0,'Positivo':0},
2:{'Negativo':0,'Neutro':0,'Positivo':0},
3:{'Negativo': 0, 'Neutro': 0, 'Positivo': 0},
4: {'Negativo': 0, 'Neutro': 0... | {"/app.py": ["/hourcounter.py", "/streaming.py"]} |
30,237 | vaziozio/sentiment-analysis-app | refs/heads/master | /app.py | #importing libraries
from flask import Flask, render_template, url_for, jsonify, request
from sklearn.naive_bayes import MultinomialNB
from sklearn.feature_extraction.text import CountVectorizer
import pickle
import os
from hourcounter import tweets_count, count_tweets
from streaming import StreamListener
#lo... | {"/app.py": ["/hourcounter.py", "/streaming.py"]} |
30,238 | vaziozio/sentiment-analysis-app | refs/heads/master | /streaming.py | from tweepy import Stream
from tweepy import OAuthHandler
from tweepy.streaming import StreamListener
import requests
import pickle
import json
import time
#loading credentials
ckey = 'Client key'
csecret = 'Client secret'
atoken ='Access token'
asecret = 'Access secret'
#streaming listener
class listene... | {"/app.py": ["/hourcounter.py", "/streaming.py"]} |
30,262 | fraperr/python | refs/heads/master | /monPremierPackage/nombre.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import monPremierPackage.nombre
def verifEntier(entier):
try:
entier = int(entier)
assert entier > 0
except ValueError:
print("Vous n'avez pas saisi un nombre.")
except AssertionError:
print("Vous avez misé une somme négative.")
... | {"/ZCasino.py": ["/monPremierPackage/nombre.py"]} |
30,263 | fraperr/python | refs/heads/master | /ZCasino.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import random
import math
import monPremierPackage.nombre
sommeDeDepart = monPremierPackage.nombre.saisirEntier("Quelle somme de départ: ")
mise = 5
while sommeDeDepart > 0:
mise = monPremierPackage.nombre.saisirEntier("Combien voulez-vous miser: ")
# Choisir un nom... | {"/ZCasino.py": ["/monPremierPackage/nombre.py"]} |
30,265 | Kronholt/harding | refs/heads/master | /events/models.py | from django.db import models
from django.contrib.auth.models import User
# Create your models here.
class Volunteer(models.Model):
user = models.OneToOneField(User, null=True, blank=True, on_delete=models.CASCADE)
user_name = models.CharField(max_length=200, null=True, blank=True)
first_name = models.Char... | {"/events/filters.py": ["/events/models.py"], "/events/forms.py": ["/events/models.py"], "/events/views.py": ["/events/filters.py", "/events/forms.py", "/events/models.py"]} |
30,266 | Kronholt/harding | refs/heads/master | /events/urls.py | from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name="home"),
path('volunteering/', views.volunteering, name="volunteering"),
path('event/<str:pk>/', views.event,name='event'),
path('stories/', views.stories, name="stories"),
path('story/<str:pk>/', views.st... | {"/events/filters.py": ["/events/models.py"], "/events/forms.py": ["/events/models.py"], "/events/views.py": ["/events/filters.py", "/events/forms.py", "/events/models.py"]} |
30,267 | Kronholt/harding | refs/heads/master | /events/migrations/0006_post_attending.py | # Generated by Django 3.1.2 on 2021-01-07 17:16
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('events', '0005_post_full_story'),
]
operations =... | {"/events/filters.py": ["/events/models.py"], "/events/forms.py": ["/events/models.py"], "/events/views.py": ["/events/filters.py", "/events/forms.py", "/events/models.py"]} |
30,268 | Kronholt/harding | refs/heads/master | /events/filters.py | import django_filters
from .models import Post
from django_filters import DateFilter, CharFilter
class PostFilter(django_filters.FilterSet):
start_date = DateFilter(field_name="start_date", lookup_expr='gte'),
end_date = DateFilter(field_name="end_date", lookup_expr='lte'),
# tag = CharFilter(field_name="... | {"/events/filters.py": ["/events/models.py"], "/events/forms.py": ["/events/models.py"], "/events/views.py": ["/events/filters.py", "/events/forms.py", "/events/models.py"]} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.