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
src/plugin.py
JuggOrNot/battle.net
0
6622451
<filename>src/plugin.py<gh_stars>0 import asyncio import json import os import sys import multiprocessing import webbrowser import requests import requests.cookies import pathlib import logging as log import subprocess import errno from threading import Thread from threading import Lock from version import __version_...
<filename>src/plugin.py<gh_stars>0 import asyncio import json import os import sys import multiprocessing import webbrowser import requests import requests.cookies import pathlib import logging as log import subprocess import errno from threading import Thread from threading import Lock from version import __version_...
en
0.691143
# 5 WindowsError access denied # 5 WindowsError access denied Game is considered as installed when present in both config and product.db # give threads 4 seconds to finish # attempting to uninstall classic wow through protocol gives you a message that the game cannot # be uninstalled through protocol and you should use...
1.922734
2
features/steps/sum_ABCs.py
percebus/leetcode-excercises
0
6622452
from aloe import step, world from problems.meta.coding.puzzles.warmup.sum_abc import get_sum @step("three integers (?P<A>.+), (?P<B>.+), and (?P<C>.+)") def step_impl(self, A, B, C): world.A = int(A) world.B = int(B) world.C = int(C) @step("I call getSum") def step_impl(self): world.result = get_sum...
from aloe import step, world from problems.meta.coding.puzzles.warmup.sum_abc import get_sum @step("three integers (?P<A>.+), (?P<B>.+), and (?P<C>.+)") def step_impl(self, A, B, C): world.A = int(A) world.B = int(B) world.C = int(C) @step("I call getSum") def step_impl(self): world.result = get_sum...
none
1
3.054697
3
src/errors.py
Maskime/complex-extract
0
6622453
from types import TracebackType from typing import Optional class ComplexExtractException(Exception): def __init__(self, *args: object) -> None: super().__init__(*args) def with_traceback(self, tb: Optional[TracebackType]) -> BaseException: return super().with_traceback(tb)
from types import TracebackType from typing import Optional class ComplexExtractException(Exception): def __init__(self, *args: object) -> None: super().__init__(*args) def with_traceback(self, tb: Optional[TracebackType]) -> BaseException: return super().with_traceback(tb)
none
1
2.91983
3
strongholds-and-followers/retainer/check.py
kbsletten/AvraeAliases
0
6622454
embed <drac2> argv = &ARGS& args = argparse(argv) GVARS = load_json(get_gvar("c1ee7d0f-750d-4f92-8d87-70fa22c07a81")) CLASSES = [load_json(get_gvar(gvar)) for gvar in GVARS] ABILITIES = { "dex": "dex", "dexterity": "dex", "cha": "cha", "charisma": "cha", "con": "con", "constitution": "con", "...
embed <drac2> argv = &ARGS& args = argparse(argv) GVARS = load_json(get_gvar("c1ee7d0f-750d-4f92-8d87-70fa22c07a81")) CLASSES = [load_json(get_gvar(gvar)) for gvar in GVARS] ABILITIES = { "dex": "dex", "dexterity": "dex", "cha": "cha", "charisma": "cha", "con": "con", "constitution": "con", "...
en
0.313211
**DC {dc}** {check}mi{args.last("mc")} -f "Check {i}|{check_roll}|inline" -f "{field}" -phrase "{args.last("phrase")}" -desc "{desc}" #5710"}}"
2.550015
3
poppy/bootstrap.py
jqxin2006/poppy
0
6622455
<reponame>jqxin2006/poppy<gh_stars>0 # Copyright (c) 2014 Rackspace, 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...
# Copyright (c) 2014 Rackspace, 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 agreed to in wr...
en
0.82973
# Copyright (c) 2014 Rackspace, 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 agreed to in wr...
1.867443
2
script.py
krishkiran/Unlimited-Filter-Bot
0
6622456
<gh_stars>0 class Script(object): START_MSG = """Hi <b>{}, </b> I'm <b>Samantha v2.O</b> Auto Filter Bot Specially Made For 2kTamilmovies Controlled By [This Person](https://t.me/DChoco_Boy) 😎 """ HELP_MSG = """ <i>No One Gonna Help You 🤣</i> """ ABOUT_MSG = """ Hi I'm <b>Samantha v2.O</b> Auto Fi...
class Script(object): START_MSG = """Hi <b>{}, </b> I'm <b>Samantha v2.O</b> Auto Filter Bot Specially Made For 2kTamilmovies Controlled By [This Person](https://t.me/DChoco_Boy) 😎 """ HELP_MSG = """ <i>No One Gonna Help You 🤣</i> """ ABOUT_MSG = """ Hi I'm <b>Samantha v2.O</b> Auto Filter Bot Spe...
en
0.414802
Hi <b>{}, </b> I'm <b>Samantha v2.O</b> Auto Filter Bot Specially Made For 2kTamilmovies Controlled By [This Person](https://t.me/DChoco_Boy) 😎 <i>No One Gonna Help You 🤣</i> Hi I'm <b>Samantha v2.O</b> Auto Filter Bot Specially Made For 2kTamilmovies Controlled By [This Person](https://t.me/DChoco_Boy) 😎
2.168456
2
PublicTools/bin/tools/PackTool/src/util/data/xxtea.py
lyzardiar/RETools
2
6622457
<filename>PublicTools/bin/tools/PackTool/src/util/data/xxtea.py import struct _DELTA = 0x9E3779B9 ENCODE_FORMAT = "utf-8" def _long2str(v, w): n = (len(v) - 1) << 2 if w: m = v[-1] if (m < n - 3) or (m > n): return '' n = m s = struct.pack('<%iL' % le...
<filename>PublicTools/bin/tools/PackTool/src/util/data/xxtea.py import struct _DELTA = 0x9E3779B9 ENCODE_FORMAT = "utf-8" def _long2str(v, w): n = (len(v) - 1) << 2 if w: m = v[-1] if (m < n - 3) or (m > n): return '' n = m s = struct.pack('<%iL' % le...
en
0.883657
# already encoded
2.212017
2
Decoradores em Python/preservando_metadata_wraps.py
GlennSR/Curso-Python-Udemy
0
6622458
''' Preservando metadata com wraps Metadados -> São dados intrísecos em arquivos wraps -> São funções que envolvem elementos com diversas finalidades ''' # Problema def ver_log(funcao): def logar(*args, **kwargs): '''Eu sou uma função (logar) dentro de outra''' print(f'Você está chamando {funca...
''' Preservando metadata com wraps Metadados -> São dados intrísecos em arquivos wraps -> São funções que envolvem elementos com diversas finalidades ''' # Problema def ver_log(funcao): def logar(*args, **kwargs): '''Eu sou uma função (logar) dentro de outra''' print(f'Você está chamando {funca...
pt
0.997445
Preservando metadata com wraps Metadados -> São dados intrísecos em arquivos wraps -> São funções que envolvem elementos com diversas finalidades # Problema Eu sou uma função (logar) dentro de outra Soma dois números. # Mas usando uma outra maneira # logar # Eu sou uma função (logar) dentro de outra # Resolução do pr...
3.377772
3
Solutions/Tree Problems/zig_zag_print.py
maharshi365/Python-Practice
0
6622459
# Definition for a binary tree node. # class TreeNode(object): # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution(object): def zigzagLevelOrder(self, root): """ :type root: TreeNode :rtype: List[List[int]] """ ...
# Definition for a binary tree node. # class TreeNode(object): # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution(object): def zigzagLevelOrder(self, root): """ :type root: TreeNode :rtype: List[List[int]] """ ...
en
0.407069
# Definition for a binary tree node. # class TreeNode(object): # def __init__(self, x): # self.val = x # self.left = None # self.right = None :type root: TreeNode :rtype: List[List[int]]
3.643921
4
tests/utils/test_Misc.py
anejaalekh/OSBot-Utils
0
6622460
<reponame>anejaalekh/OSBot-Utils<filename>tests/utils/test_Misc.py import collections import datetime import sys import time import timeit from typing import Generator from unittest import TestCase from osbot_utils.utils import Misc from osbot_utils.utils.Files import Files, file_extension from osbot_utils.utils.Misc ...
import collections import datetime import sys import time import timeit from typing import Generator from unittest import TestCase from osbot_utils.utils import Misc from osbot_utils.utils.Files import Files, file_extension from osbot_utils.utils.Misc import bytes_to_base64, base64_to_bytes, date_now, class_name, str_...
en
0.888187
# todo: improve test to also check for the password complexity # time to wait (in seconds) AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAALorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...
2.354158
2
AtCoder/ABC/000-159/ABC127_B.py
sireline/PyCode
0
6622461
<filename>AtCoder/ABC/000-159/ABC127_B.py r, D, x2k = [int(n) for n in input().split()] X = [x2k] for i in range(10): X.append(r*X[i]-D) print(X[i+1])
<filename>AtCoder/ABC/000-159/ABC127_B.py r, D, x2k = [int(n) for n in input().split()] X = [x2k] for i in range(10): X.append(r*X[i]-D) print(X[i+1])
none
1
2.659848
3
meiduo_mall/utils/views.py
Vent-Any/meiduo_mall_cangku
0
6622462
<reponame>Vent-Any/meiduo_mall_cangku from django.contrib.auth.mixins import LoginRequiredMixin from django.http import JsonResponse class LoginRequiredJsonMixin(LoginRequiredMixin): def handle_no_permission(self): return JsonResponse({'code': 400, 'errmsg': "OK"})
from django.contrib.auth.mixins import LoginRequiredMixin from django.http import JsonResponse class LoginRequiredJsonMixin(LoginRequiredMixin): def handle_no_permission(self): return JsonResponse({'code': 400, 'errmsg': "OK"})
none
1
1.868851
2
readcsv.py
nicholas-long/github-exploit-code-repository-index
0
6622463
#!/usr/bin/env python3 import sys import csv def fix(col: str): result = col result = result.replace('\"', "") result = result.replace('"', "") result = result.replace("\n", " ") result = result.replace("|", " ") return result reader = csv.reader(open(sys.argv[1], "r")) for row in reader: ...
#!/usr/bin/env python3 import sys import csv def fix(col: str): result = col result = result.replace('\"', "") result = result.replace('"', "") result = result.replace("\n", " ") result = result.replace("|", " ") return result reader = csv.reader(open(sys.argv[1], "r")) for row in reader: ...
fr
0.221828
#!/usr/bin/env python3
3.444174
3
app/run.py
bkontonis/NLP---Messages-Classification
0
6622464
import re import sys import json import nltk import random import joblib import plotly import pandas as pd from flask import Flask from plotly.graph_objs import Bar, Scatter from sqlalchemy import create_engine from sklearn.pipeline import Pipeline from sklearn.linear_model import SGDClassifier from flask import rende...
import re import sys import json import nltk import random import joblib import plotly import pandas as pd from flask import Flask from plotly.graph_objs import Bar, Scatter from sqlalchemy import create_engine from sklearn.pipeline import Pipeline from sklearn.linear_model import SGDClassifier from flask import rende...
en
0.768421
# load data # load model # Below I extract data needed for visuals # Visual 1: Genre counts # Visual 2: Category counts # index webpage displays cool visuals and receives user input text for model # create visuals # encode plotly graphs in JSON # render web page with plotly graphs # web page that handles user query and...
2.579997
3
chris_cunningham/day_06.py
techartorg/Advent_of_code_2021
0
6622465
from collections import deque from copy import copy def main(): with open("inputs/day_06.txt", 'r') as f: inputs = deque([0] * 9) for i in f.read().split(","): inputs[int(i)] += 1 print(f"Part One: {solve(inputs, 80)}") print(f"Part Two: {solve(inputs, 256)}") def solve(data...
from collections import deque from copy import copy def main(): with open("inputs/day_06.txt", 'r') as f: inputs = deque([0] * 9) for i in f.read().split(","): inputs[int(i)] += 1 print(f"Part One: {solve(inputs, 80)}") print(f"Part Two: {solve(inputs, 256)}") def solve(data...
none
1
3.104658
3
Student-Management-system/code.py
meenakshidolhare/greyatom-python-for-data-science
0
6622466
<gh_stars>0 # -------------- class_1=['<NAME>','<NAME>','<NAME>','<NAME>'] class_2=['<NAME>','<NAME>','<NAME>'] new_class=class_1+class_2 new_class new_class.append('<NAME>') new_class new_class.remove('<NAME>') new_class courses={'Maths':65,'English':70,'History':80,'French':70,'Science':60} courses_values=co...
# -------------- class_1=['<NAME>','<NAME>','<NAME>','<NAME>'] class_2=['<NAME>','<NAME>','<NAME>'] new_class=class_1+class_2 new_class new_class.append('<NAME>') new_class new_class.remove('<NAME>') new_class courses={'Maths':65,'English':70,'History':80,'French':70,'Science':60} courses_values=courses.values...
en
0.125318
# --------------
3.445799
3
bspump/abc/source.py
gitter-badger/bspump
1
6622467
<gh_stars>1-10 import abc import logging import asyncio from .config import ConfigObject # L = logging.getLogger(__name__) # class Source(abc.ABC, ConfigObject): ''' Each source represent a coroutine/Future/Task that is running in the context of the main loop. The coroutine method main() contains an implementatio...
import abc import logging import asyncio from .config import ConfigObject # L = logging.getLogger(__name__) # class Source(abc.ABC, ConfigObject): ''' Each source represent a coroutine/Future/Task that is running in the context of the main loop. The coroutine method main() contains an implementation of each parti...
en
0.836491
# # Each source represent a coroutine/Future/Task that is running in the context of the main loop. The coroutine method main() contains an implementation of each particular source. Source MUST await a pipeline ready state prior producing the event. It is acomplished by `await self.Pipeline.ready()` call. # Contains a ...
2.747837
3
527 Word Abbreviation.py
krishna13052001/LeetCode
872
6622468
#!/usr/bin/python3 """ premium question """ from typing import List from collections import defaultdict class Solution: def wordsAbbreviation(self, words: List[str]) -> List[str]: """ Sort the word, check prefix and last word Group by first and last char, group by prefix and last char ...
#!/usr/bin/python3 """ premium question """ from typing import List from collections import defaultdict class Solution: def wordsAbbreviation(self, words: List[str]) -> List[str]: """ Sort the word, check prefix and last word Group by first and last char, group by prefix and last char ...
en
0.753489
#!/usr/bin/python3 premium question Sort the word, check prefix and last word Group by first and last char, group by prefix and last char then make a trie - hard to implement? TrieNode lambda Need to count the #appearances in the TrieNode
3.699549
4
tests/train/helper.py
korepwx/madoka
0
6622469
<reponame>korepwx/madoka # -*- coding: utf-8 -*- from logging import getLogger import numpy as np import six import tensorflow as tf from sklearn.base import BaseEstimator from madoka.train import Monitor, EnsembleTrainer from madoka.utils import flatten_list from madoka.utils.tfhelper import ensure_default_session ...
# -*- coding: utf-8 -*- from logging import getLogger import numpy as np import six import tensorflow as tf from sklearn.base import BaseEstimator from madoka.train import Monitor, EnsembleTrainer from madoka.utils import flatten_list from madoka.utils.tfhelper import ensure_default_session if six.PY2: from iter...
en
0.872053
# -*- coding: utf-8 -*- Notify the monitor that a training process has finished. It will be triggered whether or not any error has taken place. Parameters ---------- has_error : bool Whether or not any error has occurred during training. Notify the monitor that a training e...
2.128741
2
rio/commands/__init__.py
soasme/rio
0
6622470
# -*- coding: utf-8 -*- from .runworker import RunWorkerCommand from .syncproject import SyncProjectCommand
# -*- coding: utf-8 -*- from .runworker import RunWorkerCommand from .syncproject import SyncProjectCommand
en
0.769321
# -*- coding: utf-8 -*-
1.005646
1
api/__init__.py
yezz123/Apollo
18
6622471
<reponame>yezz123/Apollo #!/usr/bin/python3 from sqlalchemy.orm import Session from models import models from schemas import schemas import bcrypt import requests from requests.auth import HTTPBasicAuth import json from datetime import datetime import base64
#!/usr/bin/python3 from sqlalchemy.orm import Session from models import models from schemas import schemas import bcrypt import requests from requests.auth import HTTPBasicAuth import json from datetime import datetime import base64
fr
0.386793
#!/usr/bin/python3
1.40665
1
api/ai_tools/ai_model.py
urbrob/ai-pacman
0
6622472
from pymongo import MongoClient from tensorflow.keras.datasets import mnist from tensorflow.keras import models, layers from tensorflow.keras.utils import to_categorical from numpy import array direction_map = {"w": 1, "s": 0, "d": 2, "a": 3} def format_database_data_to_list(cursor): formated_data_x = [] for...
from pymongo import MongoClient from tensorflow.keras.datasets import mnist from tensorflow.keras import models, layers from tensorflow.keras.utils import to_categorical from numpy import array direction_map = {"w": 1, "s": 0, "d": 2, "a": 3} def format_database_data_to_list(cursor): formated_data_x = [] for...
none
1
2.494221
2
b3j0f/conf/parser/test/core.py
b3j0f/configuration
3
6622473
#!/usr/bin/env python # -*- coding: utf-8 -*- # -------------------------------------------------------------------- # The MIT License (MIT) # # Copyright (c) 2014 <NAME> <<EMAIL>> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (th...
#!/usr/bin/env python # -*- coding: utf-8 -*- # -------------------------------------------------------------------- # The MIT License (MIT) # # Copyright (c) 2014 <NAME> <<EMAIL>> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (th...
en
0.668956
#!/usr/bin/env python # -*- coding: utf-8 -*- # -------------------------------------------------------------------- # The MIT License (MIT) # # Copyright (c) 2014 <NAME> <<EMAIL>> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the...
1.477993
1
finetune/src/dataset.py
affjljoo3581/Samsung-AI-Challenge-for-Scientific-Discovery
35
6622474
import os from typing import Dict, List, Optional, Tuple, Union import numpy as np import pandas as pd from torch.utils.data import Dataset from encoding import MolecularEncoder ST1_ENERGY_GAP_MEAN = 0.8486 ST1_ENERGY_GAP_STD = 0.3656 class SSDDataset(Dataset): """A dataset class for `Samsung AI Challenge For ...
import os from typing import Dict, List, Optional, Tuple, Union import numpy as np import pandas as pd from torch.utils.data import Dataset from encoding import MolecularEncoder ST1_ENERGY_GAP_MEAN = 0.8486 ST1_ENERGY_GAP_STD = 0.3656 class SSDDataset(Dataset): """A dataset class for `Samsung AI Challenge For ...
en
0.754438
A dataset class for `Samsung AI Challenge For Scientific Discovery` competition. Args: dataset: A pandas dataframe object containing energy informations. structure_files: A list of SDF molfiles. encoder: A molecular structure encoder. bond_drop_prob: The probability of dropping mole...
2.651193
3
backend/app/alembic/versions/6d371a5e1414_add_locations_table.py
dmitritruf/distiller-django-react
2
6622475
"""Add locations table Revision ID: 6d371a5e1414 Revises: <PASSWORD>2<PASSWORD> Create Date: 2021-08-08 21:03:35.623650 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '<KEY>' down_revision = 'a3b2fff032fd' branch_labels = None depends_on = None def upgrade()...
"""Add locations table Revision ID: 6d371a5e1414 Revises: <PASSWORD>2<PASSWORD> Create Date: 2021-08-08 21:03:35.623650 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '<KEY>' down_revision = 'a3b2fff032fd' branch_labels = None depends_on = None def upgrade()...
en
0.538731
Add locations table Revision ID: 6d371a5e1414 Revises: <PASSWORD>2<PASSWORD> Create Date: 2021-08-08 21:03:35.623650 # revision identifiers, used by Alembic. # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic commands ### # ### commands auto generated by Alembic - please adjust! ### # ### ...
1.708187
2
restructuredBootstrap/media.py
lakhman/restructuredBootstrap
1
6622476
<reponame>lakhman/restructuredBootstrap<filename>restructuredBootstrap/media.py #!/usr/bin/env python # -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2017 - <NAME> - MIT License # --------------------------------------------------------------------...
#!/usr/bin/env python # -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2017 - <NAME> - MIT License # ----------------------------------------------------------------------------- from docutils import nodes from docutils.parsers.rst import Directive,...
en
0.329289
#!/usr/bin/env python # -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2017 - <NAME> - MIT License # ----------------------------------------------------------------------------- # Move media-right to after media-body # Add media-object class to chi...
2.184102
2
attachment/base_admin.py
chunkai-meng/django-rest-attachment
0
6622477
<reponame>chunkai-meng/django-rest-attachment from django.contrib import admin from django.utils.safestring import mark_safe class BaseAttachmentAdmin(admin.ModelAdmin): list_display = ('id', 'name', 'uploaded_at', 'uploaded_by', 'doc_tag') list_filter = ('uploaded_at', 'uploaded_by',) list_per_page = 20 ...
from django.contrib import admin from django.utils.safestring import mark_safe class BaseAttachmentAdmin(admin.ModelAdmin): list_display = ('id', 'name', 'uploaded_at', 'uploaded_by', 'doc_tag') list_filter = ('uploaded_at', 'uploaded_by',) list_per_page = 20 readonly_fields = ('doc_tag',) list_se...
none
1
2.014212
2
Tareaejercicios/Example11.py
Dan-Elioth/Ejerciciospararesolver
0
6622478
<gh_stars>0 print("Bienvenido al programa de bono al empleado de nuestra tienda") #Variables bono=0 bono1=100 bono2=200 bono3=300 bono4=400 bono5=500 bonomayor=1000 #Datos de entrada años=float(input("Ingrese los años que labora en la tienda:")) #Proceso if años==1: bono=bono1 if años==2: bono=bono2 if años==3: ...
print("Bienvenido al programa de bono al empleado de nuestra tienda") #Variables bono=0 bono1=100 bono2=200 bono3=300 bono4=400 bono5=500 bonomayor=1000 #Datos de entrada años=float(input("Ingrese los años que labora en la tienda:")) #Proceso if años==1: bono=bono1 if años==2: bono=bono2 if años==3: bono=bono3 ...
es
0.782248
#Variables #Datos de entrada #Proceso #Datos de salida
3.632758
4
{{cookiecutter.project_name}}/{{cookiecutter.app_name}}/commons/utils/dictlist_util.py
juforg/cookiecutter-flask-restful
1
6622479
<reponame>juforg/cookiecutter-flask-restful from typing import List, Dict, Tuple from {{cookiecutter.app_name}}.commons.exception import BizException def group_by_for_list(data_list: List[Dict], by: List[str] = None,key_error: bool = False) -> Dict[Tuple, List]: """ json数据group by :param key_error: :...
from typing import List, Dict, Tuple from {{cookiecutter.app_name}}.commons.exception import BizException def group_by_for_list(data_list: List[Dict], by: List[str] = None,key_error: bool = False) -> Dict[Tuple, List]: """ json数据group by :param key_error: :param data_list: 数据列表 :param by: grou...
zh
0.758788
json数据group by :param key_error: :param data_list: 数据列表 :param by: group by 列表 :return: 分组后的数据
2.647984
3
src/pywikibot_extensions/textlib.py
JJMC89/pywikibot-extensions
0
6622480
""" Functions for manipulating wikitext. This module extends pywikibot.textlib. """ from typing import Iterable from pywikibot.page import BasePage # The namespace names must be substituted into this regex, # e.g., FILE_LINK_REGEX.format("|".join(site.namespaces.FILE)). # Adds named groups to pywikibot.textlib.FILE...
""" Functions for manipulating wikitext. This module extends pywikibot.textlib. """ from typing import Iterable from pywikibot.page import BasePage # The namespace names must be substituted into this regex, # e.g., FILE_LINK_REGEX.format("|".join(site.namespaces.FILE)). # Adds named groups to pywikibot.textlib.FILE...
en
0.331379
Functions for manipulating wikitext. This module extends pywikibot.textlib. # The namespace names must be substituted into this regex, # e.g., FILE_LINK_REGEX.format("|".join(site.namespaces.FILE)). # Adds named groups to pywikibot.textlib.FILE_LINK_REGEX # and uses str.format instead of %. \[\[\s* (?P<namespace>{...
3.420689
3
api.py
AdityaSingh17/DogsVsCats
0
6622481
<filename>api.py import requests import json # Define API Endpoint and Headers. ApiEndpoint = "http://dogorcat.pythonanywhere.com/query" Headers = {"Content-Type": "application/json"} # Specify the URL. URL = "<URL HERE>" # Convert the data into JSON. Data = json.dumps({"url": URL}) # Generate a POST request at the ...
<filename>api.py import requests import json # Define API Endpoint and Headers. ApiEndpoint = "http://dogorcat.pythonanywhere.com/query" Headers = {"Content-Type": "application/json"} # Specify the URL. URL = "<URL HERE>" # Convert the data into JSON. Data = json.dumps({"url": URL}) # Generate a POST request at the ...
en
0.742293
# Define API Endpoint and Headers. # Specify the URL. # Convert the data into JSON. # Generate a POST request at the API Endpoint with Headers and JSON data. # A text response is returned, convert it to JSON. # Print the result. # In case of any error, print the response text as is.
3.441069
3
theseus/segmentation/metrics/projection.py
kaylode/shrec22-pothole
1
6622482
import os import torch from typing import Any, Dict, Optional, List from theseus.base.metrics.metric_template import Metric import numpy as np import hashlib from theseus.utilities.visualization.visualizer import Visualizer from theseus.utilities.loggers import LoggerObserver class EmbeddingProjection(Metric): ""...
import os import torch from typing import Any, Dict, Optional, List from theseus.base.metrics.metric_template import Metric import numpy as np import hashlib from theseus.utilities.visualization.visualizer import Visualizer from theseus.utilities.loggers import LoggerObserver class EmbeddingProjection(Metric): ""...
en
0.793803
Visualize embedding project for classification Perform calculation based on prediction and targets # (B, C, H, W)
2.260472
2
Chapter11/dcn_da.py
PacktPublishing/Mastering-Machine-Learning-Algorithms-Second-Edition
40
6622483
import matplotlib.pyplot as plt import numpy as np import seaborn as sns import tensorflow as tf # Set random seed for reproducibility np.random.seed(1000) nb_classes = 10 train_batch_size = 256 test_batch_size = 100 nb_epochs = 100 steps_per_epoch = 1500 if __name__ == '__main__': # Load ...
import matplotlib.pyplot as plt import numpy as np import seaborn as sns import tensorflow as tf # Set random seed for reproducibility np.random.seed(1000) nb_classes = 10 train_batch_size = 256 test_batch_size = 100 nb_epochs = 100 steps_per_epoch = 1500 if __name__ == '__main__': # Load ...
en
0.644169
# Set random seed for reproducibility # Load the dataset # Create the augmented data generators # Create the model # Compile the model # Train the model # Show the results
2.942063
3
code/util/nectar_s3_task.py
madconsulting/datanectar
5
6622484
#1/usr/bin/env python import os import sys import time import hashlib from datetime import datetime from boto import connect_s3 import luigi from luigi.s3 import S3Client from pathutils import project_path class NectarS3Task(luigi.Task): def __init__(self, *args, **kwargs): super(NectarS3Task, self).__ini...
#1/usr/bin/env python import os import sys import time import hashlib from datetime import datetime from boto import connect_s3 import luigi from luigi.s3 import S3Client from pathutils import project_path class NectarS3Task(luigi.Task): def __init__(self, *args, **kwargs): super(NectarS3Task, self).__ini...
en
0.597763
#1/usr/bin/env python Custom implementation for s3 Returns ------- target_path : str of target path # this could be an ENV variable that we first check # then default to datanectar Returns ------- target_path : str of target path Returns -------- s3stdout_log_path : str o...
2.114394
2
leetcode/179.py
windniw/just-for-fun
1
6622485
""" link: https://leetcode-cn.com/problems/largest-number problem: 计算数字拼凑最大值 solution: 排序。两两比对放置前后顺序的大小 """ class Solution: def largestNumber(self, nums: List[int]) -> str: def ncmp(a, b: int) -> int: aa, bb = str(a) + str(b), str(b) + str(a) return 1 if aa > bb else -1 ...
""" link: https://leetcode-cn.com/problems/largest-number problem: 计算数字拼凑最大值 solution: 排序。两两比对放置前后顺序的大小 """ class Solution: def largestNumber(self, nums: List[int]) -> str: def ncmp(a, b: int) -> int: aa, bb = str(a) + str(b), str(b) + str(a) return 1 if aa > bb else -1 ...
en
0.318123
link: https://leetcode-cn.com/problems/largest-number problem: 计算数字拼凑最大值 solution: 排序。两两比对放置前后顺序的大小
3.611338
4
LitterFilter/PirSource.py
mattdbartlett/LitterFilter
0
6622486
from LitterFilter.Event import EventSource import qwiic_pir import logging class PirSource(EventSource): """ An event generator backed by a I2C base PIR device """ def __init__(self, activeEvent, inactiveEvent, address=None): self.__device = qwiic_pir.QwiicPIR(address=address) self.__a...
from LitterFilter.Event import EventSource import qwiic_pir import logging class PirSource(EventSource): """ An event generator backed by a I2C base PIR device """ def __init__(self, activeEvent, inactiveEvent, address=None): self.__device = qwiic_pir.QwiicPIR(address=address) self.__a...
en
0.741491
An event generator backed by a I2C base PIR device #logging.debug("PIR value is {0}".format(curValue))
2.653761
3
tests/linalg/utils.py
brisvag/pygfx
60
6622487
from pygfx.linalg import ( Euler, Matrix4, Quaternion, ) def matrix_equals(a: Matrix4, b: Matrix4, tolerance: float = 0.0001): if len(a.elements) != len(b.elements): return False return all(abs(x - y) < tolerance for x, y in zip(a.elements, b.elements)) def euler_equals(a: Euler, b: Eule...
from pygfx.linalg import ( Euler, Matrix4, Quaternion, ) def matrix_equals(a: Matrix4, b: Matrix4, tolerance: float = 0.0001): if len(a.elements) != len(b.elements): return False return all(abs(x - y) < tolerance for x, y in zip(a.elements, b.elements)) def euler_equals(a: Euler, b: Eule...
none
1
2.55544
3
Intro/24 - minesweeper.py
lucasalme1da/codesignal
2
6622488
def minesweeper(matrix): raw = [] array = [] for row in range(len(matrix)): for col in range(len(matrix[0])): aux = 0 # Corner if (row == 0 and col == 0): # topLeftCorner if(matrix[row + 1][col]): aux += 1 if(m...
def minesweeper(matrix): raw = [] array = [] for row in range(len(matrix)): for col in range(len(matrix[0])): aux = 0 # Corner if (row == 0 and col == 0): # topLeftCorner if(matrix[row + 1][col]): aux += 1 if(m...
en
0.361774
# Corner # topLeftCorner # topRightCorner # bottomLeftCorner # Sides # verticalLeft # verticalRight # horizontalTop # horizontalBottom # Middle
3.354874
3
scripts/desafio015.py
User7558/Python3
0
6622489
<reponame>User7558/Python3 #desafio15: um programa que pergunte a quantidade de km percorridos por um carro alugado e a quantidade de dias pelos quais ele foi alugado. Calcule o preço a pagar, sabendo que o carro custa R$60 por dia e R$0.15 por km rodado # km=float(input('Quantos km o carro alugado percorreu? ')) d=int...
#desafio15: um programa que pergunte a quantidade de km percorridos por um carro alugado e a quantidade de dias pelos quais ele foi alugado. Calcule o preço a pagar, sabendo que o carro custa R$60 por dia e R$0.15 por km rodado # km=float(input('Quantos km o carro alugado percorreu? ')) d=int(input('Por quantos dias el...
pt
0.938643
#desafio15: um programa que pergunte a quantidade de km percorridos por um carro alugado e a quantidade de dias pelos quais ele foi alugado. Calcule o preço a pagar, sabendo que o carro custa R$60 por dia e R$0.15 por km rodado #
3.855968
4
distrobuild/routes/bootstrap.py
rocky-linux/distrobuild
30
6622490
# Copyright (c) 2021 The Distrobuild Authors # # 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 without limitation the rights # to use, copy, modify, merge,...
# Copyright (c) 2021 The Distrobuild Authors # # 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 without limitation the rights # to use, copy, modify, merge,...
en
0.769406
# Copyright (c) 2021 The Distrobuild Authors # # 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 without limitation the rights # to use, copy, modify, merge,...
1.648092
2
excel/writeexcel.py
ty68/alped
0
6622491
import xlwt #https://www.cnblogs.com/nancyzhu/p/8401552.html students = [ ['姓名','年龄','性别','分数'], ['mary',20,'女',89.9], ['mary',20,'女',89.9], ['mary',20,'女',89.9], ['mary',20,'女',90.9], ] def write_excel(data,filename): #新建一个excel对象 book = xlwt.Workbook() # 给这个book添加一个sheet sheet = b...
import xlwt #https://www.cnblogs.com/nancyzhu/p/8401552.html students = [ ['姓名','年龄','性别','分数'], ['mary',20,'女',89.9], ['mary',20,'女',89.9], ['mary',20,'女',89.9], ['mary',20,'女',90.9], ] def write_excel(data,filename): #新建一个excel对象 book = xlwt.Workbook() # 给这个book添加一个sheet sheet = b...
zh
0.87457
#https://www.cnblogs.com/nancyzhu/p/8401552.html #新建一个excel对象 # 给这个book添加一个sheet #给指定单元格写入数据 #保存写入的数据到文件
3.46069
3
mysite/urls.py
gurupratap-matharu/django-rest-booking-api
35
6622492
from api import views from django.contrib import admin from django.urls import include, path from rest_framework.routers import DefaultRouter from rest_framework.schemas import get_schema_view from rest_framework.documentation import include_docs_urls router = DefaultRouter() router.register(r'match', views.MatchView...
from api import views from django.contrib import admin from django.urls import include, path from rest_framework.routers import DefaultRouter from rest_framework.schemas import get_schema_view from rest_framework.documentation import include_docs_urls router = DefaultRouter() router.register(r'match', views.MatchView...
none
1
2.010706
2
hwtLib/peripheral/usb/usb2/utmi_usb_agent.py
Nic30/hwtLib
24
6622493
<gh_stars>10-100 from collections import deque from typing import Deque, Union from hwt.hdl.types.bits import Bits from hwt.hdl.types.struct import HStruct from hwt.simulator.agentBase import SyncAgentBase from hwtLib.peripheral.usb.constants import usb_addr_t, usb_endp_t, \ usb_crc5_t, usb_pid_t, USB_PID from hw...
from collections import deque from typing import Deque, Union from hwt.hdl.types.bits import Bits from hwt.hdl.types.struct import HStruct from hwt.simulator.agentBase import SyncAgentBase from hwtLib.peripheral.usb.constants import usb_addr_t, usb_endp_t, \ usb_crc5_t, usb_pid_t, USB_PID from hwtLib.peripheral.u...
en
0.653978
A simulation agent for :class:`hwtLib.peripheral.usb.usb2.utmi.Utmi_8b` interface with the functionality of the host. # inversion of the pid # :note: does not involve USB_PID, only addr, endp # need to cut of ulpi tx_cmd header # need to add ulpi tx_cmd header :class:` hwtLib.peripheral.usb.usb2.utmi_agent.Utmi_8bA...
2.06327
2
Sunphotometer/spdata.py
baikangwang/SunPhotometer
0
6622494
<filename>Sunphotometer/spdata.py # -*- coding: utf-8 -*- import os import sys import time import shutil import subprocess as sub import threading from datetime import datetime from datetime import timedelta from ftplib import FTP from sunphotometer import DataProcess def download(stime, etime=None, stations=None, f...
<filename>Sunphotometer/spdata.py # -*- coding: utf-8 -*- import os import sys import time import shutil import subprocess as sub import threading from datetime import datetime from datetime import timedelta from ftplib import FTP from sunphotometer import DataProcess def download(stime, etime=None, stations=None, f...
en
0.471417
# -*- coding: utf-8 -*- Download AOD data files from CAMS ftp server. :param stime: (*datetime*) Start time. :param etime: (*datetime*) End time. :param stations: (*list*) Station list. Default is None, all stations will be included. :param ftp_dir: (*string*) Ftp server directory. :param data_dir:...
2.574269
3
db/projects.py
gfoo/fastapi-demo
0
6622495
<filename>db/projects.py from core.security import get_password_hash from models.project import DBProject from models.user import DBUser from schemas.project import Project from sqlalchemy import or_ from sqlalchemy.orm import Session def create_project(db: Session, project: Project, owner_id: int): db_project ...
<filename>db/projects.py from core.security import get_password_hash from models.project import DBProject from models.user import DBUser from schemas.project import Project from sqlalchemy import or_ from sqlalchemy.orm import Session def create_project(db: Session, project: Project, owner_id: int): db_project ...
none
1
2.641767
3
2019/src/Advent2019_14.py
davidxbuck/advent2018
1
6622496
from math import ceil def calculate_ore(reactions, chem_qty, fuel_required): chem_qty['FUEL'] = -fuel_required ore = 0 satisfied = False while not satisfied: satisfied = True for output_chemical in chem_qty.keys(): if output_chemical == "ORE" and chem_qty[output_chemical] <...
from math import ceil def calculate_ore(reactions, chem_qty, fuel_required): chem_qty['FUEL'] = -fuel_required ore = 0 satisfied = False while not satisfied: satisfied = True for output_chemical in chem_qty.keys(): if output_chemical == "ORE" and chem_qty[output_chemical] <...
none
1
3.16873
3
Tools/my_globals.py
yuanfangtardis/vscode_project
0
6622497
<gh_stars>0 #!/usr/bin/env python2.7 # yuafang # 2017.11.26 easy_globals=dict() # if __name__=='__main__': # print 'testing gloabls ...' # print ES,Programs,CS,Ploter,Programs
#!/usr/bin/env python2.7 # yuafang # 2017.11.26 easy_globals=dict() # if __name__=='__main__': # print 'testing gloabls ...' # print ES,Programs,CS,Ploter,Programs
en
0.234468
#!/usr/bin/env python2.7 # yuafang # 2017.11.26 # if __name__=='__main__': # print 'testing gloabls ...' # print ES,Programs,CS,Ploter,Programs
1.238534
1
auth/auth_server.py
ivmfnal/dm_common
0
6622498
<reponame>ivmfnal/dm_common from dm_common.auth import BaseApp, AuthHandler import time, os, yaml from urllib.parse import quote_plus, unquote_plus class AuthApp(BaseApp): pass def create_application(config_path=None): config_path = config_path or os.environ.get("AUTH_SERVER_CFG") if not config_path: ...
from dm_common.auth import BaseApp, AuthHandler import time, os, yaml from urllib.parse import quote_plus, unquote_plus class AuthApp(BaseApp): pass def create_application(config_path=None): config_path = config_path or os.environ.get("AUTH_SERVER_CFG") if not config_path: print("Config file is n...
en
0.174407
python auth_server.py [-p <port>] [-c <config.yaml>]
2.207873
2
tests/test_template.py
czerwe/zabbixmgm
0
6622499
import unittest2 import zabbixmgm from mock import Mock, call from pprint import pprint class template_tests(unittest2.TestCase): def setUp(self): self.apimock = Mock() def tearDown(self): pass def test_template_init(self): ttemplate = zabbixmgm.zbxtemplate(self.apimock, name...
import unittest2 import zabbixmgm from mock import Mock, call from pprint import pprint class template_tests(unittest2.TestCase): def setUp(self): self.apimock = Mock() def tearDown(self): pass def test_template_init(self): ttemplate = zabbixmgm.zbxtemplate(self.apimock, name...
none
1
2.523102
3
pyboretum/__init__.py
picwell/pyboretum
1
6622500
from __future__ import absolute_import from .decision_tree import DecisionTree from . import splitters from .node import ( Node, MeanNode, MedianNode, MeanMedianAnalysisNode, ) from .tree import ( LinkedTree, ListTree, ) from .training_data import TrainingData
from __future__ import absolute_import from .decision_tree import DecisionTree from . import splitters from .node import ( Node, MeanNode, MedianNode, MeanMedianAnalysisNode, ) from .tree import ( LinkedTree, ListTree, ) from .training_data import TrainingData
none
1
1.313974
1
src/cania/analysis/cohort.py
Cancer-Image-Analysis/cania-core
1
6622501
<filename>src/cania/analysis/cohort.py #!/usr/bin/env python """Provides Generic Classes to represent cohort data. """ __author__ = "<NAME>" __copyright__ = "Copyright 2020, Cancer Image Analysis" __credits__ = ["<NAME>"] __license__ = "MIT" __version__ = "1.0.1" __maintainer__ = "<NAME>" __email__ = "<EMAIL>" __stat...
<filename>src/cania/analysis/cohort.py #!/usr/bin/env python """Provides Generic Classes to represent cohort data. """ __author__ = "<NAME>" __copyright__ = "Copyright 2020, Cancer Image Analysis" __credits__ = ["<NAME>"] __license__ = "MIT" __version__ = "1.0.1" __maintainer__ = "<NAME>" __email__ = "<EMAIL>" __stat...
en
0.49507
#!/usr/bin/env python Provides Generic Classes to represent cohort data.
2.770883
3
django_smartfarm_git/main/apps.py
jyjy318/smartfarm
0
6622502
<reponame>jyjy318/smartfarm<gh_stars>0 from django.apps import AppConfig class CityTest2Config(AppConfig): name = 'city_test2'
from django.apps import AppConfig class CityTest2Config(AppConfig): name = 'city_test2'
none
1
1.241333
1
yahoo_evaluate_experssion.py
loghmanb/daily-coding-problem
0
6622503
''' Evaluate Expression Asked in: Yahoo, Google, Facebook https://www.interviewbit.com/problems/evaluate-expression/ Evaluate the value of an arithmetic expression in Reverse Polish Notation. Valid operators are +, -, *, /. Each operand may be an integer or another expression. Input Format The only argument give...
''' Evaluate Expression Asked in: Yahoo, Google, Facebook https://www.interviewbit.com/problems/evaluate-expression/ Evaluate the value of an arithmetic expression in Reverse Polish Notation. Valid operators are +, -, *, /. Each operand may be an integer or another expression. Input Format The only argument give...
en
0.631855
Evaluate Expression Asked in: Yahoo, Google, Facebook https://www.interviewbit.com/problems/evaluate-expression/ Evaluate the value of an arithmetic expression in Reverse Polish Notation. Valid operators are +, -, *, /. Each operand may be an integer or another expression. Input Format The only argument given is...
4.174996
4
images/bot/src/bioconda_bot/automerge.py
bioconda/bioconda-containers
2
6622504
import logging import os from typing import Any, Dict, List, Optional, Set, Tuple from aiohttp import ClientSession from yaml import safe_load from .common import ( get_job_context, get_prs_for_sha, get_sha_for_status_check, get_sha_for_workflow_run, ) from .merge import MergeState, request_merge lo...
import logging import os from typing import Any, Dict, List, Optional, Set, Tuple from aiohttp import ClientSession from yaml import safe_load from .common import ( get_job_context, get_prs_for_sha, get_sha_for_status_check, get_sha_for_workflow_run, ) from .merge import MergeState, request_merge lo...
en
0.897912
# TODO: "neutral" might be a valid conclusion to consider in the future. # This requires that a JOB_CONTEXT environment variable, which is made with `toJson(github)`
2.199264
2
cloudmesh_install/util.py
JulienPalard/cloudmesh
0
6622505
"""Cloudmesh install util functions. This file contains basic utility functions that must not need any import from cloudmesh OR any other non-standard python modules. Everything in this file must execute on a clean python 2.7.x environment. """ import platform from string import Template import os import sys def g...
"""Cloudmesh install util functions. This file contains basic utility functions that must not need any import from cloudmesh OR any other non-standard python modules. Everything in this file must execute on a clean python 2.7.x environment. """ import platform from string import Template import os import sys def g...
en
0.78696
Cloudmesh install util functions. This file contains basic utility functions that must not need any import from cloudmesh OR any other non-standard python modules. Everything in this file must execute on a clean python 2.7.x environment. test sif the platform is ubuntu test if the platform is centos
2.703818
3
servers/wstream.py
sodicarus/channels
0
6622506
<filename>servers/wstream.py<gh_stars>0 # -*- coding: utf-8 -*- # ------------------------------------------------------------ # pelisalacarta - XBMC Plugin # Conector para wstream.video # http://www.mimediacenter.info/foro/viewtopic.php?f=36&t=7808 # by DrZ3r0 # --------------------------------------------------------...
<filename>servers/wstream.py<gh_stars>0 # -*- coding: utf-8 -*- # ------------------------------------------------------------ # pelisalacarta - XBMC Plugin # Conector para wstream.video # http://www.mimediacenter.info/foro/viewtopic.php?f=36&t=7808 # by DrZ3r0 # --------------------------------------------------------...
en
0.244892
# -*- coding: utf-8 -*- # ------------------------------------------------------------ # pelisalacarta - XBMC Plugin # Conector para wstream.video # http://www.mimediacenter.info/foro/viewtopic.php?f=36&t=7808 # by DrZ3r0 # ------------------------------------------------------------ #" + patronvideos + "#")
2.272462
2
physionet-django/user/management/commands/loadtypes.py
Lucas-Mc/physionet-build
36
6622507
""" Command to: - reset and load fixtures for project structures """ import os from django.conf import settings from django.core.management import call_command from django.core.management.base import BaseCommand class Command(BaseCommand): def handle(self, *args, **options): # Load project types ...
""" Command to: - reset and load fixtures for project structures """ import os from django.conf import settings from django.core.management import call_command from django.core.management.base import BaseCommand class Command(BaseCommand): def handle(self, *args, **options): # Load project types ...
en
0.888724
Command to: - reset and load fixtures for project structures # Load project types
1.978988
2
MazeSolve.py
Shadowbomb/MazeLearning
0
6622508
from collections import deque def display(maze): print("------------------------------------------") for i in range(len(maze)): line = "" for j in range(len(maze[i])): if maze[i][j] == 1: line += "O" else: line += "*" pr...
from collections import deque def display(maze): print("------------------------------------------") for i in range(len(maze)): line = "" for j in range(len(maze[i])): if maze[i][j] == 1: line += "O" else: line += "*" pr...
none
1
3.471472
3
api/utils/custom/schema/aggregation.py
forging2012/opencmdb-backend
1
6622509
<reponame>forging2012/opencmdb-backend<filename>api/utils/custom/schema/aggregation.py from marshmallow import fields from api.utils.custom.schema.base import BaseSchema from api.utils.custom.validators import validate_code class AggregationSchema(BaseSchema): code = fields.Str(validate=validate_code, required=T...
from marshmallow import fields from api.utils.custom.schema.base import BaseSchema from api.utils.custom.validators import validate_code class AggregationSchema(BaseSchema): code = fields.Str(validate=validate_code, required=True) name = fields.Str(required=True) layer_id = fields.Str(load_only=True) ...
none
1
1.958434
2
smoke/features/smoke.py
unicefuganda/mtrack
1
6622510
from lettuce import * from lxml import html from nose.tools import assert_equals from splinter import Browser import sys class bcolors: HEADER = '\033[95m' OKBLUE = '\033[94m' OKGREEN = '\033[92m' WARNING = '\033[93m' FAIL = '\033[91m' ENDC = '\033[0m' def disable(self): self.HEADE...
from lettuce import * from lxml import html from nose.tools import assert_equals from splinter import Browser import sys class bcolors: HEADER = '\033[95m' OKBLUE = '\033[94m' OKGREEN = '\033[92m' WARNING = '\033[93m' FAIL = '\033[91m' ENDC = '\033[0m' def disable(self): self.HEADE...
en
0.801087
Landing page Login page Approve page Health data page Mgt Data page Facility page Users page Messaging page Anonymous reports page Stock Data page Main suite # assert_stock_data_page() #commenting this out since it takes a lot of time, uncomment this once the issue is resolved
2.704479
3
src/terial/classifier/data/register_data.py
keunhong/photoshape
81
6622511
import argparse from pathlib import Path import ujson as json import tqdm from terial import models from terial.database import session_scope parser = argparse.ArgumentParser() parser.add_argument('dataset_path', type=Path) args = parser.parse_args() def main(): if not args.dataset_path.exists(): print...
import argparse from pathlib import Path import ujson as json import tqdm from terial import models from terial.database import session_scope parser = argparse.ArgumentParser() parser.add_argument('dataset_path', type=Path) args = parser.parse_args() def main(): if not args.dataset_path.exists(): print...
none
1
2.233909
2
scripts/folder_to_gosh.py
INAETICS/AILS_Demonstrator
2
6622512
from os import listdir import argparse import re # Only execute this code if this module is not imported. So: # $ python folder_to_gosh.py # or # $ ./folder_to_gosh.py if __name__ == "__main__": parser = argparse.ArgumentParser(description='Generate a (partly) GoSH ' + 'file given a directory of jars')...
from os import listdir import argparse import re # Only execute this code if this module is not imported. So: # $ python folder_to_gosh.py # or # $ ./folder_to_gosh.py if __name__ == "__main__": parser = argparse.ArgumentParser(description='Generate a (partly) GoSH ' + 'file given a directory of jars')...
en
0.893992
# Only execute this code if this module is not imported. So: # $ python folder_to_gosh.py # or # $ ./folder_to_gosh.py # this should have been type=open, however we have to check that the # input_directory is actually a dir, which is not possible with the # argparse library # list a folder, remove any file (or director...
2.805011
3
PythonFIAP/5_1_Wazeyes/Converter_geolocalizacao.py
DanielGMesquita/StudyPath
0
6622513
from geopy.geocoders import Nominatim geolocator = Nominatim(user_agent="wazeyes") endereco=input("Digite um endereco com número e cidade. ") resultado = str(geolocator.geocode(endereco)).split(",") if resultado[0]!='None': print("Endereço completo.: ", resultado) print("Bairro............: ", resultado[1]) ...
from geopy.geocoders import Nominatim geolocator = Nominatim(user_agent="wazeyes") endereco=input("Digite um endereco com número e cidade. ") resultado = str(geolocator.geocode(endereco)).split(",") if resultado[0]!='None': print("Endereço completo.: ", resultado) print("Bairro............: ", resultado[1]) ...
none
1
3.340258
3
blogs/migrations/0001_initial.py
laodeaksar/post
1
6622514
<reponame>laodeaksar/post<gh_stars>1-10 # Generated by Django 3.0.8 on 2020-07-16 14:12 import ckeditor_uploader.fields from django.conf import settings import django.core.validators from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True ...
# Generated by Django 3.0.8 on 2020-07-16 14:12 import ckeditor_uploader.fields from django.conf import settings import django.core.validators from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations....
en
0.806495
# Generated by Django 3.0.8 on 2020-07-16 14:12
1.813402
2
videocompress.py
point86/videocompress
3
6622515
<reponame>point86/videocompress from PyQt5.QtGui import * from PyQt5.QtCore import * from PyQt5.QtWidgets import * import os import sys from taskPerformer import TaskPerformer class MainWindow(QWidget): DESC = "Videocompress is a simple utility that runs ffmpeg over a single file or an entire directory (thus re...
from PyQt5.QtGui import * from PyQt5.QtCore import * from PyQt5.QtWidgets import * import os import sys from taskPerformer import TaskPerformer class MainWindow(QWidget): DESC = "Videocompress is a simple utility that runs ffmpeg over a single file or an entire directory (thus recursively on all\n"\ ...
en
0.553703
#vertical layout #introduction labels #input area #data model for treeView #name column #output area #settings area #2 radio buttons #simple settings (x264), with slider #total CRF range is 0-51, but 18-28 is a sane range #visually lossless or nearly so #higher values than 28 results in very poor quality #advanced sett...
2.717688
3
tests/test_utils.py
abersheeran/baize
36
6622516
from baize.utils import cached_property def test_cached_property(): class T: @cached_property def li(self): return object() assert T.li.__name__ == "li" assert not callable(T.li)
from baize.utils import cached_property def test_cached_property(): class T: @cached_property def li(self): return object() assert T.li.__name__ == "li" assert not callable(T.li)
none
1
2.508597
3
tests/utils.py
xqliu/incubator-superset
0
6622517
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import json from os import path from superset import db from superset.models import core as models FIXTURES_DIR = 'tests/fixtures' def load_fi...
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import json from os import path from superset import db from superset.models import core as models FIXTURES_DIR = 'tests/fixtures' def load_fi...
en
0.769321
# -*- coding: utf-8 -*-
2.022279
2
cincoconfig/version.py
ameily/cincoconfig
6
6622518
<gh_stars>1-10 # # Copyright (C) 2021 <NAME> # # This file is subject to the terms and conditions defined in the file 'LICENSE', which is part of # this source code package. # ''' Cincoconfig version. ''' __version__ = '0.8.0'
# # Copyright (C) 2021 <NAME> # # This file is subject to the terms and conditions defined in the file 'LICENSE', which is part of # this source code package. # ''' Cincoconfig version. ''' __version__ = '0.8.0'
en
0.897181
# # Copyright (C) 2021 <NAME> # # This file is subject to the terms and conditions defined in the file 'LICENSE', which is part of # this source code package. # Cincoconfig version.
0.927164
1
litex_boards/platforms/rz_easyfpga.py
danielgusvt/litex-boards
0
6622519
# # This file is part of LiteX-Boards. # # Copyright (c) 2021 <NAME> <<EMAIL>> # Copyright (c) 2022 <NAME> <<EMAIL>> # SPDX-License-Identifier: BSD-2-Clause from litex.build.generic_platform import * from litex.build.altera import AlteraPlatform from litex.build.altera.programmer import USBBlaster # IOs -------------...
# # This file is part of LiteX-Boards. # # Copyright (c) 2021 <NAME> <<EMAIL>> # Copyright (c) 2022 <NAME> <<EMAIL>> # SPDX-License-Identifier: BSD-2-Clause from litex.build.generic_platform import * from litex.build.altera import AlteraPlatform from litex.build.altera.programmer import USBBlaster # IOs -------------...
en
0.630356
# # This file is part of LiteX-Boards. # # Copyright (c) 2021 <NAME> <<EMAIL>> # Copyright (c) 2022 <NAME> <<EMAIL>> # SPDX-License-Identifier: BSD-2-Clause # IOs ---------------------------------------------------------------------------------------------- # Clk / Rst # Leds # DIP switches shared with buttons # Passiv...
1.341279
1
pyrpiic/sensor/ldc161x.py
Samtec-ASH/pyrpiic
0
6622520
<filename>pyrpiic/sensor/ldc161x.py from typing import Tuple from pyrpiic.sensor.ldc1x1y import LDC1X1Y class LDC161X(LDC1X1Y): ''' TI 28-bit LDC1612/LDC1614 inductive sensor API. ''' def __init__(self, bus, address=0x2A): # Manufacturing ID: 0x5449 # Device ID: 0x3055 super().__init_...
<filename>pyrpiic/sensor/ldc161x.py from typing import Tuple from pyrpiic.sensor.ldc1x1y import LDC1X1Y class LDC161X(LDC1X1Y): ''' TI 28-bit LDC1612/LDC1614 inductive sensor API. ''' def __init__(self, bus, address=0x2A): # Manufacturing ID: 0x5449 # Device ID: 0x3055 super().__init_...
en
0.54831
TI 28-bit LDC1612/LDC1614 inductive sensor API. # Manufacturing ID: 0x5449 # Device ID: 0x3055 Get channel data and error flags. Returns: int: Channel computed conversion value int: Error code 0x8: Under range error bit 0x4: Over range ...
2.568205
3
discussion/pathfinder/pathfinder_test.py
jakee417/probability-1
3,670
6622521
# Copyright 2021 The TensorFlow Probability 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 applicable law o...
# Copyright 2021 The TensorFlow Probability 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 applicable law o...
en
0.807582
# Copyright 2021 The TensorFlow Probability 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 applicable law o...
1.677192
2
test/test_point_masses.py
richannan/read-GRACE-harmonics
9
6622522
<filename>test/test_point_masses.py #!/usr/bin/env python u""" test_point_masses.py (02/2021) """ import pytest import numpy as np from gravity_toolkit.utilities import get_data_path from gravity_toolkit.read_love_numbers import read_love_numbers from gravity_toolkit.gen_point_load import gen_point_load from gravity_to...
<filename>test/test_point_masses.py #!/usr/bin/env python u""" test_point_masses.py (02/2021) """ import pytest import numpy as np from gravity_toolkit.utilities import get_data_path from gravity_toolkit.read_love_numbers import read_love_numbers from gravity_toolkit.gen_point_load import gen_point_load from gravity_to...
en
0.644198
#!/usr/bin/env python test_point_masses.py (02/2021) # parameterize the number of point masses # create spatial grid # parameterize point masses # create test gridded field # path to load Love numbers file # read load Love numbers # calculate harmonics and degree amplitudes for each case # check that harmonic data is e...
2.464975
2
Data Structures and Algorithms/HackerRank Algo Solutions/EASY PROBLEMS/BeautifulTriplets.py
akkik04/Python-DataStructures-and-Algorithms
1
6622523
# BEAUTIFUL TRIPLETS HACKERRANK SOLUTION: # creating a function to return the number of beautiful triplets. def beautifulTriplets(d, arr): # creating a variable to track the count. count = 0 # creating a for-loop to iterate for the length of the array. for i in range(len(arr)): # ...
# BEAUTIFUL TRIPLETS HACKERRANK SOLUTION: # creating a function to return the number of beautiful triplets. def beautifulTriplets(d, arr): # creating a variable to track the count. count = 0 # creating a for-loop to iterate for the length of the array. for i in range(len(arr)): # ...
en
0.845168
# BEAUTIFUL TRIPLETS HACKERRANK SOLUTION: # creating a function to return the number of beautiful triplets. # creating a variable to track the count. # creating a for-loop to iterate for the length of the array. # creating a nested for-loop to iterate based on the first loop. # creating a nested if-statement to check i...
4.299064
4
bindings/examples/test.py
byungsook/FleX_PyBind11
0
6622524
<reponame>byungsook/FleX_PyBind11 #Written by <NAME>. November 15, 2018. import pyflex from time import time from random import random import numpy as np main_loop_quit = False time_step = 100 dim_position = 4 dim_velocity = 3 pyflex.initialize() bbox = [pyflex.get_scene_lower(), pyflex.get_scene_upper()] d_size ...
#Written by <NAME>. November 15, 2018. import pyflex from time import time from random import random import numpy as np main_loop_quit = False time_step = 100 dim_position = 4 dim_velocity = 3 pyflex.initialize() bbox = [pyflex.get_scene_lower(), pyflex.get_scene_upper()] d_size = pyflex.get_scene_upper()- pyflex...
en
0.340054
#Written by <NAME>. November 15, 2018. # main_loop_quit == False or # pos_array = np.zeros((1000, 3)) # for i in range(0, 1000): # pos_array[i, 0] = pyflex.grab_x_pos_particle(i) # pos_array[i, 0] = pyflex.grab_y_pos_particle(i) # pos_array[i, 2] = pyflex.grab_z_pos_particle(i) # px, py, pz = positions[t,.....
2.71291
3
exercises/ali/Hello World - Deep Q learning .py
alik604/ra
0
6622525
import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import gym import math import numpy as np import random class Network(torch.nn.Module): def __init__(self, alpha, inputShape, numActions): super().__init__() self.inputShape = inputShape self.numA...
import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import gym import math import numpy as np import random class Network(torch.nn.Module): def __init__(self, alpha, inputShape, numActions): super().__init__() self.inputShape = inputShape self.numA...
en
0.215413
# self.device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") # 10% chance # print("qValues: {}, action {}".format(qValues.detach(), action)) # interpret the past # interpret the future # print("reward {}".format(reward))
2.934658
3
main.py
kamkry-zz/LANwaker-android-public
0
6622526
<gh_stars>0 from kivy.app import App from kivy.uix.button import Button from kivy.uix.floatlayout import FloatLayout from kivy.uix.spinner import Spinner from kivy.uix.popup import Popup from kivy.uix.label import Label from kivy.uix.textinput import TextInput from kivy.uix.boxlayout import BoxLayout from kivy.uix.che...
from kivy.app import App from kivy.uix.button import Button from kivy.uix.floatlayout import FloatLayout from kivy.uix.spinner import Spinner from kivy.uix.popup import Popup from kivy.uix.label import Label from kivy.uix.textinput import TextInput from kivy.uix.boxlayout import BoxLayout from kivy.uix.checkbox import...
en
0.809642
# ### # Below.: these dependencies are for successful build on Android platform; unused but required! # ### # BACKEND # ### # Below.: is the BROADCAST address for your network; change accordingly # Below.: Definition of constants # Below.: Simple conversion of MAC for further use within app; trimming of ':' # Below.: b...
2.486232
2
main.py
joeleeofficial/Python-Console
0
6622527
<reponame>joeleeofficial/Python-Console user_color = "white" console_color = "white" pointer = "$JOE >" pointer_color = "green" # {} is the command given by the user class error: syntax_error = "Error: '{}' is not a valid command." name_error = "Error: '{}' is not defined." type_error = "Error: wrong typ...
user_color = "white" console_color = "white" pointer = "$JOE >" pointer_color = "green" # {} is the command given by the user class error: syntax_error = "Error: '{}' is not a valid command." name_error = "Error: '{}' is not defined." type_error = "Error: wrong type for '{}'" invalid_parameter_error =...
en
0.984118
# {} is the command given by the user
3.159999
3
pylibressl/utils.py
yl3dy/pylibressl
2
6622528
"""Miscellaneous useful utilities from LibreSSL.""" from . import _libressl def secure_compare(rhs, lhs): """Securely compare byte strings. Constant-time comparison of byte strings using ``CRYPTO_memcmp`` from LibreSSL. Note that when byte string lengths are different, exception is raised at once. ...
"""Miscellaneous useful utilities from LibreSSL.""" from . import _libressl def secure_compare(rhs, lhs): """Securely compare byte strings. Constant-time comparison of byte strings using ``CRYPTO_memcmp`` from LibreSSL. Note that when byte string lengths are different, exception is raised at once. ...
en
0.74522
Miscellaneous useful utilities from LibreSSL. Securely compare byte strings. Constant-time comparison of byte strings using ``CRYPTO_memcmp`` from LibreSSL. Note that when byte string lengths are different, exception is raised at once.
3.139888
3
VirtualBox-5.0.0/src/VBox/ValidationKit/testmanager/core/report.py
egraba/vbox_openbsd
1
6622529
# -*- coding: utf-8 -*- # $Id: report.py $ """ Test Manager - Report models. """ __copyright__ = \ """ Copyright (C) 2012-2015 Oracle Corporation This file is part of VirtualBox Open Source Edition (OSE), as available from http://www.virtualbox.org. This file is free software; you can redistribute it and/or modify i...
# -*- coding: utf-8 -*- # $Id: report.py $ """ Test Manager - Report models. """ __copyright__ = \ """ Copyright (C) 2012-2015 Oracle Corporation This file is part of VirtualBox Open Source Edition (OSE), as available from http://www.virtualbox.org. This file is free software; you can redistribute it and/or modify i...
en
0.806658
# -*- coding: utf-8 -*- # $Id: report.py $ Test Manager - Report models. Copyright (C) 2012-2015 Oracle Corporation This file is part of VirtualBox Open Source Edition (OSE), as available from http://www.virtualbox.org. This file is free software; you can redistribute it and/or modify it under the terms of the GNU Gen...
1.573635
2
jplacer/rename_tree.py
johned0/EdwardsLab
30
6622530
<reponame>johned0/EdwardsLab<filename>jplacer/rename_tree.py """ Rename the internal nodes in the pplacer tree using my awesome NCBI taxonomy """ import os import sys import argparse import json import re from ete3 import Tree from ete3.parser.newick import NewickError from taxon import get_taxonomy_db, get_taxonom...
""" Rename the internal nodes in the pplacer tree using my awesome NCBI taxonomy """ import os import sys import argparse import json import re from ete3 import Tree from ete3.parser.newick import NewickError from taxon import get_taxonomy_db, get_taxonomy def load_jplacer(jpf, verbose=False): """ load the...
en
0.889198
Rename the internal nodes in the pplacer tree using my awesome NCBI taxonomy load the jplacer file and return the tree :param jpf: The jplacer file :return: the data structure of the tree Extract the tree from the jplacer data structure and make it into an ete3 object :param data: the jplacer data structure...
2.89513
3
daemon/core/gui/dialogs/alerts.py
b00ga/core
0
6622531
<filename>daemon/core/gui/dialogs/alerts.py """ check engine light """ import tkinter as tk from tkinter import ttk from typing import TYPE_CHECKING from core.api.grpc.core_pb2 import ExceptionLevel from core.gui.dialogs.dialog import Dialog from core.gui.themes import PADX, PADY from core.gui.widgets import CodeText ...
<filename>daemon/core/gui/dialogs/alerts.py """ check engine light """ import tkinter as tk from tkinter import ttk from typing import TYPE_CHECKING from core.api.grpc.core_pb2 import ExceptionLevel from core.gui.dialogs.dialog import Dialog from core.gui.themes import PADX, PADY from core.gui.widgets import CodeText ...
en
0.666544
check engine light
2.366579
2
qa/tasks/util/rados.py
rpratap-bot/ceph
4
6622532
<filename>qa/tasks/util/rados.py import logging from teuthology import misc as teuthology log = logging.getLogger(__name__) def rados(ctx, remote, cmd, wait=True, check_status=False): testdir = teuthology.get_testdir(ctx) log.info("rados %s" % ' '.join(cmd)) pre = [ 'adjust-ulimits', 'cep...
<filename>qa/tasks/util/rados.py import logging from teuthology import misc as teuthology log = logging.getLogger(__name__) def rados(ctx, remote, cmd, wait=True, check_status=False): testdir = teuthology.get_testdir(ctx) log.info("rados %s" % ' '.join(cmd)) pre = [ 'adjust-ulimits', 'cep...
en
0.866852
# may fail as EINVAL when run in jewel upgrade test Return the shell command to run to create the erasure code profile described by the profile parameter. :param profile_name: a string matching [A-Za-z0-9-_.]+ :param profile: a map whose semantic depends on the erasure code plugin :returns: a shell...
2.074795
2
python/toy-problems/help_fruit_guy.py
vinnyhoward/til
0
6622533
<reponame>vinnyhoward/til # Our fruit guy has a bag of fruit (represented as an array of strings) where some fruits are rotten. He wants to replace all the rotten pieces of fruit with fresh ones. For example, given ["apple","rottenBanana","apple"] the replaced array should be ["apple","banana","apple"]. Your task is to...
# Our fruit guy has a bag of fruit (represented as an array of strings) where some fruits are rotten. He wants to replace all the rotten pieces of fruit with fresh ones. For example, given ["apple","rottenBanana","apple"] the replaced array should be ["apple","banana","apple"]. Your task is to implement a method that a...
en
0.823267
# Our fruit guy has a bag of fruit (represented as an array of strings) where some fruits are rotten. He wants to replace all the rotten pieces of fruit with fresh ones. For example, given ["apple","rottenBanana","apple"] the replaced array should be ["apple","banana","apple"]. Your task is to implement a method that a...
4.120198
4
src/cogs/memberlogs.py
Tocutoeltuco/hackweekbot
4
6622534
import objects.utils as utils from discord.ext import commands class MemberLogs(commands.Cog, name="Member Logs"): def __init__(self, bot): self.bot = bot @commands.Cog.listener() async def on_member_join(self, member): config = await self.bot.get_guild_config(member.guild.id) if config["welcome_channel"] !...
import objects.utils as utils from discord.ext import commands class MemberLogs(commands.Cog, name="Member Logs"): def __init__(self, bot): self.bot = bot @commands.Cog.listener() async def on_member_join(self, member): config = await self.bot.get_guild_config(member.guild.id) if config["welcome_channel"] !...
none
1
2.492384
2
HumanModeling/openai_gym/advanced_engagement_gym_coach.py
nesl/EngagementService
6
6622535
<gh_stars>1-10 import math import sys import os import numpy as np from gym.spaces import Box from .advanced_engagement_gym_base import AdvancedEngagementGymBase from human_modeling_utils import utils sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'Nurture', 'server', 'notification')) from nurt...
import math import sys import os import numpy as np from gym.spaces import Box from .advanced_engagement_gym_base import AdvancedEngagementGymBase from human_modeling_utils import utils sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'Nurture', 'server', 'notification')) from nurture.learning.st...
en
0.698636
# time of day # day of week # motion - stationary # motion - walking # motion - running # motion - driving # motion - biking # location - home # location - work # location - other # notificatoin time # ringer mode - silent # ringer mode - vibrate # ringer mode - normal # screen status # time of day # day of week # moti...
2.393576
2
train_classification_fastai.py
Data-drone/cv_experiments
0
6622536
<filename>train_classification_fastai.py ### Fastai v2 training script # built on fastai v2.2.2 # testing to see how the presets compare to my hand tuning ## So this is training better than my pytorch lightning... from fastai.vision.all import * path = '../cv_data/cifar10' ### Setup Image transforms item_transform...
<filename>train_classification_fastai.py ### Fastai v2 training script # built on fastai v2.2.2 # testing to see how the presets compare to my hand tuning ## So this is training better than my pytorch lightning... from fastai.vision.all import * path = '../cv_data/cifar10' ### Setup Image transforms item_transform...
en
0.743165
### Fastai v2 training script # built on fastai v2.2.2 # testing to see how the presets compare to my hand tuning ## So this is training better than my pytorch lightning... ### Setup Image transforms ### Setup Data Loaders ### Setup CNN Learner
2.267493
2
database_migrations/versions/6f1b895840a_change_report_parameters_to_varbinary.py
wikimedia/analytics-wikimetrics
6
6622537
<reponame>wikimedia/analytics-wikimetrics """change report parameters to varbinary Revision ID: 6f1b895840a Revises: <KEY> Create Date: 2015-06-16 09:58:57.874087 """ # revision identifiers, used by Alembic. revision = '6f1b895840a' down_revision = '<KEY>' from alembic import op from sqlalchemy.dialects.mysql import...
"""change report parameters to varbinary Revision ID: 6f1b895840a Revises: <KEY> Create Date: 2015-06-16 09:58:57.874087 """ # revision identifiers, used by Alembic. revision = '6f1b895840a' down_revision = '<KEY>' from alembic import op from sqlalchemy.dialects.mysql import VARBINARY from sqlalchemy import String ...
en
0.408453
change report parameters to varbinary Revision ID: 6f1b895840a Revises: <KEY> Create Date: 2015-06-16 09:58:57.874087 # revision identifiers, used by Alembic.
0.984417
1
utils/path_util.py
wooings/ViT-pytorch-1
0
6622538
from os.path import join from os.path import normpath import platform def pjoin(path, *paths): p = join(path, *paths) if platform.system() == "Windows": return normpath(p).replace('\\','/') else: return p
from os.path import join from os.path import normpath import platform def pjoin(path, *paths): p = join(path, *paths) if platform.system() == "Windows": return normpath(p).replace('\\','/') else: return p
none
1
2.982739
3
python/scriptflow.py
tlamadon/balke-lamadon-2022-aer
6
6622539
#!/usr/bin/python3 # simple script flow from email import policy import os import asyncio import click import numpy as np import shutil import glob import asyncio from time import sleep from pathlib import Path import scriptflowlib as sf @click.group() def cli(): pass # ----------------------------- TASKS ---...
#!/usr/bin/python3 # simple script flow from email import policy import os import asyncio import click import numpy as np import shutil import glob import asyncio from time import sleep from pathlib import Path import scriptflowlib as sf @click.group() def cli(): pass # ----------------------------- TASKS ---...
en
0.64131
#!/usr/bin/python3 # simple script flow # ----------------------------- TASKS ----------------------- Task that solves the model once taking a given file as input and generating an output file next to it # ----------------------------- FLOWS ----------------------- # save the model # save first best # save fit Flow th...
2.24312
2
src_old/tests/examples/legendre.py
toddrme2178/pyccel
0
6622540
<gh_stars>0 # coding: utf-8 #$ header legendre(int) def legendre(p): k = p + 1 x = zeros(k, double) w = zeros(k, double) if p == 1: x[0] = -0.577350269189625765 x[1] = 0.577350269189625765 w[0] = 1.0 w[1] = 1.0 elif p == 2: x[0] = -0.774596669241483377 ...
# coding: utf-8 #$ header legendre(int) def legendre(p): k = p + 1 x = zeros(k, double) w = zeros(k, double) if p == 1: x[0] = -0.577350269189625765 x[1] = 0.577350269189625765 w[0] = 1.0 w[1] = 1.0 elif p == 2: x[0] = -0.774596669241483377 x[1] = ...
en
0.285001
# coding: utf-8 #$ header legendre(int)
2.823787
3
lupa-core/src/test/resources/org/jetbrains/research/lupa/kotlinAnalysis/util/python/jupyter/data/out_5.py
JetBrains-Research/Lupa
16
6622541
import numpy as np import plt.pyplot as plt x = np.linspace(-2, 2, 9).reshape((3,3)) print(x / 2) print('hello') def foo(x: int = 1): assert(isinstance(x, np.ndarray)) return x * x / 2 print(foo(x)) class A: def __init__(self): self.string = "It's class A" def create_a(): a = A() ret...
import numpy as np import plt.pyplot as plt x = np.linspace(-2, 2, 9).reshape((3,3)) print(x / 2) print('hello') def foo(x: int = 1): assert(isinstance(x, np.ndarray)) return x * x / 2 print(foo(x)) class A: def __init__(self): self.string = "It's class A" def create_a(): a = A() ret...
none
1
3.645863
4
aries_cloudcontroller/api/multitenancy.py
didx-xyz/aries-cloudcontroller-pyton
5
6622542
from uplink import ( Consumer, Path, Query, Body, Header, get, post, patch, put, delete, returns, json, ) from typing import Dict, List, Optional, Union # noqa: F401 from aries_cloudcontroller.uplink_util import bool_query from aries_cloudcontroller.model.create_walle...
from uplink import ( Consumer, Path, Query, Body, Header, get, post, patch, put, delete, returns, json, ) from typing import Dict, List, Optional, Union # noqa: F401 from aries_cloudcontroller.uplink_util import bool_query from aries_cloudcontroller.model.create_walle...
en
0.643617
# noqa: F401 Create a subwallet Remove a subwallet Get auth token for a subwallet Get a single subwallet Query subwallets Update a subwallet Internal uplink method for create_wallet Internal uplink method for delete_wallet Internal uplink method for get_auth_token Internal uplink method for get_wallet Internal uplink m...
2.071766
2
python/testing/bboxtester_azure.py
pokotylo/ocrlayout
4
6622543
import io import json import logging import os import os.path import sys import types import time import requests from enum import Enum from pathlib import Path # Azure CV Support from azure.cognitiveservices.vision.computervision import ComputerVisionClient from msrest.authentication import CognitiveS...
import io import json import logging import os import os.path import sys import types import time import requests from enum import Enum from pathlib import Path # Azure CV Support from azure.cognitiveservices.vision.computervision import ComputerVisionClient from msrest.authentication import CognitiveS...
en
0.725845
# Azure CV Support # OCRLAYOUT Import # # Azure Specific # # Import Draw a border around the image using the hints in the vector list. # Convert the given bounding box to BBOXPoint # Check if we have a cached ocr response already for this provider # Set Content-Type to octet-stream # Azure Computer Vision OCR API Call ...
2.372848
2
tests/test_cli.py
benranderson/uhb
0
6622544
<filename>tests/test_cli.py """Tests for cli module.""" import pytest import json import click from click.testing import CliRunner from uhb import cli test_inputs = {"D_o": 0.1731, "f": 0.6} # def test_command_line_interface(): # """Test the CLI.""" # runner = CliRunner() # with runner.isolated_files...
<filename>tests/test_cli.py """Tests for cli module.""" import pytest import json import click from click.testing import CliRunner from uhb import cli test_inputs = {"D_o": 0.1731, "f": 0.6} # def test_command_line_interface(): # """Test the CLI.""" # runner = CliRunner() # with runner.isolated_files...
en
0.575805
Tests for cli module. # def test_command_line_interface(): # """Test the CLI.""" # runner = CliRunner() # with runner.isolated_filesystem(): # with open("inputs.json", "w") as f: # json.dump(test_inputs, f) # result = runner.invoke(cli.main, ["inputs.json"]) # assert resu...
2.433151
2
lc0219_contains_duplicate_ii.py
bowen0701/python-algorithms-data-structures
8
6622545
"""Leetcode 219. Contains Duplicate II Easy URL: https://leetcode.com/problems/contains-duplicate-ii/ Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums[i] = nums[j] and the absolute difference between i and j is at most k. Example 1: Inpu...
"""Leetcode 219. Contains Duplicate II Easy URL: https://leetcode.com/problems/contains-duplicate-ii/ Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums[i] = nums[j] and the absolute difference between i and j is at most k. Example 1: Inpu...
en
0.712616
Leetcode 219. Contains Duplicate II Easy URL: https://leetcode.com/problems/contains-duplicate-ii/ Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums[i] = nums[j] and the absolute difference between i and j is at most k. Example 1: Input: ...
3.542938
4
test/test_strict_lax.py
kurtsansom/netcdf-flattener
0
6622546
"""Project: NetCDF Flattener Copyright (c) 2020 EUMETSAT License: Apache License 2.0 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 t...
"""Project: NetCDF Flattener Copyright (c) 2020 EUMETSAT License: Apache License 2.0 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 t...
en
0.827962
Project: NetCDF Flattener Copyright (c) 2020 EUMETSAT License: Apache License 2.0 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 y...
1.876339
2
uiUtilities/makeScheduleDFdisplayable.py
jaime-varela/boaAnalysisTool
2
6622547
<filename>uiUtilities/makeScheduleDFdisplayable.py from .dropdownData import dayOfWeekToLetter, stringToEnumGrouping from .dropdownData import stringToEnumTextProcess, dayOfWeekToName from .dropdownData import dayOfWeekToLetter, EnumScheduleToString import numpy as np #FIXME: get rid of this copied var (this is a prob...
<filename>uiUtilities/makeScheduleDFdisplayable.py from .dropdownData import dayOfWeekToLetter, stringToEnumGrouping from .dropdownData import stringToEnumTextProcess, dayOfWeekToName from .dropdownData import dayOfWeekToLetter, EnumScheduleToString import numpy as np #FIXME: get rid of this copied var (this is a prob...
en
0.729998
#FIXME: get rid of this copied var (this is a problem!) # daily handler
2.598998
3
2-28-22.py
H-isaac23/LeetCode-Challenges
0
6622548
<filename>2-28-22.py # You are given a sorted unique integer array nums. # # Return the smallest sorted list of ranges that cover all the numbers in the array exactly. That is, each element of nums # is covered by exactly one of the ranges, and there is no integer x such that x is in one of the ranges but not in nums. ...
<filename>2-28-22.py # You are given a sorted unique integer array nums. # # Return the smallest sorted list of ranges that cover all the numbers in the array exactly. That is, each element of nums # is covered by exactly one of the ranges, and there is no integer x such that x is in one of the ranges but not in nums. ...
en
0.768752
# You are given a sorted unique integer array nums. # # Return the smallest sorted list of ranges that cover all the numbers in the array exactly. That is, each element of nums # is covered by exactly one of the ranges, and there is no integer x such that x is in one of the ranges but not in nums. # # Each range [a,b] ...
3.780117
4
src/armodel/parser/arxml_parser.py
melodypapa/py-armodel
2
6622549
<reponame>melodypapa/py-armodel from ..models import AUTOSAR, ARPackage, ARObject, EcuAbstractionSwComponentType, AtomicSwComponentType, SwComponentType, CompositionSwComponentType from ..models import SwcInternalBehavior, RunnableEntity, RTEEvent, VariableAccess, ServerCallPoint, OperationInvokedEvent from ..models im...
from ..models import AUTOSAR, ARPackage, ARObject, EcuAbstractionSwComponentType, AtomicSwComponentType, SwComponentType, CompositionSwComponentType from ..models import SwcInternalBehavior, RunnableEntity, RTEEvent, VariableAccess, ServerCallPoint, OperationInvokedEvent from ..models import RefType, AutosarVariableRef...
en
0.173247
# TODO: add read APPLICATION-RECORD-ELEMENT # type: ImplementationDataTypeElement #FIXME: readchildElement # FIXME: # FIXME: # add the data type map to global namespace
1.799652
2
app/migrations/0008_alter_hood_biashara.py
KairigoShawn/neighbourhood
0
6622550
<filename>app/migrations/0008_alter_hood_biashara.py # Generated by Django 4.0 on 2022-01-04 15:33 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('app', '0007_alter_hood_biashara'), ] operations = [ migrations.AlterField( mo...
<filename>app/migrations/0008_alter_hood_biashara.py # Generated by Django 4.0 on 2022-01-04 15:33 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('app', '0007_alter_hood_biashara'), ] operations = [ migrations.AlterField( mo...
en
0.83823
# Generated by Django 4.0 on 2022-01-04 15:33
1.335996
1