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 |
|---|---|---|---|---|---|---|
python/tests/test_insertion_sort.py | arahal81/data-structures-and-algorithms | 0 | 12768751 | from insertion_sort.insertion_sort import insertion_Sort
import pytest
@pytest.mark.parametrize(
"input,expected_value",
[
([8, 4, 23, 42, 16, 15], [4, 8, 15, 16, 23, 42]),
([20, 18, 12, 8, 5, -2], [-2, 5, 8, 12, 18, 20]),
([5, 12, 7, 5, 5, 7], [5, 5, 5, 7, 7, 12]),
([2, 3, 5, ... | 3.171875 | 3 |
stockdata/filters.py | Borderlander103/pythoncapstone-stockdata | 0 | 12768752 | <reponame>Borderlander103/pythoncapstone-stockdata<gh_stars>0
import settings
def nameFilter(stock):
if(stock.name == settings.value):
return True
else:
return False
def industryFilter(stock):
if(stock.industry == settings.value):
return True
else:
return False
def ... | 3.015625 | 3 |
comicMaker/makeFullPdf.py | Gunjan933/comicMaker | 3 | 12768753 | <filename>comicMaker/makeFullPdf.py
import shutil,os,os.path
from PyPDF2 import PdfFileMerger
class makeFullPdf:
def mangaLike(comicBook):
print(" Merging all pdf's, please wait!")
for file in os.listdir("."):
if file.endswith(".pdf"):
os.remove(os.path.join(".", file))
pdflist=[]
for dirp... | 3.078125 | 3 |
dbinorm/pg_connection_pool.py | rabus-t48/dbinorm | 0 | 12768754 | <filename>dbinorm/pg_connection_pool.py
#coding: utf-8
import time
import logging
import base64
import psycopg2
import psycopg2.extensions
import psycopg2.sql as sql
from psycopg2.extensions import connection as _connection
from rbs_db.pg_factory import RealDictConnectionUpper
from rbs_db.db_exception import DatabaseC... | 2.640625 | 3 |
Lambda/MatchStatus.py | nkwangjun/aws-gamelift-sample | 131 | 12768755 | import boto3
from botocore.exceptions import ClientError
import json
import time
dynamodb = boto3.resource('dynamodb', region_name='us-east-1')
ddb_table = dynamodb.Table('GomokuPlayerInfo')
def lambda_handler(event, context):
print(event)
# You can also use TicketId to track Matchmaking Event.
ticke... | 1.984375 | 2 |
11_actionchainsDemo2.py | ITXIAOKE/XKSelenium | 1 | 12768756 | <reponame>ITXIAOKE/XKSelenium<filename>11_actionchainsDemo2.py<gh_stars>1-10
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
import time
driver = webdriver.Firefox()
driver.get("http://www.baidu.com")
# time.sleep(3)
# move = driver.find_element_by_xpath(".//*[@... | 2.5625 | 3 |
rpm/make-osc-upload.py | augustand/Nuitka | 0 | 12768757 | <filename>rpm/make-osc-upload.py
#!/usr/bin/env python
# Copyright 2016, <NAME>, mailto:<EMAIL>
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you m... | 1.9375 | 2 |
kafka_streamer/topic/datatype/byte.py | sam-mosleh/kafka-streamer | 1 | 12768758 | from typing import Optional
from .base import KafkaDataType
class ByteDataType(KafkaDataType):
def deserialize(self, data: bytes) -> bytes:
return data
def serialize(self, data: Optional[bytes]):
return data
| 2.609375 | 3 |
23/solution2.py | msagi/advent-of-code-2021 | 0 | 12768759 | <filename>23/solution2.py
# https://adventofcode.com/2021/day/23
import sys
from copy import deepcopy
"""
Note: Amphipods => Crabs, I can't stand writing it so many times with typos
"""
# room indexes (positions) on the hallway
ROOM_POSITION = {'A': 2, 'B': 4, 'C': 6, 'D': 8}
# the energy cost for each step for the va... | 3.875 | 4 |
transformers/executables/pe_general_features.py | ucds-sg/h2oai | 0 | 12768760 | """Extract LIEF features from PE files"""
from h2oaicore.transformer_utils import CustomTransformer
import datatable as dt
import numpy as np
class PEGeneralFeatures(CustomTransformer):
_modules_needed_by_name = ['lief==0.9.0']
_regression = True
_binary = True
_multiclass = True
_is_reproducible ... | 2.671875 | 3 |
pinterest_problems/problem_3.py | loftwah/Daily-Coding-Problem | 129 | 12768761 | """This problem was asked by Pinterest.
At a party, there is a single person who everyone knows, but who does not
know anyone in return (the "celebrity"). To help figure out who this is,
you have access to an O(1) method called knows(a, b), which returns True
if person a knows person b, else False.
Given a list of... | 3.53125 | 4 |
ubuntu/twist2int64.py | ryomakawakami/rosmotor | 1 | 12768762 | #!/usr/bin/env python
import rospy
from geometry_msgs.msg import Twist
from std_msgs.msg import Int64
class Twist2int64():
def __init__(self):
self.command_left = Int64()
self.command_right = Int64()
self.received_twist = None
rospy.init_node('Twist2int64')
rospy.Subscriber('motor/twist/cmd_vel',... | 2.53125 | 3 |
tests.py | HUSKI3/EzConfig | 1 | 12768763 | <reponame>HUSKI3/EzConfig<gh_stars>1-10
# Import EzConfig
import ezconf
# Create config object
config = ezconf.config()
# Read the config file
print("\nLoad config")
config.read("example_config.json")
# Get non-nested values
print("\nGet non-nested value\n")
print(config.get("name"))
# Get nested values
print("\nGet ne... | 2.40625 | 2 |
python/particle_predictor/serving/particle_client.py | KiranArun/tensorflow | 2 | 12768764 | <filename>python/particle_predictor/serving/particle_client.py<gh_stars>1-10
# import dependancies
from __future__ import print_function
from grpc.beta import implementations
import tensorflow as tf
import numpy as np
from tensorflow_serving.apis import predict_pb2
from tensorflow_serving.apis import prediction_service... | 2.515625 | 3 |
ScienceCruiseDataManagement/main/management/commands/importprojects.py | Swiss-Polar-Institute/science-cruise-data-management | 6 | 12768765 | from django.core.management.base import BaseCommand, CommandError
from main.models import Project, Person
import csv
# This file is part of https://github.com/cpina/science-cruise-data-management
#
# This project was programmed in a hurry without any prior Django experience,
# while circumnavigating the Antarctic on t... | 2.5 | 2 |
src/routeFinder.py | dinulade101/apartment-finder | 0 | 12768766 | <reponame>dinulade101/apartment-finder
from graph import Graph
from breadth_first_search import *
import math
import settings
from binary_heap import BinaryHeap
class RouteFinder:
"""
A class that returns the shortest path between several different locations
1) List of all LRT Stations
2) Unive... | 3.859375 | 4 |
software/temcagt/temcagt/nodes/control/statemachines/findslotsm.py | htem/GridTapeStage | 2 | 12768767 | #!/usr/bin/env python
import time
from ... import base
class FindSlotSM(base.StateMachine):
"""
verify tape untensioned
setup stats and beam
move to approximate center
find edge(s)
move to center
set center
set roi (outside?)
state = {
'center': {
'x': ...... | 2.25 | 2 |
tools/android/modularization/convenience/touch_resources.py | Ron423c/chromium | 575 | 12768768 | #!/usr/bin/env python3
# Copyright 2021 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
r"""Creates Android resources directories and boilerplate files for a module.
This is a utility script for conveniently creating resou... | 2.265625 | 2 |
sot/eval_sot.py | take-cheeze/models | 112 | 12768769 | import argparse
import numpy as np
import chainer
from siam_rpn.general.eval_sot_vot import eval_sot_vot
from siam_rpn.siam_rpn import SiamRPN
from siam_rpn.siam_rpn_tracker import SiamRPNTracker
from siam_rpn.siam_mask_tracker import SiamMaskTracker
from siam_rpn.general.vot_tracking_dataset import VOTTrackingDatase... | 1.960938 | 2 |
rejected_article_tracker/tests/ML/test_ArXivArticleItem.py | sagepublishing/rejected_article_tracker_pkg | 10 | 12768770 | <filename>rejected_article_tracker/tests/ML/test_ArXivArticleItem.py
import unittest
import pandas as pd
from rejected_article_tracker.src.ML.ArXivArticleItem import ArXivArticleItem
class TestArXivArticleItem(unittest.TestCase):
def test_object_creation_with_required_fields(self):
items = {
... | 2.796875 | 3 |
Section2/reader.py | Zealll/Algo-and-Quant-Trading | 0 | 12768771 | <reponame>Zealll/Algo-and-Quant-Trading
import pandas_datareader.data as pdr
import datetime as dt
ticker = 'AMZN'
start_date = dt.date.today() - dt.timedelta(365)
end_date = dt.date.today()
data = pdr.get_data_yahoo(ticker, start_date, end_date, interval='m')
print(data) | 2.9375 | 3 |
peripy/__init__.py | jd-bartlett96/PeriPy | 17 | 12768772 | <gh_stars>10-100
"""
PeriPy.
A module for defining and simulating peridynamic systems.
"""
from .model import Model
__all__ = [
"Model"
]
| 1.101563 | 1 |
Src/plot.py | sanjeevmk/GLASS | 2 | 12768773 | <filename>Src/plot.py
import torch
torch.manual_seed(10)
torch.cuda.manual_seed_all(10)
import header
import init
import sys
import train
import randomSample
import latentSpaceExplore_VanillaHMC,latentSpaceExplore_NUTSHmc,latentSpaceExplore_PerturbOptimize
from train import trainVAE
import csv
import matplotlib.pyplo... | 1.875 | 2 |
sydent/http/servlets/bulklookupservlet.py | jp-modernisation-gouv-fr/sydent | 0 | 12768774 | # -*- coding: utf-8 -*-
# Copyright 2017 OpenMarket Ltd
#
# 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 l... | 1.703125 | 2 |
repos/classes.py | JSLucena/ShopGenerator | 0 | 12768775 | <reponame>JSLucena/ShopGenerator
class Item:
def __init__(self, name, price, rarity, typ):
self.__name = name
self.__price = price
self.__rarity = rarity
self.__typ = typ
def getName(self):
return self.__name
def setName(self, name):
self.__name = name
... | 2.625 | 3 |
mmaps/mmaps_manager.py | pamiyummy/MMAPs_Module | 0 | 12768776 | <gh_stars>0
import bpy
import math
from . import mmaps_launcher
from . import mmaps_clearer
class MMAP_PT_MMAPsManager(bpy.types.Panel):
'''
Panel class to manage MMAPs parameters
'''
bl_label = 'MMAPs'
bl_space_type = 'VIEW_3D'
bl_region_type = 'UI'
bl_category = 'MMAPs'
bl_context ... | 2.265625 | 2 |
src/ticket/migrations/0004_ticket_fare.py | KeshavSeth/RailwayReservationSystem | 0 | 12768777 | <reponame>KeshavSeth/RailwayReservationSystem<gh_stars>0
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('ticket', '0003_auto_20150504_1318'),
]
operations = [
migrations.Ad... | 1.648438 | 2 |
test/test_edit_pdf_api.py | Cloudmersive/Cloudmersive.APIClient.Python.Convert | 3 | 12768778 | <reponame>Cloudmersive/Cloudmersive.APIClient.Python.Convert
# coding: utf-8
"""
convertapi
Convert API lets you effortlessly convert file formats and types. # noqa: E501
OpenAPI spec version: v1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absol... | 2.296875 | 2 |
hobbies/models.py | ablades/sideline | 1 | 12768779 | from django.db import models
from django.utils import timezone
from django.contrib.auth.models import User
from django.urls import reverse
class Hobbies(models.Model):
title = models.CharField(max_length=100)
content = models.TextField()
img_url = models.URLField(max_length=1000, default="https://www.okea.... | 2.28125 | 2 |
tests/integration_tests/test_resources/general_value.py | JobtechSwe/elastic-importers | 2 | 12768780 | general_value_test_cases = [( {'type': 'driving-licence', 'id': '4HpY_e2U_TUH', 'preferred_label': 'AM', 'deprecated_legacy_id': '16'},
'driving-license', {'legacy_ams_taxonomy_id': '16', 'type': 'driving-license', 'label': 'AM', 'concept_id': '4HpY_e2U_TUH', 'legacy_ams_taxonomy_num_id': 16}),
( {'type': 'driving-li... | 1.242188 | 1 |
mavlink_comm.py | RichardAntalik/mavlink-antena-tracker | 0 | 12768781 | <filename>mavlink_comm.py
#
# Comm stuff
# This assumes arduino driving motors, servos, steam engines, pistons or whatever.
#
import serial
import struct
import serial.tools.list_ports
ports = serial.tools.list_ports.comports()
for port, desc, hwid in sorted(ports):
print("{}: {} [{}]".format(port, des... | 2.546875 | 3 |
messenger_channels/signals/user_signals.py | ThePokerFaCcCe/messenger | 0 | 12768782 | from django.dispatch import receiver
from django.contrib.auth import get_user_model
from messenger_channels.querysets import get_pvchat_ids_cached
from user.signals import user_online
from user.serializers import UserLastSeenSerializer
from messenger_channels.utils import send_event
User = get_user_model()
@receive... | 1.984375 | 2 |
main_app/migrations/0004_profile_about_me.py | vidhishah03/Rescue | 0 | 12768783 | # Generated by Django 3.1.1 on 2021-03-24 16:44
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main_app', '0003_auto_20210324_2124'),
]
operations = [
migrations.AddField(
model_name='profile',
name='about_me',
... | 1.71875 | 2 |
ship.py | bfirner/armada-player-demo | 0 | 12768784 | #
# Copyright <NAME>, 2019-2020
#
# Ship class and supporting classes
from collections import OrderedDict
from enum import Enum
import torch
from dice import ArmadaDice
from game_constants import (
ArmadaDimensions,
ArmadaTypes
)
class UpgradeType(Enum):
commander = 1
officer ... | 2.828125 | 3 |
web-scrapping/indeed-site/webscrapper.py | AsciencioAlex/super-waddle-webscrapping | 0 | 12768785 | <gh_stars>0
import requests
from bs4 import BeautifulSoup
url = "https://www.indeed.com/"
r = requests.get(url)
soup = BeautifulSoup(r.content)
links = soup.find_all("a")
for link in links:
print "<a href='%s'>%s</a>" %(link.get("href"), link.text)
g_data = soup.find_all("div", {"class": "icon-container"})
for... | 3.328125 | 3 |
EthicsWorld/Apps/poll/migrations/0001_initial.py | DylanTheVillain/Ethics-World | 0 | 12768786 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Answer',
fields=[
('id', models.AutoField(prima... | 1.820313 | 2 |
hw.py | CRImier/WiFiNugget | 14 | 12768787 | from machine import Pin, I2C
from neopixel import NeoPixel
from time import sleep, ticks_ms, ticks_diff
import framebuf
import gc
import sh1106
# Wemos pins - for our and our users' convenience
D0 = const(16)
D1 = const(5)
D2 = const(4)
D3 = const(0)
D4 = const(2)
D5 = const(14)
D6 = const(12)
D7 = const(13)
D8 = con... | 2.765625 | 3 |
bot/core/bot.py | Rohith04MVK/Neutron-Bot | 2 | 12768788 | <reponame>Rohith04MVK/Neutron-Bot
import time
from datetime import datetime
import aiohttp
from discord.ext.commands import AutoShardedBot as Base_Bot
from loguru import logger
from bot import config
from bot.database import Database
class Bot(Base_Bot):
"""Subclassed Neutron bot."""
def __init__(self, ext... | 2.21875 | 2 |
thingpark/parsers/aqburk.py | asalminen/DjangoHttpBroker-Thingpark | 0 | 12768789 | <filename>thingpark/parsers/aqburk.py
def hex2int(hex_str):
"""
Convert hex characters (e.g. "23" or "011a") to int (35 or 282)
:param hex_str: hex character string
:return: int integer
"""
return int(hex_str, 16)
def hex2value10(hex_str):
"""
Convert 2 hex characters (e.g. "23") to fl... | 2.84375 | 3 |
olc_webportalv2/data/urls.py | OLC-Bioinformatics/olc_genomics_portal | 3 | 12768790 | from olc_webportalv2.data import views
from django.conf.urls import url, include
from django.utils.translation import gettext_lazy as _
urlpatterns = [
url(_(r'^data_home/'), views.data_home, name='data_home'),
url(_(r'^raw_data/'), views.raw_data, name='raw_data'),
url(_(r'^assembled_data/'), views.assemb... | 1.773438 | 2 |
api/resources_portal/models/material_request.py | arielsvn/resources-portal | 0 | 12768791 | <reponame>arielsvn/resources-portal<filename>api/resources_portal/models/material_request.py
from django.db import models
from resources_portal.models.material import Material
from resources_portal.models.user import User
class MaterialRequest(models.Model):
class Meta:
db_table = "material_requests"
... | 2.140625 | 2 |
practice/Greeter.py | VincentExM/snakecharmer | 0 | 12768792 | <reponame>VincentExM/snakecharmer
import datetime
import sys
from math import pi
print()
print("hello world")
print(5 * 6)
x = 20
print(x)
first_bool = True
print(first_bool)
first_word = "hehe"
print(first_word)
print("Twinkle, twinkle, little star, \n\tHow I wonder what you are! \n\t\tUp above the world so hig... | 3.765625 | 4 |
certbot-compatibility-test/certbot_compatibility_test/configurators/common.py | luisriverag/certbot | 1 | 12768793 | <gh_stars>1-10
"""Provides a common base for configurator proxies"""
from abc import abstractmethod
import logging
import os
import shutil
import tempfile
from certbot._internal import constants
from certbot_compatibility_test import interfaces
from certbot_compatibility_test import errors
from certbot_compatibility_t... | 2.265625 | 2 |
schematic/utils/cli_utils.py | linglp/schematic | 8 | 12768794 | #!/usr/bin/env python3
import inspect
import logging
from typing import Any, Mapping, Sequence, Union
from functools import reduce
from schematic import CONFIG
from schematic.exceptions import (
MissingConfigValueError,
MissingConfigAndArgumentValueError,
)
logger = logging.getLogger(__name__)
def query_d... | 2.84375 | 3 |
gallry/models.py | Evan-cell/gallery | 0 | 12768795 |
import datetime as dt
from django.db import models
from cloudinary.models import CloudinaryField
class photos(models.Model):
# title field
title = models.CharField(max_length=100)
#image field
image = CloudinaryField('image')
| 2.03125 | 2 |
mztab_m_swagger_client/models/column_parameter_mapping.py | lifs-tools/pymzTab-m | 4 | 12768796 | # coding: utf-8
"""
mzTab-M reference implementation and validation API.
This is the mzTab-M reference implementation and validation API service. # noqa: E501
OpenAPI spec version: 2.0.0
Contact: <EMAIL>
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import ... | 1.710938 | 2 |
score_reporter_handler_test.py | martincochran/score-minion | 0 | 12768797 | <gh_stars>0
#!/usr/bin/env python
#
# Copyright 2015 <NAME>
#
# 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 applicabl... | 1.96875 | 2 |
aspyrobot/__init__.py | AustralianSynchrotron/pyrobot | 4 | 12768798 | <reponame>AustralianSynchrotron/pyrobot<gh_stars>1-10
from .robot import Robot
from .server import RobotServer
from .client import RobotClient
__version__ = '0.17.0'
__all__ = [Robot, RobotServer, RobotClient]
| 1.125 | 1 |
bsc/config/configuration.py | simao-ferreira/bscscan-wrapper | 0 | 12768799 | from bsc.config.helper import get_key_from_file
ADDRESS = get_key_from_file('address.json')
API_KEY = get_key_from_file('api_key.json')
| 1.617188 | 2 |
Scanning/arpspoofer.py | FalseG0d/BasicHacking | 0 | 12768800 | <gh_stars>0
#!/usr/bin/python
import scapy.all as scapy
def get_target_mac(ip):
arp_request=scapy.ARP(pdst=ip)
broadcast=scapy.Ether(dst="ff:ff:ff:ff:ff:ff")
finalpacket=broadcast/arp_request
answer=scapy.srp(finalpacket,timeout=2,verbose=False)[0]
mac=answer[0][1].hwsrc
return mac
def spoof_arp(target_ip,spo... | 2.921875 | 3 |
src/dfa_create.py | llxzy/automata | 0 | 12768801 | import json
from src.dfa import DFA
from src.state import State
def get_state_by_label(label, states):
for state in states:
if state.label == label:
return state
def from_json(filename):
d = DFA()
d.states = set()
d.initial_state = None
with open(filename, 'r') as r_file:
... | 3.078125 | 3 |
Python/coinflip.py | akashrchandran/Projects | 30 | 12768802 | import random
def coinToss():
number = input("Number of times to flip coin: ")
recordList = []
heads = 0
tails = 0
for amount in range(number):
flip = random.randint(0, 1)
if (flip == 0):
print("Heads")
recordList.append("Heads")
else:
... | 4.03125 | 4 |
web-gui/AP/urls.py | twoexponents/opensource | 7 | 12768803 | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.AP_list, name='AP_list'),
]
| 1.476563 | 1 |
python/level1_single_api/9_amct/amct_caffe/mobilenetV2/src/auto_calibration_mobilenet_v2_sample.py | Ascend/samples | 25 | 12768804 | #!/usr/bin/python3
# -*- coding: UTF-8 -*-
"""
Copyright (C) 2019. Huawei Technologies Co., Ltd. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the Apache License Version 2.0.You may not use
this file except in compliance with the License.
This program ... | 2.09375 | 2 |
extract_location_from_exif.py | ivangayton/GDAL_scripts | 3 | 12768805 | <gh_stars>1-10
#! /usr/bin/python3
"""
Extracts the GPS locations from EXIF data from a directory full of
Sensefly Ebee camera images. Not sure if it works with other cameras as it's
currently only set up for the specific numerical format of the EXIF data
the Ebee camera creates (degrees, minutes, and seconds as a Rat... | 2.640625 | 3 |
python/html5lib/filters/inject_meta_charset.py | gsnedders/html5lib | 10 | 12768806 | from __future__ import absolute_import
from . import _base
class Filter(_base.Filter):
def __init__(self, source, encoding):
_base.Filter.__init__(self, source)
self.encoding = encoding
__init__.func_annotations = {}
def __iter__(self):
state = u"pre_head"
meta_found = (sel... | 2.234375 | 2 |
sources/dtos/symbols_dtos.py | pablintino/Altium-DBlib-source | 1 | 12768807 | <filename>sources/dtos/symbols_dtos.py
#
# MIT License
#
# Copyright (c) 2020 <NAME>, @pablintino
#
# 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 l... | 1.789063 | 2 |
integer_gtype.py | didrikjonassen/ea | 0 | 12768808 | import random
class integer_genotype(object):
gene = None
max_int = 1
def __init__(this, max_int=1, gene=None):
this.max_int = max_int
this.gene = gene
def generate_random(this, length):
this.gene = [random.randint(0, this.max_int) for i in xrange(length)]
def generate_distinct(this):
this.gene = ra... | 3.375 | 3 |
cpp/nativelib/test_echo.py | uwydoc/the-practices | 0 | 12768809 | <filename>cpp/nativelib/test_echo.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
from __future__ import print_function, division
import time
from testhelpers import ffi, lib
def test_echo():
print("nativelib echo:", lib.ne_get_version())
e = lib.ne_echo_new(b"hello world")
print("msg:", lib.ne_echo_get... | 2.109375 | 2 |
CacheSimulator.py | mbaharan/PyCacheSimulator | 0 | 12768810 | #!/usr/bin/python3.5
'''
MIT License
Copyright (c) 2018 <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, ... | 2.609375 | 3 |
draugr/generators/zipping_generator.py | cnHeider/draugr | 3 | 12768811 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from copy import deepcopy
from typing import Any, Generator, Iterable, Iterator
__author__ = "<NAME>"
__doc__ = r"""
Created on 28/10/2019
"""
__all__ = ["unzip", "unzipper"]
def unzip(iterable: Iterable) -> Iterable:
""" """
return zip(*... | 3.3125 | 3 |
appGUI/preferences/excellon/ExcellonGenPrefGroupUI.py | DannyPol/flatcam | 1 | 12768812 | <gh_stars>1-10
import platform
from PyQt5 import QtWidgets, QtCore
from PyQt5.QtCore import QSettings
from appGUI.GUIElements import FCCheckBox, FCSpinner, RadioSet, FCSliderWithSpinner, FCColorEntry
from appGUI.preferences.OptionsGroupUI import OptionsGroupUI
import gettext
import appTranslation as fcTranslate
impor... | 2.125 | 2 |
tests/task/test_graph_task.py | nathanawmk/fidesops | 0 | 12768813 | import dask
from fidesops.graph.config import (
CollectionAddress,
)
from fidesops.graph.traversal import Traversal
from fidesops.models.connectionconfig import ConnectionConfig, ConnectionType
from fidesops.models.policy import Policy
from fidesops.task.graph_task import collect_queries, TaskResources, EMPTY_REQU... | 2.234375 | 2 |
emailuser/forms.py | simlist/djangorestframework_useremail | 0 | 12768814 | from django.contrib.auth.forms import UserCreationForm, UserChangeForm
from .models import EmailUser
class EmailUserCreationForm(UserCreationForm):
class Meta(UserCreationForm):
model = EmailUser
fields = ('email', 'name')
class EmailUserChangeForm(UserChangeForm):
class Meta:
model... | 2.296875 | 2 |
stackdio/api/cloud/migrations/0001_0_8_initial.py | hdmillerdr/stackdio | 9 | 12768815 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import django.core.files.storage
import django.utils.timezone
import django_extensions.db.fields
from django.conf import settings
from django.db import migrations, models
import stackdio.core.fields
def get_config_file_path(instance, filename):
ret... | 1.75 | 2 |
ticket/migrations/0014_ticket_team_name.py | skp-github/pydbug | 1 | 12768816 | # Generated by Django 2.0.1 on 2019-06-10 15:07
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('ticket', '0013_auto_20190603_0738'),
]
operations = [
migrations.AddField(
model_name='ticket',... | 1.53125 | 2 |
pywim/estimation/speed/speed_by_peak.py | xmnfw/pywim | 4 | 12768817 | from pywim.utils.stats import iqr
import numpy as np
import pandas as pd
import peakutils
def sensors_estimation(
signal_data: pd.DataFrame, sensors_delta_distance: list
) -> [np.array]:
"""
:param signal_data:
:param sensors_delta_distance:
:return:
"""
# x axis: time
x = signal_dat... | 2.859375 | 3 |
setup.py | Oxygem/MiniWiki | 4 | 12768818 | from setuptools import find_packages, setup
INSTALL_REQUIRES = [
'cheroot==8.3.0',
'flask==1.1.2',
'flask-sqlalchemy==2.4.3',
'sqlalchemy==1.3.7',
'bcrypt==3.1.7',
'hashids==1.2.0',
'click==7.1.2',
'markdown==2.6.9',
'mdx-linkify==1.0',
]
DEV_REQUIRES = [
'wheel',
'twi... | 1.335938 | 1 |
public/cantusdata/views/manuscript_glyph_set.py | DDMAL/cantus | 12 | 12768819 | from rest_framework.response import Response
from rest_framework.views import APIView
from rest_framework.renderers import JSONRenderer
from cantusdata.models import Manuscript
from cantusdata.serializers.search import SearchSerializer
from cantusdata.helpers.solrsearch import SolrSearchQueryless
class ManuscriptGlyp... | 2.09375 | 2 |
src/generate.py | itshui3/BE-Server | 0 | 12768820 | <reponame>itshui3/BE-Server<filename>src/generate.py
from . import db, create_app
from .models import Item, Room, Merchant, Npc
app = create_app()
app.app_context().push()
from .items_generator import items
def commit_items(items):
with app.app_context():
delete_rows = db.session.query(Item).delete()
... | 2.625 | 3 |
flaskquotes/afi.py | Jeff-Moorhead/flaskquotes | 1 | 12768821 | import requests
import json
import os
import logging
from random import randint
from bs4 import BeautifulSoup
class AFITop100:
def __init__(self, quotes):
self.quotes = quotes
def get_random_quote(self):
firstquote_index = min(self.quotes.keys())
lastquote_index = max(self.quotes.key... | 2.703125 | 3 |
PWN/2019StarCTF/blindPWN/exp.py | Cossack9989/SEC_LEARNING | 13 | 12768822 | from pwn import *
from binascii import hexlify as hl
tmain_addr = 0x4006ce
start_addr = 0x400570
'''
def get_stop_addr(length):
addr = 0x401000
while 1:
try:
sh = remote('172.16.31.10', 10000)
sh.recvuntil('!\n')
print hex(addr)
payload = 'a' * length + p64(add... | 2.21875 | 2 |
coinbase_pro/api_authenticated.py | fakecoinbase/TerrellVslashpython-coinbasepro-api | 0 | 12768823 | <reponame>fakecoinbase/TerrellVslashpython-coinbasepro-api
import time
import json
import numpy as np
import pandas as pd
from coinbase_pro.auth import Auth
from coinbase_pro.api_public import CBProPublic
from coinbase_pro.api import API
pd.set_option('max_rows', 100)
pd.set_option('max_columns', 15)
pd.set_option... | 2.40625 | 2 |
auctions/emails.py | MaxGosselin/alpha-auctions | 1 | 12768824 | <reponame>MaxGosselin/alpha-auctions
from django.core.mail import send_mail
from homepage.models import User
import decimal
AUCTION_POSTED="""
\n
Your auction has been accepted.
\n
Thank you for using Alpha Auctions and good luck!
\n
You can view the status of your auction at http://alpha-auctions.herokuapp.com/acc... | 2.21875 | 2 |
source_optics/migrations/0022_auto_20190831_2043.py | heemayl/source_optics | 1 | 12768825 | <reponame>heemayl/source_optics
# Generated by Django 2.2.2 on 2019-08-31 20:43
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('source_optics', '0021_auto_20190831_2005'),
]
operations = [
migrations.Add... | 1.46875 | 1 |
clubbi_utils/json_logging.py | dev-clubbi/clubbi_utils | 0 | 12768826 | from typing import Any
from .logging import logger, LogLevelEnum
from clubbi_utils import json
from typing import Callable
import logging
class JsonLogger:
def __init__(self, logger:logging.Logger):
self.logger = logger
setattr(self, "fatal", self._log(LogLevelEnum.fatal))
setattr(self, "e... | 2.53125 | 3 |
descriptor/exercises/bulkfood/5/solution/bulkfood.py | ambleacme/decorators-descriptors | 78 | 12768827 | class Quantity(object):
def __get__(self, instance, owner):
return getattr(instance, self.target_name)
def __set__(self, instance, value):
if not hasattr(self, 'target_name'):
self.set_target_names(instance)
if value > 0:
setattr(instance, self.target_name, valu... | 3.375 | 3 |
Problem/PeopleFund/itertools_permutations().py | yeojin-dev/coding-test | 2 | 12768828 | <reponame>yeojin-dev/coding-test<gh_stars>1-10
from itertools import permutations
string, number = input().split()
print('\n'.join([''.join(i) for i in permutations(sorted(string), int(number))]))
| 3.09375 | 3 |
generate.py | lizij/Leetcode | 1 | 12768829 | <filename>generate.py
#!coding=utf-8
import codecs, sys, os, traceback, re
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support.expected_conditions import element_to_be_clickable, visibil... | 2.71875 | 3 |
vae_ld/models/vaes.py | bonheml/VAE_learning_dynamics | 3 | 12768830 | <gh_stars>1-10
import tensorflow as tf
from tensorflow import math as tfm
from vae_ld.models import logger
from vae_ld.models.vae_utils import compute_gaussian_kl, compute_batch_tc, compute_covariance, shuffle_z
class VAE(tf.keras.Model):
""" Vanilla VAE model based on Locatello et al. [1] implementation (https:... | 2.390625 | 2 |
projects/DA-project-3/problem-4.py | metanitesh/Data-Structure-Algorithm-Python | 0 | 12768831 | <gh_stars>0
def sort_012(inputList):
next0 = 0
next2 = len(inputList) - 1
frontIndex = 0
while frontIndex <= next2:
if inputList[frontIndex] is 0:
inputList[frontIndex] = inputList[next0]
inputList[next0] = 0
next0 += 1
frontIndex += 1
elif inputList[frontInd... | 3.296875 | 3 |
lesson9_working_with_data.py | panos1998/Thesis_preparation | 0 | 12768832 | from typing import List, Dict, Tuple
from collections import Counter
import random
import lesson3
from lesson5 import inverse_normal_cdf
import math
import matplotlib.pyplot as plt
from lesson4 import correlation, standard_deviation
from lesson3 import Matrix, Vector, make_matrix, vector_mean, subtract, magnitude, sca... | 3.6875 | 4 |
tree_dsa_one/1_tree_traversal.py | amanalok/python-dsa | 0 | 12768833 | <reponame>amanalok/python-dsa<gh_stars>0
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
def __repr__(self):
if type(self.data) != 'str':
return str(self.data)
return self.data
def inorder(root, is_last_node=False)... | 3.40625 | 3 |
contentcuration/contentcuration/management/commands/garbage_collect.py | Tlazypanda/studio | 1 | 12768834 | <reponame>Tlazypanda/studio
"""A management command that deletes the following from the database:
- ContentNodes older than 2 weeks, whose parents are in the designated "garbage
tree" (i.e. `settings.ORPHANAGE_ROOT_ID`). Also delete the associated Files in the
database and in object storage.
"""
from django.core.manag... | 2.015625 | 2 |
setup.py | dendisuhubdy/deep_complex_networks | 641 | 12768835 | <reponame>dendisuhubdy/deep_complex_networks
#!/usr/bin/env python
from setuptools import setup, find_packages
with open('README.md') as f:
DESCRIPTION = f.read()
setup(
name='DeepComplexNetworks',
version='1',
license='MIT',
long_description=DESCRIPTION,
packages=find_packages() + find_packa... | 1.296875 | 1 |
alipay/aop/api/domain/AlipayPcreditHuabeiAuthAgreementQueryModel.py | articuly/alipay-sdk-python-all | 0 | 12768836 | <reponame>articuly/alipay-sdk-python-all<gh_stars>0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.constant.ParamConstants import *
class AlipayPcreditHuabeiAuthAgreementQueryModel(object):
def __init__(self):
self._agreement_no = None
self._alipay_us... | 1.984375 | 2 |
third_party/lowtran-2.4.1/lowtran/__init__.py | bgorr/instrupy | 1 | 12768837 | <filename>third_party/lowtran-2.4.1/lowtran/__init__.py
"""
<NAME>, Ph.D.
Python wrapper of the venerable LOWTRAN7 atmospheric absorption and solar transmission
model circa 1992.
Note: specified Lowtran7 model limitations include
wlcminvstep >= 20 cm^-1
0 <= wlcminv <= 50000
historical note:
developed on CDC CYBER, c... | 1.359375 | 1 |
buildAll.py | Rizwan-Hasan/pyside2-default-project | 1 | 12768838 | # -*- coding: utf-8 -*-
import os
import subprocess
import sys
import platform
from ruamel.yaml import YAML
from ruamel.yaml.compat import StringIO
class MyYAML(YAML):
def dump(self, data, stream=None, **kw):
inefficient = False
if stream is None:
inefficient = True
stre... | 2.40625 | 2 |
src/main.py | alexvanacker/notilichess | 0 | 12768839 | import li
import json
# testing util
if __name__ == "__main__":
# execute only if run as a script
users=["Le_Scratch","justmaker","kazeriahm","Khrok","fauzi061089", "Vladismen", "kapuso", "Vadum-tv", "El-Nino9", "mathemagician18", "jongy", "shtrubi", "Teju12345", "papasi", "dalmatinac101"]
for line in li... | 2 | 2 |
tests/unit/api_test.py | fossabot/tilde-1 | 22 | 12768840 |
import os, sys
import unittest
from tilde.core.api import API
from tilde.core.settings import BASE_DIR, EXAMPLE_DIR
class Test_API(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.sample = API()
def test_count_classifiers(self):
available_classifiers = []
path = os.path... | 2.5 | 2 |
credentials.py | Ianwanarua/Password-locker | 1 | 12768841 | <reponame>Ianwanarua/Password-locker
class Credentials:
"""
Class that generates new instances of credentials.
"""
credentials_list = []
def __init__(self,account_name, username, password):
"""
__init__method to help us create new instances of the class credentials
"""
... | 4.0625 | 4 |
code/yss_analyze.py | andrewilyas/covid-household-transmission | 1 | 12768842 | <filename>code/yss_analyze.py
# Copyright 2020 <NAME>
# Source: https://github.com/syadlowsky/growth-rate-estimation
# 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, incl... | 1.554688 | 2 |
baekjoon/10039.py | jiyeoun/PS | 0 | 12768843 | sum=0
for i in range(5):
a=int(input())
if a<40:
a=40
sum+=a
print(sum//5) | 3.609375 | 4 |
ncdc/gentfw.py | akrherz/radcomp | 3 | 12768844 | <gh_stars>1-10
import mx.DateTime, sys, pg, random
v = sys.argv[1]
ts = mx.DateTime.strptime(v, "%Y%m%d%H%M")
out = open("n0r%s.tfw" % (v,), "w")
out.write(
""" 0.0100000000000%s
0.00000
0.00000
-0.010000000000000%s
-126.000000
50.0000"""
% (v, random.randint(0, 1000))
)
out.close()
sys.exit(0... | 1.929688 | 2 |
core/label.py | Seagate/SystemsRedfishPy | 0 | 12768845 | #
# Do NOT modify or remove this copyright and license
#
# Copyright (c) 2019 Seagate Technology LLC and/or its Affiliates, All Rights Reserved
#
# This software is subject to the terms of the MIT License. If a copy of the license was
# not distributed with this file, you can obtain one at https://opensource.org/licens... | 1.679688 | 2 |
main.py | JMathiszig-Lee/nhsAPIs | 1 | 12768846 | <gh_stars>1-10
import os
import ast
from fastapi import FastAPI, Request
from fastapi.params import Depends
from fastapi.security import APIKeyCookie
from starlette.responses import Response, RedirectResponse
from requests_oauthlib import OAuth2Session
import parse_scr
app = FastAPI()
BASE_URL = "https://sandbox.api.... | 2.609375 | 3 |
constants.py | Di-Ny/LoRaPacketForwarderDomoticzConfigurator | 0 | 12768847 | <reponame>Di-Ny/LoRaPacketForwarderDomoticzConfigurator
# Some constants to work for https://github.com/Di-Ny/LoRaPacketForwarderDomoticzConfigurator
#
# Author: DiNy
###########
## Global
GW_UNIT_ID=10
###########
## LORA
DR_2_SFBW_EU868 = {
"0":["12","125.0","5"],
"1":["11","125.0","5"],
"2":["10","125.0","5"],
... | 1.46875 | 1 |
services/image-rec-master/service/__init__.py | uavaustin/orchestra | 1 | 12768848 | """Records new images for workers and uploads targets."""
import aiohttp
import aioredis
from .app import create_app
class Service:
def __init__(self, port, imagery_host, imagery_port, interop_host,
interop_port, redis_host, redis_port, max_auto_targets):
"""Create a new image-rec-maste... | 2.734375 | 3 |
flask_application/script.py | dbdeadbeat/refurence | 4 | 12768849 | import json, os
from flask import current_app, url_for
from flask.ext.script import Command
from flask.ext.security.confirmable import confirm_user
from flask_application.models import FlaskDocument
from flask_application.profiles.models import Profile, ImageTable
from flask_application.guides.models import Guide, S... | 2.421875 | 2 |
tests/test_trans_ro.py | cristianbuse/PyTransDatRO | 2 | 12768850 | <filename>tests/test_trans_ro.py
import pytest
import math
import pytransdatro
@pytest.fixture
def st70_pnts():
"""Dictionary of points with Stereo70 coordinates for testing.
These coordinates were extracted from the
"Help_TransDatRO_code_source_EN.pdf" document found in
"TransDatRO_code_source_1.03... | 2.46875 | 2 |