max_stars_repo_path stringlengths 4 286 | max_stars_repo_name stringlengths 5 119 | max_stars_count int64 0 191k | id stringlengths 1 7 | content stringlengths 6 1.03M | content_cleaned stringlengths 6 1.03M | language stringclasses 111
values | language_score float64 0.03 1 | comments stringlengths 0 556k | edu_score float64 0.32 5.03 | edu_int_score int64 0 5 |
|---|---|---|---|---|---|---|---|---|---|---|
flaskblog/models.py | JayeshLocharla/DigiBus | 2 | 6621151 | <reponame>JayeshLocharla/DigiBus
from datetime import datetime
from flaskblog import db, login_manager
from flask_login import UserMixin
now = datetime.now()
@login_manager.user_loader
def load_user(user_id):
return User.query.get(int(user_id))
class User(db.Model, UserMixin):
id = db.Column(db.Integer, pri... | from datetime import datetime
from flaskblog import db, login_manager
from flask_login import UserMixin
now = datetime.now()
@login_manager.user_loader
def load_user(user_id):
return User.query.get(int(user_id))
class User(db.Model, UserMixin):
id = db.Column(db.Integer, primary_key=True)
fullname = db.... | none | 1 | 2.602054 | 3 | |
parentheses/1021_remove_outmost_parentheses.py | MartinMa28/Algorithms_review | 0 | 6621152 | <filename>parentheses/1021_remove_outmost_parentheses.py
from functools import reduce
class Solution:
def removeOutermostParentheses(self, S: str) -> str:
stack = []
primi_splits = []
for idx, s in enumerate(S):
if s == '(':
stack.append(idx)
elif s ... | <filename>parentheses/1021_remove_outmost_parentheses.py
from functools import reduce
class Solution:
def removeOutermostParentheses(self, S: str) -> str:
stack = []
primi_splits = []
for idx, s in enumerate(S):
if s == '(':
stack.append(idx)
elif s ... | none | 1 | 3.185186 | 3 | |
streamkov/metamarkov.py | bhtucker/streamkov | 1 | 6621153 | <filename>streamkov/metamarkov.py<gh_stars>1-10
# -*- coding: utf-8 -*-
"""
metamarkov
~~~~~~~~~~
Module for combining and drawing from multiple
"""
from streamkov.markov import MarkovGenerator
from functools import reduce
import random
class MetaMarkov(MarkovGenerator):
"""
Combine multiple Mark... | <filename>streamkov/metamarkov.py<gh_stars>1-10
# -*- coding: utf-8 -*-
"""
metamarkov
~~~~~~~~~~
Module for combining and drawing from multiple
"""
from streamkov.markov import MarkovGenerator
from functools import reduce
import random
class MetaMarkov(MarkovGenerator):
"""
Combine multiple Mark... | en | 0.744429 | # -*- coding: utf-8 -*- metamarkov ~~~~~~~~~~ Module for combining and drawing from multiple Combine multiple MarkovGenerators to draw Information and methods for transitioning from a word # returns a function mapping from a child's index to the master index | 2.662938 | 3 |
destiny/manifest.py | HazelTheWitch/destiny.py | 0 | 6621154 | from typing import TYPE_CHECKING, Union, List, Any, Dict
import sqlite3
import requests
import zipfile
import os
import json
from .errors import *
if TYPE_CHECKING:
from .destiny import *
__all__ = [
'Manifest'
]
class Manifest:
"""Handles interactions with the Destiny 2 manifest."""
def __init__(... | from typing import TYPE_CHECKING, Union, List, Any, Dict
import sqlite3
import requests
import zipfile
import os
import json
from .errors import *
if TYPE_CHECKING:
from .destiny import *
__all__ = [
'Manifest'
]
class Manifest:
"""Handles interactions with the Destiny 2 manifest."""
def __init__(... | en | 0.829362 | Handles interactions with the Destiny 2 manifest. Decode a given hash from the manifest. :param hash: the hash to decode :param definition: the defition to look up within :param locale: the locale to use to look up :return: the json response from the manifest Update the manifest from bun... | 2.725769 | 3 |
runway/lookups/handlers/__init__.py | onicagroup/runway | 134 | 6621155 | """Runway lookup handlers."""
from . import cfn, ecr, env, random_string, ssm, var
__all__ = ["cfn", "ecr", "env", "random_string", "ssm", "var"]
| """Runway lookup handlers."""
from . import cfn, ecr, env, random_string, ssm, var
__all__ = ["cfn", "ecr", "env", "random_string", "ssm", "var"]
| en | 0.713416 | Runway lookup handlers. | 1.246985 | 1 |
GUI_Web.py | KangFrank/Python_Start | 2 | 6621156 | #!usr/bin/env python3
#-*-coding:utf-8 -*-
#Filename:GUI_Web.py
#Write the first GUI program
from tkinter import *
class Application(Frame):
def __init__(self,master=None):
Frame.__init__(self,master)
self.pack()
self.createWidgets()
def createWidgets(self):
self.hel... | #!usr/bin/env python3
#-*-coding:utf-8 -*-
#Filename:GUI_Web.py
#Write the first GUI program
from tkinter import *
class Application(Frame):
def __init__(self,master=None):
Frame.__init__(self,master)
self.pack()
self.createWidgets()
def createWidgets(self):
self.hel... | en | 0.696241 | #!usr/bin/env python3 #-*-coding:utf-8 -*- #Filename:GUI_Web.py #Write the first GUI program app=Application()
app.master.title('Hello World')
app.mainloop #Add the function of input app1=Application1()
app1.master.title('Hello World')
app1.mainloop() #TCP/IP web network communications #establish the connection wit... | 3.770838 | 4 |
api/controller.py | datalogics/circulation | 0 | 6621157 | <filename>api/controller.py
from nose.tools import set_trace
import json
import logging
import sys
import urllib
import datetime
from wsgiref.handlers import format_date_time
from time import mktime
from lxml import etree
from sqlalchemy.orm import eagerload
from functools import wraps
import flask
from flask import ... | <filename>api/controller.py
from nose.tools import set_trace
import json
import logging
import sys
import urllib
import datetime
from wsgiref.handlers import format_date_time
from time import mktime
from lxml import etree
from sqlalchemy.orm import eagerload
from functools import wraps
import flask
from flask import ... | en | 0.900869 | If the site configuration has been updated, reload the CirculationManager's configuration from the database. Load all necessary configuration settings and external integrations from the database. This is called once when the CirculationManager is initialized. It may also be called late... | 1.524163 | 2 |
tests/test_for_suite/test_for_cli/test_for_runner.py | siddC/memote | 0 | 6621158 | <reponame>siddC/memote<filename>tests/test_for_suite/test_for_cli/test_for_runner.py
# -*- coding: utf-8 -*-
# Copyright 2017 Novo Nordisk Foundation Center for Biosustainability,
# Technical University of Denmark.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except i... | # -*- coding: utf-8 -*-
# Copyright 2017 Novo Nordisk Foundation Center for Biosustainability,
# Technical University of Denmark.
#
# 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... | en | 0.797921 | # -*- coding: utf-8 -*- # Copyright 2017 Novo Nordisk Foundation Center for Biosustainability, # Technical University of Denmark. # # 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:... | 2.109654 | 2 |
tests/litmus-framework-fastapi.py | Project-Dream-Weaver/pyre-http | 54 | 6621159 | import asyncio
import litmus
import uvloop
from fastapi import FastAPI
uvloop.install()
litmus.init_logger("info", None, True)
# asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
app = FastAPI()
server = None
@app.get("/stats")
async def show_stats():
print(server._server.len_clients())... | import asyncio
import litmus
import uvloop
from fastapi import FastAPI
uvloop.install()
litmus.init_logger("info", None, True)
# asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
app = FastAPI()
server = None
@app.get("/stats")
async def show_stats():
print(server._server.len_clients())... | en | 0.298551 | # asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) | 2.362912 | 2 |
zemberek/normalization/turkish_sentence_normalizer.py | Loodos/zemberek-python | 52 | 6621160 | import math
from pkg_resources import resource_filename
from typing import List, Tuple, Dict, FrozenSet, Set, Union
from zemberek.core.turkish import TurkishAlphabet, SecondaryPos
from zemberek.lm import SmoothLM
from zemberek.morphology import TurkishMorphology
from zemberek.morphology.analysis.word_analysis import ... | import math
from pkg_resources import resource_filename
from typing import List, Tuple, Dict, FrozenSet, Set, Union
from zemberek.core.turkish import TurkishAlphabet, SecondaryPos
from zemberek.lm import SmoothLM
from zemberek.morphology import TurkishMorphology
from zemberek.morphology.analysis.word_analysis import ... | none | 1 | 2.439645 | 2 | |
transaction_service/transactions/migrations/0012_remove_transactions_wallets_to_pay_and_more.py | deorz/TransactionService | 0 | 6621161 | <gh_stars>0
# Generated by Django 4.0.3 on 2022-03-13 15:55
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('transactions', '0011_transactions_wallets_to_pay_new'),
]
operations = [
migrations.RemoveField... | # Generated by Django 4.0.3 on 2022-03-13 15:55
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('transactions', '0011_transactions_wallets_to_pay_new'),
]
operations = [
migrations.RemoveField(
... | en | 0.806731 | # Generated by Django 4.0.3 on 2022-03-13 15:55 | 1.463786 | 1 |
0313.Super Ugly Number/solution.py | zhlinh/leetcode | 0 | 6621162 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
*****************************************
Author: zhlinh
Email: <EMAIL>
Version: 0.0.1
Created Time: 2016-05-16
Last_modify: 2016-05-16
******************************************
'''
'''
Write a program to find the n-th super ugly number.
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
*****************************************
Author: zhlinh
Email: <EMAIL>
Version: 0.0.1
Created Time: 2016-05-16
Last_modify: 2016-05-16
******************************************
'''
'''
Write a program to find the n-th super ugly number.
... | en | 0.692399 | #!/usr/bin/env python # -*- coding: utf-8 -*- ***************************************** Author: zhlinh Email: <EMAIL> Version: 0.0.1 Created Time: 2016-05-16 Last_modify: 2016-05-16 ****************************************** Write a program to find the n-th super ugly number. Super ugly nu... | 3.948285 | 4 |
aoc_2015/day11.py | geoffbeier/aoc_2021 | 0 | 6621163 | import itertools
import re
import string
from collections import defaultdict, namedtuple, Counter
from dataclasses import dataclass
from itertools import product
from math import prod
from typing import List, Dict, Any, Tuple
import aocd
from . import aoc_year
from loguru import logger
aoc_day = 11
@dataclass
class ... | import itertools
import re
import string
from collections import defaultdict, namedtuple, Counter
from dataclasses import dataclass
from itertools import product
from math import prod
from typing import List, Dict, Any, Tuple
import aocd
from . import aoc_year
from loguru import logger
aoc_day = 11
@dataclass
class ... | none | 1 | 3.100452 | 3 | |
tests/optimizer/test_insert.py | hongfuli/sharding-py | 1 | 6621164 | <filename>tests/optimizer/test_insert.py
import unittest
from shardingpy.api.config.base import load_sharding_rule_config_from_dict
from shardingpy.constant import ShardingOperator
from shardingpy.optimizer.insert_optimizer import InsertOptimizeEngine
from shardingpy.parsing.parser.context.condition import AndConditio... | <filename>tests/optimizer/test_insert.py
import unittest
from shardingpy.api.config.base import load_sharding_rule_config_from_dict
from shardingpy.constant import ShardingOperator
from shardingpy.optimizer.insert_optimizer import InsertOptimizeEngine
from shardingpy.parsing.parser.context.condition import AndConditio... | none | 1 | 2.168556 | 2 | |
gluetool_modules_framework/pipelines/pipeline_install_ancestors.py | testing-farm/gluetool-modules | 0 | 6621165 | <gh_stars>0
# Copyright Contributors to the Testing Farm project.
# SPDX-License-Identifier: Apache-2.0
import gluetool
from gluetool.result import Ok, Error
from gluetool.utils import normalize_shell_option, normalize_multistring_option
from gluetool.log import log_dict
from gluetool_modules_framework.libs.guest_setu... | # Copyright Contributors to the Testing Farm project.
# SPDX-License-Identifier: Apache-2.0
import gluetool
from gluetool.result import Ok, Error
from gluetool.utils import normalize_shell_option, normalize_multistring_option
from gluetool.log import log_dict
from gluetool_modules_framework.libs.guest_setup import gue... | en | 0.859038 | # Copyright Contributors to the Testing Farm project. # SPDX-License-Identifier: Apache-2.0 # noqa Installs package ancestors in a separate pipeline. The ancestors names are resolved from ``primary_task`` component name using ``ancestors`` shared function. When ``ancestors`` shared function is not available or... | 2.018311 | 2 |
gateway/qrTest3.py | dustinengle/smart-mailbox | 0 | 6621166 | import pyqrcode
from Tkinter import *
import tkMessageBox
import os
import sys
import requests
import json
import time
import signal
import multiprocessing as mp
import requests
import ed25519
from kit.controller import Controller
from kit.file import read_file
from kit.codec import decode, encode
from kit.crypto impo... | import pyqrcode
from Tkinter import *
import tkMessageBox
import os
import sys
import requests
import json
import time
import signal
import multiprocessing as mp
import requests
import ed25519
from kit.controller import Controller
from kit.file import read_file
from kit.codec import decode, encode
from kit.crypto impo... | en | 0.351808 | #menu.add_command(label="Kit", command = self.adminMenu) #menu.add_command(label="Help") #print(self.activeList) self.controller.setup(pw) self.controller.start() self.pw = pw #self.sensor = mp.Process(target=lambda: self.sensor_start()) #self.sensor_setup() #time.sleep(30) #self.scan_mailbox(1) #restar... | 2.179888 | 2 |
mlprogram/entrypoint/modules/torchnlp.py | HiroakiMikami/mlprogram | 9 | 6621167 | <reponame>HiroakiMikami/mlprogram<gh_stars>1-10
from torchnlp.encoders import LabelEncoder
types = {
"torchnlp.encoders.LabelEncoder": LabelEncoder
}
| from torchnlp.encoders import LabelEncoder
types = {
"torchnlp.encoders.LabelEncoder": LabelEncoder
} | none | 1 | 1.4252 | 1 | |
generators/__init__.py | mathpresso/qmwp | 14 | 6621168 | from generators.arithmetic import generate_arithmetic
from generators.combination import generate_combination
from generators.comparison import generate_comparison
from generators.figure import generate_figure
from generators.number import generate_numbers
from generators.ordering import generate_ordering
__all__ = [
... | from generators.arithmetic import generate_arithmetic
from generators.combination import generate_combination
from generators.comparison import generate_comparison
from generators.figure import generate_figure
from generators.number import generate_numbers
from generators.ordering import generate_ordering
__all__ = [
... | none | 1 | 2.028611 | 2 | |
Model/DataObject/SendingData/SendingTarget.py | MaximeGLegault/UI-Debug | 2 | 6621169 | # Under MIT License, see LICENSE.txt
from Model.DataObject.BaseDataObject import catch_format_error
from Model.DataObject.SendingData.BaseDataSending import BaseDataSending
__author__ = 'RoboCupULaval'
class SendingTarget(BaseDataSending):
def __init__(self, data_in=None):
super().__init__(data_in)
... | # Under MIT License, see LICENSE.txt
from Model.DataObject.BaseDataObject import catch_format_error
from Model.DataObject.SendingData.BaseDataSending import BaseDataSending
__author__ = 'RoboCupULaval'
class SendingTarget(BaseDataSending):
def __init__(self, data_in=None):
super().__init__(data_in)
... | fr | 0.989451 | # Under MIT License, see LICENSE.txt Retourne une dictionnaire de données par défaut | 2.421896 | 2 |
asanakoy/unet.py | chritter/kaggle_carvana_segmentation | 447 | 6621170 | import torch
import torch.nn as nn
class Unet4(nn.Module):
def __init__(self, feature_scale=1, n_classes=1, is_deconv=True, in_channels=3,
is_batchnorm=True, filters=None):
super(Unet4, self).__init__()
self.is_deconv = is_deconv
self.in_channels = in_channels
self... | import torch
import torch.nn as nn
class Unet4(nn.Module):
def __init__(self, feature_scale=1, n_classes=1, is_deconv=True, in_channels=3,
is_batchnorm=True, filters=None):
super(Unet4, self).__init__()
self.is_deconv = is_deconv
self.in_channels = in_channels
self... | en | 0.359729 | # TODO: fixme. Some dimensions could be wrong # print 'UnetUp convBlock::{}->{}'.format(in_size + residual_size, out_size) # print 'previous ({}) -> upsampled ({})'.format(previous.size()[1], upsampled.size()[1]) # print 'residual.size(), upsampled.size()', residual.size(), upsampled.size() # print 'Result size:', resu... | 2.225243 | 2 |
awslambda_lookup/exceptions.py | ITProKyle/runway-hook-awslambda | 1 | 6621171 | <gh_stars>1-10
"""High-level exceptions."""
from __future__ import annotations
from runway.cfngin.exceptions import CfnginError
class CfnginOnlyLookupError(CfnginError):
"""Attempted to use a CFNgin lookup outside of CFNgin."""
lookup_name: str
def __init__(self, lookup_name: str) -> None:
"""I... | """High-level exceptions."""
from __future__ import annotations
from runway.cfngin.exceptions import CfnginError
class CfnginOnlyLookupError(CfnginError):
"""Attempted to use a CFNgin lookup outside of CFNgin."""
lookup_name: str
def __init__(self, lookup_name: str) -> None:
"""Instantiate clas... | en | 0.873792 | High-level exceptions. Attempted to use a CFNgin lookup outside of CFNgin. Instantiate class. | 2.347157 | 2 |
viz/models/cycles_parallel/render.py | mepearson/Dash | 3 | 6621172 | ##### RENDER.PY #####
## FOR LIVE
from viz.utils import *
##
#styling
external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css',
'https://codepen.io/chriddyp/pen/brPBPO.css']
# Options lists for cycles. Move to callback when metadata available
options_list=['end_planting_day','fertilizer_rate','... | ##### RENDER.PY #####
## FOR LIVE
from viz.utils import *
##
#styling
external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css',
'https://codepen.io/chriddyp/pen/brPBPO.css']
# Options lists for cycles. Move to callback when metadata available
options_list=['end_planting_day','fertilizer_rate','... | en | 0.5754 | ##### RENDER.PY ##### ## FOR LIVE ## #styling # Options lists for cycles. Move to callback when metadata available # Layout # Local Data Stores # dcc.Store(id='cyclespc-s-settings'), # dcc.Store(id='cyclespc-cyclespc-s-sqldata'), #Page elements # ],className='row'), # html.Div([ # FUNCTIONS SELECT DISTINCT threadid, x... | 1.846877 | 2 |
tests/views.py | jockerz/Starlette-Login | 0 | 6621173 | from urllib.parse import parse_qsl
from starlette.requests import Request
from starlette.responses import (
HTMLResponse, RedirectResponse, PlainTextResponse, JSONResponse
)
from starlette_login.decorator import login_required, fresh_login_required
from starlette_login.utils import login_user, logout_user
from .... | from urllib.parse import parse_qsl
from starlette.requests import Request
from starlette.responses import (
HTMLResponse, RedirectResponse, PlainTextResponse, JSONResponse
)
from starlette_login.decorator import login_required, fresh_login_required
from starlette_login.utils import login_user, logout_user
from .... | en | 0.239969 | <h4>{error}<h4> <form method="POST"> <label>username <input name="username"></label> <label>Password <input name="password" type="password"></label> <button type="submit">Login</button> </form> # Ignore starlette(`AuthenticationMiddleware`) exception | 2.546739 | 3 |
BBNNet.py | yudasong/Reinforcement-Learning-Branch-and-Bound | 14 | 6621174 | import os
import shutil
import time
import random
import numpy as np
import math
import sys
sys.path.append('../../')
from utils import *
from pytorch_classification.utils import Bar, AverageMeter
from NeuralNet import NeuralNet
import tensorflow as tf
args = dotdict({
'architecture': 'CNN',
'lr': 0.001,
... | import os
import shutil
import time
import random
import numpy as np
import math
import sys
sys.path.append('../../')
from utils import *
from pytorch_classification.utils import Bar, AverageMeter
from NeuralNet import NeuralNet
import tensorflow as tf
args = dotdict({
'architecture': 'CNN',
'lr': 0.001,
... | en | 0.656031 | examples: list of examples, each example is of form (board, pi, v) # self.sess.run(tf.local_variables_initializer()) # predict and compute gradient and do SGD step # measure data loading time # record loss # measure elapsed time # plot progress board: np array with board # timing # start = time.time() # preparing input... | 2.567693 | 3 |
python-data-analysis/matplotlib/subplot/matplotlib_subplot.py | nkhn37/python-tech-sample-source | 0 | 6621175 | """matplotlib
複数グラフを一つのウィンドウに表示する(subplot)
[説明ページ]
https://tech.nkhn37.net/matplotlib-subplots/#_subplot
"""
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(0, 10, 100)
# 引数は、(行数, 列数, 指定する位置)
plt.subplot(2, 1, 1)
plt.plot(x, np.sin(x))
plt.subplot(2, 1, 2)
plt.plot(x, np.cos(x))
plt.show()
| """matplotlib
複数グラフを一つのウィンドウに表示する(subplot)
[説明ページ]
https://tech.nkhn37.net/matplotlib-subplots/#_subplot
"""
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(0, 10, 100)
# 引数は、(行数, 列数, 指定する位置)
plt.subplot(2, 1, 1)
plt.plot(x, np.sin(x))
plt.subplot(2, 1, 2)
plt.plot(x, np.cos(x))
plt.show()
| ja | 0.946963 | matplotlib 複数グラフを一つのウィンドウに表示する(subplot) [説明ページ] https://tech.nkhn37.net/matplotlib-subplots/#_subplot # 引数は、(行数, 列数, 指定する位置) | 3.90057 | 4 |
compiladores/algoritmos/Compiler/models/Symbol.py | WesleyAdriann/iesb | 0 | 6621176 |
class Symbol():
code = dict({
'LF': 10,
'ETX': 3,
'=': 11,
'+': 21,
'-': 22,
'*': 23,
'/': 24,
'%': 25,
'==': 31,
'!=': 32,
'>': 33,
'<': 34,
'>=': 35,
'<=': 36,
'var': 41,
'int': 51,
... |
class Symbol():
code = dict({
'LF': 10,
'ETX': 3,
'=': 11,
'+': 21,
'-': 22,
'*': 23,
'/': 24,
'%': 25,
'==': 31,
'!=': 32,
'>': 33,
'<': 34,
'>=': 35,
'<=': 36,
'var': 41,
'int': 51,
... | none | 1 | 2.760429 | 3 | |
tests/unit/controllers/test_user_employment_controller.py | Maxcutex/pm_api | 0 | 6621177 | """
Unit tests for the User Employment Controller.
"""
from datetime import datetime, date
from unittest.mock import patch
from app.controllers.user_employment_controller import UserEmploymentController
from app.models import User, UserEmployment, UserEmploymentSkill
from app.repositories.user_employment_repo import U... | """
Unit tests for the User Employment Controller.
"""
from datetime import datetime, date
from unittest.mock import patch
from app.controllers.user_employment_controller import UserEmploymentController
from app.models import User, UserEmployment, UserEmploymentSkill
from app.repositories.user_employment_repo import U... | en | 0.736651 | Unit tests for the User Employment Controller. Test list_user_employments OK response. # Arrange # Act # Assert Test get_user_employment invalid repo response. # Arrange # Act # Assert Test get_user_employment OK response. # Arrange # Act # Assert # import pdb # pdb.set_trace() # assert result.get_json()["payload"]["us... | 2.94887 | 3 |
devskill/4-great-the-work-is-done.py | neizod/problems | 1 | 6621178 | <gh_stars>1-10
#!/usr/bin/env python3
def main():
try:
while True:
hours, n = [int(n) for n in input().split()]
perf = sum(int(input()) for _ in range(n))
days, rem = divmod(hours, perf)
days += (rem > 0)
if days == 1:
print('Proje... | #!/usr/bin/env python3
def main():
try:
while True:
hours, n = [int(n) for n in input().split()]
perf = sum(int(input()) for _ in range(n))
days, rem = divmod(hours, perf)
days += (rem > 0)
if days == 1:
print('Project will finish ... | fr | 0.221828 | #!/usr/bin/env python3 | 3.453788 | 3 |
omoide/presentation/infra/paginator.py | IgorZyktin/omoide | 0 | 6621179 | # -*- coding: utf-8 -*-
"""Paginator that works with page numbers.
"""
import math
from typing import Iterator, Optional
from pydantic import BaseModel
class PageNum(BaseModel):
"""Single page representation."""
number: int
is_dummy: bool
is_current: bool
class Paginator:
"""Paginator that work... | # -*- coding: utf-8 -*-
"""Paginator that works with page numbers.
"""
import math
from typing import Iterator, Optional
from pydantic import BaseModel
class PageNum(BaseModel):
"""Single page representation."""
number: int
is_dummy: bool
is_current: bool
class Paginator:
"""Paginator that work... | en | 0.642197 | # -*- coding: utf-8 -*- Paginator that works with page numbers. Single page representation. Paginator that works with page numbers. Initialize instance. Return string representation. Iterate over current page. # [1][2][3][4][5] # [1][...][55][56][57][...][70] Return total amount of items in the sequence. Return True if... | 3.488404 | 3 |
fable/fable_sources/libtbx/command_line/prime_factors_of.py | hickerson/bbn | 4 | 6621180 | from __future__ import division
from libtbx.math_utils import prime_factors_of
import sys
def run(args):
for arg in args:
n = int(arg)
assert n > 0
print "prime factors of %d:" % n, prime_factors_of(n)
if (__name__ == "__main__"):
run(args=sys.argv[1:])
| from __future__ import division
from libtbx.math_utils import prime_factors_of
import sys
def run(args):
for arg in args:
n = int(arg)
assert n > 0
print "prime factors of %d:" % n, prime_factors_of(n)
if (__name__ == "__main__"):
run(args=sys.argv[1:])
| none | 1 | 2.383993 | 2 | |
tests/swarm/test_swarm.py | widdowquinn/lpbio | 0 | 6621181 | #!/usr/bin/env python
"""Tests of wrapper code in pycits.swarm"""
import os
import shutil
import unittest
import pytest
from lpbio import swarm, LPBioNotExecutableError
class TestSwarm(unittest.TestCase):
"""Class collecting tests for Swarm wrapper."""
def setUp(self):
"""Set up test fixtures"""... | #!/usr/bin/env python
"""Tests of wrapper code in pycits.swarm"""
import os
import shutil
import unittest
import pytest
from lpbio import swarm, LPBioNotExecutableError
class TestSwarm(unittest.TestCase):
"""Class collecting tests for Swarm wrapper."""
def setUp(self):
"""Set up test fixtures"""... | en | 0.641631 | #!/usr/bin/env python Tests of wrapper code in pycits.swarm Class collecting tests for Swarm wrapper. Set up test fixtures # Input/output paths # Target paths # remove and recreate the output directory swarm executable is in $PATH swarm module returns correct form of cmd-line swarm wrapper returns correct form of cmd-l... | 2.427671 | 2 |
modules/make_report.py | tbersez/Allmine | 5 | 6621182 | <reponame>tbersez/Allmine
# Report generator
#
# Starts the .py script for report generation
#
# Inputs:
# - sample_non_synm_variants.vcf
#
# Output:
# - Non_synonymous_variants_summary.tab
#
# Parameters:
# None
rule make_report :
input:
non_syno = expand(config["VAR"] + "{sample... | # Report generator
#
# Starts the .py script for report generation
#
# Inputs:
# - sample_non_synm_variants.vcf
#
# Output:
# - Non_synonymous_variants_summary.tab
#
# Parameters:
# None
rule make_report :
input:
non_syno = expand(config["VAR"] + "{samples}/{samples}_varscan.avinp... | en | 0.452613 | # Report generator # # Starts the .py script for report generation # # Inputs: # - sample_non_synm_variants.vcf # # Output: # - Non_synonymous_variants_summary.tab # # Parameters: # None ./modules/report_generator.py | 1.912473 | 2 |
pynamodb/util.py | dataframehq/PynamoDB | 1 | 6621183 | <filename>pynamodb/util.py
"""
Utils
"""
import re
def snake_to_camel_case(var_name: str) -> str:
"""
Converts camel case variable names to snake case variable_names
"""
first_pass = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', var_name)
return re.sub('([a-z0-9])([A-Z])', r'\1_\2', first_pass).lower()
| <filename>pynamodb/util.py
"""
Utils
"""
import re
def snake_to_camel_case(var_name: str) -> str:
"""
Converts camel case variable names to snake case variable_names
"""
first_pass = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', var_name)
return re.sub('([a-z0-9])([A-Z])', r'\1_\2', first_pass).lower()
| en | 0.592292 | Utils Converts camel case variable names to snake case variable_names | 3.161222 | 3 |
modelmaker/resources/templates/text_classification/scripts/test.py | shirecoding/ModelMaker | 0 | 6621184 | import os
import sys
import numpy as np
from tensorflow import keras
file_path = os.path.abspath(__file__)
current_directory = os.path.dirname(file_path)
project_directory = os.path.dirname(current_directory)
sys.path.insert(0, project_directory)
from {{package_name}}.models import {{ project_name }}
# load model in... | import os
import sys
import numpy as np
from tensorflow import keras
file_path = os.path.abspath(__file__)
current_directory = os.path.dirname(file_path)
project_directory = os.path.dirname(current_directory)
sys.path.insert(0, project_directory)
from {{package_name}}.models import {{ project_name }}
# load model in... | en | 0.838268 | # load model in development mode | 2.32274 | 2 |
auth_gitlab/constants.py | fufik/sentry-auth-gitlab | 0 | 6621185 | from django.conf import settings
CLIENT_ID = getattr(settings, 'GITLAB_APP_ID', None)
CLIENT_SECRET = getattr(settings, 'GITLAB_APP_SECRET', None)
BASE_DOMAIN = getattr(settings, 'GITLAB_BASE_DOMAIN', None)
SCHEME = getattr(settings, 'GITLAB_HTTP_SCHEME', 'https')
API_VERSION = getattr(settings, 'GITLAB_API_VERSION',... | from django.conf import settings
CLIENT_ID = getattr(settings, 'GITLAB_APP_ID', None)
CLIENT_SECRET = getattr(settings, 'GITLAB_APP_SECRET', None)
BASE_DOMAIN = getattr(settings, 'GITLAB_BASE_DOMAIN', None)
SCHEME = getattr(settings, 'GITLAB_HTTP_SCHEME', 'https')
API_VERSION = getattr(settings, 'GITLAB_API_VERSION',... | en | 0.27415 | # Just dummies from copied GitHub API so far | 1.941684 | 2 |
weiboCrawler/migrations/0002_auto_20210413_0745.py | SongYuQiu/Social-Network-Portrait-Analysis-System-BackCode | 0 | 6621186 | # Generated by Django 2.2.19 on 2021-04-13 07:45
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('weiboCrawler', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='weibotext',
name='source_text',... | # Generated by Django 2.2.19 on 2021-04-13 07:45
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('weiboCrawler', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='weibotext',
name='source_text',... | en | 0.752692 | # Generated by Django 2.2.19 on 2021-04-13 07:45 | 1.573404 | 2 |
ViscoIndent.py | yu-efremov/ViscoIndent | 3 | 6621187 | <reponame>yu-efremov/ViscoIndent
# -*- coding: utf-8 -*-
"""
gui for viscoindent, v. May-2021
with images for viscomodels
gui_Viscoindent
"""
import sys
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtWidgets import QMainWindow, QApplication, QWidget, QSizePolicy,\
QVBox... | # -*- coding: utf-8 -*-
"""
gui for viscoindent, v. May-2021
with images for viscomodels
gui_Viscoindent
"""
import sys
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtWidgets import QMainWindow, QApplication, QWidget, QSizePolicy,\
QVBoxLayout, QHBoxLayout, QLabel,\
... | en | 0.38015 | # -*- coding: utf-8 -*- gui for viscoindent, v. May-2021
with images for viscomodels
gui_Viscoindent # import matplotlib.pyplot as plt # import csv # general parameters (indenter, etc.) # indentation history # viscoelastic parameters # print(indpars) # print(vpars) # print(Pars) # print(self.curvedata) # with open('f... | 2.259176 | 2 |
problems/problem_16.py | minuq/project-euler | 0 | 6621188 | <filename>problems/problem_16.py
"""What is the sum of the digits of the number 2^1000? """
def main():
bignum = 1
result = 0
for i in range(0, 1000):
bignum *= 2
for i in range(0, len(str(bignum))):
result += int(str(bignum)[i])
print("Problem 16: {0}".format(result))
| <filename>problems/problem_16.py
"""What is the sum of the digits of the number 2^1000? """
def main():
bignum = 1
result = 0
for i in range(0, 1000):
bignum *= 2
for i in range(0, len(str(bignum))):
result += int(str(bignum)[i])
print("Problem 16: {0}".format(result))
| en | 0.886841 | What is the sum of the digits of the number 2^1000? | 3.438479 | 3 |
simulaqron/start/start_qnodeos.py | WrathfulSpatula/SimulaQron | 25 | 6621189 | #!/usr/bin/env python
import sys
import time
import signal
from timeit import default_timer as timer
from twisted.internet import reactor
from twisted.internet.error import ConnectionRefusedError, CannotListenError
from twisted.spread import pb
from netqasm.logging.glob import get_netqasm_logger, set_log_level
from ... | #!/usr/bin/env python
import sys
import time
import signal
from timeit import default_timer as timer
from twisted.internet import reactor
from twisted.internet.error import ConnectionRefusedError, CannotListenError
from twisted.spread import pb
from netqasm.logging.glob import get_netqasm_logger, set_log_level
from ... | en | 0.823128 | #!/usr/bin/env python Retrieves the relevant root objects to talk to such remote connections # Set the virtual node # Start listening to NetQASM messages Trys to connect to local virtual node. If connection is refused, we try again after a set amount of time (specified in handle_connection_error) # Connect # I... | 2.004815 | 2 |
AdventOfCode2020/02.simple.py | wandyezj/scripts | 0 | 6621190 | <filename>AdventOfCode2020/02.simple.py
def readFileLines(file):
f = open(file);
data = f.read().strip()
f.close()
return data.split("\n")
lines = readFileLines("02.data.txt")
partOneCount = 0
partTwoCount = 0
#go through each line
for line in lines:
# a b letter password
# a-b letter:... | <filename>AdventOfCode2020/02.simple.py
def readFileLines(file):
f = open(file);
data = f.read().strip()
f.close()
return data.split("\n")
lines = readFileLines("02.data.txt")
partOneCount = 0
partTwoCount = 0
#go through each line
for line in lines:
# a b letter password
# a-b letter:... | en | 0.8528 | #go through each line # a b letter password # a-b letter: password #print("{} {} {} {}".format(a, b, letter, password)) # part 1 # count how many of the letter is in the password # test against a and b # part 2 # test for letters presence at a and b using one based index # count the number that pass | 3.664104 | 4 |
menvod/html_extract.py | anokata/pythonPetProjects | 3 | 6621191 | from lxml import html
import glob
import os
import re
def file_to_html(filename):
if os.path.exists(filename):
with open(filename, 'rt') as fin:
content = fin.read()
html_doc = html.fromstring(content)
return html_doc
def get_all_tags(ht, tag):
return ht.xpath('//%s'%tag)
d... | from lxml import html
import glob
import os
import re
def file_to_html(filename):
if os.path.exists(filename):
with open(filename, 'rt') as fin:
content = fin.read()
html_doc = html.fromstring(content)
return html_doc
def get_all_tags(ht, tag):
return ht.xpath('//%s'%tag)
d... | en | 0.369688 | #if os.path.exists(end_name): # return None #if __name__=='__main__': #save_text('/home/ksi/Downloads/mol58.txt', x) | 3.041179 | 3 |
django/solution/untitled/ksiazkaadresowa/models/address.py | giserh/book-python | 1 | 6621192 | <reponame>giserh/book-python
from django.db import models
from django.utils.translation import ugettext_lazy as _
class Address(models.Model):
person = models.ForeignKey(verbose_name=_('Person'), to='ksiazkaadresowa.Person', on_delete=models.CASCADE)
street = models.CharField(verbose_name=_('Street'), max_len... | from django.db import models
from django.utils.translation import ugettext_lazy as _
class Address(models.Model):
person = models.ForeignKey(verbose_name=_('Person'), to='ksiazkaadresowa.Person', on_delete=models.CASCADE)
street = models.CharField(verbose_name=_('Street'), max_length=30, db_index=True)
ho... | none | 1 | 2.271821 | 2 | |
python/2020_04_1.py | wensby/advent-of-code | 0 | 6621193 | import sys
required_fields = ['byr', 'iyr', 'eyr', 'hgt', 'hcl', 'ecl', 'pid', 'cid']
def run(input):
passports = parse_passports(input)
return len([p for p in passports if is_valid(p)])
def parse_passports(input):
passports = []
passport = {}
passports.append(passport)
for line in input.splitlines():
... | import sys
required_fields = ['byr', 'iyr', 'eyr', 'hgt', 'hcl', 'ecl', 'pid', 'cid']
def run(input):
passports = parse_passports(input)
return len([p for p in passports if is_valid(p)])
def parse_passports(input):
passports = []
passport = {}
passports.append(passport)
for line in input.splitlines():
... | none | 1 | 3.609857 | 4 | |
agent.py | akhilcjacob/flappybird-parallel-rl | 0 | 6621194 | <reponame>akhilcjacob/flappybird-parallel-rl<filename>agent.py<gh_stars>0
import json
import os
import random
class Agent(object):
def __init__(self, agent_name, b_model=None):
self.q_table_loc = "./models/"
self._verify_dir()
self.last_state = '0_0_0'
self.base_model = {self.last... | import json
import os
import random
class Agent(object):
def __init__(self, agent_name, b_model=None):
self.q_table_loc = "./models/"
self._verify_dir()
self.last_state = '0_0_0'
self.base_model = {self.last_state: [0, 0]}
self.agent_name = agent_name
self.learning... | en | 0.357908 | # print(self.base_model) # if self.base_model != None: # Check to see if this state exists # self.base_model = self.base_model.append(columns) # print('appending') # columns = [{"id": state, "x": x_distance, "y": y_distance, "v": velocity, "a0": 0, "a1": 0}] # columns = [{"id":'0_1_2', "x":0, "y":0, "v":0, "a0":0, "a1"... | 2.892795 | 3 |
src/main.py | skbobade/UniversalRemote | 1 | 6621195 | ''' Main file to execute all micropython codes '''
import _thread
import machine
import utime
import mqtt
# Simple implementation for logging
logfile = 'mainlog.txt'
try:
_thread.start_new_thread(mqtt.start, ())
except Exception as exc:
with open(logfile, 'a+') as f:
print(str(exc))
f.write(... | ''' Main file to execute all micropython codes '''
import _thread
import machine
import utime
import mqtt
# Simple implementation for logging
logfile = 'mainlog.txt'
try:
_thread.start_new_thread(mqtt.start, ())
except Exception as exc:
with open(logfile, 'a+') as f:
print(str(exc))
f.write(... | en | 0.780405 | Main file to execute all micropython codes # Simple implementation for logging | 2.481964 | 2 |
language/apps.py | DiegoBrian/Flashcards | 1 | 6621196 | <filename>language/apps.py
from django.apps import AppConfig
class Language2Config(AppConfig):
name = 'language2'
| <filename>language/apps.py
from django.apps import AppConfig
class Language2Config(AppConfig):
name = 'language2'
| none | 1 | 1.375414 | 1 | |
azure/functions/decorators/eventhub.py | ShaneMicro/azure-functions-python-library | 0 | 6621197 | <gh_stars>0
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
from typing import Optional
from azure.functions.decorators.constants import EVENT_HUB_TRIGGER, EVENT_HUB
from azure.functions.decorators.core import Trigger, DataType, OutputBinding, \
Cardinality
class E... | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
from typing import Optional
from azure.functions.decorators.constants import EVENT_HUB_TRIGGER, EVENT_HUB
from azure.functions.decorators.core import Trigger, DataType, OutputBinding, \
Cardinality
class EventHubTrigg... | en | 0.853886 | # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. | 2.057477 | 2 |
test.py | FinnishArmy/Fibinachi-Sequence | 0 | 6621198 | def fib(n):
"""
Inputs a number,
Returns None if number is negative
Otherwise return final fibinachi number in sequence
Must use recursion
"""
#If n is less than or equal to 0, return an error.
if n < 0:
return None
#If n is equal to 0, return 0.
if n == 0:
re... | def fib(n):
"""
Inputs a number,
Returns None if number is negative
Otherwise return final fibinachi number in sequence
Must use recursion
"""
#If n is less than or equal to 0, return an error.
if n < 0:
return None
#If n is equal to 0, return 0.
if n == 0:
re... | en | 0.678538 | Inputs a number, Returns None if number is negative Otherwise return final fibinachi number in sequence Must use recursion #If n is less than or equal to 0, return an error. #If n is equal to 0, return 0. #If n is equal to 1, return 1. #If n is equal to 2, return 1. #If n is something else, return the fibin... | 4.116222 | 4 |
katas/kyu_4/roman_numerals_decoder.py | the-zebulan/CodeWars | 40 | 6621199 | from itertools import groupby, izip_longest
ROMAN = {'M': 1000, 'D': 500, 'C': 100, 'L': 50, 'X': 10, 'V': 5, 'I': 1}
def solution(roman):
pairs = [sum(g) for _, g in groupby(ROMAN[a] for a in roman)]
return sum(a + b if a > b else b - a
for a, b in izip_longest(pairs[::2], pairs[1::2], fillva... | from itertools import groupby, izip_longest
ROMAN = {'M': 1000, 'D': 500, 'C': 100, 'L': 50, 'X': 10, 'V': 5, 'I': 1}
def solution(roman):
pairs = [sum(g) for _, g in groupby(ROMAN[a] for a in roman)]
return sum(a + b if a > b else b - a
for a, b in izip_longest(pairs[::2], pairs[1::2], fillva... | none | 1 | 3.03968 | 3 | |
src/user_utils.py | ECS-OH-Bot/OH-Bot | 6 | 6621200 | """
Utility functions for working with user and member instances
"""
from typing import Optional
from discord.ext import commands
from discord import User, Member
from constants import GetConstants
from errors import CommandPermissionError
async def userToMember(user: User, bot: commands.Bot) -> Optional[Member]:
... | """
Utility functions for working with user and member instances
"""
from typing import Optional
from discord.ext import commands
from discord import User, Member
from constants import GetConstants
from errors import CommandPermissionError
async def userToMember(user: User, bot: commands.Bot) -> Optional[Member]:
... | en | 0.865091 | Utility functions for working with user and member instances Resolves a user into a member of the guild When the bot receives a direct message the author of the message is a User To get information about this user as a member of a guild, a member instance is needed :param user: The user instance :param ... | 3.225272 | 3 |
tests/test_repozewho.py | passy/glashammer-rdrei | 1 | 6621201 | <reponame>passy/glashammer-rdrei
from unittest import TestCase
from glashammer import make_app
from glashammer.utils import Response
from werkzeug.test import Client
from repoze.who.middleware import PluggableAuthenticationMiddleware
from repoze.who.interfaces import IIdentifier
from repoze.who.interfaces import I... | from unittest import TestCase
from glashammer import make_app
from glashammer.utils import Response
from werkzeug.test import Client
from repoze.who.middleware import PluggableAuthenticationMiddleware
from repoze.who.interfaces import IIdentifier
from repoze.who.interfaces import IChallenger
from repoze.who.plugins... | en | 0.498159 | # only for browser | 1.99368 | 2 |
seeq/addons/clustering/app/historicalBenchmarking/__init__.py | eparsonnet93/seeq-clustering | 3 | 6621202 | from .core import *
from .cluster import *
from .contour import * | from .core import *
from .cluster import *
from .contour import * | none | 1 | 0.930786 | 1 | |
.conan/conanfile.py | Viatorus/compile-time-printer | 35 | 6621203 | from conans import ConanFile, tools
from conans.errors import CalledProcessErrorWithStderr
class ConanPackage(ConanFile):
name = 'compile-time-printer'
license = 'BSL-1.0'
url = 'https://github.com/Viatorus/compile-time-printer'
description = 'The C++ files for the compile-time printer.'
exports_s... | from conans import ConanFile, tools
from conans.errors import CalledProcessErrorWithStderr
class ConanPackage(ConanFile):
name = 'compile-time-printer'
license = 'BSL-1.0'
url = 'https://github.com/Viatorus/compile-time-printer'
description = 'The C++ files for the compile-time printer.'
exports_s... | none | 1 | 2.01837 | 2 | |
trace_for_guess/calculate_fsdscl.py | wtraylor/trace21ka_for_lpjguess | 0 | 6621204 | <gh_stars>0
# SPDX-FileCopyrightText: 2021 <NAME> <<EMAIL>>
#
# SPDX-License-Identifier: MIT
import glob
import os
import shutil
import subprocess
import xarray as xr
from termcolor import cprint
from trace_for_guess.skip import skip
def calculate_fsdscl(cldtot_file, fsds_file, fsdsc_file, out_file):
"""Re-con... | # SPDX-FileCopyrightText: 2021 <NAME> <<EMAIL>>
#
# SPDX-License-Identifier: MIT
import glob
import os
import shutil
import subprocess
import xarray as xr
from termcolor import cprint
from trace_for_guess.skip import skip
def calculate_fsdscl(cldtot_file, fsds_file, fsdsc_file, out_file):
"""Re-construct the C... | en | 0.79733 | # SPDX-FileCopyrightText: 2021 <NAME> <<EMAIL>> # # SPDX-License-Identifier: MIT Re-construct the CCSM3 FSDSCL variable from CLDTOT, FSDS, and FSDSC. - FSDS: Downwelling solar flux at surface in W/m². - CLDTOT: Vertically-integrated total cloud fraction. This is equivalent to the cld variable in the CR... | 2.358957 | 2 |
parse.py | tbicr/OfflineMap | 195 | 6621205 | <filename>parse.py
import os
import urllib2
import math
import base64
import json
from operator import attrgetter
from sys import maxint as MAX_INT
from multiprocessing.pool import ThreadPool as Pool
def get_length(point1, point2):
return math.sqrt((point1.x - point2.x) ** 2 + (point1.y - point2.y) ** 2)
def ge... | <filename>parse.py
import os
import urllib2
import math
import base64
import json
from operator import attrgetter
from sys import maxint as MAX_INT
from multiprocessing.pool import ThreadPool as Pool
def get_length(point1, point2):
return math.sqrt((point1.x - point2.x) ** 2 + (point1.y - point2.y) ** 2)
def ge... | none | 1 | 2.785791 | 3 | |
test_geo.py | Frangoulides/Flood_Warning_System_179 | 0 | 6621206 | from floodsystem import geo
from floodsystem import stationdata
from haversine import haversine
from floodsystem.station import MonitoringStation
def test_stations_by_distance():
stations_list = geo.stations_by_distance(stationdata.build_station_list(), (52.2053, 0.1218))
assert stations_list[0][0].name == ... | from floodsystem import geo
from floodsystem import stationdata
from haversine import haversine
from floodsystem.station import MonitoringStation
def test_stations_by_distance():
stations_list = geo.stations_by_distance(stationdata.build_station_list(), (52.2053, 0.1218))
assert stations_list[0][0].name == ... | en | 0.877972 | # Create 100 new stations on an imaginary river called 'HopefullyNotARealRiverName'. | 3.026811 | 3 |
examples/hello_world.py | mohamedelkansouli/https-github.com-jshaffstall-PyPhysicsSandbox | 38 | 6621207 | <gh_stars>10-100
"""
A traditional Hello World example for PyPhysicsSandbox. A screencast showing the development
of this example can be found at: https://www.youtube.com/watch?v=xux3z2unaME
"""
from pyphysicssandbox import *
window('Hello World', 300, 300)
floor = static_box((0, 290), 300, 10)
floor.color = Color(... | """
A traditional Hello World example for PyPhysicsSandbox. A screencast showing the development
of this example can be found at: https://www.youtube.com/watch?v=xux3z2unaME
"""
from pyphysicssandbox import *
window('Hello World', 300, 300)
floor = static_box((0, 290), 300, 10)
floor.color = Color('blue')
caption ... | en | 0.624103 | A traditional Hello World example for PyPhysicsSandbox. A screencast showing the development of this example can be found at: https://www.youtube.com/watch?v=xux3z2unaME | 3.119733 | 3 |
其他面试题/DNA改造.py | lih627/python-algorithm-templates | 24 | 6621208 | """
360公司 2020笔试题
有一种特殊的DNA, 仅仅由 A 和 T 组成, 顺次链接
科学家通过一种手段, 可以改变这种DNA, 每一次, 科学家可以交换改DNA上的
两个核酸的位置, 也可以把特定位置的某个核酸修改为另外一种.
有一个DNA 希望改造成另外一个DNA, 计算最小操作次数
输入
ATTTAA
TTAATT
返回 3
"""
def solve(s1, s2):
"""
找规律题, 先通过更改核酸, 让两个核酸的A和T数量一致,
注意修改后的核酸放到正确位置上
然后对不满足要求的位置记录其更换次数
更换次数 等于 总不满足要求的位置个数 // 2
""... | """
360公司 2020笔试题
有一种特殊的DNA, 仅仅由 A 和 T 组成, 顺次链接
科学家通过一种手段, 可以改变这种DNA, 每一次, 科学家可以交换改DNA上的
两个核酸的位置, 也可以把特定位置的某个核酸修改为另外一种.
有一个DNA 希望改造成另外一个DNA, 计算最小操作次数
输入
ATTTAA
TTAATT
返回 3
"""
def solve(s1, s2):
"""
找规律题, 先通过更改核酸, 让两个核酸的A和T数量一致,
注意修改后的核酸放到正确位置上
然后对不满足要求的位置记录其更换次数
更换次数 等于 总不满足要求的位置个数 // 2
""... | zh | 0.9967 | 360公司 2020笔试题 有一种特殊的DNA, 仅仅由 A 和 T 组成, 顺次链接 科学家通过一种手段, 可以改变这种DNA, 每一次, 科学家可以交换改DNA上的 两个核酸的位置, 也可以把特定位置的某个核酸修改为另外一种. 有一个DNA 希望改造成另外一个DNA, 计算最小操作次数 输入 ATTTAA TTAATT 返回 3 找规律题, 先通过更改核酸, 让两个核酸的A和T数量一致, 注意修改后的核酸放到正确位置上 然后对不满足要求的位置记录其更换次数 更换次数 等于 总不满足要求的位置个数 // 2 | 3.404774 | 3 |
hackerrank/Python/Set Mutations/solution.py | ATrain951/01.python-com_Qproject | 4 | 6621209 | <gh_stars>1-10
_, A = int(input().rstrip()), set(map(int, input().rstrip().split()))
N = int(input())
for _ in range(N):
method, new_set = input().rstrip().split()[0], set(map(int, input().rstrip().split()))
getattr(A, method)(new_set)
print(sum(A))
| _, A = int(input().rstrip()), set(map(int, input().rstrip().split()))
N = int(input())
for _ in range(N):
method, new_set = input().rstrip().split()[0], set(map(int, input().rstrip().split()))
getattr(A, method)(new_set)
print(sum(A)) | none | 1 | 2.96508 | 3 | |
2020/09/Teil 2 - V02 - optimal window sliding.py | HeWeMel/adventofcode | 1 | 6621210 | import sys, itertools
import re
with open('input.txt') as f:
lines = f.readlines() # read complete file, create list of lines with CRs
g = 258585477
# create list of ints from the lines
ints = []
for str in lines:
str = str.rstrip('\n')
i = int(str)
ints.append(i)
# solve problem: slide window over... | import sys, itertools
import re
with open('input.txt') as f:
lines = f.readlines() # read complete file, create list of lines with CRs
g = 258585477
# create list of ints from the lines
ints = []
for str in lines:
str = str.rstrip('\n')
i = int(str)
ints.append(i)
# solve problem: slide window over... | en | 0.669368 | # read complete file, create list of lines with CRs # create list of ints from the lines # solve problem: slide window over the numbers (n), move start or end if sum does not fit (-> n^2) # 36981213 | 3.222947 | 3 |
flexible_filter_conditions/migrations/0003_auto_20200218_1236.py | auto-mat/django-flexible-filter-conditions | 0 | 6621211 | <gh_stars>0
# Generated by Django 2.2.10 on 2020-02-18 11:36
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('flexible_filter_conditions', '0002_auto_20200218_1214'),
]
operations = [
migrations.AlterFiel... | # Generated by Django 2.2.10 on 2020-02-18 11:36
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('flexible_filter_conditions', '0002_auto_20200218_1214'),
]
operations = [
migrations.AlterField(
... | en | 0.764828 | # Generated by Django 2.2.10 on 2020-02-18 11:36 | 1.661222 | 2 |
enelvo/candidate_scoring/__init__.py | tfcbertaglia/enelvo | 15 | 6621212 | <filename>enelvo/candidate_scoring/__init__.py
from .baselines import *
from .embeddings import *
| <filename>enelvo/candidate_scoring/__init__.py
from .baselines import *
from .embeddings import *
| none | 1 | 1.084911 | 1 | |
Server/app/views/restaurant/menu.py | TblMaker/TableMaker-Backend | 0 | 6621213 | <filename>Server/app/views/restaurant/menu.py
from flask import Blueprint, Response, abort, g, request
from flask_restful import Api
from flasgger import swag_from
from app.views import BaseResource, auth_required, json_required
api = Api(Blueprint('menu-api', __name__))
@api.resource('/menu/<restaurant_id>')
class... | <filename>Server/app/views/restaurant/menu.py
from flask import Blueprint, Response, abort, g, request
from flask_restful import Api
from flasgger import swag_from
from app.views import BaseResource, auth_required, json_required
api = Api(Blueprint('menu-api', __name__))
@api.resource('/menu/<restaurant_id>')
class... | ko | 1.00007 | 특정 식당의 메뉴 목록 조회 특정 메뉴의 정보 조회 | 2.326831 | 2 |
car_number_detection.py | function-test/Car-Number-Detect | 0 | 6621214 | <gh_stars>0
import sys
import os
import cv2
import numpy as np
original_image = None
valid_rects = None
def car_number_detection():
image_file_name = 'original.png'
global original_image
original_image = cv2.imread(image_file_name)
gray_image = gray_scale(original_image)
save_image(gray_image, i... | import sys
import os
import cv2
import numpy as np
original_image = None
valid_rects = None
def car_number_detection():
image_file_name = 'original.png'
global original_image
original_image = cv2.imread(image_file_name)
gray_image = gray_scale(original_image)
save_image(gray_image, image_file_na... | ko | 0.999941 | ## 이미지 저장 # image : source image # image_file_name : image name # middle_name : image's middle name ## temp image를 생성해 주는 함수 # @return: original_image와 똑같은 사이즈의 temp image # original_image 의 크기를 가져옴 # 이미지 생성을 위해서 이미지 크기의 빈 array 선언 ## 이미지 흑백으로 변경 # image : source image # @return gray scale image # 색 변경. gray scale로 변경 ... | 3.117811 | 3 |
year/2020/11/seat_planner.py | nbalas/advent_of_code | 0 | 6621215 | from collections import namedtuple
from copy import deepcopy
from logs.setup_logs import init_logs
from readers.file_reader import FileReader
logger = init_logs(__name__)
EMPTY_SEAT = 'L'
OCCUPIED_SEAT = '#'
FLOOR = '.'
PART_1_OCCUPIED_LIMIT = 4
PART_2_OCCUPIED_LIMIT = 5
Coordinates = namedtuple("Coordinates", ('x... | from collections import namedtuple
from copy import deepcopy
from logs.setup_logs import init_logs
from readers.file_reader import FileReader
logger = init_logs(__name__)
EMPTY_SEAT = 'L'
OCCUPIED_SEAT = '#'
FLOOR = '.'
PART_1_OCCUPIED_LIMIT = 4
PART_2_OCCUPIED_LIMIT = 5
Coordinates = namedtuple("Coordinates", ('x... | en | 0.339538 | # print_seat_map(current_seating_map) # Part 1 # logger.debug(f"Processing {x_range}, {y_range}") # logger.debug(f"There are {occupied_seats} occupied_seats for coordinates {current_cords}") # Part 2 # logger.debug(f"Searching for occupied seat {direction} of {current_cords} in {directional_cords}") | 3.129552 | 3 |
CSV File import.py | pgmccann/nbbdd | 2 | 6621216 | <reponame>pgmccann/nbbdd<filename>CSV File import.py
from behave import given, when, then
import os.path
@given('the csv file to import exists')
def step_the_csv_file_to_import_exists(context):
assert os.path.exists("results.csv"), "results.csv does not exist"
@when('I call pandas read_csv')
def step_I_call_pandas_rea... | File import.py
from behave import given, when, then
import os.path
@given('the csv file to import exists')
def step_the_csv_file_to_import_exists(context):
assert os.path.exists("results.csv"), "results.csv does not exist"
@when('I call pandas read_csv')
def step_I_call_pandas_read_csv(context):
context.loader = CSVL... | none | 1 | 3.017116 | 3 | |
Kuriakose Eldho/pookalam.py | aldrin163/Code-a-pookalam | 12 | 6621217 | import cv2
import numpy as np
import math
size = 800
center = size//2
radius = 3*size//8
dark_red = (0,0,170)
red = (0,0,240)
dark_orange = (0,80,255)
orange = (0,120,255)
yellow = (0,200,255)
light_yellow = (214,250,255)
white = (255,255,255)
violet = (100,20,140)
dark_violet = (80,0,100)
dark_green = (0,120,0)
gree... | import cv2
import numpy as np
import math
size = 800
center = size//2
radius = 3*size//8
dark_red = (0,0,170)
red = (0,0,240)
dark_orange = (0,80,255)
orange = (0,120,255)
yellow = (0,200,255)
light_yellow = (214,250,255)
white = (255,255,255)
violet = (100,20,140)
dark_violet = (80,0,100)
dark_green = (0,120,0)
gree... | en | 0.469715 | # Adding Colors # Erase construction lines of layer 1 #second layer # Erase construction lines of layer 2 #Joining layer 1 & 2 | 2.886025 | 3 |
tests/test_dataset.py | andylolz/pyandi | 4 | 6621218 | from os.path import abspath, dirname, join
from unittest import TestCase
from mock import patch
from iatikit.data.dataset import DatasetSet, Dataset
from iatikit.utils.config import CONFIG
class TestDatasets(TestCase):
def __init__(self, *args, **kwargs):
super(TestDatasets, self).__init__(*args, **kwar... | from os.path import abspath, dirname, join
from unittest import TestCase
from mock import patch
from iatikit.data.dataset import DatasetSet, Dataset
from iatikit.utils.config import CONFIG
class TestDatasets(TestCase):
def __init__(self, *args, **kwargs):
super(TestDatasets, self).__init__(*args, **kwar... | none | 1 | 2.043299 | 2 | |
mysql-utilities-1.6.0/mysql/fabric/utils.py | bopopescu/mysql-dbcompare | 2 | 6621219 | <reponame>bopopescu/mysql-dbcompare
#
# Copyright (c) 2013,2014, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
... | #
# Copyright (c) 2013,2014, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the... | en | 0.823548 | # # Copyright (c) 2013,2014, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; version 2 of the License. # # This program is distributed in the... | 2.586774 | 3 |
authors/apps/article/filters.py | arthurarty/ah-backend-poseidon | 1 | 6621220 | from django_filters import FilterSet
from django_filters import rest_framework as filters
from .models import Article
class ArticleFilter(FilterSet):
"""custom filter class for Articles"""
title = filters.CharFilter('title')
keyword = filters.CharFilter('title', 'icontains')
author = filters.CharFilt... | from django_filters import FilterSet
from django_filters import rest_framework as filters
from .models import Article
class ArticleFilter(FilterSet):
"""custom filter class for Articles"""
title = filters.CharFilter('title')
keyword = filters.CharFilter('title', 'icontains')
author = filters.CharFilt... | en | 0.749494 | custom filter class for Articles | 2.346374 | 2 |
config/test_config.py | jgoney/api-test | 0 | 6621221 | # Config values for testing
TESTING = True
MONGO_DB = 'api_test' | # Config values for testing
TESTING = True
MONGO_DB = 'api_test' | en | 0.153787 | # Config values for testing | 1.00535 | 1 |
server/udp_module.py | peakBreaker/embedded_utils | 1 | 6621222 | <reponame>peakBreaker/embedded_utils<gh_stars>1-10
#!/usr/bin/python3
import socket
from datetime import datetime
socket.setdefaulttimeout(1)
class udp_handler():
"Class for the udp handler"
def __init__(self, **kw):
# Create a TCP/IP socket
self.sock = socket.socket(socket.AF_INET, socket.SO... | #!/usr/bin/python3
import socket
from datetime import datetime
socket.setdefaulttimeout(1)
class udp_handler():
"Class for the udp handler"
def __init__(self, **kw):
# Create a TCP/IP socket
self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
# Bind the socket to the port
... | en | 0.514783 | #!/usr/bin/python3 # Create a TCP/IP socket # Bind the socket to the port # return "0000001" | 3.353967 | 3 |
today_mood/api/users/urls.py | 5boon/backend | 4 | 6621223 | from django.conf.urls import url
from rest_framework import routers
from api.users.views import UserInformationViewSet, UserRegisterViewSet, UserPasswordViewSet, UserIDViewSet, \
UserCheckViewSet, SNSLoginViewSet
app_name = 'users'
information = UserInformationViewSet.as_view({
'get': 'list',
'post': 'cr... | from django.conf.urls import url
from rest_framework import routers
from api.users.views import UserInformationViewSet, UserRegisterViewSet, UserPasswordViewSet, UserIDViewSet, \
UserCheckViewSet, SNSLoginViewSet
app_name = 'users'
information = UserInformationViewSet.as_view({
'get': 'list',
'post': 'cr... | none | 1 | 2.051568 | 2 | |
django/apps/forecast/views.py | koreander2001/weather-forecast-api | 0 | 6621224 | import json
import os
import pandas as pd
import requests
from datetime import datetime
from dateutil.tz import gettz
from rest_framework.response import Response
from rest_framework.views import APIView
from typing import Any, Dict
from .models import Forecast
from region.models import City
class ForecastView(APIVi... | import json
import os
import pandas as pd
import requests
from datetime import datetime
from dateutil.tz import gettz
from rest_framework.response import Response
from rest_framework.views import APIView
from typing import Any, Dict
from .models import Forecast
from region.models import City
class ForecastView(APIVi... | en | 0.060968 | # type: Dict[str, Any] | 2.530878 | 3 |
pycalphad/core/constraints.py | igorjrd/pycalphad | 0 | 6621225 | from symengine import sympify, lambdify, Symbol
from pycalphad.core.cache import cacheit
from pycalphad import variables as v
from pycalphad.core.constants import INTERNAL_CONSTRAINT_SCALING, MULTIPHASE_CONSTRAINT_SCALING
from pycalphad.core.utils import wrap_symbol_symengine
from collections import namedtuple
Constr... | from symengine import sympify, lambdify, Symbol
from pycalphad.core.cache import cacheit
from pycalphad import variables as v
from pycalphad.core.constants import INTERNAL_CONSTRAINT_SCALING, MULTIPHASE_CONSTRAINT_SCALING
from pycalphad.core.utils import wrap_symbol_symengine
from collections import namedtuple
Constr... | none | 1 | 2.157244 | 2 | |
ThreadFixProApi/Applications/_utils/__init__.py | denimgroup/threadfix-python-api | 1 | 6621226 | from ._team import TeamsAPI
from ._application import ApplicationsAPI
from ._defect_trackers import DefectTrackersAPI
from ._policies import PoliciesAPI
from ._scans import ScansAPI
from ._tags import TagsAPI
from ._tasks import TasksAPI
from ._vulnerabilities import VulnerabilitiesAPI
from ._waf import WafsAPI
from ._... | from ._team import TeamsAPI
from ._application import ApplicationsAPI
from ._defect_trackers import DefectTrackersAPI
from ._policies import PoliciesAPI
from ._scans import ScansAPI
from ._tags import TagsAPI
from ._tasks import TasksAPI
from ._vulnerabilities import VulnerabilitiesAPI
from ._waf import WafsAPI
from ._... | none | 1 | 1.044711 | 1 | |
work/run.py | jackthgu/K-AR_HYU_Deform_Simulation | 0 | 6621227 | import os,sys
os.chdir('../../work')
os.system(sys.argv[1])
| import os,sys
os.chdir('../../work')
os.system(sys.argv[1])
| none | 1 | 1.529572 | 2 | |
PicoWizard/modules/locale/locale.py | PureTryOut/pico-wizard | 11 | 6621228 | # SPDX-FileCopyrightText: 2021 <NAME> <<EMAIL>>
#
# SPDX-License-Identifier: MIT
import os
from PySide2.QtCore import QUrl, Slot, Property, QObject, Signal, QSortFilterProxyModel, Qt, QProcess
from PySide2.QtQml import qmlRegisterType
from PicoWizard.module import Module
from PicoWizard.modules.locale.localemodel im... | # SPDX-FileCopyrightText: 2021 <NAME> <<EMAIL>>
#
# SPDX-License-Identifier: MIT
import os
from PySide2.QtCore import QUrl, Slot, Property, QObject, Signal, QSortFilterProxyModel, Qt, QProcess
from PySide2.QtQml import qmlRegisterType
from PicoWizard.module import Module
from PicoWizard.modules.locale.localemodel im... | de | 0.260507 | # SPDX-FileCopyrightText: 2021 <NAME> <<EMAIL>> # # SPDX-License-Identifier: MIT | 1.864278 | 2 |
custom_components/tekmar_482/helpers.py | WillCodeForCats/tekmar-482 | 0 | 6621229 |
def regBytes(integer):
return divmod(integer, 0x100)
def degCtoF(degC):
return ((degC * 9/5) + 32)
def degCtoE(degC):
return (2 * degC)
def degEtoC(degE):
#degE = 2*(degC)
return (degE / 2)
def degHtoF(degH):
#degH = 10*(degF) + 850
return ((degH - 850) / 10)
def degFtoC(degF):
ret... |
def regBytes(integer):
return divmod(integer, 0x100)
def degCtoF(degC):
return ((degC * 9/5) + 32)
def degCtoE(degC):
return (2 * degC)
def degEtoC(degE):
#degE = 2*(degC)
return (degE / 2)
def degHtoF(degH):
#degH = 10*(degF) + 850
return ((degH - 850) / 10)
def degFtoC(degF):
ret... | es | 0.202226 | #degE = 2*(degC) #degH = 10*(degF) + 850 | 2.694842 | 3 |
mwach/settings_hiv.py | uw-ictd/mwbase | 1 | 6621230 | from .settings_base import *
### app specific overides
INSTALLED_APPS += ('mwhiv',)
ROOT_URLCONF = 'mwach.urls.hiv'
STATICFILES_DIRS = [f'{PROJECT_ROOT}/mwhiv/static', f'{PROJECT_ROOT}/mwbase/static']
### Swappable classes and inherited classes
SMSBANK_CLASS = 'utils.sms_utils.FinalRowHIV'
MWBASE_AUTOMATEDMESSAGE_MOD... | from .settings_base import *
### app specific overides
INSTALLED_APPS += ('mwhiv',)
ROOT_URLCONF = 'mwach.urls.hiv'
STATICFILES_DIRS = [f'{PROJECT_ROOT}/mwhiv/static', f'{PROJECT_ROOT}/mwbase/static']
### Swappable classes and inherited classes
SMSBANK_CLASS = 'utils.sms_utils.FinalRowHIV'
MWBASE_AUTOMATEDMESSAGE_MOD... | en | 0.737788 | ### app specific overides ### Swappable classes and inherited classes | 1.519014 | 2 |
django-rest-greetings/greetings/testtask_api/views.py | orionoiro/test-tasks | 0 | 6621231 | import datetime
from rest_framework import mixins, generics
from drf_renderer_xlsx.mixins import XLSXFileMixin
from .models import Record
from .serializers import RecordSerializer
class RecordsView(mixins.ListModelMixin,
mixins.CreateModelMixin,
XLSXFileMixin,
gen... | import datetime
from rest_framework import mixins, generics
from drf_renderer_xlsx.mixins import XLSXFileMixin
from .models import Record
from .serializers import RecordSerializer
class RecordsView(mixins.ListModelMixin,
mixins.CreateModelMixin,
XLSXFileMixin,
gen... | en | 0.299495 | # HTML-form browsable-api date filtering | 2.188594 | 2 |
hardware/testing/arfan.py | haziquehaikal/smartdb | 0 | 6621232 | <gh_stars>0
import schedule
import time
import urllib3
import json
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(4, GPIO.OUT)
GPIO.setup(17, GPIO.OUT)
p = GPIO.PWM(4, 50)
p.start(2.5)
t = GPIO.PWM(17, 50)
t.start(2.5)
op = {"FUSE OPEN"}
cl = {"FUSE CLOSE"}
o = json.dumps(op)
c = json.dumps(cl)
print("... | import schedule
import time
import urllib3
import json
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(4, GPIO.OUT)
GPIO.setup(17, GPIO.OUT)
p = GPIO.PWM(4, 50)
p.start(2.5)
t = GPIO.PWM(17, 50)
t.start(2.5)
op = {"FUSE OPEN"}
cl = {"FUSE CLOSE"}
o = json.dumps(op)
c = json.dumps(cl)
print("ACTIVATION S... | none | 1 | 2.640187 | 3 | |
chartingperformance/__init__.py | netplusdesign/home-performance-flask | 1 | 6621233 | <filename>chartingperformance/__init__.py
from flask import Flask
from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
from sqlalchemy import exc
from sqlalchemy import event
from sqlalchemy.pool import Pool
from flask_cors import CORS
app = Flask(__name__)
app.config.from_ob... | <filename>chartingperformance/__init__.py
from flask import Flask
from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
from sqlalchemy import exc
from sqlalchemy import event
from sqlalchemy.pool import Pool
from flask_cors import CORS
app = Flask(__name__)
app.config.from_ob... | en | 0.731611 | # optional - dispose the whole pool # instead of invalidating one at a time # connection_proxy._pool.dispose() # raise DisconnectionError - pool will try # connecting again up to three times before raising. | 2.204992 | 2 |
prestodb/prestodb.py | sasank1/plugins | 36 | 6621234 | #!/usr/bin/python
import json
import jpype
from jpype import java
from jpype import javax
# if any impacting changes to this plugin kindly increment the plugin version here
plugin_version = 1
# Setting this to true will alert you when there is a communication problem while posting plugin data to server
heartbeat_req... | #!/usr/bin/python
import json
import jpype
from jpype import java
from jpype import javax
# if any impacting changes to this plugin kindly increment the plugin version here
plugin_version = 1
# Setting this to true will alert you when there is a communication problem while posting plugin data to server
heartbeat_req... | en | 0.71822 | #!/usr/bin/python # if any impacting changes to this plugin kindly increment the plugin version here # Setting this to true will alert you when there is a communication problem while posting plugin data to server | 1.655494 | 2 |
main.py | alejogs4/statistics-python | 0 | 6621235 | # Arhivo para hacer pruebas de cada uno de los modulos
import descriptive
import dispersion
import probability
from distributions import binomial_distribution, acumulated_binomial, hypergeometric, acumulated_hypergeometric, poisson, exponential, norm
from distributions import uniform
from intervals import interval_pobl... | # Arhivo para hacer pruebas de cada uno de los modulos
import descriptive
import dispersion
import probability
from distributions import binomial_distribution, acumulated_binomial, hypergeometric, acumulated_hypergeometric, poisson, exponential, norm
from distributions import uniform
from intervals import interval_pobl... | es | 0.827017 | # Arhivo para hacer pruebas de cada uno de los modulos # Taller # print(binomial_distribution(10, 0.05, 2)) # Si me piden menor a 2 # print(acumulated_binomial(range(0, 3), 10, 0.05)) Aqui es si me piden mayor a algo en poisson # sum = 0 # for i in range(0, 11): # sum += poisson(i, 10.0) # print(1 - sum) # Taller 1... | 3.197472 | 3 |
receipts/receipts.py | dannysauer/misc_python | 0 | 6621236 | <filename>receipts/receipts.py
#!/usr/bin/env python3
import pickle
import os.path
from googleapiclient.discovery import build
from googleapiclient.http import MediaFileUpload
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
# If modifying these scopes, delete t... | <filename>receipts/receipts.py
#!/usr/bin/env python3
import pickle
import os.path
from googleapiclient.discovery import build
from googleapiclient.http import MediaFileUpload
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
# If modifying these scopes, delete t... | en | 0.841787 | #!/usr/bin/env python3 # If modifying these scopes, delete the file token.pickle. main receipt upload class # 'https://www.googleapis.com/auth/spreadsheets', # The cache_file stores the user's access and refresh tokens, and is # created automatically when the authorization flow completes for the # first time. # If ther... | 2.634859 | 3 |
code2/day09/demo11.py | picktsh/python | 1 | 6621237 | <reponame>picktsh/python<filename>code2/day09/demo11.py
# 教学系统的浏览器设置方法
from selenium.webdriver.chrome.webdriver import RemoteWebDriver # 从selenium库中调用RemoteWebDriver模块
from selenium.webdriver.chrome.options import Options # 从options模块中调用Options类
from bs4 import BeautifulSoup
import time
chrome_options = Options() #... | # 教学系统的浏览器设置方法
from selenium.webdriver.chrome.webdriver import RemoteWebDriver # 从selenium库中调用RemoteWebDriver模块
from selenium.webdriver.chrome.options import Options # 从options模块中调用Options类
from bs4 import BeautifulSoup
import time
chrome_options = Options() # 实例化Option对象
chrome_options.add_argument('--headless') ... | zh | 0.954877 | # 教学系统的浏览器设置方法 # 从selenium库中调用RemoteWebDriver模块 # 从options模块中调用Options类 # 实例化Option对象 # 对浏览器的设置 # 声明浏览器对象 # 访问页面 # 根据类名找到【点击加载更多】 # 点击 # 等待两秒 # 获取Elements中渲染完成的网页源代码 # 使用bs解析网页 # 使用bs提取元素 # 打印comments的数量 # 循环 # 提取评论 # 打印评论 # 关闭浏览器 | 3.090243 | 3 |
lambdata_Vincent_Emma/df_utils.py | Vincent-Emma/lambdata_Vincent_Emma | 0 | 6621238 | <gh_stars>0
import numpy as np
import pandas as pd
ONES = pd.Series(np.ones(20))
ZEROS = pd.Series(np.zeros(20))
def isna(df):
print(df.isna().sum())
def correlation_matrix(df):
print(df.corr())
| import numpy as np
import pandas as pd
ONES = pd.Series(np.ones(20))
ZEROS = pd.Series(np.zeros(20))
def isna(df):
print(df.isna().sum())
def correlation_matrix(df):
print(df.corr()) | none | 1 | 2.715399 | 3 | |
pycounter/test/test_pr1.py | yannsta/pycounter | 60 | 6621239 | """Test COUNTER DB1 database report"""
import os
import pycounter.report
def test_pr1_reportname(pr1_report):
assert pr1_report.report_type == "PR1"
def test_pr1_stats(pr1_report):
publication = pr1_report.pubs[0]
assert [x[2] for x in publication] == [91, 41, 13, 21, 44, 8, 0, 0, 36, 36, 7, 2]
def t... | """Test COUNTER DB1 database report"""
import os
import pycounter.report
def test_pr1_reportname(pr1_report):
assert pr1_report.report_type == "PR1"
def test_pr1_stats(pr1_report):
publication = pr1_report.pubs[0]
assert [x[2] for x in publication] == [91, 41, 13, 21, 44, 8, 0, 0, 36, 36, 7, 2]
def t... | en | 0.71579 | Test COUNTER DB1 database report # test metric of the first row # test metric of the second row | 2.704726 | 3 |
Code/sets.py | Andre-Williams22/CS-1.3-Core-Data-Structures | 0 | 6621240 | <filename>Code/sets.py<gh_stars>0
#!python
#from hashtable import HashTable
from binarytree import BinarySearchTree, BinaryTreeNode
class Treeset:
def __init__(self, elements=None):
''' initialize a new empty set structure, and add each element if a sequence is given '''
#self.hash = HashTable()
... | <filename>Code/sets.py<gh_stars>0
#!python
#from hashtable import HashTable
from binarytree import BinarySearchTree, BinaryTreeNode
class Treeset:
def __init__(self, elements=None):
''' initialize a new empty set structure, and add each element if a sequence is given '''
#self.hash = HashTable()
... | en | 0.765919 | #!python #from hashtable import HashTable initialize a new empty set structure, and add each element if a sequence is given #self.hash = HashTable() # self.element = BinaryTreeNode() property that tracks the number of elements in constant time Average Case Runtime: O(1) because we're updating the size variable... | 4.10752 | 4 |
sdk.py | carlgonz/qt-pyqt-sdk-builder | 1 | 6621241 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
#
# The MIT License (MIT)
#
# Copyright (c) 2014 <NAME>.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including witho... | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
#
# The MIT License (MIT)
#
# Copyright (c) 2014 <NAME>.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including witho... | en | 0.79824 | #!/usr/bin/env python2 # -*- coding: utf-8 -*- # # The MIT License (MIT) # # Copyright (c) 2014 <NAME>. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including witho... | 1.59421 | 2 |
test/test_violations_per_group.py | rschuitema/misra | 0 | 6621242 | <reponame>rschuitema/misra<gh_stars>0
from src.misra.misra_guideline import MisraGuideline
from src.queries.violations_per_group import get_violations_per_group
def test_violations_per_group_success():
guidelines = {"1.1": MisraGuideline(("1.1", "rule", "Mandatory", "Functions", "Functions rule 1")),
... | from src.misra.misra_guideline import MisraGuideline
from src.queries.violations_per_group import get_violations_per_group
def test_violations_per_group_success():
guidelines = {"1.1": MisraGuideline(("1.1", "rule", "Mandatory", "Functions", "Functions rule 1")),
"1.5": MisraGuideline(("1.5", "... | none | 1 | 1.929762 | 2 | |
experiments/whoosh-stemming.py | antipatico/pytoyir | 0 | 6621243 | #!/usr/bin/env python3
import whoosh.lang.porter as porter
import whoosh.lang.porter2 as porter2
import whoosh.lang.paicehusk as paicehusk
if __name__ == "__main__":
print(porter.stem("dancer"))
print(porter2.stem("dancer"))
print(paicehusk.stem("dancer"))
| #!/usr/bin/env python3
import whoosh.lang.porter as porter
import whoosh.lang.porter2 as porter2
import whoosh.lang.paicehusk as paicehusk
if __name__ == "__main__":
print(porter.stem("dancer"))
print(porter2.stem("dancer"))
print(paicehusk.stem("dancer"))
| fr | 0.221828 | #!/usr/bin/env python3 | 1.849309 | 2 |
Algorithms/inversions/inversions.py | BackEndTea/Learning | 1 | 6621244 |
def main():
print(sort_and_count_inversions(readfile())[0])
def readfile():
with open('./integerarray.txt') as f:
content = f.readlines()
return map(lambda x : int(x.strip()),content)
def sort_and_count_inversions(input):
n = len(input)
if n == 1:
return (0, input)
x = sort_... |
def main():
print(sort_and_count_inversions(readfile())[0])
def readfile():
with open('./integerarray.txt') as f:
content = f.readlines()
return map(lambda x : int(x.strip()),content)
def sort_and_count_inversions(input):
n = len(input)
if n == 1:
return (0, input)
x = sort_... | none | 1 | 3.40384 | 3 | |
myCompany/rules/urls.py | Rom4eg/myCompany | 0 | 6621245 | <filename>myCompany/rules/urls.py
import rules.views as views
from django.conf.urls import url, include
from rest_framework.routers import SimpleRouter
from rest_framework_nested import routers
router = SimpleRouter()
router.register(r'rules', views.RulesViewSet)
urlpatterns = [
url(r'^', include(router.urls)),
]... | <filename>myCompany/rules/urls.py
import rules.views as views
from django.conf.urls import url, include
from rest_framework.routers import SimpleRouter
from rest_framework_nested import routers
router = SimpleRouter()
router.register(r'rules', views.RulesViewSet)
urlpatterns = [
url(r'^', include(router.urls)),
]... | none | 1 | 1.861157 | 2 | |
ADS - Algoritimos e Estrutura de Dados/exercicio_arr1.py | mlobf/python_advanced | 0 | 6621246 | <gh_stars>0
"""
Recebe um array nao vazio que possui inteiros distintos e um
inteiro respersentando uma soma alvo.
Caso dois numeros no array de entrada gerar a soma alvo,
ele devem retornar estes dois numeros no array de saida.
Se nao gera retorna vazio.
"""
"""
Parametro 1 => Array de inteir... | """
Recebe um array nao vazio que possui inteiros distintos e um
inteiro respersentando uma soma alvo.
Caso dois numeros no array de entrada gerar a soma alvo,
ele devem retornar estes dois numeros no array de saida.
Se nao gera retorna vazio.
"""
"""
Parametro 1 => Array de inteiros
Param... | pt | 0.761747 | Recebe um array nao vazio que possui inteiros distintos e um inteiro respersentando uma soma alvo. Caso dois numeros no array de entrada gerar a soma alvo, ele devem retornar estes dois numeros no array de saida. Se nao gera retorna vazio. Parametro 1 => Array de inteiros Parametro 2 => Valor alvo q... | 4.059896 | 4 |
tutorials/01-basics/chainer_basics/main.py | nattochaduke/ChainerImitatingPyTorchTutorial | 0 | 6621247 | import chainer
from chainer.backends import cuda
from chainer import Function, gradient_check, report, training, utils, Variable
from chainer import datasets, iterators, optimizers, serializers
from chainer import Link, Chain, ChainList
from chainer.dataset import convert
import chainer.functions as F
import chainer.li... | import chainer
from chainer.backends import cuda
from chainer import Function, gradient_check, report, training, utils, Variable
from chainer import datasets, iterators, optimizers, serializers
from chainer import Link, Chain, ChainList
from chainer.dataset import convert
import chainer.functions as F
import chainer.li... | en | 0.630366 | # ================================================================== # # Table of Contents # # ================================================================== # # 1. Basic autograd example 1 (Line 31 to 45) # 2. Basic autograd example 2 (Li... | 2.498675 | 2 |
ocr_calculator.py | rudolfce/ocr_calculator | 2 | 6621248 | # OCR Calculator
# Copyright (C) 2019 <NAME>
#
# This module is part of OCR Calculator and is under the MIT License:
# http://www.opensource.org/licenses/mit-license.php
'''Script that summarizes the ocr calculator. Requires a propperly configured
settings.py file. See settings_example.py for more information'''
impor... | # OCR Calculator
# Copyright (C) 2019 <NAME>
#
# This module is part of OCR Calculator and is under the MIT License:
# http://www.opensource.org/licenses/mit-license.php
'''Script that summarizes the ocr calculator. Requires a propperly configured
settings.py file. See settings_example.py for more information'''
impor... | en | 0.686918 | # OCR Calculator # Copyright (C) 2019 <NAME> # # This module is part of OCR Calculator and is under the MIT License: # http://www.opensource.org/licenses/mit-license.php Script that summarizes the ocr calculator. Requires a propperly configured settings.py file. See settings_example.py for more information # Creating l... | 2.709737 | 3 |
main.py | ovvladimir/Training_apparatus | 0 | 6621249 | import pygame
from settings import *
from Back_Ground import *
from Bot_cl import group, bot
bot_pos = Kletky_rect.topleft
font = pygame.font.Font(None, 30)
card = pygame.Surface((200, 50))
card.fill(grey)
looseCard = []
LooseCardPos = []
card_rect = card.get_rect(center=(part1.get_width() // 2, 50))
text = font.rende... | import pygame
from settings import *
from Back_Ground import *
from Bot_cl import group, bot
bot_pos = Kletky_rect.topleft
font = pygame.font.Font(None, 30)
card = pygame.Surface((200, 50))
card.fill(grey)
looseCard = []
LooseCardPos = []
card_rect = card.get_rect(center=(part1.get_width() // 2, 50))
text = font.rende... | th | 0.062603 | ## # group.update() | 2.402542 | 2 |
placidity/core/cd.py | bebraw/Placidity | 2 | 6621250 | from __future__ import absolute_import
import os
class Cd:
aliases = 'cd'
description = 'Change working directory'
prev = os.getcwd()
def matches(self, expression):
parts = expression.split()
return parts[0] == 'cd' and len(parts) == 2
def execute(self, expression, variables):
... | from __future__ import absolute_import
import os
class Cd:
aliases = 'cd'
description = 'Change working directory'
prev = os.getcwd()
def matches(self, expression):
parts = expression.split()
return parts[0] == 'cd' and len(parts) == 2
def execute(self, expression, variables):
... | none | 1 | 2.617234 | 3 |