max_stars_repo_path stringlengths 3 269 | max_stars_repo_name stringlengths 4 119 | max_stars_count int64 0 191k | id stringlengths 1 7 | content stringlengths 6 1.05M | score float64 0.23 5.13 | int_score int64 0 5 |
|---|---|---|---|---|---|---|
LLINS_API/urls.py | majorblackc/LLINS-Hackathon-g5 | 4 | 12763151 | from django.urls import path
from LLINS_API import views
from rest_framework.urlpatterns import format_suffix_patterns
from django.contrib import admin
urlpatterns = [
path('', admin.site.urls),
path('patients/', views.patient_data_list),
path('patints/<int:pk>/', views.patient_data_detail),
path('nets/... | 1.679688 | 2 |
tests/data/program_analysis/strings/Translation/str05.py | rsulli55/automates | 17 | 12763152 | <reponame>rsulli55/automates
from automates.program_analysis.for2py.format import *
from automates.program_analysis.for2py.strings import *
def main():
str1 = String(10)
str1.set_("abcdef")
n1 = str1.f_index("bc")
n2 = str1.f_index("xyz")
n3 = str1.f_index("f ", ["back"])
n4 = str1.f_index("c... | 2.71875 | 3 |
backend/api/forms/UpdateReviewForm.py | kukiamarilla/polijira | 1 | 12763153 | from django import forms
class UpdateReviewForm(forms.Form):
"""
UpdateReviewForm Valida los datos del request.data al modificar un review
Args:
forms (Form): Form de django
Atributes:
observacion (TextField): Campo para validar que se especifca la observacion
"""
observacio... | 2.390625 | 2 |
wordler/simulator.py | jacobepst/wordler | 0 | 12763154 | <reponame>jacobepst/wordler
"""class that simulates a game of wordle (with a game and a solver)"""
from wordler.solver import Solver
from wordler.wordle_game import WordleGame
from logging import getLogger
class Simulator:
"""A Wordle simulator"""
def __init__(self, display: bool = False, strategy: str = N... | 3.359375 | 3 |
bitcounting.py | boachiejude/kata | 0 | 12763155 | <gh_stars>0
"""
Write a function that takes an integer as input, and returns the number of bits that are equal to one in the binary representation of that number.
You can guarantee that input is non-negative.
Example: The binary representation of 1234 is 10011010010, so the function should return 5 in this case.
"""
d... | 4 | 4 |
ApplicationPerformance/webautomation/webAutomation.py | hsy5332/Blog | 0 | 12763156 | # to do 发送邮件,以及需要增加用例的执行结果
import time
import ApplicationPerformance.sendReport as sendReport
import ApplicationPerformance.applicationperformance.launchTime as launchTime # MAC
# import ApplicationPerformance.applicationperformance.launchTime as launchTime # Windows
from selenium import webdriver
from selenium.webd... | 2.796875 | 3 |
iast/views/agent_search.py | luzhongyang/DongTai-webapi | 6 | 12763157 | <gh_stars>1-10
from functools import reduce
from django.core.paginator import Paginator
from django.db.models import Q
from dongtai.endpoint import R, AnonymousAndUserEndPoint
from dongtai.models.agent import IastAgent
from dongtai.models.heartbeat import IastHeartbeat
from dongtai.models.server import IastServer
from... | 1.96875 | 2 |
mangle-infra-agent/Faults/NetworkFaults.py | vmaligireddy/mangle | 151 | 12763158 | from enum import Enum
class NetworkFaults(Enum):
NETWORK_DELAY_MILLISECONDS = 1
PACKET_DUPLICATE_PERCENTAGE = 2
PACKET_CORRUPT_PERCENTAGE = 3
PACKET_LOSS_PERCENTAGE = 4 | 2.203125 | 2 |
scripts/dataloader.py | haohao11/AMENet | 4 | 12763159 | # -*- coding: utf-8 -*-
"""
Created on Fri Apr 24 13:50:54 2020
This is the load to load data based on occupancy maps
@author: cheng
"""
import numpy as np
import time
import os
from augmentation import rotation
from maps import Maps
from occupancy import circle_group_grid
def loaddata(dataset_list, args, data... | 2.46875 | 2 |
erica/application/FreischaltCode/FreischaltCodeRevocationService.py | punknoir101/erica-1 | 0 | 12763160 | <reponame>punknoir101/erica-1
import datetime
from abc import abstractmethod, ABCMeta
from uuid import uuid4
from opyoid import Injector, Module
from rq import Retry
from erica.application.EricRequestProcessing.erica_input.v1.erica_input import UnlockCodeRevocationData
from erica.application.EricRequestProcessing.req... | 1.78125 | 2 |
ample/util/tests/test_tm_util.py | fsimkovic/ample | 6 | 12763161 | """Test functions for util.tm_util"""
import unittest
from ample.testing import test_funcs
from ample.util import ample_util, tm_util
@unittest.skipUnless(test_funcs.found_exe("TMscore" + ample_util.EXE_EXT), "TMscore exec missing")
class TestTM(unittest.TestCase):
def test_gaps_1(self):
gaps = tm_util.T... | 2.25 | 2 |
classification/model.py | rechardchen123/Classification-and-regression-of-vessel-AIS-data | 7 | 12763162 | # Copyright 2017 Google Inc. and Skytruth 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 agr... | 2.03125 | 2 |
custom_components/populartimes/sensor.py | disrupted/hass-populartimes | 0 | 12763163 | """Support for Google Places API."""
from datetime import timedelta
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import CONF_API_KEY, CONF_ID, CONF_NAME
from homeassistant.helpers.entity import Entity
import homeassistant.helpers.config_validation as cv
import logging
import popu... | 2.46875 | 2 |
models/detectron2_detector.py | allenai/interactron | 4 | 12763164 | <filename>models/detectron2_detector.py
import torch
import torch.nn as nn
import torch.nn.functional as F
import detectron2
from detectron2 import model_zoo
from detectron2.engine import DefaultPredictor
from detectron2.config import get_cfg
import detectron2.data.transforms as T
from detectron2.structures import Boxe... | 2.359375 | 2 |
sparsereg/util/pipeline.py | Thomasillo/sparsereg | 0 | 12763165 | <reponame>Thomasillo/sparsereg
from sklearn.base import BaseEstimator, TransformerMixin
class ColumnSelector(TransformerMixin, BaseEstimator):
def __init__(self, index=slice(None)):
self.index = index
self.n_features = None
def fit(self, x, y=None):
if len(x.shape) == 2:
_... | 2.578125 | 3 |
tests/generators/transition/main.py | jacobkaufmann/consensus-specs | 2,161 | 12763166 | from typing import Iterable
from eth2spec.test.helpers.constants import ALTAIR, MINIMAL, MAINNET, PHASE0
from eth2spec.test.altair.transition import (
test_transition as test_altair_transition,
test_activations_and_exits as test_altair_activations_and_exits,
test_leaking as test_altair_leaking,
test_sl... | 1.90625 | 2 |
ws_lcd/layout_222.py | hnikolov/ws_lcd | 0 | 12763167 | # -*- coding: utf-8 -*-
import time
from layout import Layout
from component import *
class Layout_222(Layout):
def __init__(self):
super(Layout_222, self).__init__(color = "black")
self.ch1 = 18 # component height 1
self.ch2 = 26 # component height 2
self.sh1 =... | 2.828125 | 3 |
mlflow/entities/model_registry/__init__.py | PeterSulcs/mlflow | 10,351 | 12763168 | from mlflow.entities.model_registry.registered_model import RegisteredModel
from mlflow.entities.model_registry.model_version import ModelVersion
from mlflow.entities.model_registry.registered_model_tag import RegisteredModelTag
from mlflow.entities.model_registry.model_version_tag import ModelVersionTag
__all__ = [
... | 1.242188 | 1 |
utils/pascal.py | Vious/LPG_BBox_Segmentation | 14 | 12763169 | import xml.etree.ElementTree as ET
def parse_xml(anno_path):
CLASSES = ('background',
'aeroplane', 'bicycle', 'bird', 'boat', 'bottle', 'bus', 'car',
'cat', 'chair', 'cow', 'diningtable', 'dog', 'horse', 'motorbike',
'person', 'pottedplant', 'sheep', 'sofa', 'train', 'tvmonitor'... | 2.96875 | 3 |
Basic Data Type/4_lists.py | FaranakAlikhah/ADM-HW1 | 0 | 12763170 | #!/usr/bin/env python
# coding: utf-8
# # *section 2: Basic Data Type*
#
# ### writer : <NAME> 1954128
# ### 4. Lists :
#
# In[ ]:
if __name__ == '__main__':
N = int(input())
my_list=[]
for i in range(N):
A=input().split();
if A[0]=="sort":
my_list.sort();
... | 3.96875 | 4 |
fuji_server/models/persistence_output.py | ignpelloz/fuji | 25 | 12763171 | <gh_stars>10-100
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from fuji_server.models.base_model_ import Model
from fuji_server import util
class PersistenceOutput(Model):
"""NOTE: This class is auto... | 2.03125 | 2 |
question_repo/apps/repo/validator.py | Quizas007/question_repo | 0 | 12763172 | <reponame>Quizas007/question_repo<filename>question_repo/apps/repo/validator.py
from django.core.exceptions import ValidationError
def valid_difficulty(n):
if n > 5 or n <1:
raise ValidationError("难度介于1到5之间") | 1.8125 | 2 |
tests/issues/test_project_issue.py | mubashshirjamal/code | 1,582 | 12763173 | # encoding: UTF-8
from tests.base import TestCase
from vilya.models.issue import Issue
from vilya.models.project_issue import ProjectIssue
class TestProjectIssue(TestCase):
def test_add_issue(self):
p = ProjectIssue.add('test', 'test description', 'test', project=1)
assert isinstance(p, Project... | 2.265625 | 2 |
slybot/slybot/tests/test_linkextractors.py | ruairif/portia | 8 | 12763174 | <reponame>ruairif/portia
from unittest import TestCase
from scrapy.http import TextResponse, HtmlResponse
from slybot.linkextractor import (
create_linkextractor_from_specs,
RssLinkExtractor,
SitemapLinkExtractor,
)
class Test_RegexLinkExtractor(TestCase):
def test_default(self):
s... | 2.8125 | 3 |
parkings/migrations/0027_parkingcheck_performer.py | klemmari1/parkkihubi | 12 | 12763175 | # Generated by Django 2.2.3 on 2019-07-18 06:34
from django.conf import settings
from django.db import migrations, models
def fill_parkingcheck_performer(apps, schema_editor):
parking_check_model = apps.get_model('parkings', 'ParkingCheck')
items_to_process = parking_check_model.objects.filter(performer=None... | 2.140625 | 2 |
dysql/test/test_sql_in_list_templates.py | LaudateCorpus1/dy-sql | 1 | 12763176 | <reponame>LaudateCorpus1/dy-sql
"""
Copyright 2021 Adobe
All Rights Reserved.
NOTICE: Adobe permits you to use, modify, and distribute this file in accordance
with the terms of the Adobe license agreement accompanying it.
"""
# pylint: disable=too-many-public-methods
import pytest
import dysql
from dysql import Query... | 2.265625 | 2 |
Find if there is a subarray 0 sum.py | Into-Y0u/Github-Baby | 2 | 12763177 | class Solution:
def hasZeroSumSubarray(self, nums: List[int]) -> bool:
vis = set()
x = 0
for n in nums :
x+=n
if x==0 or x in vis :
return 1
vis.add(x)
return 0
| 3 | 3 |
Ejercicio3/Gato.py | carlotamartin/Ejercicio-de-POO-entrega | 0 | 12763178 | <filename>Ejercicio3/Gato.py
from Mamifero import Mamifero
class Gato (Mamifero):
def __init__ (self):
pass | 1.523438 | 2 |
models/__init__.py | doslindos/ml_crapwrap | 0 | 12763179 | from numpy import save as npsave, load as npload, array as nparray, append as npappend, expand_dims as npexpand, prod as npprod, argmax, zeros as npzeros
from datetime import datetime
from json import dump as jsondump, load as jsonload
from pickle import dump as pkldump, load as pklload
from inspect import signature
fr... | 1.648438 | 2 |
build/lib/geonomics/utils/__init__.py | AnushaPB/geonomics-1 | 8 | 12763180 | <reponame>AnushaPB/geonomics-1<filename>build/lib/geonomics/utils/__init__.py<gh_stars>1-10
from . import io
from . import viz
from . import spatial
from . import _str_repr_
| 1.015625 | 1 |
tests/test_008.py | vutsalsinghal/python-terrascript | 0 | 12763181 | # https://www.terraform.io/docs/configuration/locals.html
import terrascript
import terrascript.aws
import terrascript.aws.d
from shared import assert_equals_json
def test():
"""Data (008)"""
config = terrascript.Terrascript()
config += terrascript.aws.aws(version='~> 2.0', region='us-east-1')
con... | 2.25 | 2 |
payment_predictor/cluster_features.py | michaelmurdock/py_ml_projects | 0 | 12763182 | # cluster_features.py
#
# Based on snippets here:
# http://scikit-learn.org/dev/auto_examples/cluster/plot_cluster_iris.html#sphx-glr-auto-examples-cluster-plot-cluster-iris-py
from __future__ import print_function
import time
import datetime
import numpy as np
import pandas as pd
import ... | 3.421875 | 3 |
src/ufdl/json/image_classification/_CategoriesModSpec.py | waikato-ufdl/ufdl-json-messages | 0 | 12763183 | from typing import List
from wai.json.object import StrictJSONObject
from wai.json.object.property import ArrayProperty, StringProperty, EnumProperty
class CategoriesModSpec(StrictJSONObject['CategoriesModSpec']):
"""
A specification of which images to modify the categories
for, and which categories to m... | 2.546875 | 3 |
pyfo/tests/unittests/models/hmm/run_hmm.py | bradleygramhansen/pyfo | 3 | 12763184 | <filename>pyfo/tests/unittests/models/hmm/run_hmm.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
Author: <NAME>
Time created: 11:07
Date created: 20/01/2018
License: MIT
'''
import tests.unittests.models.hmm.hmm as test
from ..inference.dhmc import DHMCSampler as dhmc
### model
# test.model.display_graph()
... | 2.25 | 2 |
speclus4py/assembler.py | ml4py/speclus4py | 0 | 12763185 | import numpy as np
from numba import jit
import pyflann
from petsc4py import PETSc
from mpi4py import MPI
from speclus4py.types import DataObject, DataType, GraphType, OperatorType, OperatorContainer
@jit(nopython=True)
def get_global_index(x, y, ydim):
return y + x * ydim
@jit(nopython=True)
def get_global_i... | 1.953125 | 2 |
wcics/auth/_cookies.py | CS-Center/CS-Center | 0 | 12763186 | <reponame>CS-Center/CS-Center
# -*- coding: utf-8 -*-
# File defines a single function, a set cookie that takes a configuration
# Use only if the app cannot be imported, otherwise use .cookies
def set_cookie(config, response, key, val):
response.set_cookie(key, val,
secure = config['COOKIES_SEC... | 1.820313 | 2 |
samples/python/winforms.py | MicroFocus/SilkAppDriver | 8 | 12763187 | <gh_stars>1-10
import unittest
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.select import Select
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
class InsuranceTests(unittest.TestCase)... | 2.609375 | 3 |
sql_queries.py | AlkaSaliss/aws-datawarehouse | 0 | 12763188 | <filename>sql_queries.py
import configparser
# CONFIG
config = configparser.ConfigParser()
config.read('dwh.cfg')
# DROP TABLES
staging_events_table_drop = "DROP TABLE IF EXISTS staging_events;"
staging_songs_table_drop = "DROP TABLE IF EXISTS staging_songs;"
songplay_table_drop = "DROP TABLE IF EXISTS songplays;"
... | 2.53125 | 3 |
2020/day03.py | sree-cfa/adventOfCode | 0 | 12763189 | from util.inputReader import read_as_strings
def part1(slope_grid):
trees = 0
slope = 1
for i, line in enumerate(slope_grid):
if i % 2 == 0 and line[(int(i / 2) * slope) % len(line)] == '#':
trees += 1
return trees
grid = read_as_strings("../inputs/2020_03.txt")
print("part1:", ... | 3.375 | 3 |
distracting_control/suite_test.py | TmacAaron/mydrq | 0 | 12763190 | # coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# 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 applicab... | 1.976563 | 2 |
src/python_patterns/factory/rectangle.py | NostraDavid/python-patterns | 0 | 12763191 | <reponame>NostraDavid/python-patterns
from shape import IShape
class Rectangle(IShape):
def draw(self):
print("Inside Rectangle::draw() method.")
| 3.390625 | 3 |
python/petitBloc/ui/paramEditor.py | sol-ansano-kim/unitBlock | 24 | 12763192 | from Qt import QtWidgets
from Qt import QtCore
from Qt import QtGui
from . import const
from . import uiUtil
from .. import util
from .. import box
from .. import core
from functools import partial
import re
ReEqual = re.compile("^\s*[=]\s*")
class ParamCreator(QtWidgets.QDialog):
ParamTypes = {"bool": bool, "i... | 2.21875 | 2 |
juice_scm_gse/app.py | NadjB/Juice_SCM_GSE | 0 | 12763193 | <filename>juice_scm_gse/app.py
#!/usr/bin/env python3
import sys, os
from functools import partial
import subprocess
#import atexit
import zmq, json
from datetime import datetime
from PySide2.QtGui import QValidator, QRegExpValidator
from PySide2.QtWidgets import QMainWindow, QApplication, QWidget, QMessageBox
from ... | 1.765625 | 2 |
tests/test_gtfsrt.py | carsonyl/tilapya | 6 | 12763194 | import pytest
from requests import codes
from tilapya.errors import TransLinkAPIError
from tilapya.gtfsrt import GTFSRT
from .conftest import remove_response_headers_func
# Apply VCR to all tests in this file.
pytestmark = pytest.mark.vcr(before_record_response=remove_response_headers_func('Set-Cookie'))
@pytest.f... | 2.0625 | 2 |
bigsql/types.py | wabscale/bigsql | 1 | 12763195 | <filename>bigsql/types.py
# from . import Sql
from dataclasses import dataclass
from scanf import scanf
@dataclass
class DataType:
"""
Base datatype object. All defined types should inherit
from this object.
All this object should need is a name class variable.
"""
name: str=None
def __... | 3.90625 | 4 |
RottenTomatoes/rt/rt/spiders/movie.py | hovhannest/TMScrappers | 0 | 12763196 | <reponame>hovhannest/TMScrappers
# -*- coding: utf-8 -*-
import scrapy
from rt.items import *
import re
class MovieSpider(scrapy.Spider):
name = 'movie'
allowed_domains = ['rottentomatoes.com']
# start_urls = ['https://www.rottentomatoes.com/m/blade_runner_2049']
start_urls = ['https://www.rottentomato... | 2.65625 | 3 |
Regression/LinearRegression.py | ssklykov/collection_numCalc | 0 | 12763197 | <reponame>ssklykov/collection_numCalc
# -*- coding: utf-8 -*-
"""
Linear regression using the deviated randomly linear dependency (y(x) = a*x + b)
Developed in the Spyder IDE using Kite
@author: ssklykov
"""
# %% Import section
from SampleValues import GenerateSample
import numpy as np
from ComparisonLinPlots import P... | 2.875 | 3 |
main.py | bl-msch-c220-max-park/01-Interactive-Fiction | 0 | 12763198 | <reponame>bl-msch-c220-max-park/01-Interactive-Fiction
import sys
assert sys.version_info >= (3,9), "This script requires at least Python 3.9"
passages = [
{
"name": "Headquarters",
"tags": "",
"id": "1",
"text": "You are at Space Headquaters. Your objective today is to find the infamous spa... | 2.375 | 2 |
swftp/test/unit/test_utils.py | softlayer/swftp | 30 | 12763199 | """
See COPYING for license information.
"""
import unittest
import os
import time
from twisted.python import log
from swftp.utils import (
try_datetime_parse, MetricCollector, parse_key_value_config)
class MetricCollectorTest(unittest.TestCase):
def setUp(self):
self.c = MetricCollector()
def ... | 2.28125 | 2 |
covariance/rank_avg_windows.py | methylgrammarlab/proj_scwgbs | 0 | 12763200 | <reponame>methylgrammarlab/proj_scwgbs
"""
Take different bedgraph files which represent windows which were normalized ( so one value per window) and
rank them across patient to see if they match
"""
import argparse
import glob
import os
import sys
import numpy as np
import pandas as pd
from tqdm import tqdm
sys.pat... | 2.6875 | 3 |
code/pyscripts/computepspace.py | GandalfSaxe/letomes | 0 | 12763201 |
from matplotlib.colors import Normalize
import matplotlib as mpl
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
import pandas as pd
import numpy as np
from math import pi, log
from scipy.stats import rankdata
from argparse import ArgumentParser
if __name__ == "__main__":
... | 2.4375 | 2 |
Week2/week2/scripts/publisher_radius.py | vedanth-03/Robotics-Automation-QSTP-2021 | 0 | 12763202 | #!/usr/bin/env python
import rospy
from std_msgs.msg import Float32
rospy.init_node('publisher_radius')
pub = rospy.Publisher('radius', Float32, queue_size=1)
rate = rospy.Rate(1)
radius = 1.0
while not rospy.is_shutdown():
try:
pub.publish(radius)
rate.sleep()
except:
pass | 2.21875 | 2 |
cla_backend/apps/guidance/admin.py | uk-gov-mirror/ministryofjustice.cla_backend | 3 | 12763203 | # coding=utf-8
from django.contrib import admin
from .admin_support.forms import NoteModelForm
from .models import Note, Tag
class TagInline(admin.TabularInline):
model = Note.tags.through
class NoteAdmin(admin.ModelAdmin):
ordering = ["title"]
exclude = ("created", "modified", "body")
list_displa... | 1.960938 | 2 |
tests/test_en_zh_debug.py | ffreemt/google-tr-async-free | 0 | 12763204 | '''
test en-zh
'''
# import sys
import pytest # type: ignore
from loguru import logger
# sys.path.insert(0, '..')
# from google_tr_async.google_tr_async import google_tr_async
from google_tr_async import google_tr_async
@pytest.mark.asyncio
async def test_0():
''' test 0'''
text = \
'''There is now... | 2.328125 | 2 |
Leetcode/1000-2000/1151. Minimum Swaps to Group All 1's Together/1151.py | Next-Gen-UI/Code-Dynamics | 0 | 12763205 | <filename>Leetcode/1000-2000/1151. Minimum Swaps to Group All 1's Together/1151.py
class Solution:
def minSwaps(self, data: List[int]) -> int:
k = data.count(1)
ones = 0 # ones in window
maxOnes = 0 # max ones in window
for i, num in enumerate(data):
if i >= k and data[i - k]:
ones -=... | 3.015625 | 3 |
sort/Maximum_628.py | smallbaby/leetcode | 0 | 12763206 | # -*- coding: utf-8 -*-
class Solution(object):
def maximumProduct(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
nums.sort(reverse=True)
m1 = nums[0] * nums[1] * nums[2]
m2 = nums[0] * nums[-1] * nums[-2]
return m1 if m1 > m2 else m2
def... | 3.578125 | 4 |
pagarme/transaction.py | ch1ninha/analisar-pagarme | 0 | 12763207 | <gh_stars>0
from pagarme.resources import handler_request
from pagarme.resources.routes import transaction_routes
def calculate_installments_amount(dictionary):
return handler_request.get(transaction_routes.CALCULATE_INSTALLMENTS_AMOUNT, dictionary)
def capture(transaction_id, dictionary):
return handler_re... | 2.015625 | 2 |
findingPath.py | truongsatthu/neo4j_autonomous_path_planner_project | 0 | 12763208 | #!/usr/bin/env python3.6
# -*- coding: utf-8 -*-
import numpy as np
import networkx as nx
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import sys,os,time,yaml,argparse,itertools
from numpy.lib.arraysetops import isin
from queue import PriorityQueue
from mpl_toolkits.mplot3d import Axes3D
from neo4j ... | 2.109375 | 2 |
dnsimple/exceptions.py | mherrmann/dnsimple-python | 12 | 12763209 | class DNSimpleException(Exception):
def __init__(self, message=None, errors=None):
self.message = message
self.errors = errors
| 1.929688 | 2 |
src/api/tests/test_auth_refresh.py | DiceNameIsMy/proper-FastAPI-startup | 0 | 12763210 | from requests.models import Response
from fastapi.testclient import TestClient
from domain.user import UserDomain
from settings import settings
URI = f"/v{settings.api_version}/token/refresh"
def test_valid(
client: TestClient,
user_domain: UserDomain,
user_refresh_token: str,
):
response: Respons... | 2.546875 | 3 |
jmetal/problem/multiobjective/constrained.py | LuckysonKhaidem/ProjectAlpha | 1 | 12763211 | <reponame>LuckysonKhaidem/ProjectAlpha<filename>jmetal/problem/multiobjective/constrained.py
from math import pi, cos, atan
from jmetal.core.solution import FloatSolution
from jmetal.core.problem import FloatProblem
"""
.. module:: constrained
:platform: Unix, Windows
:synopsis: Constrained test problems for mu... | 2.421875 | 2 |
ui/data/polygon.py | Simi4/imgmalibu | 0 | 12763212 | polygon = [
[2000, 1333],
[2000, 300],
[500, 900],
[0, 1333],
[2000, 1333]
]
'''
polygon = [
[0, 0],
[0, 600],
[900, 600],
[1800, 0],
[0, 0]
]
''' | 2.125 | 2 |
src/hark_lang/examples/__init__.py | krrome/teal-lang | 85 | 12763213 | <reponame>krrome/teal-lang<filename>src/hark_lang/examples/__init__.py
from .load_examples import load_examples
| 1.109375 | 1 |
team_9/cocos/tools/autotest/proxy_snapshots.py | Donnyvdm/dojo19 | 1 | 12763214 | <reponame>Donnyvdm/dojo19
from __future__ import division, print_function, unicode_literals
import six
import sys
import os
import remembercases.snapshot_taker as st
import random
# seed random for repeteability
random.seed(123)
# for repeteabilty between py2 and py3 when running in autotest, random.randint
# random... | 2.359375 | 2 |
app/home/urls.py | Allen-lang/FXTest | 1 | 12763215 | # -*- coding: utf-8 -*-
# @Author : lileilei
# @File : urls.py
# @Time : 2017/12/7 9:27
from .views import *
from .views import home
home.add_url_rule('/index',view_func=Indexview.as_view('index'))
home.add_url_rule('/login',view_func=LoginView.as_view('login'))
home.add_url_rule('/logt',view_func=Logt... | 1.84375 | 2 |
nlp/englishnlp/bag_of_words.py | geminihcc526/Learning-Demo | 0 | 12763216 | import pandas as pd
train = pd.read_csv('alldata/labeledTrainData.tsv', header=0, delimiter='\t', quoting=3)
print(train.shape)
print(train.columns.values)
print(train.head())
print(train['review'][0])
test = pd.read_csv('alldata/testData.tsv', header=0, delimiter='\t', quoting=3)
print(test.shape)
print(test.head())
... | 3.390625 | 3 |
src/sc3nb/timed_queue.py | interactive-sonification/sc3nb | 7 | 12763217 | """Classes to run register functions at certain timepoints and run asynchronously"""
import threading
import time
from typing import Any, Callable, Iterable, NoReturn, Union
import numpy as np
import sc3nb
from sc3nb.osc.osc_communication import Bundler, OSCCommunication, OSCMessage
class Event:
"""Stores a ti... | 3.28125 | 3 |
fawkes/fetch/remote.py | AalokAhluwalia/fawkes | 87 | 12763218 | <filename>fawkes/fetch/remote.py
import urllib.request
def fetch(review_channel):
return urllib.request.urlopen(review_channel.file_path).read().decode("utf-8")
| 1.796875 | 2 |
python_challenge/3.py | facmartoni/python_exercises | 0 | 12763219 | <reponame>facmartoni/python_exercises
# URL = http://www.pythonchallenge.com/pc/def/equality.html
import re
import collections
def run():
with open('3_text.txt', 'r') as f:
text = f.read()
patterns = re.findall(
r'[a-z][A-Z][A-Z][A-Z][a-z][A-Z][A-Z][A-Z][a-z]', text)
print(patterns)
... | 3.546875 | 4 |
mayan/apps/documents/tests/test_document_type_views.py | wan1869/dushuhu | 1 | 12763220 | import os
from ..models import DocumentType
from ..permissions import (
permission_document_properties_edit,
permission_document_type_create, permission_document_type_delete,
permission_document_type_edit, permission_document_type_view,
)
from .base import GenericDocumentViewTestCase
from .literals import... | 1.992188 | 2 |
tests/system_tests_edge_router.py | cliffjansen/qpid-dispatch | 1 | 12763221 | <gh_stars>1-10
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License... | 1.851563 | 2 |
Inheritance_5.py | SahilSandasani/Py2 | 0 | 12763222 | class A:
def __init__(self):
self._x = 5
class B(A):
def display(self):
print(self._x)
def main():
obj = B()
obj.display()
main() | 3.21875 | 3 |
picklachu/storage/s3.py | fowbi/picklachu | 1 | 12763223 | <filename>picklachu/storage/s3.py<gh_stars>1-10
import boto3
from botocore.client import BaseClient
from picklachu.storage.base import BaseStorage
class S3(BaseStorage):
def __init__(self, client: BaseClient, bucket: str):
self.bucket = bucket
self.client = client
def persist(self, path: str... | 2.875 | 3 |
kissim/tests/encoding/test_features_sitealign.py | AJK-dev/kissim | 15 | 12763224 | """
Unit and regression test for the kissim.encoding.features.sitealign.SiteAlignFeature class.
"""
from pathlib import Path
import pytest
import numpy as np
import pandas as pd
from opencadd.databases.klifs import setup_local
from kissim.io import PocketBioPython
from kissim.encoding.features import SiteAlignFeatur... | 2.140625 | 2 |
socketserver/echo_stream_request_client.py | TheBigFish/simple-python | 0 | 12763225 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @File : echo_stream_request_client.py
# @Author: yubo
# @Date : 2018/12/19
# @Desc :
import sys
from socket import *
serverHost = '127.0.0.1'
serverPort = 50008
if len(sys.argv) > 1:
serverHost = sys.argv[1]
#Create socket
sSock = socket(AF_INET, SOCK_STREAM)
#... | 2.796875 | 3 |
mailviews/helpers.py | archchoa/django-mailviews | 93 | 12763226 | <filename>mailviews/helpers.py
from django.conf import settings
def should_use_staticfiles():
return 'django.contrib.staticfiles' in settings.INSTALLED_APPS
| 1.414063 | 1 |
011. Container With Most Water.py | patrick-luo/Leet-Code | 0 | 12763227 | """
Ideas:
1. The widest container (using first and last line) is a good candidate, because of its width. Its water level is the height of the smaller one of first and last line.
2. All other containers are less wide and thus would need a higher water level in order to hold more water.
3. The smaller one of first and ... | 3.828125 | 4 |
core/src/zeit/vgwort/tests/test_token.py | rickdg/vivi | 5 | 12763228 | from zeit.vgwort.token import _order_tokens
import transaction
import unittest
import zeit.vgwort.interfaces
import zeit.vgwort.testing
import zope.component
class TokenStorageTest(zeit.vgwort.testing.EndToEndTestCase):
def order(self, amount):
ts = zope.component.getUtility(zeit.vgwort.interfaces.IToken... | 2.1875 | 2 |
setup.py | ds-wizard/dsw2to3 | 0 | 12763229 | <filename>setup.py<gh_stars>0
from setuptools import setup, find_packages
with open('README.md') as f:
long_description = ''.join(f.readlines())
setup(
name='dsw2to3',
version='1.0.2',
description='CLI tool to support migration from DSW 2.14 to DSW 3.0',
long_description=long_description,
lon... | 1.296875 | 1 |
FastApi/sima/src/apps/comment/__init__.py | parker-pu/SiMa | 2 | 12763230 | <reponame>parker-pu/SiMa
from src.apps.comment.urls import router
__all__ = [router]
| 1.203125 | 1 |
rlogbook/computing/migrations/0010_auto_20141128_1123.py | tamasgal/rlogbook | 0 | 12763231 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('computing', '0009_auto_20141128_1121'),
]
operations = [
migrations.RenameField(
model_name='computer',
... | 1.6875 | 2 |
solfasol/issues/admin.py | Solfasol/journo-blog | 0 | 12763232 | <reponame>Solfasol/journo-blog
import os
from io import BytesIO
from pdf2image import convert_from_path, convert_from_bytes
from django.core.files.base import ContentFile
from django.contrib import admin
from django.conf import settings
from .models import Issue, Page
class PageInline(admin.TabularInline):
model ... | 2.203125 | 2 |
PATH ANALYSIS Left Coordinate_Commited to SVN/calculus.py | abricot1025/Sloan_January_2018 | 1 | 12763233 | <reponame>abricot1025/Sloan_January_2018<gh_stars>1-10
import numpy as np
theta = np.tan(1.3/22.4)
print(theta*180/np.pi)
a = np.sqrt(1.3**2 + 22.4**2)
print(a)
delta_a = a - 22.4
print(delta_a) | 2.3125 | 2 |
mpfi/util.py | bensonby/mpfi | 1 | 12763234 | <filename>mpfi/util.py
import re
import pandas as pd
import numpy as np
'''
data: pandas DataFrame
key_tuple: a tuple which is the "index_col" of the data
'''
def is_exist(data, key_tuple):
return data.index.isin([key_tuple]).any()
def get_index_values(data, column):
return data.index.get_level_values(column)... | 3.4375 | 3 |
src/CreeDictionary/phrase_translate/crk_tag_map.py | aarppe/cree-intelligent-dictionary | 0 | 12763235 | <filename>src/CreeDictionary/phrase_translate/crk_tag_map.py<gh_stars>0
from CreeDictionary.phrase_translate.tag_map import TagMap
## Motivation
#
# TagMap handles the mapping from analysis FST tags to phrase-generation
# FST tags. As the wordform analysis and phrase-generation FSTs do fairly
# different things, using... | 2.15625 | 2 |
Codeforces/A_Vanya_and_Table.py | anubhab-code/Competitive-Programming | 0 | 12763236 | <gh_stars>0
arr = []
for x in range(100):
arr.append([])
arr[x] = [0 for i in range(100)]
n = int(input())
ans=0
for x in range(n):
a, b, c, d = map(int, input().split())
ans=ans+(c-a+1)*(d-b+1)
print(ans) | 2.671875 | 3 |
sdk/python/pulumi_gcp/dns/get_keys.py | sisisin/pulumi-gcp | 121 | 12763237 | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | 1.765625 | 2 |
preferences/admin.py | jbbqqf/okapi | 0 | 12763238 | <filename>preferences/admin.py<gh_stars>0
# -*- coding: utf-8 -*-
from django.contrib import admin
from preferences.models import (
UserInterface, UserInterfaceForm, UserPref, UserPrefForm)
class UserInterfaceAdmin(admin.ModelAdmin):
form = UserInterfaceForm
list_display = ('name', 'comment',)
search... | 1.875 | 2 |
ExerciciosPYTHON/NovPython/054.py | Samuel-Melo890/Python-Desafios | 0 | 12763239 | <reponame>Samuel-Melo890/Python-Desafios<filename>ExerciciosPYTHON/NovPython/054.py
from module.interface import *
from os import system
system('cls')
menu('Parênteses Pilhas')
f = input('Digite uma frase com parênteses: ').strip()
cont = 0
pilha = []
while cont < len(f):
if f[cont] == '(':
pilha.append(... | 3.296875 | 3 |
BOJ4287.py | INYEONGKIM/BOJ | 2 | 12763240 | alp = "abcdefghijklmnopqrstuvwxyz"
res = ""
while True:
s = __import__('sys').stdin.readline().strip()
if s == "#":
break
x, y, z = s.split()
t = ""
for i in range(len(x)):
dif = (ord(y[i]) - ord(x[i]) + 26) % 26
t += alp[(ord(z[i]) - ord('a') + dif) % 26]
res += s + " " ... | 2.96875 | 3 |
PythonBrasil/EstruturaSequencial/Soma.py | IGDEXE/Python | 0 | 12763241 | # Faça um Programa que peça dois números e imprima a soma.
# <NAME>
# Recebe os numeros
primeiroNumero = int(input("Informe um numero: "))
segundoNumero = int(input("Informe outro numero: "))
# Faz a soma
soma = primeiroNumero + segundoNumero
# Mostra na tela
print("A soma do numero %s com %s é %s" % (primeiroNumero... | 4.09375 | 4 |
code/Tokens/TokenEnum.py | antuniooh/Dattebayo-compiler | 0 | 12763242 | <gh_stars>0
from enum import Enum
""" Enum class of Tokens
"""
class TokenEnum(Enum):
NINJUTSU = "if"
GENJUTSU = "elif"
TAIJUTSU = "else"
KAGEBUNSHIN = "for"
TSUKUYOMI = "while"
CHAKRA = "def"
KAMUI = "return"
SHARINGAN = "print"
RASENGAN = "int"
RAIKIRI = "float"
... | 3.078125 | 3 |
magpie/dropboxlib/downloader/__init__.py | nimiq/moogle-project | 4 | 12763243 | import logging
from dropbox.client import DropboxClient # Dropobox official library
from ..redislist import RedisDropboxDownloadList, RedisDropboxIndexList
from .dropboxfile import DropboxFile
log = logging.getLogger('dropbox')
class DropboxDownloader:
"""
Download files from Dropbox based on a list previ... | 2.6875 | 3 |
test/levenshteinTests.py | gerhardJaeger/asjp19worldTree | 0 | 12763244 | import pandas as pd
import numpy as np
import Levenshtein
import random
random.seed(12345)
d = pd.read_csv("../data/asjp19wide.csv", index_col=0)
words = d.values[~d.isnull()]
words = np.concatenate([w.split('-') for w in words])
tests = pd.DataFrame(columns=['word1', 'word2', 'LD'])
for i in range(1000):
if... | 2.96875 | 3 |
tests/test_snakefile.py | stephenkraemer/regionset_profiler | 2 | 12763245 | """Test for the snakemake workflow distributed with region_set_profiler"""
import json
import subprocess
import os
import pandas as pd
import numpy as np
tmpdir = "/icgc/dkfzlsdf/analysis/hs_ontogeny/temp"
# TODO: gtfanno result has weird index
gtfanno_result: pd.DataFrame = pd.read_pickle(
"/icgc/dkfzlsdf/analy... | 2.078125 | 2 |
src/day10.py | TobiasRoeding/advent-of-code-2021 | 0 | 12763246 | <gh_stars>0
class Day10:
ILLEGAL_CHAR_TO_POINTS = {
")": 3,
"]": 57,
"}": 1197,
">": 25137,
}
def __init__(self, input="src/input/day10.txt"):
self.INPUT = input
def read_input(self):
input = []
with open(self.INPUT, "r") as fp:
line... | 3.203125 | 3 |
game/template.py | laddie132/MD3 | 6 | 12763247 | <filename>game/template.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = "Han"
__email__ = "<EMAIL>"
import random
import json
class AgentActs:
"""
Pre-defined agent actions and slots
"""
DIRECTED_BY = 'directed_by'
RELEASE_YEAR = 'release_year'
WRITTEN_BY = 'written_by'
ST... | 2.953125 | 3 |
multidb/decorators.py | apnarm/django-multidb | 0 | 12763248 | # -*- coding: utf-8 -*-
import functools
from django.forms.utils import ErrorList
from .readonly import read_only_mode, ReadOnlyError
from .signals import send_post_commit, send_post_rollback, send_pre_commit
def full_clean_if_not_read_only(full_clean):
"""Decorator for preventing form submissions while in read... | 2.578125 | 3 |
tests/dygraph/test_unstructured_prune.py | zzjjay/PaddleSlim | 0 | 12763249 | import sys
sys.path.append("../../")
import unittest
import paddle
import numpy as np
from paddleslim import UnstructuredPruner
from paddle.vision.models import mobilenet_v1
class TestUnstructuredPruner(unittest.TestCase):
def __init__(self, *args, **kwargs):
super(TestUnstructuredPruner, self).__init__(*... | 2.5 | 2 |
reg/models.py | saurabh00031/Coding-Avengers-007 | 2 | 12763250 | <filename>reg/models.py<gh_stars>1-10
from django.db import models
from django.contrib.auth.models import AbstractUser
# Create your models here.
class User(AbstractUser):
is_user = models.BooleanField(default=False)
is_hospital = models.BooleanField(default=False)
class hspinfo(models.Model):
user = mod... | 2.4375 | 2 |