max_stars_repo_path stringlengths 3 269 | max_stars_repo_name stringlengths 4 119 | max_stars_count int64 0 191k | id stringlengths 1 7 | content stringlengths 6 1.05M | score float64 0.23 5.13 | int_score int64 0 5 |
|---|---|---|---|---|---|---|
Dataset/Leetcode/test/7/279.py | kkcookies99/UAST | 0 | 12765251 | class Solution:
def XXX(self, x: int) -> int:
if x == 0:
return 0
res = str(x)
sign = 1
if res[0] == '-':
res = res[1:]
sign = -1
res = res[::-1]
if res[0] == '0':
res = res[1:]
resint = int(res)*sign
... | 3.03125 | 3 |
torchvision/prototype/datasets/_builtin/semeion.py | yoshitomo-matsubara/vision | 2 | 12765252 | import functools
import io
from typing import Any, Callable, Dict, List, Optional, Tuple
import torch
from torchdata.datapipes.iter import (
IterDataPipe,
Mapper,
CSVParser,
)
from torchvision.prototype.datasets.decoder import raw
from torchvision.prototype.datasets.utils import (
Dataset,
DatasetC... | 2.390625 | 2 |
cloudrunner/node/matcher.py | CloudRunnerIO/cloudrunner | 5 | 12765253 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 CloudRunner.IO
# All Rights Reserved.
#
# 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 Lic... | 2.296875 | 2 |
kolab/multiese/parser.py | KuramitsuLab/kolab | 0 | 12765254 | import pegtree as pg
from pegtree import ParseTree
from pegtree.visitor import ParseTreeVisitor
import tree as ntree
import pprint
peg = pg.grammar('multiese.pegtree')
parser = pg.generate(peg)
def fix(tree):
a = [tree.epos_]
for t in tree:
fix(t)
a.append(t.epos_)
for key in tree.keys():... | 2.65625 | 3 |
inclassapr23.py | seanmacb/COMP-115-Exercises | 0 | 12765255 | #Making a nice litte x o o o x o o o x tic tac toe board
def printer(board):
for i in range(3):
for j in range (3):
print(board[i][j], end="")
if j<2:
print(" | ", end="")
print()
if i<2:
print("--+----+--")
def main():
tictactoe=[[... | 3.84375 | 4 |
packages/w3af/w3af/plugins/tests/crawl/failing_spider.py | ZooAtmosphereGroup/HelloPackages | 3 | 12765256 | <filename>packages/w3af/w3af/plugins/tests/crawl/failing_spider.py
"""
failing_spider.py
Copyright 2012 <NAME>
This file is part of w3af, http://w3af.org/ .
w3af 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 v... | 2.234375 | 2 |
CarND-Camera-Calibration/challenge/challenge.py | vikramriyer/CarND-Advanced-Lane-Lines | 1 | 12765257 | <reponame>vikramriyer/CarND-Advanced-Lane-Lines
import pickle
import cv2
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
%matplotlib inline
# Read in the saved camera matrix and distortion coefficients
# These are the arrays you calculated using cv2.calibrateCamera()
dist_pickle = p... | 2.671875 | 3 |
andinopy/nextion_util.py | andino-systems/andinopy | 0 | 12765258 | # _ _ _
# / \ _ __ __| (_)_ __ ___ _ __ _ _
# / _ \ | '_ \ / _` | | '_ \ / _ \| '_ \| | | |
# / ___ \| | | | (_| | | | | | (_) | |_) | |_| |
# /_/ \_\_| |_|\__,_|_|_| |_|\___/| .__/ \__, |
# |_| |___/
# by <NAME>
import time
import seri... | 2.46875 | 2 |
openff/bespokefit/executor/services/coordinator/worker.py | openforcefield/openff-bespokefit | 7 | 12765259 | <reponame>openforcefield/openff-bespokefit<gh_stars>1-10
import asyncio
import logging
import time
import redis
from openff.bespokefit.executor.services import current_settings
from openff.bespokefit.executor.services.coordinator.storage import (
TaskStatus,
get_n_tasks,
get_task,
peek_task_status,
... | 2.125 | 2 |
client/python/test/test_upload_locations.py | google/strabo | 70 | 12765260 | #
# Copyright 2015 Google, 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 writi... | 2.390625 | 2 |
src/workspace.py | monkey2000/wtfcf | 1 | 12765261 | #!/usr/bin/env python3
# coding=UTF-8
import os
import sys
import shutil
import ConfigParser
from logger import *
def generate_workspace(config, info):
cwd = os.path.abspath(os.getcwd())
ws_dir = cwd + '/' + info['contest_id'] + info['problem_id']
sample_dir = ws_dir + '/sample'
if os.path.isd... | 2.359375 | 2 |
astropop/polarimetry/__init__.py | rudnerlq/astropop | 3 | 12765262 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from .dualbeam import * # noqa
| 0.96875 | 1 |
test_mptt/models.py | kollivier/django-tree-tests | 0 | 12765263 | <reponame>kollivier/django-tree-tests
from django.db import models
# Create your models here.
from django.db import models
from mptt.models import MPTTModel, TreeForeignKey
class Object(models.Model):
name = models.CharField(max_length=50)
class TreeNode(MPTTModel):
name = models.CharField(max_length=50)
... | 2.609375 | 3 |
socketL/zhangll/client/reader.py | MaochengXiong/PythonLearning | 0 | 12765264 | <gh_stars>0
import threading
import json
import status
class Reader(threading.Thread):
def __init__(self, threadId, socket):
threading.Thread.__init__(self)
self.threadId = threadId
self.socket = socket
def run(self):
while True:
receivedBytes = self.socket.recv(1... | 3.015625 | 3 |
search/graph.py | almonteloya/project2 | 0 | 12765265 | <filename>search/graph.py
import networkx as nx
class Graph:
"""
Class to contain a graph perform BFS search
Atributtes:
graph: a graph read by networkx
Methods:
bfs: a method to perform breath first search or traversal
"""
def __init__(self, filename: str):
"""
Ini... | 4.15625 | 4 |
main.py | myungseokang/portfolio-backend | 0 | 12765266 | <reponame>myungseokang/portfolio-backend
from typing import List
from fastapi import Depends, FastAPI, HTTPException
from sqlalchemy.orm import Session
from utils.users import get_user_by_email, create_user, get_users, get_user
from schemas.users import User, UserCreate
from database import SessionLocal, engine, Base... | 2.296875 | 2 |
python/yugabyte_db_thirdparty/packager.py | pkj415/yugabyte-db-thirdparty | 0 | 12765267 | <filename>python/yugabyte_db_thirdparty/packager.py
from yugabyte_db_thirdparty.git_util import get_git_sha1
from yugabyte_db_thirdparty.util import (
compute_file_sha256,
create_symlink_and_log,
log_and_run_cmd,
remove_path,
YB_THIRDPARTY_DIR,
)
from yugabyte_db_thirdparty.checksums import CHECKSUM... | 2.234375 | 2 |
WebApp/forms.py | sunniqua97/Vote-Power | 0 | 12765268 | from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField
from wtforms.validators import DataRequired, EqualTo, Email
# Form for address
class AddressForm(FlaskForm):
address = StringField('Address',validators=[DataRequired()])
submit = SubmitField('Submit')
# Form for email noti... | 2.859375 | 3 |
src/materia/actions/action.py | kijanac/Materia | 0 | 12765269 | <gh_stars>0
import abc
__all__ = ["Action", "ActionSignal"]
class Action(abc.ABC):
@abc.abstractmethod
def run(self, node, tasks, links, done):
pass
class ActionSignal(Exception):
def __init__(self, message=None, result=None, actions=None):
# result and actions have default values only
... | 3.1875 | 3 |
orgconfig/__init__.py | yiwenlong/fabric-easy-dev | 14 | 12765270 | # -*- encoding: utf-8 -*-
#
# Copyright 2020 Yiwenlong(<EMAIL>)
#
# 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 applic... | 1.835938 | 2 |
rep2recall/engine/search.py | patarapolw/rep2recall-py | 2 | 12765271 | from datetime import datetime, timedelta
import re
from typing import Union, Callable, Any
import math
import functools
from uuid import uuid4
from .typing import IParserResult
ANY_OF = {"template", "front", "mnemonic", "entry", "deck", "tag"}
IS_DATE = {"created", "modified", "nextReview"}
IS_STRING = {"template", "... | 2.578125 | 3 |
dict/create_dict.py | janbodnar/Python-Course | 13 | 12765272 | #!/usr/bin/python
# create_dict.py
weekend = { "Sun": "Sunday", "Mon": "Monday" }
vals = dict(one=1, two=2)
capitals = {}
capitals["svk"] = "Bratislava"
capitals["deu"] = "Berlin"
capitals["dnk"] = "Copenhagen"
d = { i: object() for i in range(4) }
print (weekend)
print (vals)
print (capitals)
print (d)
| 3.734375 | 4 |
webexdev-mtgquality/lambda_function.py | netone-g/Webex-QoE-Dashboard | 0 | 12765273 | <gh_stars>0
import json
import os
import logging
import decimal
import base64
import urllib.request
import urllib.parse
import boto3
from botocore.exceptions import ClientError
from urllib import error
logger = logging.getLogger()
logger.setLevel(logging.INFO)
REGION = os.environ['AWS_DEFAULT_REGION']
def lambda_han... | 1.90625 | 2 |
backend/lib/oauth2.py | ale-cci/demo-oauth-openid | 0 | 12765274 | <reponame>ale-cci/demo-oauth-openid
# Signing using rsa
# https://stackoverflow.com/questions/49116579/sign-a-byte-string-with-sha256-in-python
import math
import random
import string
import time
import flask
import cryptography
import json
import base64
# Required for jwt signature
from cryptography.hazmat.primitives... | 2.59375 | 3 |
codigo/setup.py | mattyws/desafio-iafront | 0 | 12765275 | <gh_stars>0
from setuptools import setup, find_packages
setup(
name='desafio_iafront',
version='',
packages=find_packages(),
url='',
license='',
author='<NAME>',
author_email='',
description='',
install_requires=[
"scikit-learn==0.23.1",
"click==7.1.2",
"boke... | 1.507813 | 2 |
cogs/mal.py | loomkoom/appuselfbotmain | 0 | 12765276 | <gh_stars>0
import sys
import subprocess
import os
import requests
import re
import asyncio
import gc
import tokage
import discord
import pytz
import json
from datetime import datetime, timedelta
from discord.ext import commands
from bs4 import BeautifulSoup
from urllib.request import Request, urlopen
from cogs.utils.c... | 2.3125 | 2 |
project-simple-00.py | MaxZar1/project-simple | 0 | 12765277 | # to jest komentarz
WIDTH = 550
HEIGHT = 550
| 1.070313 | 1 |
src/metrics/data/_classification.py | exprmntr/crowd-kit | 0 | 12765278 | from typing import Any, Optional, Union
import numpy as np
import pandas as pd
from crowdkit.aggregation.base_aggregator import BaseAggregator
from crowdkit.aggregation import MajorityVote
def _check_answers(answers: pd.DataFrame) -> None:
if not isinstance(answers, pd.DataFrame):
raise TypeError('Workin... | 2.796875 | 3 |
annotations/admin.py | connectik/digital-manifesto | 0 | 12765279 | from __future__ import unicode_literals, absolute_import
from django.contrib import admin
from . import models
@admin.register(models.Annotation)
class AnnotationAdmin(admin.ModelAdmin):
search_fields = ('text',)
fields = (
'user',
'text_object',
'annotator_schema_version',
'... | 1.6875 | 2 |
tools/regVariation/maf_cpg_filter.py | bopopescu/phyG | 2 | 12765280 | #!/usr/bin/env python
#<NAME>
#Adapted from bx/scripts/maf_mask_cpg.py
"""
Mask out potential CpG sites from a maf. Restricted or inclusive definition
of CpG sites can be used. The total fraction masked is printed to stderr.
usage: %prog < input > output restricted
-m, --mask=N: Character to use as mask ('?' is de... | 2.625 | 3 |
minigest/tributi/models/accertamento_rata/__init__.py | ctrlmaniac/minigest | 0 | 12765281 | from .erario import AccertamentoRataSezErario
from .rata import AccertamentoRata
__all__ = ["AccertamentoRataSezErario", "AccertamentoRata"]
| 1.039063 | 1 |
src/register/migrations/0001_initial.py | saurabhs92/django-organ-donatation | 0 | 12765282 | <filename>src/register/migrations/0001_initial.py
# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-08-13 18:46
from __future__ import unicode_literals
import django.core.validators
from django.db import migrations, models
import uuid
class Migration(migrations.Migration):
initial = True
dependenc... | 1.875 | 2 |
laia/models/htr/__init__.py | basbeu/PyLaia | 2 | 12765283 | <reponame>basbeu/PyLaia
from __future__ import absolute_import
from laia.models.htr.conv_block import ConvBlock
from laia.models.htr.dummy_model import DummyModel
from laia.models.htr.laia_crnn import LaiaCRNN
from laia.models.htr.gated_crnn import GatedConv2d, GatedCRNN
| 0.929688 | 1 |
test_all_data.py | GabrielComanescu/fashion_Mnist | 0 | 12765284 | <filename>test_all_data.py
from Model import ConvNet
import torch
from torch.utils.data import DataLoader
import data
from sklearn.metrics import confusion_matrix
model_test = ConvNet()
model_test.load_state_dict(torch.load('models/model.pt'))
if torch.cuda.is_available():
model_test.cuda()
model_test.... | 2.765625 | 3 |
setup.py | RaymondKlass/entity-extract | 0 | 12765285 | <reponame>RaymondKlass/entity-extract<filename>setup.py
#! /usr/bin/env python
from setuptools import setup
setup(name="entity-extractor",
version="0.01",
author="<NAME>",
author_email="<EMAIL>",
description="Entity Extraction, Recognition, and Translation to RDF",
license="MIT",
pa... | 1.265625 | 1 |
core/gym/cloudsim_env.py | kangyifei/CloudSimPy | 0 | 12765286 | <filename>core/gym/cloudsim_env.py<gh_stars>0
import gym
from core.gym.abstract_agent import AbstractAgent
from core.cluster import Cluster
from core.scheduler import Scheduler
from core.cooling_equipment import CoolingEquipment
from core.simulation import Simulation
from gym import spaces
from core.config import Machi... | 2.078125 | 2 |
01_scikit-learn-intelex_Intro/lab/scikit_dbscan.py | IntelSoftware/scikit-learn_essentials | 1 | 12765287 |
# Copyright 2021 Intel Corporation
#
# 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 w... | 1.90625 | 2 |
tests/test_shell.py | eanderton/dash | 0 | 12765288 | <gh_stars>0
"""Tests for the dcsh shell module."""
import dcsh.printer as printer
import dcsh.shell as shell
import unittest
from mock import patch
from StringIO import StringIO
class TestDCShell(unittest.TestCase):
def setUp(self):
self.settings = {
'sudo': False,
'debug': False,... | 2.359375 | 2 |
engine/models.py | scwall/cocktail_engine | 2 | 12765289 | #!/usr/bin/python3
from django.core.validators import MinValueValidator, MaxValueValidator
from django.db import models
class SolenoidValve(models.Model):
"""
Model for the solenoid valves in database
"""
number = models.IntegerField(validators=[MinValueValidator(1),
... | 2.640625 | 3 |
Assignment_1.py | ankit9437/Zelthy | 0 | 12765290 | import smtplib #Python Library
print("Subject?")
sub=input() #Used to take subject
print("Body?")
message = input() #Used for taking message for email
print("Recipient")
receivers_mail = input() #Used to take receiver's mail
print("Sender's Mail?")
sender_mail= inpu... | 3.5625 | 4 |
napalm_ansible/__init__.py | CPintoB/napalm-automation-napalm-ansible | 0 | 12765291 | <reponame>CPintoB/napalm-automation-napalm-ansible
from __future__ import unicode_literals, print_function
import os
import ansible
from distutils.version import LooseVersion
message = """
To ensure Ansible can use the NAPALM modules you will have
to add the following configurtion to your Ansible configuration
file (a... | 1.882813 | 2 |
api-server/apps/resource/hyperv/hypervisor.py | run4life/hyperv-api-server | 0 | 12765292 | import wmi
class HypervisorClient(object):
def get_wmi_client(self, server, user, password):
conn = wmi.connect_server(server=server, user=user, password=password)
client = wmi.WMI(wmi=conn)
return client
def _get_cpu_info(self,client):
# cpus = client.query(
# ... | 2.8125 | 3 |
optimizers/layers.py | ppeigne/optimizers | 0 | 12765293 | from typing import Tuple
from initialization import *
from activations import *
class Layer():
def __init__(self, n_units, activation):#, initialization=None):
self.n_units = n_units
#self.activation = self._select_activation(activation)
#self.initialization = initialization if initializati... | 3.078125 | 3 |
Tracked.py | FLUX-SE/TrackedHQ_python_wrapper | 0 | 12765294 | import requests
from endpoints.projects import Projects
from endpoints.lists import Lists
from endpoints.todos import Todos
from endpoints.labels import Labels
class Tracked:
def __init__(self, email_address: str, api_token: str, basecamp_account_id: int):
self.email_address = email_address
self.... | 2.5 | 2 |
blog/admin.py | KimLHill/MSP4 | 0 | 12765295 | from django.contrib import admin
from .models import Blog
# Blog information
class BlogAdmin(admin.ModelAdmin):
list_display = (
'name',
'author',
'description',
'image',
)
ordering = ('name',)
admin.site.register(Blog, BlogAdmin)
| 1.828125 | 2 |
examples/graph/gnn_citations.py | IMvision12/keras-io | 0 | 12765296 | <filename>examples/graph/gnn_citations.py
"""
Title: Node Classification with Graph Neural Networks
Author: [<NAME>](https://www.linkedin.com/in/khalid-salama-24403144/)
Date created: 2021/05/30
Last modified: 2021/05/30
Description: Implementing a graph neural network model for predicting the topic of a paper given it... | 2.9375 | 3 |
cris/reviews/controller.py | umarmiti/COMP-4350--Group-8 | 1 | 12765297 | <reponame>umarmiti/COMP-4350--Group-8
from flask import Blueprint, jsonify, render_template, request, flash, session
from cris import db
from model import Review
from decimal import *
from cris.users.controller import check_follower
from cris.users.model import User
mod = Blueprint('reviews', __name__, url_prefix='/re... | 2.171875 | 2 |
jinahub/encoders/audio/VGGISHAudioEncoder/tests/unit/test_exec.py | vivek2301/executors | 0 | 12765298 | <reponame>vivek2301/executors<filename>jinahub/encoders/audio/VGGISHAudioEncoder/tests/unit/test_exec.py
from pathlib import Path
import librosa
import pytest
from jina import Document, DocumentArray, Executor
from tensorflow.python.framework import ops
from ...vggish import vggish_input
from ...vggish_audio_encoder ... | 1.859375 | 2 |
manage.py | ganggas95/E-Wisata | 0 | 12765299 | <reponame>ganggas95/E-Wisata
from flask_migrate import MigrateCommand
from flask_script import Manager
from app import app
from app.commands import InitDbCommand
# Setup Flask-Script with command line commands
manager = Manager(app)
manager.add_command('db', MigrateCommand)
manager.add_command('init_db', InitDbComman... | 1.875 | 2 |
cotacao.py | cassianodess/CotacaoMoedas | 1 | 12765300 | import requests # Pega informações de API's
from datetime import datetime # Data e hora atual
from openpyxl import Workbook # Cria arquivo Excel
from openpyxl.styles import Alignment, Font # Estilos para células
import pandas as pd # Nesse caso, estou usando p/ transformar em html
# Busca as informações do site
r... | 3.1875 | 3 |
server/external/youtube-dl/youtube_dl/extractor/inc.py | yycc179/urlp | 0 | 12765301 | <filename>server/external/youtube-dl/youtube_dl/extractor/inc.py
from __future__ import unicode_literals
from .common import InfoExtractor
from .kaltura import KalturaIE
class IncIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?inc\.com/(?:[^/]+/)+(?P<id>[^.]+).html'
_TESTS = [{
'url': '... | 2.53125 | 3 |
Students/abinash_flask/day1/app.py | Throttlerz-devs/flask-tutorial | 7 | 12765302 | from flask import Flask, render_template
# create a flask application name app
app = Flask(__name__)
@app.route("/")
def index():
return render_template('index.html')
if __name__=="__main__":
app.run(debug=True) | 2.5 | 2 |
pyaims/python/soma/aims/io_ext.py | brainvisa/aims-free | 4 | 12765303 |
import numpy as np
import atexit
import sys
aims = sys.modules['soma.aims']
'''
IO formats readers / writers written in python for aims.
Currently:
Numpy format for matrices
'''
class NpyFormat(aims.FileFormat_SparseOrDenseMatrix):
def read(self, filename, obj, context, options=None):
mat = np.load(fil... | 2.265625 | 2 |
setup.py | chvogl/snII_cosmo_tools | 0 | 12765304 | <filename>setup.py
from setuptools import setup, find_packages
setup(
name='snII_cosmo_tools',
url='https://github.com/chvogl/snII_cosmo_tools.git',
author='<NAME>',
author_email='<EMAIL>',
packages=find_packages(),
package_data={'snII_cosmo_tools': ['templates/*.html']}
)
| 1.289063 | 1 |
SpiceMix/estimateParameters.py | ma-compbio/SpiceMix | 18 | 12765305 | import sys, time, itertools, resource, logging
from multiprocessing import Pool, Process
from util import psutil_process, print_datetime, array2string, PyTorchDType as dtype
import torch
import numpy as np
import gurobipy as grb
from scipy.special import loggamma
from sampleForIntegral import integrateOfExponentialOv... | 1.90625 | 2 |
evaluation/easy_evaluation.py | eldrin/MTLMusicRepresentation | 5 | 12765306 | # import numpy as np
from sklearn.pipeline import Pipeline
# from sklearn.svm import SVC, SVR
from sklearn.linear_model import SGDClassifier
from sklearn.preprocessing import StandardScaler
from sklearn.decomposition import PCA
from sklearn.model_selection import cross_val_predict
from sklearn.metrics import accuracy_... | 2.75 | 3 |
illusion_testing/training/KWS_LSTM/chunk_model.py | robust-systems-group/illusion_system | 4 | 12765307 | <reponame>robust-systems-group/illusion_system
#
# Copyright (C) 2020 by The Board of Trustees of Stanford University
# This program is free software: you can redistribute it and/or modify it under
# the terms of the Modified BSD-3 License as published by the Open Source
# Initiative.
# If you use this program in your ... | 1.929688 | 2 |
bot/helper/mirror_utils/download_utils/direct_link_generator.py | styloxyash1/mybot | 0 | 12765308 |
import json
import re
import urllib.parse
from os import popen
from random import choice
import requests
from bs4 import BeautifulSoup
from bot.helper.ext_utils.exceptions import DirectDownloadLinkException
def direct_link_generator(link: str):
""" direct links generator """
if not link:
... | 2.609375 | 3 |
users/urls.py | bhatiaisb5300/DevelopmentRobotix | 0 | 12765309 | from rest_framework.routers import DefaultRouter
from django.urls import path,include,re_path
from . import views
from .views import UserProfileViewSet,accountView,loginView,registerView
router = DefaultRouter()
router.register('profiles',UserProfileViewSet,base_name='user-profile-viewset')
urlpatterns = [
path('... | 2.0625 | 2 |
mutester/__main__.py | XPerianer/Mutester | 1 | 12765310 | import argparse
import logging
import math
import time
from threading import Thread
from typing import List
import pandas as pd
from mutester.data_analysis import DataAnalysis
from mutester.data_crawler import DataCrawler
def analysis_thread(repository_path, environment_path, mutant_ids: List[int], results: List[Da... | 2.578125 | 3 |
NLP/Text2SQL-BASELINE/text2sql/dataproc/sql_preproc_v2.py | zhangyimi/Research | 1,319 | 12765311 | <gh_stars>1000+
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# 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://... | 1.9375 | 2 |
codes_auto/617.merge-two-binary-trees.py | smartmark-pro/leetcode_record | 0 | 12765312 | #
# @lc app=leetcode.cn id=617 lang=python3
#
# [617] merge-two-binary-trees
#
None
# @lc code=end | 1.25 | 1 |
thread/multi_threading.py | hupantingxue/advancedpython | 2 | 12765313 | #-*- coding: utf-8 -*-
from threading import Thread
import time
def loop(idx, nsec):
print("start loop", idx, " at ", time.ctime())
time.sleep(nsec)
print("start loop", idx, " at ", time.ctime())
def main():
print("Process start at ", time.ctime())
thread0 = Thread(target=loop, args=(0, 4))
th... | 3.296875 | 3 |
scripts/data-restification-kit/import_data.py | AuthEceSoftEng/ma-made-core | 0 | 12765314 | <reponame>AuthEceSoftEng/ma-made-core
from datasetsHandler import datasetsHandler
import dataImporter
from settings import HOST as host
from settings import SERVICE_PORT as host_port
import json
def importData(dataset, port):
# Initialize the datasets handler
dH = datasetsHandler('datasets')
# Initialize the data ... | 2.125 | 2 |
components/example_01/nodes/telegram.py | Legodev/Flask-Drawflow | 0 | 12765315 | from components.base.drawflownodebase import DrawflowNodeBase
class TelegramNode(DrawflowNodeBase):
def __init__(self):
super().__init__()
self.name('telegram')
self.title('Telegram send message')
self.input('msg', str)
self.icon('fab fa-telegram')
self.html("""
... | 2.734375 | 3 |
deep-scratch/steps/step47.py | jayChung0302/myml | 0 | 12765316 | <reponame>jayChung0302/myml
if '__file__' in globals():
import os, sys
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
import numpy as np
from dezero import Variable, Model, as_variable
import dezero.functions as F
import dezero.layers as L
from dezero.models import MLP
from dezero import optimiz... | 2.65625 | 3 |
backend/ocr-modules/OCR-Attn/RunOCREngine.py | refrainfl/CapstonProject | 0 | 12765317 | <reponame>refrainfl/CapstonProject<gh_stars>0
import os
import sys
import LIST2JSON
import DrawTextBox
from ocr import OCR
from types import SimpleNamespace
import warnings
warnings.filterwarnings("ignore", category=UserWarning, module="torch.nn.functional")
def OCREngine(image):
# 이하 opt을 변경하여 기학습된 모델을 교체할 수 있음... | 2.40625 | 2 |
csrc/setup.py | tarepan/HiPPO | 57 | 12765318 | <reponame>tarepan/HiPPO
from setuptools import setup
from torch.utils.cpp_extension import CppExtension, BuildExtension
ext_modules = []
extension = CppExtension('hippo', ['hippo.cpp', 'hippolegs.cpp', 'hippolegt.cpp'], extra_compile_args=['-march=native'])
ext_modules.append(extension)
setup(
name='hippo',
e... | 1.523438 | 2 |
libs/Utils.py | leftstick/sublime-quick-move | 0 | 12765319 | <filename>libs/Utils.py
import sublime
import os.path
def getBaseName(fullpath):
return os.path.basename(fullpath)
def oneThingSelected(paths):
return len(paths) == 1
def removeNonPathEnd(path):
return path.rstrip('\\/')
def getParent(path):
return os.path.dirname(path)
def revert(view):
while ... | 2.25 | 2 |
Python/293.py | JWang169/LintCodeJava | 1 | 12765320 | class Solution:
def generatePossibleNextMoves(self, s: str) -> List[str]:
results = []
for i in range(len(s) - 1):
if s[i: i + 2] == "++":
results.append(s[:i] + "--" + s[i + 2:])
return results | 3.234375 | 3 |
working/timer.py | satchm0h/ChamTimer | 0 | 12765321 | <filename>working/timer.py
'''
What we are trying to do here is support simple periodic wall clock timers.
They come in two forms. First is a simple periodic timer. It runs the provided
callback Every N seconds. Second is a nested timer. It runs the provided
last_callback every N seconds (primary period), then again M... | 3.359375 | 3 |
py/path-sum-iii.py | ckclark/leetcode | 0 | 12765322 | from collections import Counter
# 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 dfs(self, cur):
if cur:
self.subsum += cur.val
yield... | 3.578125 | 4 |
build/piman.app/pysnmp/entity/rfc3413/oneliner/ntforg.py | jackgisel/team-athens | 0 | 12765323 | <filename>build/piman.app/pysnmp/entity/rfc3413/oneliner/ntforg.py
#
# This file is part of pysnmp software.
#
# Copyright (c) 2005-2019, <NAME> <<EMAIL>>
# License: http://snmplabs.com/pysnmp/license.html
#
# All code in this file belongs to obsolete, compatibility wrappers.
# Never use interfaces below for new applic... | 1.828125 | 2 |
LaneDetect.py | Eng-Mo/CarND-Advanced-Lane-Lines | 0 | 12765324 |
# coding: utf-8
# In[1]:
import numpy as np
import cv2
import matplotlib
import matplotlib.pyplot as plt
import matplotlib as mpimg
import numpy as np
from IPython.display import HTML
import os, sys
import glob
import moviepy
from moviepy.editor import VideoFileClip
from moviepy.editor import *
from IPython import ... | 2.640625 | 3 |
tests/test_zz_jvm_kill.py | edurand/cellom2tif | 4 | 12765325 | <filename>tests/test_zz_jvm_kill.py<gh_stars>1-10
from cellom2tif import cellom2tif
import bioformats as bf
import pytest
cfile = 'test-data/d1/MFGTMP_120628160001_C18f00d0.C01'
def test_read_image():
im = cellom2tif.read_image(cfile)
assert im.shape == (512, 512)
def test_read_image_from_reader():
rd... | 2.109375 | 2 |
src/atcoder/abc056/a/sol_0.py | kagemeka/competitive-programming | 1 | 12765326 | import typing
def main() -> typing.NoReturn:
a, b = input().split()
print('H' if a == b else 'D')
main() | 3.1875 | 3 |
tests/keys.py | snikch/chia-blockchain | 0 | 12765327 | from blspy import AugSchemeMPL
from src.types.coin_solution import CoinSolution
from src.types.spend_bundle import SpendBundle
from src.wallet.puzzles import p2_delegated_puzzle
from src.wallet.puzzles.puzzle_utils import make_create_coin_condition
from tests.util.key_tool import KeyTool
from src.util.ints import uin... | 2 | 2 |
python/design/0225_implement_stack_using_queues.py | linshaoyong/leetcode | 6 | 12765328 | class MyStack(object):
def __init__(self):
"""
Initialize your data structure here.
"""
self.data = []
def push(self, x):
"""
Push element x onto stack.
:type x: int
:rtype: None
"""
q = [x]
while self.data:
q.... | 4.25 | 4 |
copy farture.py | wy1157497582/arcpy | 1 | 12765329 | <gh_stars>1-10
#-*- coding:utf-8-*-
import arcpy,os
inPath = u"F:\第四批数据\beizh\ls.mdb"
arcpy.env.workspace = inPath
arcpy.env.overwriteoutput=1
outPath =u"F:"
outName = "dian.mdb"
try:
#'''''复制要素类函数'''
def copyAll(outPath,outName):
for fc in arcpy.ListFeatureClasses():
#print(" Feature Clas... | 2.21875 | 2 |
hathor/p2p/states/hello.py | khengleng/khathor | 0 | 12765330 | import json
from typing import TYPE_CHECKING, Any, Dict
import hathor
from hathor.conf import HathorSettings
from hathor.p2p.messages import ProtocolMessages
from hathor.p2p.states.base import BaseState
from hathor.p2p.utils import get_genesis_short_hash, get_settings_hello_dict
if TYPE_CHECKING:
from hathor.p2p.... | 2.40625 | 2 |
similarIV/processing_data.py | pinedbean/similarIV | 1 | 12765331 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from .instant_function import data_vars
def create_categorical_onehot(df,category_columns):
category_dataframe = []
for category_column in category_columns:
category_dataframe.append(pd.get_dummies(df[category_column],prefix='col_'... | 3.046875 | 3 |
sancho/dglload.py | el-assistant/sancho | 0 | 12765332 | <filename>sancho/dglload.py<gh_stars>0
"""
This module implents data loading into DGL library
"""
from defaults import *
import dgl
import torch as th
from parsing import ParsedText
from neo4jschema import ASTnode as N4node
def get_coo(node: N4Node):
assert node.kind == "module"
visited = {}
# TODO: tag ... | 2.046875 | 2 |
src/main.py | Nenma/ga-qas-sm | 0 | 12765333 | <reponame>Nenma/ga-qas-sm
'Main module.'
import json
import random
import tweepy
import crawler.twitter_crawler as tc
import controller
def get_tweet():
possible_trends = tc.get_trends()
selected_trend = random.choice(possible_trends)
selected_tweet = controller.get_selected_tweet(selected_trend)
r... | 2.578125 | 3 |
urbarium/character/migrations/0005_auto_20200518_1218.py | nikerzetic/zacasno-ime | 0 | 12765334 | # Generated by Django 3.0.4 on 2020-05-18 10:18
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('character', '0004_auto_20200518_1215'),
]
operations = [
migrations.AlterField(
model_name='character',
name='notes'... | 1.390625 | 1 |
CV/SemSegPaddle/train.py | zhangyimi/Research | 1,319 | 12765335 | <filename>CV/SemSegPaddle/train.py
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
# GPU memory garbage collection optimization flags
os.environ['FLAGS_eager_delete_tensor_gb'] = "0.0"
import sys
import timeit
import argparse
import pprint
import ... | 1.90625 | 2 |
l10n_ve_isrl/models/account_invoice_inherit.py | Chief0-0/Localizacion_ERP_V12 | 0 | 12765336 | <filename>l10n_ve_isrl/models/account_invoice_inherit.py<gh_stars>0
# -*- coding: utf-8 -*-
# Copyright 2019 <NAME> <<EMAIL>>
from odoo import _, api, fields, models
from odoo.exceptions import UserError, ValidationError
class AccountInvoiceTaxInherit(models.Model):
_inherit = "account.invoice.tax"
subject_... | 2.125 | 2 |
purchases_storage/source/api/api.py | icYFTL/RTULAB_Service | 0 | 12765337 | <reponame>icYFTL/RTULAB_Service
from source.database import *
from . import app
from .utils import *
from flask import request
from datetime import datetime
from pytz import timezone
@app.route('/purchases', methods=['GET'])
def on_root():
return Reply.ok()
@app.route('/purchases/new_purchase', met... | 2.5 | 2 |
wikipedia-bot.py | sinasystem/wikipediabot | 0 | 12765338 | # Required modules and libraries
from telegram.ext import Updater, CommandHandler, InlineQueryHandler, MessageHandler, Filters
import telegram
from telegram import InlineQueryResultArticle, ParseMode, \
InputTextMessageContent
import requests
import wikipediaapi
import re
from uuid import uuid4
# Varia... | 2.875 | 3 |
main.py | Lonikoo/Sorting_Visualization | 1 | 12765339 | from data import DataSeq
from bubblesort import BubbleSort
from bucketsort import BucketSort
from combsort import CombSort
from cyclesort import CycleSort
from heapsort import HeapSort
from insertionsort import InsertionSort
from mergesort import MergeSort
from monkeysort import MonkeySort
from quicksort import QuickSo... | 2.75 | 3 |
labs/04_conv_nets_2/solutions/geom_avg.py | souillade/Deep | 1 | 12765340 | heatmap_1_r = imresize(heatmap_1, (50,80)).astype("float32")
heatmap_2_r = imresize(heatmap_2, (50,80)).astype("float32")
heatmap_3_r = imresize(heatmap_3, (50,80)).astype("float32")
heatmap_geom_avg = np.power(heatmap_1_r * heatmap_2_r * heatmap_3_r, 0.333)
display_img_and_heatmap("dog.jpg", heatmap_geom_avg)
| 2.46875 | 2 |
Python/2311.py | alinemarchiori/URI_Exercises_Solved | 0 | 12765341 | quantidade, menor, maior, soma = 0,0,0,0
quantidade = int(input())
while(quantidade>0):
menor, maior, soma, final= 10,0,0,0
nome = input()
dificuldade = float(input())
notas = input().split()
notas = list(notas)
for i in range(len(notas)):
notas[i] = float(notas[i])
notas.sort()
cont = 0
for i in range(len(n... | 3.609375 | 4 |
datafeeds/winddatabasefeeds/stockfeedswinddatabase.py | liuqiuxi/datafeeds | 1 | 12765342 | # -*- coding:utf-8 -*-
# @Time : 2019-12-27 16:11
# @Author : liuqiuxi
# @Email : <EMAIL>
# @File : stockfeedswinddatabase.py
# @Project : datafeeds
# @Software: PyCharm
# @Remark : This is class of stock market
import datetime
import copy
import pandas as pd
import numpy as np
from datafeeds.ut... | 2.578125 | 3 |
plugins/sumtia/sumtia.py | RodPy/Turtlebots.activity | 0 | 12765343 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2011 Butiá Team <EMAIL>
# Butia is a free open plataform for robotics projects
# www.fing.edu.uy/inco/proyectos/butia
# Universidad de la República del Uruguay
#
# This program is free software; you can redistribute it and/or modify
# it under the terms ... | 2.703125 | 3 |
server/yubikeys/apps.py | msdrigg/DuoAutoFiller | 0 | 12765344 | from django.apps import AppConfig
class YubikeysConfig(AppConfig):
name = 'yubikeys'
| 1.039063 | 1 |
formatting.py | apoorv-jain/youtube-transcript-api | 0 | 12765345 | import sys
import os
class SrtFormatter():
def _secs_to_minutes_hours(self , time):
add_formatting = lambda a: '0' + a if len(a) == 1 else a
milli_secs = time - int(time)
secs = add_formatting(str(int(time)%60))
mins = add_formatting((int(time)//60).__str__())
h... | 2.875 | 3 |
app/app/models.py | UWA-CITS3200-18-2021/ReSQ | 1 | 12765346 | <reponame>UWA-CITS3200-18-2021/ReSQ
from sqlalchemy.sql.expression import null
from app import db, login_manager
from app.globals import queueType, statusType, roleType, invalidChar
from flask_login import UserMixin
from sqlalchemy import Column, Integer, String, Enum, DateTime, Text
from sqlalchemy.orm import validate... | 2.421875 | 2 |
static/stitch_images.py | thabat12/TetraNet | 0 | 12765347 | import cv2
import tensorflow as tf
import numpy as np
from keras.models import Model
from keras.models import load_model
from numpy import asarray
from PIL import Image, ImageOps
import azure_get_unet as azure_predict
# Since we are using the Azure API, there is not need to save the model to the local filesystem
# mod... | 2.828125 | 3 |
custom_libs/Project3/plotter.py | drkostas/COSC522 | 1 | 12765348 | <reponame>drkostas/COSC522
import matplotlib.pyplot as plt
import numpy as np
from typing import *
class Plotter:
nx: np.ndarray
fx: np.ndarray
px: np.ndarray
px1: np.ndarray
def __init__(self, nx: np.ndarray, fx: np.ndarray, px1: np.ndarray, px: np.ndarray):
self.nx = nx
self.fx ... | 2.84375 | 3 |
source/dtmil/visualizations.py | ajayarunachalam/ADOPT | 11 | 12765349 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 20 15:55:46 2019
@author: dweckler
"""
import numpy as np, matplotlib.pyplot as plt
from keras import backend as T
import time
import os
from .utilities import flat_avg
from dtmil.configuration.config_dtmil import get_json_config_data
from .predic... | 2.109375 | 2 |
sem6000/bluetooth_lowenergy_interface/timeout_decorator.py | moormaster/voltcraft-sem-6000 | 2 | 12765350 | import threading
def DisconnectAfterTimeout(timeout):
def Decorator(function):
def decorated_function(*s, **d):
def disconnect():
disconnectable = s[0]
disconnectable.disconnect()
timer = threading.Timer(timeout, disconnect)
timer.start()... | 3.09375 | 3 |