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 |
|---|---|---|---|---|---|---|
qt-creator-opensource-src-4.6.1/tests/system/shared/suites_qtta.py | kevinlq/Qt-Creator-Opensource-Study | 5 | 44600 | ############################################################################
#
# Copyright (C) 2016 The Qt Company Ltd.
# Contact: https://www.qt.io/licensing/
#
# This file is part of Qt Creator.
#
# Commercial License Usage
# Licensees holding valid commercial Qt licenses may use this file in
# accordance with the co... | 1.507813 | 2 |
import_3dm/converters/curve.py | jesterKing/import_3dm | 167 | 44601 | # MIT License
# Copyright (c) 2018-2019 <NAME>, <NAME>, <NAME>, <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... | 1.859375 | 2 |
subtitle-audio-transfer/audio-transfer.py | iwalton3/media-scripts | 31 | 44602 | #!/usr/bin/env python3
import sys
import subprocess
from align_videos_by_soundtrack.align import SyncDetector, cli_common
remove = []
remove_specified = False
remove_all = False
add = []
add_specified = False
copy_subtitles = False
files = []
print_offset_only = False
for argument in sys.argv[1:]:
if argument == ... | 2.53125 | 3 |
nailgun-client/py/__init__.py | h4l/nailgun | 362 | 44603 | <filename>nailgun-client/py/__init__.py<gh_stars>100-1000
# Copyright 2004-2015, <NAME>, Inc.
# Copyright 2017-Present Facebook, Inc.
from ng import NailgunConnection, NailgunException
| 1.367188 | 1 |
WaveNetClassifier.py | Yeok-c/audio_data_augment | 0 | 44604 | import numpy as np
import pandas as pd
import sys
import tensorflow as tf
from keras.layers import Input, Dense, Lambda, Flatten, Reshape, Activation, Dropout, Add, TimeDistributed, Multiply, Conv1D, Conv2D, MaxPooling1D, AveragePooling1D
from keras.models import Model, Sequential, load_model
from keras import backend ... | 2.703125 | 3 |
tagify_project/music/migrations/old/0001_initial.py | Krayonn/tagify | 0 | 44605 | # Generated by Django 3.1.6 on 2021-03-08 10:44
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Album',
fields=[
('id', models.AutoField(au... | 1.921875 | 2 |
tf_saving_restore/restore.py | simonfong6/micro-projects | 0 | 44606 | <reponame>simonfong6/micro-projects
# restore.py
import tensorflow as tf
tf.reset_default_graph()
# Create some variables.
v1 = tf.get_variable("v1", [3], initializer = tf.zeros_initializer)
v2 = tf.get_variable("v2", [5], initializer = tf.zeros_initializer)
# Add ops to save and restore only `v2` using the name "v2... | 2.734375 | 3 |
pysite/views/staff/jams/forms/questions_edit.py | gatarelib/site | 0 | 44607 | <gh_stars>0
import json
from flask import redirect, request, url_for
from werkzeug.exceptions import BadRequest, NotFound
from pysite.base_route import RouteView
from pysite.constants import ALL_STAFF_ROLES
from pysite.decorators import csrf, require_roles
from pysite.mixins import DBMixin
REQUIRED_KEYS = ["title", ... | 2.25 | 2 |
intrepyd/colors.py | bobosoft/intrepyd | 2 | 44608 | <reponame>bobosoft/intrepyd
"""
Copyright (C) 2017 <NAME> <<EMAIL>>
This file is distributed under the terms of the 3-clause BSD License.
A copy of the license can be found in the root directory or at
https://opensource.org/licenses/BSD-3-Clause.
Author: <NAME> <<EMAIL>>
Date: 27/03/2017
This module implements som... | 2.296875 | 2 |
instagram_api/response/model/direct_expiring_summary.py | Yuego/instagram_api | 13 | 44609 | <gh_stars>10-100
from ..mapper import PropertyMapper, ApiInterfaceBase
from ..mapper.types import Timestamp, AnyType
__all__ = ['DirectExpiringSummary', 'DirectExpiringSummaryInterface']
class DirectExpiringSummaryInterface(ApiInterfaceBase):
type: str
timestamp: Timestamp
count: int
class DirectExpir... | 1.929688 | 2 |
unmasked/m3/read_serial.py | saber-collection/saber-collection | 3 | 44610 | #!/usr/bin/env python3
import platform
import serial
import sys
from config import Settings
dev = serial.Serial(Settings.SERIAL_DEVICE, Settings.BAUD_RATE)
print("> Returned data:", file=sys.stderr)
while True:
x = dev.read()
sys.stdout.buffer.write(x)
sys.stdout.flush()
| 2.625 | 3 |
python/haystack.py | ssorj/haystack | 0 | 44611 | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 1.867188 | 2 |
src/train_and_save.py | shifty21/neural-numpy | 0 | 44612 | <filename>src/train_and_save.py
#!/usr/bin/env python3
import argparse
import numpy as np
np.random.seed(1337)
from keras.layers.convolutional import Convolution2D, MaxPooling2D
from keras.layers.core import Dense, Flatten
from keras.models import Sequential
from keras.optimizers import SGD
from logger import Logger
... | 2.609375 | 3 |
lib/lecture.py | kfkonrad/py-stundenplan | 0 | 44613 | <gh_stars>0
from typing import List, NoReturn
from lib.t import T
class Lecture: # Vorlesungen/Fächer
subject: str
room: str
schedule: List[T]
def __init__(self,
subject: str,
room: str,
*schedule: T
) -> NoReturn:
self.subje... | 3.078125 | 3 |
planner/migrations/0008_lawnproduct.py | pmontgo33/lawn-care-planner | 7 | 44614 | <reponame>pmontgo33/lawn-care-planner<gh_stars>1-10
# -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-12-06 03:59
from __future__ import unicode_literals
from django.db import migrations, models
import jsonfield.fields
class Migration(migrations.Migration):
dependencies = [
('planner', '0007_... | 1.835938 | 2 |
gdc_client/__init__.py | di2ag/gdc_client | 0 | 44615 | """ Initialization file for a GDC API client.
"""
from copy import copy
import types
from .client import BaseClient
# Aliases
COMMON_ALIASES = {
"_get_cases": 'get_cases',
"_get_mappings": 'get_mappings',
"_get_genes": 'get_genes',
"_get_ssm_occurrences": 'get_ssm_occurrences',
}
# API speci... | 2.421875 | 2 |
pyaz/search/service/__init__.py | py-az-cli/py-az-cli | 0 | 44616 | '''
Manage Azure Search services.
'''
from ... pyaz_utils import _call_az
def list(resource_group):
'''
Required Parameters:
- resource_group -- Name of resource group. You can configure the default group using `az configure --defaults group=<name>`
'''
return _call_az("az search service list... | 2.609375 | 3 |
codeforces.com/1560B/solution.py | zubtsov/competitive-programming | 0 | 44617 | <gh_stars>0
for i in range(int(input())):
a, b, c = map(int, input().split())
mi = min(a, b)
ma = max(a, b)
half_circle_people = (ma - mi)
full_circle_people = 2 * half_circle_people
if ma > half_circle_people * 2 or c > full_circle_people:
print(-1)
else:
print((c - half_c... | 2.84375 | 3 |
first_step.py | xulu199705/RT_Check | 0 | 44618 | <reponame>xulu199705/RT_Check<gh_stars>0
import get_hwnd
get_hwnd.prt_hwnd_title()
| 1.148438 | 1 |
dags/func.py | akaimo/docker_airflow | 0 | 44619 | <reponame>akaimo/docker_airflow<filename>dags/func.py
def sample_func():
print("sample func")
| 1.382813 | 1 |
care_batch/train.py | amedyukhina/care_batch | 0 | 44620 | <reponame>amedyukhina/care_batch
from __future__ import print_function, unicode_literals, absolute_import, division
import os
import matplotlib.pyplot as plt
from csbdeep.io import load_training_data
from csbdeep.models import Config, CARE
from csbdeep.utils import axes_dict, plot_history
from csbdeep.utils.tf import... | 2.1875 | 2 |
204.Count_Primes.py | wanxin-code/leetcode | 1 | 44621 | <reponame>wanxin-code/leetcode
import math
class Solution:
def countPrimes(self, n: int) -> int:
isPrime = [True]*n
for i in range(2, n):
if i*i >= n: # the upbound of isPrime
break
if not isPrime:
continue
for j in range(i*i, n,... | 3.78125 | 4 |
packages/auto-nlp-workflow-lib/src/tagflip/model/mlflow/huggingface/huggingface_sequenceclassification_savable.py | fhswf/tagflip-autonlp | 4 | 44622 | import logging
from typing import Any, Dict, List, NewType
import mlflow
import numpy as np
import pandas as pd
import torch
import transformers
from mlflow.models import ModelSignature
from mlflow.pyfunc import PythonModel
from mlflow.types import ColSpec, DataType, Schema, TensorSpec
from mlflow.utils.environment im... | 2.53125 | 3 |
src/my_py_pkg/my_py_pkg/action_client.py | devis12/ros2_ws_src | 1 | 44623 | import rclpy
from rclpy.action import ActionClient
from rclpy.node import Node
from functools import partial
from my_robot_interfaces.action import Test
class TestActionClient(Node):
def __init__(self):
super().__init__('test_action_client')
self.declare_parameter("secs", 2)
self.... | 2.453125 | 2 |
img/cards/cardify_driv.py | ETHproductions/mkt | 0 | 44624 | <reponame>ETHproductions/mkt<filename>img/cards/cardify_driv.py
import sys
from PIL import Image
from os import listdir
for rarity in "Normal", "Rare", "Ultra":
imfiles = [i for i in listdir("adj_drivers/" + rarity) if i[-4:] == ".png" and i[0] != '_']
print(imfiles)
im_base = Image.open("../frames/" + rarity... | 2.453125 | 2 |
weather_bot/generate_audio_files.py | tinalimbudev/weather-bot | 0 | 44625 | <gh_stars>0
import os
from gtts import gTTS
from pathlib import Path
def generate_audio_file_from_text(
text, file_name, file_type="mp3", language="en", slow=False
):
audio = gTTS(text=text, lang=language, slow=slow)
file_path = os.path.join(
Path().absolute(),
"media",
"common_responses",
f"{f... | 3.28125 | 3 |
app.py | sohje/__flask_psgr | 0 | 44626 | <reponame>sohje/__flask_psgr<gh_stars>0
import os
from sqlalchemy import (create_engine, MetaData,
Table, Column, Integer, Text, String, DateTime)
from flask import Flask, request, jsonify, g
from mock_session import session_info_retriever
app = Flask(__name__)
# config.DevelopmentConfig -> sqlite://testing.db
#... | 2.53125 | 3 |
08/08.py | stevenpclark/aoc2019 | 0 | 44627 | <reponame>stevenpclark/aoc2019<filename>08/08.py
import numpy as np
with open('input.txt', 'r') as f:
s = f.read().strip()
#s = '0222112222120000'
nr = 6
nc = 25
x = [int(c) for c in s]
d = np.array(x)
d = np.reshape(d, (-1, nr, nc))
nb = d.shape[0]
tups = []
for b in range(nb):
band = d[b,:,:]
unique... | 2.640625 | 3 |
tests/acceptance/test_project/ignored.py | wo0dyn/raincoat | 18 | 44628 | # Raincoat: pypi package: raincoat==0.1.4 path: raincoat/_acceptance_test.py # noqa
| 1.15625 | 1 |
configs/recognition/tpn/inference_tpn_slowonly_rpl.py | Cogito2012/DEAR | 47 | 44629 | <reponame>Cogito2012/DEAR
# model settings
model = dict(
type='Recognizer3DRPL',
backbone=dict(
type='ResNet3dSlowOnly',
depth=50,
pretrained='torchvision://resnet50',
lateral=False,
out_indices=(2, 3),
conv1_kernel=(1, 7, 7),
conv1_stride_t=1,
poo... | 1.507813 | 2 |
draw.py | Adamv27/Pygame-drawing | 0 | 44630 | import sys
import pygame
def draw_canvas(screen, colors):
screen.fill(colors[0])
pygame.draw.rect(screen, colors[5], (20, 20, 500, 500))
index = 1 # skip light grey
for row in range(2):
for column in range(4):
pygame.draw.rect(screen, colors[index], ((60 * column) + 20... | 3.203125 | 3 |
fixture/soap.py | AlekseyVR/Python_mantis | 0 | 44631 | from suds.client import Client
from suds import WebFault
from model.project import Project
class SoapHelper:
def __init__(self, app):
self.app = app
def can_login(self, username, password):
client = Client(self.app.base_url + "api/soap/mantisconnect.php?wsdl")
try:
client.... | 2.625 | 3 |
test_git01.py | KSeungBin/rapa_detect_line | 0 | 44632 | <reponame>KSeungBin/rapa_detect_line<filename>test_git01.py
import os
os.getcwd()
print('line 5')
print('line 5')
print('line 7')
print('line 5')
print('line 8')
print('line 5')
안떠요
| 1.921875 | 2 |
samples/sample.py | andy1xx8/spacy-train-tools | 0 | 44633 | <reponame>andy1xx8/spacy-train-tools<gh_stars>0
from src.spacy_train_tools.train import train_spacy_model
if __name__ == "__main__":
train_spacy_model(
config_file='./en_config.cfg',
vector_file='en_core_web_lg',
train_file='./data/train.jsonl',
dev_file='./data/dev.jsonl',
... | 1.398438 | 1 |
cpc.py | vkramskikh/cgminer-pool-chooser | 1 | 44634 | #!/usr/bin/env python
import sys
import time
import json
import yaml
import socket
import argparse
import traceback
from pycgminer import CgminerAPI
from data_providers import CoinwarzAPI, CryptsyAPI
from rating_calculator import RatingCalculator
import logging
logging.basicConfig(
level=logging.INFO,
format=... | 2.1875 | 2 |
tournaments/migrations/0010_auto_20210413_1103.py | lejbron/arkenstone | 0 | 44635 | <reponame>lejbron/arkenstone
# Generated by Django 3.1.4 on 2021-04-13 11:03
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
... | 1.59375 | 2 |
Week15/2.py | bobsingh149/LeetCode | 101 | 44636 | <filename>Week15/2.py
### DO NOT REMOVE THIS
from typing import List
class ListNode:
def __init__(self, val=0, next=None):
self.val = val
self.next = next
### DO NOT REMOVE THIS
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, val=0, next=None):
# self.val = va... | 3.890625 | 4 |
pyverse/message.py | FelixWolf/pyverse | 5 | 44637 | <filename>pyverse/message.py
#!/usr/bin/env python3
from . import llTypes
import struct
baseTypes = {
"Null": llTypes.null(),
"Fixed": llTypes.fixed(b""),
"Variable": [
None,
llTypes.variable(1, b""),
llTypes.variable(2, b"")
],
"U8": 0,
"U16": 0,
"U32": 0,
"U64"... | 2.03125 | 2 |
scripts/change_user_details.py | ONSdigital/sdc-uaa | 0 | 44638 | import pprint
import requests
import argparse
def login_admin(admin_id, admin_secret, url, verbose):
headers = {'Content-Type': 'application/x-www-form-urlencoded',
'Accept': 'application/json'}
payload = {'grant_type': 'client_credentials',
'response_type': 'token',
... | 2.796875 | 3 |
slackhandler/blockkit.py | bonartm/slackhandler | 0 | 44639 | def make_divider():
return {"type": "divider"}
def make_markdown(text):
return {"type": "mrkdwn", "text": text }
def make_section(text):
return {"type":"section", "text": make_markdown(text)}
def make_context(*args):
return {"type":"context", "elements": [*args]}
def make_blocks(*args):
return [... | 2.171875 | 2 |
build/imu_calib/catkin_generated/pkg.develspace.context.pc.py | dawnchen123/AutonomousCar | 0 | 44640 | <gh_stars>0
# generated from catkin/cmake/template/pkg.context.pc.in
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "/home/nvidia/linorobot_ws/src/imu_calib/include;/usr/local/include/eigen3".split(';') if "/home/nvidia/linorobot_ws/src/imu_calib/include;/usr/local/include/eigen3" != "" else []
PROJECT_CA... | 1.101563 | 1 |
Exe19_centena_dezena_unidade.py | lucaslk122/Exercicios_Python_estutura_decisao | 0 | 44641 | numero = int(input("Entre com um numero inteiro e menor que 1000: "))
if numero > 1000:
print("Numero invalido")
else:
unidade = numero % 10
numero = (numero - unidade) / 10
dezena = int(numero % 10)
numero = (numero - dezena) / 10
centena = int(numero)
print(f"{centena} centena(s) , {dezena... | 4.0625 | 4 |
FourFrontScripts/MachineLearning/RandomForestNames.py | FourFront-Senior-Design/pythonenv | 0 | 44642 | <reponame>FourFront-Senior-Design/pythonenv
# Random forest classifier to predict names only
from MachineLearning.RandomForestAll import RandomForestAll
class RandomForestNames(RandomForestAll):
def __init__(self):
super().__init__()
# Selects only the names from the dataframe to train the model on
... | 3.40625 | 3 |
tests/report_test.py | thepatrik/corunner | 0 | 44643 | <reponame>thepatrik/corunner<gh_stars>0
import time
from corunner.report import Execution, Report
def test_fastest():
report = _get_report()
assert report.fastest().latency == 100.0
assert report.fastest(include_errored=True).latency == 1.0
def test_slowest():
report = _get_report()
assert re... | 2.34375 | 2 |
lib/synthetic_data.py | ppmdatix/rtdl | 298 | 44644 | "Code used to generate data for experiments with synthetic data"
import math
import typing as ty
import numba
import numpy as np
import torch
import torch.nn as nn
from numba.experimental import jitclass
from tqdm.auto import tqdm
class MLP(nn.Module):
def __init__(
self,
*,
d_in: int,
... | 2.5625 | 3 |
py_codes/036enum.py | fusugz/lifeisshort | 2 | 44645 | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
from enum import Enum, unique
@unique
class Weekday(Enum):
Sun = 0
Mon = 1
Tue = 2
Web = 3
Thu = 4
Fri = 5
Sat = 6
day1 = Weekday.Mon
print('day1 =', day1)
print('Weekday.Tue =', Weekday.Tue)
print('Weekday[\'Tue\'] =', Weekday['Tue'])
print(... | 3.5625 | 4 |
scrape.py | schemedoc/temp-aggregator-in-python | 2 | 44646 | #! /usr/bin/env python3
import json
import mimetypes
import os
import re
import shutil
import string
import sys
import tarfile
import urllib.parse
import urllib.request
from collections import defaultdict, namedtuple
from http.server import BaseHTTPRequestHandler, HTTPServer
from bs4 import BeautifulSoup # pip3 in... | 2.828125 | 3 |
importer.py | CSwigg/stellarmass_pca | 0 | 44647 | import os, sys, matplotlib
import faulthandler; faulthandler.enable()
mpl_v = 'MPL-8'
daptype = 'SPX-MILESHC-MILESHC'
os.environ['STELLARMASS_PCA_RESULTSDIR'] = '/Users/admin/sas/mangawork/manga/mangapca/zachpace/CSPs_CKC14_MaNGA_20190215-1/v2_5_3/2.3.0/results'
manga_results_basedir = os.environ['STELLARMASS_PCA_RESU... | 1.78125 | 2 |
src/google-cloud-speech/python/client.py | d-iii-s/teaching-introduction-middleware | 2 | 44648 | <filename>src/google-cloud-speech/python/client.py
#!/usr/bin/env python3
import sys
from google.cloud import speech as google_cloud_speech
# Create the object representing the API to the client.
client = google_cloud_speech.SpeechClient ()
content = open (sys.argv [1], 'rb').read ()
audio = google_cloud_speech.Rec... | 3.03125 | 3 |
jupiter/use_cases/metrics/entry/create.py | horia141/jupiter | 15 | 44649 | <filename>jupiter/use_cases/metrics/entry/create.py
"""The command for creating a metric entry."""
from dataclasses import dataclass
from typing import Optional, Final
from jupiter.domain.adate import ADate
from jupiter.domain.metrics.infra.metric_notion_manager import MetricNotionManager
from jupiter.domain.metrics.m... | 2.34375 | 2 |
xor_example.py | tudelft-cda-lab/ROCT | 1 | 44650 | <gh_stars>1-10
from groot.adversary import DecisionTreeAdversary
from groot.datasets import epsilon_attacker
from groot.model import GrootTreeClassifier
from groot.treant import RobustDecisionTree
from groot.visualization import plot_adversary
from roct.maxsat import SATOptimalRobustTree
from sklearn.preprocessing im... | 2.40625 | 2 |
Statistics/Randomgen_1.py | Sakthi0722/StatsCalculator | 1 | 44651 | import random
r1 = random.randint(1, 40)
print("Generate a random number without a seed between a range of two numbers - Integer:", r1)
r2 = random.uniform(1, 40)
print("Generate a random number without a seed between a range of two numbers - Decimal:", r2)
| 3.78125 | 4 |
service_catalog/utils.py | a-belhadj/squest | 0 | 44652 | <reponame>a-belhadj/squest<gh_stars>0
def str_to_bool(s):
if isinstance(s, bool): # do not convert if already a boolean
return s
else:
if s == 'True' \
or s == 'true' \
or s == '1' \
or s == 1 \
or s == True:
return Tru... | 3.4375 | 3 |
mitreattack/navlayers/generators/usage_generator.py | wetkind/mitreattack-python | 137 | 44653 | <filename>mitreattack/navlayers/generators/usage_generator.py<gh_stars>100-1000
from stix2 import Filter
from itertools import chain
import copy
from mitreattack.navlayers.exporters.matrix_gen import MatrixGen
from mitreattack.navlayers.core.exceptions import BadInput, typeChecker
from mitreattack.navlayers.core.layer... | 2.109375 | 2 |
main.py | pierrePalud/MeudonPDR-stat-files-extraction | 0 | 44654 | <reponame>pierrePalud/MeudonPDR-stat-files-extraction
import sys
import glob
import os
import numpy as np
import pandas as pd
from tqdm.auto import tqdm
import argparse
def extract_input_parameters(path_file_in, df_input_params, dict_result={}):
"""extracts the data from the input file of the simulation
Par... | 2.953125 | 3 |
2015/day24/day24.py | naitmare01/Adventofcode | 0 | 44655 | <reponame>naitmare01/Adventofcode
#!/usr/bin/python
# -*- coding: utf-8 -*-
import argparse
from functools import reduce
from itertools import combinations
from operator import mul
def arguments():
# Handle command line arguments
parser = argparse.ArgumentParser(description='Adventofcode.')
parser.add_arg... | 3.3125 | 3 |
generate_data_2d.py | salimmj/grid-cells | 1 | 44656 | <gh_stars>1-10
import os
import tensorflow as tf
from scipy import stats
import numpy as np
import math
from sklearn import preprocessing
import concurrent.futures
import logging
import threading
from multiprocessing import Process
# Duration of simulated trajectories (seconds)
T = 15
# Width and height of environme... | 2.25 | 2 |
wowsinfo/lib/core/models/converter.py | rhwong/WoWs-Info-Future | 1 | 44657 | <gh_stars>1-10
'''
This helps to check if the object isn't null before creating any new objects
'''
import glob
import re
from os import path as p
def convert(line):
if ("Utils.guard" in line or "!= null" in line or "as" in line or "cast" in line or "map" in line or "=>" in line or "{" in line or not "=" in line):... | 3.09375 | 3 |
tests/unit/viz/test_source.py | jorisvandenbossche/cartoframes | 0 | 44658 | <reponame>jorisvandenbossche/cartoframes
import pytest
from cartoframes.viz import Source
from cartoframes.lib.context.api_context import APIContext
from cartoframes.auth import Credentials
from .utils import simple_dataframe
def setup_mocks(mocker):
mocker.patch.object(Source, 'get_geom_type', return_value='po... | 2.546875 | 3 |
scripts/version.py | kevinrue/cgat-flow | 0 | 44659 | """Version
==========
"""
__version__ = "0.4.0"
| 1.054688 | 1 |
christmasflix/urls.py | jbettenh/last_christmas | 0 | 44660 | <gh_stars>0
from django.urls import path
from . import views
app_name = 'christmasflix'
urlpatterns = [
path('', views.IndexView.as_view(), name='index'),
path('<int:pk>/', views.MovieListView.as_view(), name='movie_list'),
path('new/', views.add_list, name='add_list'),
path('delete/<int:list_id>', vi... | 1.773438 | 2 |
mssql-info-parser.py | addenial/mssqlinfo2csv | 0 | 44661 | #!/usr/bin/python
#use to parse ms-sql-info nmap xml
#https://nmap.org/nsedoc/scripts/ms-sql-info.html
#nmap -Pn -n -p135,445,1433 --script ms-sql-info <host> -oX results-ms-sql-info.xml
#nmap -Pn -n -p135,445,1433 --script ms-sql-info -iL <hosts_file> -oX results-ms-sql-info.xml
# python3 mssql-info-parser.py... | 2.671875 | 3 |
halfpipe/io/metadata/niftimetadata.py | fossabot/Halfpipe-1 | 0 | 44662 | <gh_stars>0
# -*- coding: utf-8 -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
import logging
import numpy as np
import nibabel as nib
from templateflow import api
from .niftiheader import NiftiheaderLoader
from .direction import canonicalize_d... | 1.945313 | 2 |
test_stream_zip.py | uktrade/stream-zip | 8 | 44663 | <filename>test_stream_zip.py
from datetime import datetime
from io import BytesIO
import os
import subprocess
from tempfile import TemporaryDirectory
from zipfile import ZipFile
import pytest
from stream_unzip import stream_unzip
from stream_zip import (
stream_zip,
NO_COMPRESSION_64,
NO_COMPRESSION_32,
... | 2.5625 | 3 |
Leetcoding-Actions/Explore-Monthly-Challenges/2020-09/09-Compare-Version-Numbers.py | shoaibur/SWE | 1 | 44664 | class Solution:
def compareVersion(self, version1: str, version2: str) -> int:
ver1 = version1.split('.')
ver2 = version2.split('.')
def removeLeadingZeros(s):
while len(s) > 1 and s[0] == '0':
s = s[1:]
return s
ver1... | 3.0625 | 3 |
src/hyper_prompt/themes/default.py | artbycrunk/hyper-prompt | 5 | 44665 | from ..theme import BasicTheme
class Theme(BasicTheme):
USERNAME_FG = (188, 188, 188)
USERNAME_BG = (88, 88, 88)
USERNAME_ROOT_BG = (175, 0, 0)
VIRTUAL_ENV_BG = (0, 175, 95)
VIRTUAL_ENV_FG = (0, 0, 0)
SSH_BG = (240, 121, 9)
SSH_FG = (228, 228, 228)
| 1.617188 | 2 |
uefi_firmware/guids/efiguids_asrock.py | MikeSpreitzer/uefi-firmware-parser | 492 | 44666 |
GUIDs = {
"ASROCK_ACPIS4_DXE_GUID": [69196166, 45078, 18382, 175, 197, 34, 105, 237, 212, 173, 100],
"ASROCK_USBRT_GUID": [82487969, 10657, 4567, 136, 56, 0, 80, 4, 115, 212, 235],
"ASROCK_RAID_SETUP_GUID": [152494882, 14144, 12750, 173, 98, 189, 23, 44, 236, 202, 54],
"ASROCK_RAID_LOADER_GUID": [16450... | 1.195313 | 1 |
tests/test_conns.py | wgmueller1/unicorn | 0 | 44667 | <filename>tests/test_conns.py
import sys
import os
import unittest
from mock import MagicMock, patch
import json
sys.path.append(os.path.dirname(os.path.dirname(
os.path.abspath(__file__))))
import app
from app.config import db_conn_str
import base64
import sqlalchemy
class TestConnections(unittest.TestCase):
... | 2.609375 | 3 |
Mundo3/aula18d Mais sobre matriz em python.py | OliveiraVasconcelos/Python-CursoemVideo | 0 | 44668 | <filename>Mundo3/aula18d Mais sobre matriz em python.py
lista = [[], [], []]
soma=somapar=0
for l in range(3):
for c in range(3):
if c == 2:
n = int(input(f'Digite um valor para [{l}, {c}]: '))
lista[l].append(n)
soma += n
if n % 2 == 0:
somap... | 3.640625 | 4 |
main.py | pyfection/battleship | 1 | 44669 |
from kivy.app import App
from controller.game import Game
from controller.actor import Local, AI
class GameApp(App):
def build(self):
game = Game()
game.actors = [
Local(game=game, name='player1'),
AI(game=game, name='player2'),
]
view = game.actors[0].vi... | 2.6875 | 3 |
tests/server/pong_routing.py | Drachenfels/carp-api | 0 | 44670 | from carp_api.routing import router
from . import endpoints # NOQA
# to use pong we need to disable common routes as they are using conflicting
# urls
router.enable(endpoints=[
endpoints.UberPong,
])
| 1.601563 | 2 |
tf3d/utils/projections_test.py | deepneuralmachine/google-research | 23,901 | 44671 | <reponame>deepneuralmachine/google-research
# coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses... | 1.875 | 2 |
tests/test_groups.py | bmaranville/pyfive | 52 | 44672 | <gh_stars>10-100
""" Test groups and sub-groups in pyfive. """
import os
import pyfive
DIRNAME = os.path.dirname(__file__)
GROUPS_HDF5_FILE = os.path.join(DIRNAME, 'groups.hdf5')
def test_groups():
with pyfive.File(GROUPS_HDF5_FILE) as hfile:
# groups
assert len(hfile) == 2
grp1 = hfil... | 2.71875 | 3 |
kino/draw/locomotion.py | BrancoLab/Kino | 1 | 44673 | <gh_stars>1-10
import matplotlib.pyplot as plt
from myterial import blue_grey_dark
from kino.locomotion import Locomotion
from kino.draw.gliphs import Arrows
from kino.draw import colors
def plot_locomotion_2D(locomotion: Locomotion, ax: plt.Axes):
"""
Draws a 2D trace with the locomotion trajectory of ... | 3.046875 | 3 |
docs/core/examples/stdin.py | Khymeira/twisted | 4,612 | 44674 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
An example of reading a line at a time from standard input
without blocking the reactor.
"""
from os import linesep
from twisted.internet import stdio
from twisted.protocols import basic
class Echo(basic.LineReceiver):
delimiter = lin... | 2.890625 | 3 |
floweaver/hierarchy.py | fullflu/floweaver | 342 | 44675 | import networkx as nx
class Hierarchy:
def __init__(self, tree, column):
self.tree = tree
self.column = column
def _leaves_below(self, node):
leaves = sum(([vv for vv in v if self.tree.out_degree(vv) == 0]
for k, v in nx.dfs_successors(self.tree, node).items()),
... | 3.078125 | 3 |
set_dictionary/abstractdict.py | pinmingkenan/python_structure | 0 | 44676 | # coding = utf-8
from inherit_abstract.abstractcollection import AbstractCollection
class AbstractDict(AbstractCollection):
"""
Common data and method implementations for dictionaries.
"""
def __init__(self, source_collection):
"""
Will copy items to the collection from source_collect... | 3.703125 | 4 |
tests/test_general.py | haku-kiro/flaskCRUD | 0 | 44677 | """
General unit tests
"""
class TestClass:
def test_base(self):
assert 42 == 42
| 2.125 | 2 |
readthedocs/core/history.py | shazelquist/readthedocs.org | 0 | 44678 | import logging
from functools import partial
from django import forms
from django.db import models
from django.utils.translation import ugettext_lazy as _
from simple_history.admin import SimpleHistoryAdmin
from simple_history.models import HistoricalRecords
from simple_history.utils import update_change_reason
log =... | 2.09375 | 2 |
storm_analysis/test/test_pupil_math.py | bintulab/storm-analysis | 0 | 44679 | #!/usr/bin/env python
import numpy
import storm_analysis
import storm_analysis.simulator.pupil_math as pupilMath
def test_pupil_math_1():
"""
Test GeometryC, intensity, no scaling.
"""
geo = pupilMath.Geometry(20, 0.1, 0.6, 1.5, 1.4)
geo_c = pupilMath.GeometryC(20, 0.1, 0.6, 1.5, 1.4)
pf = ... | 2.203125 | 2 |
coderbyte/CodelandUsernameValidation/CodelandUsernameValidation.py | asraful009/hackerrank | 0 | 44680 | <reponame>asraful009/hackerrank<filename>coderbyte/CodelandUsernameValidation/CodelandUsernameValidation.py
import re
def CodelandUsernameValidation(strParam):
x = re.match(r"[a-zA-Z]{1}[a-zA-Z0-9_]{2,22}[a-zA-Z0-9]{1}", strParam)
# print(x)
if(x):
return True
return False
# keep this function call here ... | 3.6875 | 4 |
goodsManage/admin.py | z-Wind/warehouse | 0 | 44681 | <gh_stars>0
from django.contrib import admin
# Register your models here.
from goodsManage.models import *
class GoodInventoryInline(admin.TabularInline):
model = GoodInventory
extra = 1
@admin.register(GoodKind)
class GoodKindAdmin(admin.ModelAdmin):
list_display = [f.name for f in GoodKind._meta.fields... | 2.03125 | 2 |
andmath/KMeansClustering.py | andregerbaulet/andmath | 0 | 44682 | <reponame>andregerbaulet/andmath
import numpy as np
from .general_functions import get_centroid, get_distance
class KMeansClustering():
def __init__(self, data, K=3, max_iterations=1000):
if len(data.shape)==1:
data = np.array([data]).T
self.data = data
self.K = K
self.D... | 3.125 | 3 |
CellProfiler/cellprofiler/gui/module_view/_module_sizer.py | aidotse/Team-rahma.ai | 0 | 44683 | <filename>CellProfiler/cellprofiler/gui/module_view/_module_sizer.py
import logging
import wx
class ModuleSizer(wx.Sizer):
"""The module sizer uses the maximum best width of the setting
edit controls to compute the column widths, then it sets the text
controls to wrap within the remaining space, then it ... | 2.4375 | 2 |
venv/Lib/site-packages/win32/Demos/win32gui_demo.py | ajayiagbebaku/NFL-Model | 150 | 44684 | <reponame>ajayiagbebaku/NFL-Model
# The start of a win32gui generic demo.
# Feel free to contribute more demos back ;-)
import win32gui, win32con, win32api
import time, math, random
def _MyCallback(hwnd, extra):
hwnds, classes = extra
hwnds.append(hwnd)
classes[win32gui.GetClassName(hwnd)] = 1
def Test... | 2.671875 | 3 |
wafer/tickets/urls.py | liip-forks/wafer | 0 | 44685 | <reponame>liip-forks/wafer
from django.conf.urls import url
from wafer.tickets.views import ClaimView, zapier_cancel_hook, zapier_guest_hook
urlpatterns = [
url(r'^claim/$', ClaimView.as_view(), name='wafer_ticket_claim'),
url(r'^zapier_guest_hook/$', zapier_guest_hook),
url(r'^zapier_cancel_hook/$', zapi... | 1.570313 | 2 |
2_CS_Medium/Leetcode/Interview_Easy/DLC_7_Design.py | andremichalowski/CSN1 | 0 | 44686 | 1. SHUFFLE AN ARRAY:
class Solution:
def __init__(self, nums):
self.array = nums
self.original = list(nums)
def reset(self):
self.array = self.original
self.original = list(self.original)
return self.array
def shuffle(self):
aux = list(s... | 3.609375 | 4 |
plio/io/hcube.py | kaitlyndlee/plio | 0 | 44687 | import numpy as np
import gdal
from ..utils.indexing import _LocIndexer, _iLocIndexer
from libpyhat.transform.continuum import continuum_correction
from libpyhat.transform.continuum import polynomial, linear, regression
class HCube(object):
"""
A Mixin class for use with the io_gdal.GeoDataset class
to o... | 2.21875 | 2 |
products/ui/llbuildui/graphalgorithms.py | uraimo/swift-llbuild | 1,034 | 44688 | import orderedset
def find_cycle(nodes, successors):
path = orderedset.orderedset()
visited = set()
def visit(node):
# If the node is already in the current path, we have found a cycle.
if not path.add(node):
return (path, node)
# If we have otherwise already visit... | 3.90625 | 4 |
db.py | ninimihaila/raspi-server | 0 | 44689 | <reponame>ninimihaila/raspi-server
import sqlite3
from datetime import datetime
def connect(db):
conn = sqlite3.connect(db)
return conn
def create(conn):
tables = [
{
'name': 'ir',
}
]
c = conn.cursor()
for table in tables:
c.execute('''
... | 3.140625 | 3 |
AntiAnalysis/__init__.py | Devtion/CrazyPy | 2 | 44690 | <reponame>Devtion/CrazyPy<filename>AntiAnalysis/__init__.py
# Import all modules
import AntiAnalysis.VirtualBox
import AntiAnalysis.SandBox
import AntiAnalysis.Debugger
import AntiAnalysis.Emulator
import AntiAnalysis.Process | 1.03125 | 1 |
lib/python2.7/site-packages/appionlib/apTilt/autotilt.py | leschzinerlab/myami-3.2-freeHand | 0 | 44691 | <filename>lib/python2.7/site-packages/appionlib/apTilt/autotilt.py
#!/usr/bin/env python
#python
import os
import sys
import time
import numpy
import threading
from PIL import Image
from pyami import quietscipy
from scipy import ndimage, optimize
#appion
try:
import radermacher
except:
print "using slow tilt angle c... | 2.234375 | 2 |
bin/utils/topo.py | akrishna1995/emuedge | 8 | 44692 | <filename>bin/utils/topo.py
import json
# use adjacency list for representing network would be intuitive for human
class topo:
def __init__(self):
self.graph=[]
@staticmethod
def read_from_json(filename):
raw=open(filename).read()
jdata=json.loads(raw)
nodes=[]
# init graph based on how many nodes we hav... | 3.671875 | 4 |
__getYardAndMiles.py | simdevex/01.Basics | 0 | 44693 | '''
Python program to convert the distance (in feet) to inches,yards, and miles
'''
def distanceInInches (d_ft):
print("The distance in inches is %i inches." %(d_ft * 12))
def distanceInYard (d_ft):
print("The distance in yards is %.2f yards." %(d_ft / 3.0))
def distanceInMiles (d_ft):
print("The distanc... | 4.28125 | 4 |
lib/googlecloudsdk/command_lib/memcache/instances_describe_util.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2 | 44694 | # -*- coding: utf-8 -*- #
# Copyright 2021 Google LLC. 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://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | 1.742188 | 2 |
ktrain/tests/test_multilabel.py | sathishksankarpandi/ktrain | 0 | 44695 | #!/usr/bin/env python3
"""
Tests of ktrain text classification flows
"""
import sys
import os
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID";
os.environ["CUDA_VISIBLE_DEVICES"]="0"
sys.path.insert(0,'../..')
from unittest import TestCase, main, skip
import ktrain
def synthetic_multilabel():
import numpy as np
... | 2.40625 | 2 |
api/serializer.py | lirandepira/winccoa-web | 0 | 44696 | from rest_framework import serializers, status
from api.models import *
class ElementsSerializer(serializers.ModelSerializer):
# element_number = serializers.RelatedField(source='element_id', read_only=True)
class Meta:
model = Elements
fields = ('element_id', 'element_name')
class EventHisto... | 2.171875 | 2 |
utils/models.py | michaelnation26/pix2pix-edges-with-color | 1 | 44697 | """
Keras implementation of Pix2Pix from <NAME>'s tutorial.
https://machinelearningmastery.com/how-to-develop-a-pix2pix-gan-for-image-to-image-translation/
"""
from keras.initializers import RandomNormal
from keras.layers import Activation, BatchNormalization, Concatenate, Conv2D, Conv2DTranspose, Dropout, LeakyReLU
f... | 3.28125 | 3 |
lxserv/tagger_pTag_quickSelect_Popup.py | 9bstudios/mecco_tagger | 0 | 44698 |
import lx, lxifc, lxu.command, tagger
CMD_NAME = tagger.CMD_PTAG_QUICK_SELECT_POPUP
class CommandClass(tagger.CommanderClass):
#_commander_default_values = []
def commander_arguments(self):
return [
{
'name': tagger.TAGTYPE,
'label': tagger.LAB... | 2.34375 | 2 |
canvas_sdk/methods/gradebook_history.py | david-house-harvard/canvas_python_sdk | 21 | 44699 | <filename>canvas_sdk/methods/gradebook_history.py<gh_stars>10-100
from canvas_sdk import client, utils
def days_in_gradebook_history_for_this_course(request_ctx, course_id, per_page=None, **request_kwargs):
"""
Returns a map of dates to grader/assignment groups
:param request_ctx: The request context
... | 3.25 | 3 |