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 |
|---|---|---|---|---|---|---|
cyder/cydns/models.py | ngokevin/cyder | 1 | 12792751 | from django.core.exceptions import ObjectDoesNotExist, ValidationError
from django.db import models
import cyder
from cyder.cydns.domain.models import Domain, _check_TLD_condition
from cyder.cydns.mixins import ObjectUrlMixin
from cyder.cydns.validation import validate_label, validate_name
from cyder.settings import C... | 2.4375 | 2 |
bounca/templatetags/templatetags/version_tags.py | warthog9/bounca | 0 | 12792752 | <gh_stars>0
"""Version template tag"""
from django import template
from django.utils.version import get_version
from bounca import VERSION
register = template.Library()
@register.simple_tag
def bounca_version():
return str(get_version(VERSION))
| 1.585938 | 2 |
codigo/Live29/exemplo_6.py | cassiasamp/live-de-python | 572 | 12792753 | <reponame>cassiasamp/live-de-python
class Pessoa:
def __init__(self, n, s):
self.n = n
self.s = s
def __hash__(self):
return hash((self.n,self.s))
ll = Pessoa('Lugão','Ricardo')
lulu = Pessoa('Lugão','Ricardinho')
print(hash(ll)) # True
print(hash(lulu)) # True
| 3.53125 | 4 |
Lesson12/f1.py | shinkai-tester/python_beginner | 2 | 12792754 | try:
f = open('f.txt', 'r')
except FileNotFoundError:
f = open('f.txt', 'w')
else:
text = f.read()
print(text)
finally:
f.close()
| 3.1875 | 3 |
js/SFLIX/getfilepath.py | Apop85/Scripts | 0 | 12792755 | import os
from shutil import move as moveFile
os.chdir(os.getcwd())
print("".center(50, "="))
print("Update STEFFLIX-Daten".center(50))
print("".center(50, "="))
homeDir = os.getcwd()
allowedFileTypes = ["jpg", "jpeg", "mp4", "mp3", "png"]
diallowedItems = ["System Volume Information", "$RECYCLE.BIN", ".vscode", "s... | 2.5625 | 3 |
libraries/ArbotiX/examples/old/CommExt/CommEXT.py | bouraqadi/ArbotiX-M | 1 | 12792756 | #!/usr/bin/env python
# CommEXT.py - ArbotiX Commander Extended Instruction Set Example
# Copyright (c) 2008-2010 Vanadium Labs LLC. All right reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistri... | 1.867188 | 2 |
torch_rl/envs/__init__.py | JimmyMVP/plain_rl | 10 | 12792757 | from gym.envs.registration import register
from .wrappers import *
from .logger import *
from .envs import *
register(
id='BanditsX2-v0',
kwargs = {'num_bandits' : 2},
entry_point='torch_rl.envs:BanditEnv',
)
register(
id='BanditsX4-v0',
kwargs = {'num_bandits' : 4},
entry_point='torch_rl.env... | 1.617188 | 2 |
src/search/views.py | mahidul-islam/shopmanagementsystem | 0 | 12792758 | from django.shortcuts import render
from products.models import Product
from django.views.generic.list import ListView
from django.db.models import Q
class SearchProductView(ListView):
queryset = Product.objects.all()
template_name = "search/searched.html"
def get_context_data(self, *args, **kwargs):
... | 1.9375 | 2 |
smart_alarm_clock/test_apis.py | kfb19/Smart-Alarm-Clock | 0 | 12792759 | """this module is designed to test the version of the APIs required
to see if they are up to date so the program can be run"""
import logging
from news_api import check_news_version
from weather_api import check_weather_version
from covid_api import check_covid_version
logging.basicConfig(filename='pysys.log'... | 3.421875 | 3 |
tide_predictor/tidal_model.py | guyt101z/tide-predictor | 1 | 12792760 | <reponame>guyt101z/tide-predictor<gh_stars>1-10
from __future__ import unicode_literals
import pytz
import math
from functools import partial
from dateutil.parser import parse as parse_datetime
from collections import namedtuple
Constituent = namedtuple(
'Constituent', 'name,description,amplitude,phase,speed')
... | 2.875 | 3 |
rectangles.py | CoffeeTableEnnui/RedCircleGame | 0 | 12792761 | <reponame>CoffeeTableEnnui/RedCircleGame
import pygame
class Rectangle:
def collide(self, circle):
x_range = range(self.xmin - circle.size, self.xmax + circle.size)
y_range = range(self.ymin - circle.size, self.ymax + circle.size)
return circle.x in x_range and circle.y in y_range
class Le... | 3.453125 | 3 |
Python/scope.py | MarsBighead/mustang | 4 | 12792762 | #!/usr/bin/python
class Difference:
def __init__(self, a):
self.__elements = a
def computeDifference(self):
a = self.__elements
max = a[0]
min = a[0]
for i in range(0, len(a)):
if max<a[i]:
max=a[i]
else:
pass
... | 3.46875 | 3 |
saifooler/saliency/saliency_estimator.py | sailab-code/SAIFooler | 0 | 12792763 | <reponame>sailab-code/SAIFooler<filename>saifooler/saliency/saliency_estimator.py
import torch
from tqdm import tqdm
from saifooler.render.sailenv_module import SailenvModule
class SaliencyEstimator:
def __init__(self, mesh_descriptor, classifier, p3d_module, sailenv_module, data_module, use_cache=False):
... | 1.992188 | 2 |
cred/cred_data.py | TECommons/tec-sourcecred-dashboard | 0 | 12792764 | from datetime import datetime
import pandas as pd
from typing import Any, Dict, List, Tuple
class CredData():
"""
Parses information from Sourcecred
- Works with TimelineCred data format (sourcecred <= v0.7x)
"""
def __init__(self, cred_data, accounts_data):
self.cred_json_dat... | 2.96875 | 3 |
utils/generate_tsne_data.py | cBioCenter/chell-viz-contact | 3 | 12792765 | <filename>utils/generate_tsne_data.py
from MulticoreTSNE import MulticoreTSNE as TSNE
import numpy as np
data = np.loadtxt('pca.csv', delimiter=',')
tsne = TSNE(n_jobs=4)
Y = tsne.fit_transform(data)
np.savetxt('tsne_matrix.csv', Y, delimiter=",")
| 2.390625 | 2 |
gQuant/plugins/cusignal_plugin/greenflow_cusignal_plugin/filtering/resample_poly.py | t-triobox/gQuant | 0 | 12792766 | <reponame>t-triobox/gQuant
from ast import literal_eval
from fractions import Fraction
import numpy as np
import cupy as cp
from cusignal.filtering.resample import resample_poly as curesamp
from scipy.signal import resample_poly as siresamp
from greenflow.dataframe_flow import (Node, PortsSpecSchema, ConfSchema)
from... | 1.757813 | 2 |
sample/admin.py | urm8/django-translations | 100 | 12792767 | from django.contrib import admin
from translations.admin import TranslatableAdmin, TranslationInline
from .models import Timezone, Continent, Country, City
class TimezoneAdmin(TranslatableAdmin):
inlines = [TranslationInline]
class ContinentAdmin(TranslatableAdmin):
inlines = [TranslationInline]
class Co... | 2.0625 | 2 |
lib/bin/captainsplexx/initfs_tools/make_initfs.py | elementofprgress/Frostbite3_Editor | 56 | 12792768 | <filename>lib/bin/captainsplexx/initfs_tools/make_initfs.py
from struct import unpack
initfs=open("initfs_Win32","rb")
magicB=initfs.read(4)
magic=unpack(">I",magicB)[0]
if magic in (0x00D1CE00,0x00D1CE01): #the file is XOR encrypted and has a signature
signature=initfs.read(292)
key=[ord(initfs.read(1))^... | 2.578125 | 3 |
roles/aliasses/molecule/default/tests/test_default.py | PW999/home-assistant-ansible | 0 | 12792769 | <reponame>PW999/home-assistant-ansible<filename>roles/aliasses/molecule/default/tests/test_default.py
import os
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_alias(host):
host.run_... | 1.46875 | 1 |
py_kiwoom/kiwoom_youtube.py | ijhan21/hackathon_kiwoom | 0 | 12792770 | <filename>py_kiwoom/kiwoom_youtube.py
import os
import sys
from PyQt5.QAxContainer import *
from PyQt5.QtCore import *
from config.errorCode import *
from PyQt5.QtTest import *
from config.kiwoomType import *
from config.log_class import *
# from config.slack import *
class Kiwoom(QAxWidget):
def __init__(self):
... | 2.421875 | 2 |
src/kong/json_field.py | paulgessinger/kong | 3 | 12792771 | <reponame>paulgessinger/kong
"""
Polyfill for a JSON field in SQLite.
Newer versions of sqlite (>= 3.9.0) have a native JSON extension, which we use.
If the sqlite version is lower, we roll a less-optimal replacement.
"""
from typing import Dict, cast
import peewee as pw
from peewee import sqlite3
import json
if sqli... | 2.984375 | 3 |
idataapi_transform/DataProcess/DataWriter/MySQLWriter.py | markqiu/idataapi-transform | 41 | 12792772 | <reponame>markqiu/idataapi-transform
import json
import asyncio
import random
import logging
import traceback
from .BaseWriter import BaseWriter
class MySQLWriter(BaseWriter):
def __init__(self, config):
super().__init__()
self.config = config
self.total_miss_count = 0
self.success... | 2.3125 | 2 |
src/main.py | prakhar154/Cassava-Leaf-Disease-Classification | 0 | 12792773 | import pandas as pd
import numpy as np
from sklearn.metrics import accuracy_score
import torch
from torch.utils.data import DataLoader
import torch.optim as optim
from model import CassavaModel
from loss import DenseCrossEntropy
import dataset
from config import *
def train_one_fold(fold, model, optimizer):
df = p... | 2.484375 | 2 |
tools/gdb/print_list.py | prattmic/F4OS | 42 | 12792774 | <gh_stars>10-100
import gdb
class Print_List(gdb.Command):
"""Prints out an F4OS linked list in a pretty format"""
def __init__(self):
super(Print_List, self).__init__("print-list", gdb.COMMAND_DATA, gdb.COMPLETE_SYMBOL)
def invoke(self, arg, from_tty):
head = gdb.parse_and_eval(arg)
... | 3.078125 | 3 |
cd4ml/feature_set.py | camila-contreras/CD4ML-Scenarios | 113 | 12792775 | <reponame>camila-contreras/CD4ML-Scenarios<gh_stars>100-1000
import logging
def _exclude(fields, excluded):
return [field for field in fields if field not in excluded]
def _combine_dicts(*args):
results = {}
for arg in args:
results.update(arg)
return results
class FeatureSetBase:
"""... | 2.328125 | 2 |
utils/configuration.py | jelenko5/cgccli | 0 | 12792776 | <reponame>jelenko5/cgccli
import os
import sys
import click
import utils.logger as logger
from utils.const import CONFIG_FILE_PATH
if sys.version_info[0] == 2:
import ConfigParser as configparser
else:
import configparser
config = configparser.ConfigParser()
def get_config_path():
homedir = os.environ... | 2.375 | 2 |
tests/fqe_operator_test.py | MichaelBroughton/OpenFermion-FQE | 33 | 12792777 | # Copyright 2020 Google LLC
# 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... | 2.328125 | 2 |
file_converters/ifcjson/__init__.py | IFCJSON-Team/IFC2JSON_python | 15 | 12792778 | <gh_stars>10-100
from ifcjson.ifc2json4 import IFC2JSON4
from ifcjson.ifc2json5a import IFC2JSON5a
# from ifcjson.to_ifcopenshell import JSON2IFC
| 1.265625 | 1 |
tests/all/backends/redis/client.py | stuaxo/python-stdnet | 61 | 12792779 | '''Test additional commands for redis client.'''
import json
from hashlib import sha1
from stdnet import getdb
from stdnet.backends import redisb
from stdnet.utils import test, flatzset
def get_version(info):
if 'redis_version' in info:
return info['redis_version']
else:
return inf... | 2.234375 | 2 |
src/07_mongoengine/service_central/nosql/mongo_setup.py | jabelk/mongodb-for-python-developers | 0 | 12792780 | <reponame>jabelk/mongodb-for-python-developers
import mongoengine
def global_init():
# this is where would pass in creds and port and such
# name= is the database db name
# when we define our classes we will refer to the "core" connection
# default localhost and port
mongoengine.register_connecti... | 2.703125 | 3 |
djangopreviewcard/cardviewinfo.py | hnjm/preview-card | 1 | 12792781 | from .mediasourcetype import MediaSourceType
class CardViewInfo:
def __init__(self, ms_type=MediaSourceType.NONE, url="", image_url="", title="", description=""):
self.__ms_type = ms_type
self.__url = url
self.__image_url = image_url
self.__title = title
self.__description ... | 2.453125 | 2 |
src/main.py | SimonK1/Zen-Garden-Evolutionary-Algorithm | 0 | 12792782 | <filename>src/main.py<gh_stars>0
import random
import copy
import sys
test1 = [
[00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00],
[00, 00, 00, 00, 00, -1, 00, 00, 00, 00, 00, 00],
[00, -1, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00],
[00, 00, 00, 00, -1, 00, 00, 00, 00, 00, 00, 00],
... | 2.078125 | 2 |
birthday/cron.py | joehalloran/birthday_project | 0 | 12792783 | <reponame>joehalloran/birthday_project
# Copyright 2016 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 a... | 2.53125 | 3 |
picammodapipkg/camproject.py | nkosinathintuli/mypackage | 0 | 12792784 | """This module contains the functions for taking video recordings
and enabling/disabling light triggered automatic recording
"""
import anvil.server
import picamera
import takeImg
import adc
import smtplib
import motionDetect
motionState = False
server = smtplib.SMTP('smtp.gmail.com',587)
server.starttls()
server.log... | 2.84375 | 3 |
gcf/gcf.py | pangjie/gcf | 18 | 12792785 | <reponame>pangjie/gcf<filename>gcf/gcf.py
# !/usr/bin/env python
# -*- coding: utf-8 -*-
import click
from . import gcf_mining as gm
from . import gcf_scrape as gs
@click.group(invoke_without_command=True, no_args_is_help=True)
@click.option('--dj', '-d', default='',
help=u'Search by dj, such as -d \... | 2.25 | 2 |
src/tngsdk/traffic/rest.py | sonata-nfv/ng-sdk-traffic | 0 | 12792786 | <gh_stars>0
# Copyright (c) 2018 5GTANGO, QUOBIS SL.
# 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 requi... | 1.867188 | 2 |
0x02-python-import_modules/100-my_calculator.py | oluwaseun-ebenezer/holbertonschool-higher_level_programming | 0 | 12792787 | <reponame>oluwaseun-ebenezer/holbertonschool-higher_level_programming
#!/usr/bin/python3
# 100-my_calculator.py
if __name__ == "__main__":
"""Handle basic arithmetic operations."""
from calculator_1 import add, sub, mul, div
import sys
if len(sys.argv) - 1 != 3:
print("Usage: ./100-my_calcula... | 3.921875 | 4 |
src/Africa/migrations/0006_dish_images01.py | MCN10/Demo1 | 0 | 12792788 | # Generated by Django 3.0.8 on 2020-07-31 12:04
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('Africa', '0005_auto_20200731_1203'),
]
operations = [
migrations.AddField(
model_name='dish',
name='images01',
... | 1.523438 | 2 |
makahiki/apps/widgets/status/users/views.py | justinslee/Wai-Not-Makahiki | 1 | 12792789 | """handles request for user gchart widget."""
from apps.managers.challenge_mgr import challenge_mgr
from apps.widgets.status.models import DailyStatus
def supply(request, page_name):
"""supply view_objects for user status."""
_ = page_name
_ = request
#todays_users = Profile.objects.filter(last_visit... | 2.453125 | 2 |
Modulo 01/exercicos/d003.py | euyag/python-cursoemvideo | 2 | 12792790 | print('===== DESAFIO 003 =====')
n1 = int(input('digite um valor: '))
n2 = int(input('digite um valor: '))
s = n1 + n2
print(f'a soma entre {n1} e {n2} é {s}') | 3.796875 | 4 |
Pipes/sensor for counting the heating and quantity/sensor-master/examples/webthings/ds18b20-sensor.py | ReEn-Neom/ReEn.Neom-source-code- | 0 | 12792791 | <gh_stars>0
from webthing import Thing, Property, Value, SingleThing, WebThingServer
import logging
import tornado.ioloop
from sensor import DS18B20
def run_server():
ds18 = DS18B20('28-03199779f5a1')
celsius = Value(ds18.temperature().C)
thing = Thing(
'urn:dev:ops:temperature-sensor',
'... | 2.328125 | 2 |
src/main_test.py | AliManjotho/tf_hci_pose | 0 | 12792792 | import cv2
from src.utils.heatmap import getHeatmaps
from src.visualization.visualize import visualizeAllHeatmap, visualizeBackgroundHeatmap
keypoints = [ [[100, 100, 2], [105,105, 2]] ]
image = cv2.imread('images/person.jpg')
hmaps = getHeatmaps(image, keypoints, 7)
visualizeAllHeatmap(image, hmaps)
visualizeBackg... | 2.578125 | 3 |
impact.py | jackscape/image-bot | 1 | 12792793 | '''
i actually didn't write this. credit to https://github.com/lipsumar/meme-caption
'''
from PIL import Image
from PIL import ImageFont
from PIL import ImageDraw
import sys
img = Image.open(sys.argv[1])
draw = ImageDraw.Draw(img)
def drawText(msg, pos):
fontSize = img.width//10
lines = []
font = Im... | 3 | 3 |
generic_iterative_stemmer/training/stemming/__init__.py | asaf-kali/generic-iterative-stemmer | 0 | 12792794 | from .stem_generator import StemDict, StemGenerator, reduce_stem_dict # noqa
from .stemming_trainer import StemmingTrainer, get_stats_path # noqa
from .corpus_stemmer import * # noqa
from .ft_stemming_trainer import FastTextStemmingTrainer # noqa
from .w2v_stemming_trainer import Word2VecStemmingTrainer # noqa
| 1.0625 | 1 |
lizard/core/rtl/pipeline_arbiter.py | cornell-brg/lizard | 50 | 12792795 | <filename>lizard/core/rtl/pipeline_arbiter.py
from pymtl import *
from lizard.util.rtl.interface import UseInterface
from lizard.util.rtl.method import MethodSpec
from lizard.util.rtl.case_mux import CaseMux, CaseMuxInterface
from lizard.util.rtl.arbiters import ArbiterInterface, PriorityArbiter
from lizard.util.rtl.pi... | 2.0625 | 2 |
biomedical_image_segmentation/model/model.py | luiskuhn/biomedical_image_segmentation | 1 | 12792796 | <gh_stars>1-10
import torch
import torch.nn as nn
import torch.nn.functional as F
def create_model():
return Net()
def create_parallel_model():
return DataParallelPassthrough(Net())
class Net(nn.Module):
def __init__(self):
super(Net, self).__init__()
self.conv1 = nn.Conv2d(1, 32, 3, 1... | 2.703125 | 3 |
ipec/cnn/layers.py | wwwbbb8510/ippso | 9 | 12792797 | import numpy as np
from ipec.ip.core import parse_subnet_str
from ipec.ip.core import IPStructure
from ipec.ip.core import Interface
from ipec.ip.encoder import Encoder
from ipec.ip.decoder import Decoder
from ipec.ip.core import max_decimal_value_of_binary
# convolutional layer fields
CONV_FIELDS = {
'filter_siz... | 2.28125 | 2 |
src/ground/grain-server.backup/mcc/iridium/devutil/mo_receiver.py | shostakovichs-spacecraft-factory/cansat-2018-2019 | 5 | 12792798 | <reponame>shostakovichs-spacecraft-factory/cansat-2018-2019
import typing
import logging
import sys
import argparse
from socketserver import BaseRequestHandler
from ..network.mo_server import MOServiceServer
from ..messages.mobile_originated import MOMessage
_log = logging.getLogger(__name__)
class ReqHandler(BaseR... | 2.140625 | 2 |
xgds_planner2/defaultSettings.py | xgds/xgds_planner2 | 1 | 12792799 | <filename>xgds_planner2/defaultSettings.py
#__BEGIN_LICENSE__
# Copyright (c) 2015, United States Government, as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All rights reserved.
#
# The xGDS platform is licensed under the Apache License, Version 2.0
# (the "License"); you ... | 2.015625 | 2 |
_lever_utils/foo/helpers/mail/mail_helper.py | 0lever/utils | 1 | 12792800 | <filename>_lever_utils/foo/helpers/mail/mail_helper.py
# -*- coding:utf-8 -*-
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
import smtplib
import os
import poplib
from email.parser import Parser
from email.header import decode_header
from email.utils import parseaddr
from datetime... | 2.484375 | 2 |
src/database_processor/db_common.py | Brian-Pho/RVST598_Speech_Emotion_Recognition | 2 | 12792801 | """
This file holds common functions across all database processing such as
calculating statistics.
"""
import numpy as np
from src import em_constants as emc
def is_outlier(wav, lower, upper):
"""
Checks if an audio sample is an outlier. Bounds are inclusive.
:param wav: The audio time series data poi... | 3.515625 | 4 |
attendance_app/urls.py | mattmorz/attendance_system | 0 | 12792802 | <gh_stars>0
from django.conf.urls import url
from django.urls import path, include
from . import views
urlpatterns = [
path('', views.index, name='index'),
path('sign-in', views.signup, name='sign-in'),
path('home-page', views.loggedIn, name='home-page'),
path('log-out', views.logout_view, name='log-ou... | 1.617188 | 2 |
aas_core_codegen/csharp/__init__.py | gillistephan/aas-core-codegen | 5 | 12792803 | """Generate C# code based on the intermediate meta-model."""
| 1.109375 | 1 |
code/trlda/python/tests/batchlda_test.py | lucastheis/trlda | 23 | 12792804 | import unittest
from time import time
from pickle import load, dump
from tempfile import mkstemp
from random import choice, randint
from string import ascii_letters
from numpy import corrcoef, random, abs, max, asarray, round, zeros_like
from trlda.models import BatchLDA
from trlda.utils import sample_dirichlet
class... | 2.28125 | 2 |
custom/icds_reports/tests/agg_tests/reports/test_poshan_progress_dashboard_data.py | tobiasmcnulty/commcare-hq | 1 | 12792805 | from django.test import TestCase
from custom.icds_reports.reports.poshan_progress_dashboard_data import get_poshan_progress_dashboard_data
class TestPPDData(TestCase):
def test_get_ppr_data_comparative_month(self):
self.maxDiff = None
data = get_poshan_progress_dashboard_data(
'icds-... | 2.046875 | 2 |
examples/embeddingInFLTK.py | chiluf/visvis.dev | 0 | 12792806 | #!/usr/bin/env python
"""
This example illustrates embedding a visvis figure in an FLTK application.
"""
import fltk
import visvis as vv
# Create a visvis app instance, which wraps an fltk application object.
# This needs to be done *before* instantiating the main window.
app = vv.use('fltk')
class MainWindow(flt... | 2.953125 | 3 |
mathutils/xform.py | saridut/FloriPy | 0 | 12792807 | #!/usr/bin/env python
import math
import numpy as np
from . import linalg as la
from . import eulang
#Euler angle sequence: XYZ (world). First rotation about X, second rotation
#about Y, and the third rotation about Z axis of the world(i.e. fixed) frame.
#This is the same as the sequence used in Blender.
#In contrast... | 3.5 | 4 |
python/archive/hashem.py | kfsone/tinker | 0 | 12792808 | #! /usr/bin/python3
import argparse
import hashlib
import mmap
import os
import posixpath
import stat
import sys
from collections import namedtuple
exclusions = ('lost+found', 'restore', 'backup', 'Newsfeed', '.pki', 'Jenkins')
joinpath = posixpath.join
FileDesc = namedtuple('FileDesc', ['full_path', 'item_type'... | 2.34375 | 2 |
Interview Preparation Kits/Interview Preparation Kit/Graphs/DFS: Connected Cell in a Grid/connected_cells.py | xuedong/hacker-rank | 1 | 12792809 | <filename>Interview Preparation Kits/Interview Preparation Kit/Graphs/DFS: Connected Cell in a Grid/connected_cells.py<gh_stars>1-10
#!/bin/python3
import math
import os
import random
import re
import sys
# Complete the maxRegion function below.
def in_graph(grid, i, j):
n = len(grid)
m = len(grid[0])
ret... | 3.71875 | 4 |
tests/test_indexing.py | cloudbutton/lithops-array | 0 | 12792810 | import sklearn.datasets as datasets
from numpywren.matrix import BigMatrix
from numpywren import matrix_utils, binops
from numpywren.matrix_init import shard_matrix
import pytest
import numpy as np
import pywren
import unittest
class IndexingTestClass(unittest.TestCase):
def test_single_shard_index_get(self):
... | 2.578125 | 3 |
tests/test_kooptimise.py | anilkumarpanda/kooptimize | 0 | 12792811 | <gh_stars>0
import pytest
from kooptimize.korules import get_rules_for_individual
def test_get_rule_for_individual():
ind = [1,0,1,0]
rule_dict = {0:"age <= 70",1:"ltv<=90",
3:"no_of_primary_accts <= 50",4:"credit_history_lenght >= 3"}
result_dict = get_rules_for_individual(ind)
expected_dict = {0:... | 2.21875 | 2 |
src/aiofiles/__init__.py | q0w/aiofiles | 1,947 | 12792812 | <gh_stars>1000+
"""Utilities for asyncio-friendly file handling."""
from .threadpool import open
from . import tempfile
__all__ = ["open", "tempfile"]
| 1.609375 | 2 |
data_structures/recursion/key_combinatons.py | severian5it/udacity_dsa | 0 | 12792813 | <filename>data_structures/recursion/key_combinatons.py
def get_characters(num):
if num == 2:
return "abc"
elif num == 3:
return "def"
elif num == 4:
return "ghi"
elif num == 5:
return "jkl"
elif num == 6:
return "mno"
elif num == 7:
return "pqrs"
... | 3.609375 | 4 |
Part_1/ch03_func/3_2_return.py | hyperpc/AutoStuffWithPython | 0 | 12792814 | <filename>Part_1/ch03_func/3_2_return.py
import random
def getAnswer(answerNumber):
result = ''
if answerNumber == 1:
result = 'It is certain'
elif answerNumber == 2:
result = 'It is decidedly so'
elif answerNumber == 3:
result = 'Yes'
elif answerNumber == 4:
result ... | 3.859375 | 4 |
core/migrations/0024_auto_20200410_2228.py | scottstanie/fashbowl | 1 | 12792815 | # Generated by Django 2.2.10 on 2020-04-10 22:28
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0023_game_max_words'),
]
operations = [
migrations.RenameField(
model_name='game',
old_name='max_words',
... | 1.859375 | 2 |
catena/cmd/manage.py | HewlettPackard/catena | 4 | 12792816 | # (C) Copyright 2017 Hewlett Packard Enterprise Development LP.
#
# 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.820313 | 2 |
BancoEAN.py | VivianaMontacost/ProyectoBancoEAN | 0 | 12792817 | """
Juandabu
"""
persona= ['<NAME>', '<NAME>' ]
usuario= ['superman' , 'batman' ]
contraseña= [<PASSWORD> , <PASSWORD> ]
numero_de_cuenta= [ 3115996681 , 32221822 ]
tipo_de_cuenta= [ 'corriente', 'ahorros' ]
dinero= ... | 4.09375 | 4 |
main.py | khanhcsc/tts-bot | 0 | 12792818 | import os
import sys
import discord
from bot import init_cfg, init_bot
from template import handle, Context
DEBUG = True
TOKEN = ""
def init():
if len(sys.argv) <= 1:
sys.exit("start template: python main.py <TOKEN>")
global TOKEN
TOKEN = sys.argv[1]
if __name__ == "__main__":
init()
... | 2.125 | 2 |
dragonflow/tests/unit/test_fc_app.py | qianyuqiao/dragonflow | 0 | 12792819 | <reponame>qianyuqiao/dragonflow
# Copyright (c) 2016 OpenStack Foundation.
# 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/li... | 1.828125 | 2 |
draw_lines_from_files.py | inconvergent/axidraw-xy | 29 | 12792820 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
from xy.device import Device
def main(args):
from modules.utils import get_paths_from_n_files as get
pattern = args.pattern
steps = args.steps
stride = args.stride
skip = args.skip
paths = get(pattern, skip, steps, stride, spatial_concat=True, spatial_concat_e... | 2.109375 | 2 |
Data_Structure/memoized.py | 8luebottle/DataStructure-N-Algorithm | 0 | 12792821 | from functiontools import wraps
from benchmark import benchmark
def memo(func):
cache = {}
@wraps(func)
def wrap(*args):
if args not in cache:
cache[args] = func(*args)
return cache[args]
return wrap
def fib(n):
if n < 2:
return 1
else:
return ... | 3.296875 | 3 |
gamedata.py | Positron11/prison-breakout-game | 0 | 12792822 | <reponame>Positron11/prison-breakout-game
# Inmates data
inmates = [
{"name": "billy", "strength": 55, "friendliness": 40, "influence": 20},
{"name": "bob", "strength": 70, "friendliness": 20, "influence": 50},
{"name": "joe", "strength": 23, "friendliness": 79, "influence": 30}
]
# Guards data
guards = [
{"name":... | 2.375 | 2 |
pyram/rot2/Do_serialize.py | Hoseung/pyRamAn | 1 | 12792823 | <gh_stars>1-10
import numpy as np
import galaxymodule # needed for result_sub_sample_**.pickle
import utils.match as mtc
import pickle
#from utils import hagn
import os
from rot2.analysis import *
from rot2 import serialize_results
#import tree.halomodule as hmo
#from rot2 import cell_chunk_module as ccm
import numpy.... | 1.914063 | 2 |
resticweb/interfaces/repository_list.py | XXL6/resticweb | 1 | 12792824 | import os
# from resticweb.dictionary.resticweb_constants import Repository as Rep
from resticweb.models.general import Repository, Snapshot, SnapshotObject, JobParameter, RepositoryType
from resticweb.tools.local_session import LocalSession
from resticweb.misc.credential_manager import credential_manager
# from .repos... | 1.8125 | 2 |
expect.py | chendong2016/chendong2016.github.io | 0 | 12792825 | #!/usr/bin/python
import pexpect
import os
import sys
def git_expect(repodir, u, p):
os.chdir(repodir)
os.system('git pull')
os.system('git add .')
os.system('git commit -m update')
foo = pexpect.spawn('git push')
foo.expect('.*Username.*:')
foo.sendline(u)
foo.expect('.*ssword:*')
... | 2.046875 | 2 |
latent_with_splitseqs/base/classifier_base.py | fgitmichael/SelfSupevisedSkillDiscovery | 0 | 12792826 | import abc
import torch
from code_slac.network.base import BaseNetwork
from latent_with_splitseqs.config.fun.get_obs_dims_used_df import get_obs_dims_used_df
class SplitSeqClassifierBase(BaseNetwork, metaclass=abc.ABCMeta):
def __init__(self,
obs_dim,
seq_len,
... | 2.078125 | 2 |
simplecommit/__init__.py | lightningchen34/simplecommit | 0 | 12792827 | <filename>simplecommit/__init__.py
from __future__ import absolute_import
from .commit import *
name = "simplecommit"
if __name__=="__main__":
run()
| 1.453125 | 1 |
benchtmpl/workflow/parameter/base.py | scailfin/benchmark-templates | 0 | 12792828 | # This file is part of the Reproducible Open Benchmarks for Data Analysis
# Platform (ROB).
#
# Copyright (C) 2019 NYU.
#
# ROB is free software; you can redistribute it and/or modify it under the
# terms of the MIT License; see LICENSE file for more details.
"""Base class for workflow template parameters. Each parame... | 2.859375 | 3 |
main.py | maphouse/create-subtitles | 0 | 12792829 | <filename>main.py
#requires oscar.mp4 video file in same folder
#transcript text file "oscar4.txt"
#might have to be in a folder name called oscar
#change certain character variables
import imageio
imageio.plugins.ffmpeg.download()
from moviepy.video.io.ffmpeg_tools import ffmpeg_extract_subclip
import time
from time ... | 2.625 | 3 |
ComplementaryScripts/branch_work/Step_01_model_comparison.py | HaoLuoChalmers/Lactobacillus_reuteri_MM41A_GEM | 0 | 12792830 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Created by <NAME> at 2019-05-27
"""Step_01_model_comparison.py
:description : script
:param :
:returns:
:rtype:
"""
import os
import cobra
from matplotlib import pyplot as plt
from matplotlib_venn import venn2
import pandas as pd
import My_def
from My_def.model_repor... | 2.109375 | 2 |
wikiml.py | tejaswiniallikanti/upgrad-mlcloud | 0 | 12792831 | <reponame>tejaswiniallikanti/upgrad-mlcloud<gh_stars>0
# coding: utf-8
import pandas as pd
from sklearn.linear_model import LogisticRegressionCV
df = pd.read_csv('data/wiki/articles.tsv', index_col='article_id')
df.head()
get_ipython().run_line_magic('pinfo', 'pd.get_dummies')
catCols = ['category', 'namespace']
catDat... | 2.640625 | 3 |
wirelesstraitor/display.py | DMaendlen/wirelesstraitor | 0 | 12792832 | <filename>wirelesstraitor/display.py<gh_stars>0
from wirelesstraitor.observer import Observer
class CommandLineLocationDisplay(Observer):
def __init__(self):
super(CommandLineLocationDisplay, self).__init__()
def update(self, *args, **kwargs):
"""Continuously print new mac-location pairs"""
... | 2.859375 | 3 |
protreim/config/base.py | hinihatetsu/protreim | 0 | 12792833 | <gh_stars>0
from abc import ABC, abstractmethod
from typing import Dict, List, Any, TypeVar
import PySimpleGUI as sg
class ConfigBase(ABC):
""" Base class of config class.
All config class must inherit this class.
"""
def __init__(self) -> None:
""" Set class variables as instance varia... | 3.0625 | 3 |
inference.py | aws-samples/serverless-word-embedding | 0 | 12792834 | from gensim import models
import json
import numpy as np
MODEL_VERSION = "glove-wiki-gigaword-300"
model = models.KeyedVectors.load_word2vec_format(MODEL_VERSION)
def get_word_vec(word_list):
"""
This method will get the vector of the given word
:param word_list: list of a single word string
:return... | 3.265625 | 3 |
day16/part2.py | stevotvr/adventofcode2016 | 3 | 12792835 | inp = '11101000110010100'
output = list(inp)
while len(output) < 35651584:
output += ['0'] + ['0' if x == '1' else '1' for x in reversed(output)]
output = output[0:35651584]
while len(output) % 2 == 0:
output = ['1' if output[i] == output[i + 1] else '0' for i in range(0, len(output), 2)]
print(''.join(outpu... | 3.015625 | 3 |
vertica_python/vertica/messages/frontend_messages/bind.py | jakubjedelsky/vertica-python | 1 | 12792836 | <filename>vertica_python/vertica/messages/frontend_messages/bind.py
from __future__ import print_function, division, absolute_import
from struct import pack
from ..message import BulkFrontendMessage
class Bind(BulkFrontendMessage):
message_id = b'B'
def __init__(self, portal_name, prepared_statement_name, ... | 2.109375 | 2 |
code/python/dataprocessing.py | nordin11/DataProject | 0 | 12792837 | <gh_stars>0
# coding: utf-8
# In[1]:
from pandas_datareader import data
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import json
import io
# In[2]:
## FINANCIAL INDUSTRY
# Call the stocks I want to analyze
financeTickers = ['JPM','BAC','WFC','V','C']
# Define the data source
data_sourc... | 3.328125 | 3 |
ml/classifier.py | shilang1220/tfwrapper | 0 | 12792838 | <filename>ml/classifier.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Time : 18-5-15 下午5:32
# @Author : <NAME>
# @File : classifier.py
# @Software: tfwrapper
from keras.layers import Dense
from keras.models import Sequential
from keras.datasets import mnist
(x_train,y_train),(x_test,y_test) = mnist.load... | 2.9375 | 3 |
bot/bot.py | dzd/slack-starterbot | 0 | 12792839 | from time import sleep
from re import search, finditer
from copy import copy
# from pprint import pprint
from slackclient import SlackClient
from bot.message import Message
class Bot:
def __init__(self, conf):
# instantiate Slack client
self.slack_client = SlackClient(conf.slack_bot_token)
... | 2.65625 | 3 |
code/nbs/reco-tut-mlh-02-model-comparison.py | sparsh-ai/reco-tut-mlh | 0 | 12792840 | #!/usr/bin/env python
# coding: utf-8
# In[1]:
import os
project_name = "reco-tut-mlh"; branch = "main"; account = "sparsh-ai"
project_path = os.path.join('/content', project_name)
# In[2]:
if not os.path.exists(project_path):
get_ipython().system(u'cp /content/drive/MyDrive/mykeys.py /content')
import m... | 2.171875 | 2 |
exhal/daemon.py | nficano/exhal | 0 | 12792841 | import atexit
import os
import sys
import time
from contextlib import suppress
from signal import SIGTERM
class Daemon:
def __init__(self, pidfile=None):
self.pidfile = pidfile or os.path.join("/var/run/exhal.service")
def start(self):
try:
self.get_pidfile()
except IOErro... | 2.375 | 2 |
ctpn/export_image.py | kspook/text-detection-ctpn01 | 0 | 12792842 | <reponame>kspook/text-detection-ctpn01
from __future__ import print_function
import tensorflow as tf
import numpy as np
import os, sys, cv2
from tensorflow.python.platform import gfile
import glob
import shutil
dir_path = os.path.dirname(os.path.realpath(__file__))
sys.path.append(os.path.join(dir_path, '..'))
from l... | 2.609375 | 3 |
HDPython/hdl_converter.py | HardwareDesignWithPython/HDPython | 0 | 12792843 | <reponame>HardwareDesignWithPython/HDPython
def get_dependency_objects(obj, dep_list):
return obj.__hdl_converter__.get_dependency_objects(obj, dep_list)
def ops2str(obj, ops):
return obj.__hdl_converter__.ops2str(ops)
def get_MemfunctionCalls(obj):
return obj.__hdl_converter__.get_MemfunctionCalls(obj)... | 1.945313 | 2 |
Yatube/hw04_tests/posts/migrations/0010_auto_20201103_2339.py | abi83/YaPractice | 3 | 12792844 | <reponame>abi83/YaPractice
# Generated by Django 2.2.6 on 2020-11-03 16:39
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('posts', '0009_auto_20201023_1643'),
]
operations = [
migrations.AlterField(
model_name='post',
... | 1.429688 | 1 |
{{cookiecutter.project_name}}/template_minimal/app/schemas/requests.py | rafsaf/respo-fastapi-template | 75 | 12792845 | <reponame>rafsaf/respo-fastapi-template<gh_stars>10-100
from pydantic import BaseModel, EmailStr
class BaseRequest(BaseModel):
# may define additional fields or config shared across requests
pass
class RefreshTokenRequest(BaseRequest):
refresh_token: str
class UserUpdatePasswordRequest(BaseRequest):
... | 2.09375 | 2 |
pyrtmp/__init__.py | mludolph/pyrtmp | 9 | 12792846 | import asyncio
import os
from asyncio import StreamReader, StreamWriter, AbstractEventLoop, \
WriteTransport, Task, BaseTransport
from io import BytesIO
from typing import Any, List, Optional, Mapping
from bitstring import tokenparser, BitStream
def random_byte_array(size: int) -> bytes:
return os.urandom(si... | 2.515625 | 3 |
transposition_cyphers/onetimepad.py | MahatKC/Daniao | 2 | 12792847 | def modulo_sum(x,y):
return (x+y)%26
def alphabet_position(char):
return ord(char.lower())-97
def character_sum(a,b):
new_char_index = modulo_sum(alphabet_position(a),alphabet_position(b))
return chr(new_char_index+97)
def one_time_pad(plaintext, cypher):
cyphertext = "".join([character_sum(plain... | 3.421875 | 3 |
rtcat/get_knpsr.py | mpsurnis/greenburst | 0 | 12792848 | <gh_stars>0
#!/usr/bin/env python3.5
__author__ = '<NAME>'
__email__ = '<EMAIL>'
import argparse
from catalog_utils import gen_catalog
from webcrawler import *
# Generate the catalog using the rtcat function
cat = gen_catalog()
# Some useful functions
def hmstodeg(ra):
# Convert ra from hms to decimal degree
#... | 2.765625 | 3 |
app/utils/poster.py | Xerrors/Meco-Server | 1 | 12792849 | import os
import json
from app.config import DATA_PATH
from app.utils.mass import string_to_md5
"""
cover:
link:
text:
type:
top:
"""
def get_posters():
with open(os.path.join(DATA_PATH, 'poster.json'), 'r') as f:
data = json.load(f)
return data['data']
def save_poster(data):
with open(os.... | 2.671875 | 3 |
stable_world/output/error_output.py | StableWorld/stable.world | 0 | 12792850 | from __future__ import print_function, unicode_literals
import sys
import os
import traceback
import time
from requests.utils import quote
from requests.exceptions import ConnectionError
import click
from stable_world.py_helpers import platform_uname
from stable_world import __version__ as version
from stable_world imp... | 2.375 | 2 |