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 |
|---|---|---|---|---|---|---|
sila_library/sila2lib/framework/std_features/SiLAService.py | lemmi25/sila2lib | 0 | 12787451 | <reponame>lemmi25/sila2lib<gh_stars>0
"""
________________________________________________________________________
:PROJECT: SiLA2_python
*SiLAService standard feature*
:details: The Feature each SiLA Server MUST implement. It is the entry point to a SiLA Server and helps to discover
the features it implem... | 1.398438 | 1 |
nertivia4py/utils/get.py | bentettmar/nertivia4py | 3 | 12787452 | from . import server
from . import textchannel
from . import user
class Get:
def get_server(id) -> server.Server:
"""
Gets a Nertivia server.
Args:
- id (int): The ID of the server.
Returns:
- server.Server: The server.
"""
return server.Server(id)
def get_text_channel(id) -> t... | 2.890625 | 3 |
run_encoding.py | ddboline/roku_app | 1 | 12787453 | #!/usr/bin/python
'''
Script to record from roku device via WinTV HVR-1950
'''
from __future__ import (absolute_import, division, print_function, unicode_literals)
from time import sleep
from roku_app.run_encoding import run_encoding
if __name__ == '__main__':
try:
run_encoding()
except Exception... | 2.046875 | 2 |
main.py | bjnhur/pyHelloWorld | 0 | 12787454 | <reponame>bjnhur/pyHelloWorld<filename>main.py
def test_get_helloworld():
assert 'hello world' == get_helloworld()
def get_helloworld():
print('hello world')
return 'hello world'
def main():
print(get_helloworld())
if __name__ == '__main__':
main()
| 2.484375 | 2 |
marltoolbox/utils/exploration.py | tobiasbaumann1/amd | 0 | 12787455 | from gym.spaces import Discrete
from ray.rllib.models.action_dist import ActionDistribution
from ray.rllib.models.tf.tf_action_dist import Categorical
from ray.rllib.models.torch.torch_action_dist import TorchCategorical
from ray.rllib.utils.annotations import override
from ray.rllib.utils.exploration.stochastic_sampli... | 2.609375 | 3 |
flask_playground/routes/v1/errors.py | willianantunes/flask-playground | 8 | 12787456 | from flask import jsonify
from flask_playground.routes.exceps import ValidationError
from flask_playground.routes.v1 import api_v1_routes
@api_v1_routes.errorhandler(ValidationError)
def bad_request(e):
response = jsonify({"message": e.args[0]})
response.status_code = 400
return response
@api_v1_routes... | 2.8125 | 3 |
radiomics/utility.py | RimeT/p3_radio | 0 | 12787457 | import logging
def get_logger(log_file=None, name='radiomics_logger'):
logger = logging.getLogger(name)
logger.setLevel(logging.DEBUG)
# stream handler will send message to stdout
formatter = logging.Formatter('%(asctime)s [%(levelname)s] %(message)s', datefmt='%Y-%m-%d %H:%M:%S')
ch = logging.St... | 2.6875 | 3 |
move_pdf.py | AnonymousRandomPerson/TranscriptionUtils | 0 | 12787458 | <filename>move_pdf.py<gh_stars>0
import os, shutil
from game_acronyms import *
parts_folder = os.path.join(os.sep, 'Users', 'chenghanngan', 'Documents', 'Music', 'Transcription', 'Parts')
scores_folder = os.path.join(os.sep, 'Users', 'chenghanngan', 'Documents', 'Music', 'Transcription', 'Scores')
for file in sorted(... | 2.75 | 3 |
rr/forms/spadmin.py | UniversityofHelsinki/sp-registry | 0 | 12787459 | <filename>rr/forms/spadmin.py
import re
from django.core.validators import ValidationError
from django.forms import CharField, Form, EmailField, ModelChoiceField
from django.utils.translation import ugettext_lazy as _
from rr.models.email import Template
class SPAdminForm(Form):
"""
Form for sending email i... | 2.203125 | 2 |
train_identify_domain_h2o.py | gkovacs/tmi-browsing-behavior-prediction | 1 | 12787460 | <filename>train_identify_domain_h2o.py
#!/usr/bin/env python
# md5: c8864930a096ab388f167e1cd2c0a0ef
# coding: utf-8
import csv
import sys
import traceback
import os
data_version = int(sys.argv[1])
from tmilib import *
import h2o
import h2o.grid
h2o.init(port=int(os.environ.get('h2o_port', 54321)))
train_d... | 2.4375 | 2 |
SocialHandler.py | stephensekula/navierstokes | 5 | 12787461 | <reponame>stephensekula/navierstokes<gh_stars>1-10
import abc
__metaclass__ = abc.ABCMeta
import sys
import os
import subprocess
import logging
import unicodedata
import commands
import re
import hashlib
import copy
import URLShortener
import chardet
from sets import Set
class SocialHandler(object):
def __init... | 2.453125 | 2 |
ioloop/kqueue.py | mengzhuo/ioloop | 1 | 12787462 | <gh_stars>1-10
#!/usr/bin/env python
# encoding: utf-8
import select
from ioloop import READ, WRITE, ERROR
class KQueueLoop(object):
def __init__(self):
self.loop = select.kqueue()
self.active = {}
def register(self, fd, events):
if fd in self.active:
raise IOError('FD: ... | 2.34375 | 2 |
azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_properties.py | CharaD7/azure-sdk-for-python | 0 | 12787463 | <filename>azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_properties.py<gh_stars>0
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# licens... | 1.695313 | 2 |
meiduo_mall/celery_tasks/sms/tasks.py | aprilchen918/meiduo_project2 | 0 | 12787464 | <reponame>aprilchen918/meiduo_project2<filename>meiduo_mall/celery_tasks/sms/tasks.py
# Define task
from celery_tasks.sms.twilio1.twilio_sms import Twilio
from . import constants
from celery_tasks.main import celery_app
# Use Decorator to decorate asynchronous task to ensure celery recognize task
@celery_app.task(nam... | 2.1875 | 2 |
gedcom-to-map/kml/foliumExp.py | D-Jeffrey/gedcom-to-visualmap | 1 | 12787465 | import numpy as nump
import math
import random
import folium
# import simplekml as simplekml
from models.Line import Line
from models.Pos import Pos
import time
from gedcomoptions import gvOptions
from folium.plugins import FloatImage, AntPath, MiniMap, HeatMapWithTime
legend_file = 'legend.png'
lgd_txt = '<span sty... | 2.4375 | 2 |
src/pyrin/api/swagger/__init__.py | wilsonGmn/pyrin | 0 | 12787466 | # -*- coding: utf-8 -*-
"""
swagger package.
"""
from pyrin.packaging.base import Package
class SwaggerPackage(Package):
"""
swagger package class.
"""
NAME = __name__
COMPONENT_NAME = 'api.swagger.component'
CONFIG_STORE_NAMES = ['swagger']
DEPENDS = ['pyrin.api.router',
... | 1.335938 | 1 |
src/fortrace/utility/guesttime.py | dasec/ForTrace | 1 | 12787467 | import time
from datetime import datetime
def getGuestTime():
curr_datetime = datetime.now()
dt_string = curr_datetime.strftime("%d/%m/%Y")
ti_string = curr_datetime.strftime("%H:%M:%S")
return "{0} {1}".format(dt_string, ti_string)
def getGuestTimezone():
is_dst = time.daylight and time.localtime... | 3.0625 | 3 |
vmServer.py | aivaturi/parallels-vm-manager | 1 | 12787468 | <reponame>aivaturi/parallels-vm-manager
#!/usr/bin/python
__author__ = '<NAME>'
__version__ = '0.1'
__license__ = 'FreeBSD'
import base64
import json
import logging
import logging.handlers
import os
import re
import sys
import subprocess
import xml.etree.ElementTree
from bottle import *
import prlsdkapi
"""
@packa... | 1.9375 | 2 |
tests/fixtures.py | hroncok/dist-chat | 1 | 12787469 | <filename>tests/fixtures.py
import pytest
from soucevi1_dist_chat.CNode import CNode
from soucevi1_dist_chat.CMessage import CMessage, MessageType
@pytest.fixture
def node_instance():
node = CNode(False, '127.0.0.1', '12345', '127.0.0.1', '4321', 'Jmeno')
return node
@pytest.fixture
def message_instance():
... | 1.96875 | 2 |
tests/test_matrix_props/test_is_unitary.py | paniash/toqito | 76 | 12787470 | <filename>tests/test_matrix_props/test_is_unitary.py
"""Test is_unitary."""
import numpy as np
from toqito.matrix_props import is_unitary
from toqito.random import random_unitary
def test_is_unitary_random():
"""Test that random unitary matrix returns True."""
mat = random_unitary(2)
np.testing.assert_eq... | 3.0625 | 3 |
service_layer/abstract_services/manager_service.py | Alejandro-Fuste/Python_Javascript_ReimbursementApp | 0 | 12787471 | from abc import ABC, abstractmethod
from typing import List
from entities.manager import Manager
class ManagerService(ABC):
# for login purposes
@abstractmethod
def service_validate_manager(self, user_name: str, password: str) -> Manager:
pass
@abstractmethod
def service_get_all_managers... | 2.96875 | 3 |
Backend/aws lambdas/vYelper-sqs_Handler/sns_handler.py | dhruvarora2/Yelper | 0 | 12787472 | <reponame>dhruvarora2/Yelper
import logging
import boto3
# Initialize logger and set log level
logger = logging.getLogger()
logger.setLevel(logging.INFO)
# Initialize SNS client for Ireland region
session = boto3.Session(
region_name="us-east-1"
)
sns_client = session.client('sns')
def send_message(phonenumber, ... | 2.4375 | 2 |
Configuration/DataProcessing/python/Impl/__init__.py | Purva-Chaudhari/cmssw | 852 | 12787473 | <reponame>Purva-Chaudhari/cmssw
#!/usr/bin/env python3
"""
_Impl_
Scenario Implementations
"""
__all__ = []
| 0.863281 | 1 |
geophoto_api/views.py | amatmv/geophoto-backend | 1 | 12787474 | import boto3
import io
import base64
from PIL import Image
from django.contrib.auth.models import User
from django.contrib.auth import get_user_model
from django.core.files.uploadedfile import InMemoryUploadedFile, TemporaryUploadedFile
from rest_framework import generics, permissions
from rest_framework_jwt.settings... | 1.945313 | 2 |
backend/ecs_tasks/delete_files/s3.py | guvenbz/amazon-s3-find-and-forget | 165 | 12787475 | import logging
from functools import lru_cache
from urllib.parse import urlencode, quote_plus
from boto_utils import fetch_job_manifest, paginate
from botocore.exceptions import ClientError
from utils import remove_none, retry_wrapper
logger = logging.getLogger(__name__)
def save(s3, client, buf, bucket, key, meta... | 1.890625 | 2 |
libspn/graph/op/concat.py | pronobis/libspn | 22 | 12787476 | from itertools import chain
import tensorflow as tf
from libspn.graph.node import OpNode, Input
from libspn import utils
from libspn.inference.type import InferenceType
from libspn.exceptions import StructureError
from libspn.utils.serialization import register_serializable
@register_serializable
class Concat(OpNode)... | 2.3125 | 2 |
bhs/bhs/envs/Element.py | rasorensen90/muzero-general | 0 | 12787477 | <gh_stars>0
# -*- coding: utf-8 -*-
"""
Created on Wed May 29 09:37:43 2019
@author: RTS
"""
class Element:
def __init__(self, ID = None, inputElement = None, outputElement = None):
self.ID = ID
self.inputElements = [inputElement]
self.outputElements = [outputElement]
self.tote = No... | 3.453125 | 3 |
Projects/Project1/regan/__init__.py | adelezaini/MachineLearning | 0 | 12787478 | <gh_stars>0
from .crossvalidation import cross_validation
from .bootstrap_biasvar import Confidence_Interval, bias_variance_complexity, bootstrap, bias_variance_analysis
from .regression import lasso_reg, ridge_reg, OLS_solver, FrankeFunction, create_X, Split_and_Scale, MSE, R2, Plot_FrankeFunction, create_xyz_dataset,... | 1.46875 | 1 |
imix/data/vqadata/dataset_test.py | linxi1158/iMIX | 23 | 12787479 | <gh_stars>10-100
from collections import OrderedDict
from typing import Any, Dict
import collections
import numpy as np
import torch
class VQA2Dataset(torch.utils.data.Dataset):
def __init__(self, path):
super().__init__()
self._load_npy(path)
def _load_npy(self, path):
self.db = np... | 2.421875 | 2 |
frappe/desk/doctype/desk_page/desk_page.py | shubhamgupta123/frappe | 0 | 12787480 | # -*- coding: utf-8 -*-
# Copyright (c) 2020, Frappe Technologies and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.modules.export_file import export_to_files
from frappe.model.document import Document
class DeskPa... | 1.921875 | 2 |
spira/yevon/geometry/nets/net_list.py | qedalab/spira | 10 | 12787481 | <filename>spira/yevon/geometry/nets/net_list.py
import networkx as nx
from spira.core.typed_list import TypedList
from spira.yevon.geometry.nets.net import __Net__, Net
from spira.core.parameters.variables import FloatParameter
from spira.core.parameters.descriptor import ParameterDescriptor
from spira.core.parameters... | 2.46875 | 2 |
typos.py | CesarSMx/Selenium-with-Python-course | 0 | 12787482 | <reponame>CesarSMx/Selenium-with-Python-course
import unittest
from pyunitreport import HTMLTestRunner
from selenium import webdriver
class Typos(unittest.TestCase):
@classmethod
def setUpClass(cls):
driver_path = r'/mnt/c/Users/cesar/Documents/desarrollo/Selenium/chromedriver.exe'
brave_path ... | 3.109375 | 3 |
NASA SPACEAPPS CHALLENGE/Solution/Software part/Astronomical Data and Python Libraries/pyephem/pyephem-3.7.6.0/ephem/tests/test_launchpad_236872.py | sahirsharma/Martian | 1 | 12787483 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
import ephem
# See whether asking for the rising-time of Mars hangs indefinitely.
class Launchpad236872Tests(unittest.TestCase):
def runTest(self):
mars = ephem.Mars()
boston = ephem.city('Boston')
boston.date = ephem.Date('200... | 2.75 | 3 |
billing/migrations/0009_longer_product_code.py | jayvdb/django-customer-billing | 13 | 12787484 | # Generated by Django 2.0.1 on 2018-01-26 09:41
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('billing', '0008_charge_deleted_and_reverses'),
]
operations = [
migrations.AlterField(
model_name=... | 1.992188 | 2 |
simulations/ngspice/clock.py | matthuszagh/fmcw | 14 | 12787485 | <filename>simulations/ngspice/clock.py
#!/usr/bin/env python
from skidl.pyspice import (
lib_search_paths,
Part,
generate_netlist,
SPICE,
gnd,
node,
no_files,
)
import numpy as np
import os
no_files()
spicelib = os.getenv("SPICELIB")
fname = ".data/adc-filter.dat"
lib_search_paths[SPICE]... | 2.296875 | 2 |
recap_agr/libs/ndcg.py | MirkoLenz/ReCAP-Argument-Graph-Retrieval | 0 | 12787486 | # Copyright 2016 <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 applicable law or agreed to in writing, softw... | 2.0625 | 2 |
jobRun.py | kylezhao96/sqgh-ms-flask | 0 | 12787487 | <reponame>kylezhao96/sqgh-ms-flask
'''
@Author: hua
@Date: 2019-12-18 17:22:18
@description:
@LastEditors : hua
@LastEditTime : 2019-12-18 17:23:51
'''
import environment
environment.init("job")
from app import sched
#开始任务
sched.start() | 1.21875 | 1 |
tests/isbndb_tests.py | bbengfort/isbndb-python | 4 | 12787488 | #!/usr/bin/env python
from isbndb import ISBNdbException
from isbndb.models import *
from isbndb.client import ISBNdbClient
from isbndb.catalog import *
from unittest import TestCase
ACCESS_KEY = "<KEY>"
class ISBNdbTest(TestCase):
def setup(self):
self.client = ISBNdbClient( access_key=ACCESS_KEY... | 2.4375 | 2 |
mne_kit_gui/__init__.py | mne-tools/mne-kit-gui | 1 | 12787489 | """Convenience functions for opening GUIs."""
# Authors: <NAME> <<EMAIL>>
#
# License: BSD-3-Clause
import os
from mne.utils import verbose, get_config
from ._utils import _check_mayavi_version
from ._backend import _testing_mode
__version__ = '1.1.dev0'
def _initialize_gui(frame, view=None):
"""Initialize G... | 2.4375 | 2 |
nerdle/build_nerdles.py | bacross/nerdle_wordle | 0 | 12787490 | import nerdle_cfg
import re
import luigi
import d6tflow
import itertools
import pandas as pd
import numpy as np
#helper functions
def check_len_int(nerdle):
nerdle_str = ''.join(nerdle)
try:
return all(len(x)==len(str(int(x))) for x in re.split('\+|\-|\*|\/|==',nerdle_str))
except:
return ... | 2.53125 | 3 |
source/scl.py | manojtummala/SUP | 4 | 12787491 | <filename>source/scl.py
import click
import requests
from tabulate import tabulate
@click.command()
@click.option('--section', help='What you want to see? Just type the section')
@click.argument('section')
def get(section):
"""
Simple CLI for accessing sathyabama latest updates
"""
"""This return ... | 3.578125 | 4 |
Snake.py | daydreamjesse/snake | 0 | 12787492 | __author__ = 'grahamhub'
import pygame
import random
import sys
import time
# colors
black = (0, 0, 0)
white = (255, 255, 255)
blue = (35, 25, 255)
green = (35, 255, 25)
red = (255, 35, 25)
count = 0
# width/height of snake segments
seg_width = 15
seg_height = 15
# space between each segment
seg_margin = 3
# set i... | 3.140625 | 3 |
rbc/space/utils/base.py | rebuildingcode/hardware | 0 | 12787493 | <reponame>rebuildingcode/hardware
def get_polygon_label(content):
if hasattr(content, 'name'):
# get label for polygon-type objects with name attribute
label = content.name
else:
# otherwise default to using the area value as the label
# this supports shapely's Polygon object
... | 2.796875 | 3 |
hankonator/apps/hankonator.py | Fisent/hankonator_web | 0 | 12787494 | <reponame>Fisent/hankonator_web
from pyforms.basewidget import BaseWidget
from confapp import conf
from pyforms_web.controls.control_button import ControlButton
from pyforms_web.controls.control_list import ControlList
from pyforms_web.controls.control_text import ControlText
class SiteCrawlApp(BaseWidget):
UID ... | 2.28125 | 2 |
subunit2sql/db/models.py | mtreinish/subunit2sql | 3 | 12787495 | <filename>subunit2sql/db/models.py
# Copyright 2014 Hewlett-Packard Development Company, L.P.
#
# 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.... | 2.34375 | 2 |
misago/misago/users/serializers/ban.py | vascoalramos/misago-deployment | 2 | 12787496 | from django.utils.translation import gettext as _
from rest_framework import serializers
from ...core.utils import format_plaintext_for_html
from ..models import Ban
__all__ = ["BanMessageSerializer", "BanDetailsSerializer"]
def serialize_message(message):
if message:
return {"plain": message, "html": f... | 2.171875 | 2 |
django_grpc_bus/apps.py | rameezarshad/django-grpc-framework | 2 | 12787497 | from django.apps import AppConfig
class DjangoGRPCBusConfig(AppConfig):
name = 'django_grpc_bus'
| 1.132813 | 1 |
nxted/files/test3.py | xlcteam/nxtIDE | 8 | 12787498 | <filename>nxted/files/test3.py
def main():
TextOut(0, LCD_LINE1, "test3")
Wait(2000) | 1.382813 | 1 |
py-numpy/numpy_test.py | DeercoderPractice/exp-code | 0 | 12787499 | #!/usr/bin/env python
import numpy as np
def test_concatenate():
x = np.array([11, 22])
y = np.array([18, 7, 6])
z = np.array([1, 3, 5])
print np.concatenate((x,y,z))
def test_concatenate2():
x = np.array(range(24))
x = x.reshape((3,4,2))
y = np.array(range(100, 124))
y = y.reshape((3,4,2))
z0 = np.conca... | 3.78125 | 4 |
thermodynamics/mix/equilibrium.py | luis-zepeda/thermodynamics | 0 | 12787500 | from ..helpers import eos
from ..helpers import alfaFunctions
from ..helpers.eosHelpers import A_fun, B_fun, getCubicCoefficients, getMixFugacity,getMixFugacityCoef, dAdT_fun
from ..solvers.cubicSolver import cubic_solver
from ..helpers import temperatureCorrelations as tempCorr
from ..helpers import mixing_rules
from... | 1.828125 | 2 |
bert/models/bert/cqa_supports.py | fanshiqing/DAPPLE | 50 | 12787501 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import json
import math
import numpy as np
import tokenization
import six
import tensorflow as tf
from tensorflow import logging
class EvalResults(object):
def __init__(self, capacity):... | 2.53125 | 3 |
collatz.py | TravelingMan/pyexperiments | 0 | 12787502 | <gh_stars>0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Collatz
A fun math problem.
"""
def collatz(number):
if number % 2 == 0:
x = number / 2
print(x)
return x
else:
x = 3 * number + 1
print(x)
return x
def get_number():
try:
user_number =... | 3.9375 | 4 |
all_call/input.py | jbudis/dante | 4 | 12787503 | from argparse import ArgumentParser, RawDescriptionHelpFormatter
import all_call.train
import numpy as np
import json
import sys
import pandas as pd
import re
import os
from glob import glob
from arguments import yaml_reader
# default parameters for inference
DEFAULT_MODEL_PARAMS = (-0.0107736, 0.00244419, 0.0, 0.0044... | 2.65625 | 3 |
scripts/runner.py | kzbnb/numerical_bugs | 8 | 12787504 | import os
import sys
import argparse
parse = argparse.ArgumentParser()
parse.add_argument("--type", type=str,choices=['origin', 'grist',], help="run initial file or grist file")
parse.add_argument("--times", type=int, help="time to run code")
flags, unparsed = parse.parse_known_args(sys.argv[1:])
for i in range(flags... | 2.3125 | 2 |
main.py | Tigenzero/clutch-code-project | 0 | 12787505 | <filename>main.py
import logging
import logging.config
import os
from time import perf_counter
import argparse
from flask import Flask
from flask import request, jsonify
ADDRESS_ARG = 'address'
def parse_args():
parser = argparse.ArgumentParser(description='Python Service to accept addresses and return the state... | 3 | 3 |
pq.py | phamhm/sublime_motion | 0 | 12787506 | <reponame>phamhm/sublime_motion
import queue
myq = queue.PriorityQueue()
myq.put(10)
myq.put(9)
myq.put(3)
myq.put(2)
myq.put(99)
| 1.65625 | 2 |
final_project/machinetranslation/translator.py | lgomez9/xzceb-flask_eng_fr | 0 | 12787507 | <gh_stars>0
# LGomez Version
""" Translator module for final python project """
import json
import os
from ibm_watson import LanguageTranslatorV3
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
from dotenv import load_dotenv
load_dotenv()
apikey = os.environ['apikey']
url = os.environ['url']
authenti... | 2.890625 | 3 |
REST/python/Environments/create-environments.py | gdesai1234/OctopusDeploy-Api | 199 | 12787508 | <filename>REST/python/Environments/create-environments.py
import json
import requests
from urllib.parse import quote
octopus_server_uri = 'https://your.octopus.app/api'
octopus_api_key = 'API-YOURAPIKEY'
headers = {'X-Octopus-ApiKey': octopus_api_key}
def get_octopus_resource(uri):
response = requests.get(uri, he... | 2.6875 | 3 |
mrcnn-app/ImageCollector/mrcnn-ImageCollector.py | B-C-WANG/AI-Apps | 7 | 12787509 | <filename>mrcnn-app/ImageCollector/mrcnn-ImageCollector.py
import os
import sys
import random
import math
import numpy as np
import skimage.io
import matplotlib
import matplotlib.pyplot as plt
from mrcnn import utils
import mrcnn.model as modellib
from mrcnn import visualize
import cv2
import time
class MaskRCNN():
... | 2.390625 | 2 |
scripts/rasterio/find_valid_tiff_files.py | PhilipeRLeal/xarray_case_studies | 1 | 12787510 | import pandas as pd
import numpy as np
import geopandas as gpd
import glob
import rasterio
import rasterio.mask
from shapely.geometry import box
import os
shp_file_path = r'C:\Doutorado\BD\IBGE\IBGE_Estruturas_cartograficas_Brasil\2017\Unidades_Censitarias\Setores_Censitarios\*shp'
gdf= gpd.read_file(glob.glob(shp... | 2.625 | 3 |
src/libs/utils.py | bopopescu/covid-19-visualization | 0 | 12787511 | <reponame>bopopescu/covid-19-visualization<filename>src/libs/utils.py
#coding:utf8
import time
import datetime
import random
from src.libs.platform_version import IS_PYTHON2
# import md5
def LONG(n):
return long(n) if IS_PYTHON2 else int(n)
'''获取当前时间字符串'''
def TM():
return time.strftime("%Y-%m-%d %H:%M:%S",... | 2.609375 | 3 |
csdl/examples/valid/ex_implicit_multiple_residuals_define_model_inline.py | LSDOlab/csdl | 0 | 12787512 | <gh_stars>0
def example(Simulator):
from csdl import Model, ScipyKrylov, NewtonSolver, NonlinearBlockGS
import numpy as np
from csdl.examples.models.quadratic_function import QuadraticFunction
from csdl.examples.models.fixed_point import FixedPoint1, FixedPoint2, FixedPoint3
from csdl.examples.model... | 2.84375 | 3 |
match_extensions/number.py | jdillenberger/jmatch | 1 | 12787513 | <reponame>jdillenberger/jmatch
'''
# General pattern functions
Node and subtree match functions, to be executed from
a Patterns node_matches and subtree_matches function
if they are requested by the given pattern.
Functions with a _node suffix, are executed by a Patterns
"node_matches" method and functions with a _sub... | 3.46875 | 3 |
docs/_downloads/bb12ac5c5d4a848045c14031f77a9918/plot__color_and_fill.py | IKupriyanov-HORIS/lets-plot-docs | 0 | 12787514 | """
Color and Fill Scales
=====================
Scales control how a plot maps data values to the visual values of an
aesthetic.
"""
# sphinx_gallery_thumbnail_path = "gallery_py\_scales\_color_and_fill.png"
from datetime import datetime
import pandas as pd
from lets_plot import *
LetsPlot.se... | 2.609375 | 3 |
SRC/engine/IO/meshmenu.py | usnistgov/OOF3D | 31 | 12787515 | # -*- python -*-
# This software was produced by NIST, an agency of the U.S. government,
# and by statute is not subject to copyright in the United States.
# Recipients of this software assume all responsibilities associated
# with its operation, modification and maintenance. However, to
# facilitate maintenance we as... | 1.25 | 1 |
base/include/wx-3.0/wx/wxPython/i_files/_core_ex.py | jorgediazjr/dials-dev20191018 | 0 | 12787516 | <reponame>jorgediazjr/dials-dev20191018
#----------------------------------------------------------------------------
# Use Python's bool constants if available, make some if not
try:
True
except NameError:
__builtins__.True = 1==1
__builtins__.False = 1==0
def bool(value): return not not value
__b... | 2.09375 | 2 |
ferup_fileinfo.py | JeffpanUK/NuPyTools | 2 | 12787517 | <gh_stars>1-10
#-*-coding:utf-8-*-
#!\usr\bin\env py3
import os
import sys
import re
import codecs
class FileInfo(object):
'''
statistics of corpus
'''
def __init__(self, options, logger):
self.logger = logger
self.options = options
self.task = options['task']
self.punc = self.loadPuncs(option... | 2.6875 | 3 |
ask.py | christoga/python | 5 | 12787518 | <reponame>christoga/python<filename>ask.py
print "What's your name?",
name = raw_input()
print "Hello %r!" % (name)
| 2.6875 | 3 |
tests/helpers.py | Degget1986/neo-mamba | 12 | 12787519 | from neo3.core import serialization
from neo3.core.serialization import BinaryReader, BinaryWriter
class SerializableObject(serialization.ISerializable):
def serialize(self, writer: BinaryWriter) -> None:
pass
def deserialize(self, reader: BinaryReader) -> None:
pass
def __len__(self):
... | 2.53125 | 3 |
pythonaulas/Aula 13/Desafio 052.py | jrwarg/Estudos-Phyton | 0 | 12787520 | """
DESAFIO 052: Números Primos
Faça um programa que leia um número inteiro e diga se ele é ou não um número primo.
"""
n = int(input('Digite um número: '))
v = True
if n < 2:
v = False
else:
for c in range(2, n - 1):
if n % c == 0:
v = False
if v:
print('{} é um número primo.'.format... | 3.9375 | 4 |
happytransformer/mwp/trainer.py | Mizar77/happy-transformer | 0 | 12787521 | from happytransformer.happy_trainer import HappyTrainer
from happytransformer.mwp.default_args import ARGS_MWP_TRAIN
class WPTrainer(HappyTrainer):
def train(self, input_filepath, args=ARGS_MWP_TRAIN):
raise NotImplementedError()
def eval(self, input_filepath):
raise NotImplementedError()
... | 2.09375 | 2 |
test/util/web/test_webapi.py | TomBlock/cate | 0 | 12787522 | <reponame>TomBlock/cate<gh_stars>0
import re
import unittest
from cate.util.web import webapi
class UrlPatternTest(unittest.TestCase):
def test_url_pattern_works(self):
re_pattern = webapi.url_pattern('/open/{{id1}}ws/{{id2}}wf')
matcher = re.fullmatch(re_pattern, '/open/34ws/a66wf')
self... | 2.515625 | 3 |
eosUtils/db.py | hysds/eosUtils | 0 | 12787523 | <filename>eosUtils/db.py
import os, sys, sqlite3, json
from datetime import datetime
from misc import getDatetimeFromDateString
#configured datasets
CONFIGURED_DATASETS = ['AIRS', 'MODIS-Terra', 'MODIS-Aqua', 'ALOS']
#select by time
SELECT_BY_TIME = '''select * from %s where
(starttime between :startTime and :endTim... | 2.859375 | 3 |
DiffDriveControl.py | Starfunx/Robot_Simulation | 0 | 12787524 | # coding: utf-8
import numpy as np
import matplotlib.pyplot as plt
import Transform as Transform
import DiffDriveRobot
class Wheel(object):
"""docstring for Wheel."""
def __init__(self):
super(Wheel, self).__init__()
self.speed = 0
def setSpeed(self, speed):
self.speed = speed
... | 3.28125 | 3 |
shims/CounterFitConnection/tests/test_counterfit_connection.py | CallumTarttelin/CounterFit | 86 | 12787525 | <reponame>CallumTarttelin/CounterFit<gh_stars>10-100
'''
Tests the CounterFit app connection
To run this test, ensure you have the CounterFit Virtual IoT Device app running
'''
# pylint: disable=redefined-outer-name,unused-argument,duplicate-code
import pytest
import time
from counterfit_connection import CounterFi... | 2.5625 | 3 |
scripts/wk/hw/obj.py | 2Shirt/WizardK | 0 | 12787526 | """WizardKit: Hardware objects (mostly)"""
# vim: sts=2 sw=2 ts=2
import logging
import pathlib
import plistlib
import re
from collections import OrderedDict
from wk.cfg.hw import (
ATTRIBUTE_COLORS,
KEY_NVME,
KEY_SMART,
KNOWN_DISK_ATTRIBUTES,
KNOWN_DISK_MODELS,
KNOWN_RAM_VENDOR_IDS,
REGEX_POWER_ON_TIM... | 2.375 | 2 |
Python Fundamentals/Regular Expressions/Exercise/Task03_02.py | IvanTodorovBG/SoftUni | 1 | 12787527 | <filename>Python Fundamentals/Regular Expressions/Exercise/Task03_02.py
import re
data = input()
searched = input()
pattern = f"\\b{searched}\\b"
result = re.findall(pattern, data, re.IGNORECASE)
print(data.count(searched)) | 4.34375 | 4 |
visualSHARK/util/helper.py | benjaminLedel/visualSHARK_topicShark | 0 | 12787528 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
import math
import networkx as nx
import logging
import timeit
from collections import deque
from visualSHARK.models import Commit
def tag_filter(tags, discard_qualifiers=True, discard_patch=False):
versions = []
# qualifiers are expected at the end o... | 2.375 | 2 |
firecam/data_xform/fire_weather.py | open-climate-tech/firecam | 9 | 12787529 | # Copyright 2020 Open Climate Tech Contributors
#
# 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 agr... | 2.28125 | 2 |
helper_ai.py | jpypi/pandemic-game-ai | 2 | 12787530 | <reponame>jpypi/pandemic-game-ai
from game import Game
from cards import PlayerCardDeck, PlayerCard
def calculate_uniform_probability_of_card_draw(num_of_cards):
return 1/num_of_cards
def calculate_chance_of_epidemic(game):
#Do we cast this as int or round to ceiling?
split_size = float(game.sta... | 3.265625 | 3 |
SampleBufferSonification/model_class.py | jcstucki/SampleBufferSonfication | 0 | 12787531 | <gh_stars>0
from tensorflow.keras import Sequential
from tensorflow.keras.layers import Dense
from tensorflow.keras.layers import LSTM
from tensorflow.keras.models import load_model
import numpy as np
import time
class LSTM_Network:
def __init__(self, file):
self.file = file
self.model = object()... | 3.0625 | 3 |
src/features/compress.py | DianaDI/compressedCV | 0 | 12787532 | from PIL import Image
from pathlib import Path
from glob import glob
from os.path import basename
from tqdm import tqdm
import os
class Compression:
def __init__(self, compress_level, optimize=True, log=True, resize=False, resize_params=(0, 0)):
"""
Init compression params
:param compress_... | 3 | 3 |
src/encoded/tests/test_schema_library.py | aperritano/encoded | 0 | 12787533 | import pytest
@pytest.fixture
def library(lab, award):
return {
'lab': lab['uuid'],
'award': award['uuid'],
'nucleic_acid_term_name': 'DNA'
}
@pytest.fixture
def library_starting_quantity(library):
item = library.copy()
item.update({
'nucleic_acid_starting_quantity': ... | 2.0625 | 2 |
rddeconv/__init__.py | agriff86/rd-deconvolve | 0 | 12787534 | <reponame>agriff86/rd-deconvolve
# -*- coding: utf-8 -*-
"""Correct (deconvolve) the output from two-filter radon detectors"""
from rddeconv import metadata
__version__ = metadata.version
__author__ = metadata.authors[0]
__license__ = metadata.license
__copyright__ = metadata.copyright
from .deconvolve import decon... | 2.0625 | 2 |
nfldata/spiders/schools.py | pkukkapalli/nfldata | 0 | 12787535 | """Defines spiders related to schools that NFL players have attended."""
import scrapy
from nfldata.common.pfr import pfr_request, PRO_FOOTBALL_REFERENCE_DOMAIN
from nfldata.items.schools import School
class SchoolsSpider(scrapy.Spider):
"""The spider that crawls and stores information about schools that players
... | 3.34375 | 3 |
moby_distribution/registry/auth.py | shabbywu/distribution | 7 | 12787536 | <reponame>shabbywu/distribution
# -*- coding: utf-8 -*-
import base64
import logging
from typing import Any, Dict, Optional
import requests
from www_authenticate import parse
from moby_distribution.registry.exceptions import AuthFailed
from moby_distribution.spec.auth import TokenResponse
logger = logging.getLogger(... | 2.375 | 2 |
dVRL_simulator/environments/pick.py | Cladett/rlman | 0 | 12787537 | <reponame>Cladett/rlman
from gym import utils
from dVRL_simulator.PsmEnv_Position_pick_reach import PSMEnv_Position_pick_reach
import numpy as np
class PSMPickEnv(PSMEnv_Position_pick_reach): # , utils.EzPickle):
def __init__(self, psm_num=1, reward_type='sparse',
randomize_obj=False, randomize... | 2.1875 | 2 |
mpi_process.py | pycroscopy/distUSID | 1 | 12787538 | """
Created on 7/17/16 10:08 AM
@author: <NAME>, <NAME>
"""
from __future__ import division, print_function, absolute_import
import numpy as np
import psutil
import joblib
import time as tm
import h5py
import itertools
from numbers import Number
from multiprocessing import cpu_count
try:
from mpi4py import MPI
... | 2.015625 | 2 |
tests/test.py | MAfarrag/Oasis | 2 | 12787539 | # -*- coding: utf-8 -*-
"""
Created on Sun Jan 19 16:34:44 2020
@author: mofarrag
"""
import Oasis
#try:
# import Hapi
#except ImportError:
# try:
# import HAPI
# except ImportError:
# import sys
# sys.path.append(".")
# import Hapi
| 1.71875 | 2 |
TicTacToeGame.py | jdipietro/SophiaSci1 | 0 | 12787540 | import numpy as np
class TicTacToeGame:
def __init__(self, size):
self.m_SizeSize = size;
self.m_Grid = np.zeros((size, size), np.int8)
self.m_Grid.fill(-1)
self.m_CurentPlayer = 0
def Move(self, player, row, col):
if self.IsMoveAllowed(player, row, col) =... | 2.953125 | 3 |
main.py | dev-everaldo-cyrino/exercicios-de-raciocinio-6 | 0 | 12787541 | soma =0
multiplicacao = 1
total = []
n=1
for x in range(5):
num = int(input('digite o {}° numero: '.format(n)))
total.append(num)
multiplicacao *= num
soma += num
n +=1
print('''
a soma é {}
a multiplicação é {}
e os numeros são {}'''.format(soma,multiplicacao,total)) | 4.03125 | 4 |
DesignAddon/DesignBeh/BlockEntityScripts/ClientSystem.py | linyuzhe210/BlockEntityChestDemo | 3 | 12787542 | <filename>DesignAddon/DesignBeh/BlockEntityScripts/ClientSystem.py
# -*- coding: UTF-8 -*-
from mod.client.system.clientSystem import ClientSystem
import mod.client.extraClientApi as clientApi
import time
class Main(ClientSystem):
def __init__(self, namespace, system_name):
ClientSystem.__init__... | 2.203125 | 2 |
audiochall.py | CodeAchieveDream/SpeechRecognition | 3 | 12787543 | # -*- coding: utf-8 -*-
"""
import numpy as np
import time
import tensorflow as tf
from tensorflow.python.ops import ctc_ops
from collections import Counter
yuyinutils = __import__("audioutils")
sparse_tuple_to_texts_ch = yuyinutils.sparse_tuple_to_texts_ch
ndarray_to_text_ch = yuyinutils.ndarray_to_text_c... | 2.25 | 2 |
Solutions/0045.jump.py | lyhshang/LeetCode-Solutions | 0 | 12787544 | <reponame>lyhshang/LeetCode-Solutions
# -*- coding: utf-8 -*-
# author:lyh
# datetime:2020/5/18 21:34
"""
45. 跳跃游戏 II
给定一个非负整数数组,你最初位于数组的第一个位置。
数组中的每个元素代表你在该位置可以跳跃的最大长度。
你的目标是使用最少的跳跃次数到达数组的最后一个位置。
示例:
输入: [2,3,1,1,4]
输出: 2
解释: 跳到最后一个位置的最小跳跃数是 2。
从下标为 0 跳到下标为 1 的位置,跳 1 步,然后跳 3 步到达数组的最后一个位置。
说明:
假设你总是可以到达数组的最... | 3.4375 | 3 |
test.py | yuchen02/Gesture-recognition | 0 | 12787545 | <gh_stars>0
import numpy as np
import paddle
from PIL import Image
import paddle.fluid as fluid
from model import MyDNN
import cv2
#读取预测图像,进行预测
def load_image(path):
img = Image.open(path)
img = img.resize((100, 100), Image.ANTIALIAS)
img = np.array(img).astype('float32')
img = img.transpose((2, 0, 1))... | 2.71875 | 3 |
ergo/platforms/metaculus/question/lineardate.py | bmillwood/ergo | 2 | 12787546 | <gh_stars>1-10
from datetime import date, datetime, timedelta
import pandas as pd
from plotnine import (
aes,
element_text,
facet_wrap,
geom_histogram,
ggplot,
guides,
scale_fill_brewer,
scale_x_datetime,
theme,
)
from ergo.theme import ergo_theme
from .linear import LinearQuestio... | 2.5 | 2 |
vyperlogix/gds/otp.py | raychorn/chrome_gui | 1 | 12787547 | '''
This module provides an Otp object that can be used to get one time
pad strings. It should be adequate for situations that don't require
high security.
You can call the module directly as a script; it will want the
number of otp strings to print out and an optional seed number.
For example, 'python otp.py 20' wi... | 3.265625 | 3 |
setup.py | flug/gonzo | 8 | 12787548 | <gh_stars>1-10
import os
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
make_abs = lambda fn: os.path.join(here, fn)
def parse_requirments(fn, dependency_links):
requirements = []
if not os.path.exists(fn):
return requirements, dependency_links
wit... | 2.171875 | 2 |
value/measures/migrations/0001_initial.py | M3SOulu/value | 2 | 12787549 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Measure',
fields=[
('id', models.AutoField(verb... | 1.75 | 2 |
psi/migrations/versions/05_7b2d863b105_.py | lusi1990/betterlifepsi | 33 | 12787550 | """Add role seed data for flask-security
Revision ID: 7b2d863b105
Revises: <PASSWORD>
Create Date: 2015-07-02 10:48:35.805882
"""
# revision identifiers, used by Alembic.
revision = '7b2d863b105'
down_revision = '<PASSWORD>'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto gener... | 2 | 2 |